LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
comparison_ascii.C File Reference
#include <vector>

Go to the source code of this file.

Functions

cout<< "Reading file \" "<< doseFileExp<< "\" ... ";Long64_t nlines=ntupleExperimental-> ReadFile (doseFileExp,"depthExp:EdepExp")
 
 if (nlines<=0)
 
 printf ("%d Experimental points found\n", nlines)
 
ntupleExperimental SetBranchAddress ("EdepExp",&EdepExp)
 
ntupleExperimental SetBranchAddress ("depthExp",&depthExp)
 
ntupleExperimental GetEntry (0)
 
 for (Int_t l=0;l< nentries;l++)
 
ntupleExperimental Reset ()
 
in open (doseFileSim)
 
 if (!in.is_open())
 
TNtupleSim Fill (f1, f2, f3, f4)
 
 while (in.good())
 
in close ()
 
TNtupleSim SetBranchAddress ("dose",&dose)
 
TNtupleSim SetBranchAddress ("iX",&iX)
 
vec_iX clear ()
 
 printf ("%d Simulated points found\n", vec_iX.size())
 
TNtupleSim SetMarkerStyle (26)
 
TNtupleSim SetMarkerSize (0.8)
 
ntupleExperimental SetMarkerStyle (4)
 
ntupleExperimental SetMarkerColor (2)
 
ntupleExperimental Draw ("EdepExp:depthExp")
 
TNtupleSim Draw ("dose:iX","","same")
 
leg SetTextSize (0.035)
 
leg SetFillColor (0)
 
leg AddEntry (ntupleExperimental,"Experiment","P")
 
leg AddEntry (TNtupleSim,"Simulation","P")
 
leg Draw ()
 

Variables

ifstream in
 
TFile * file = new TFile("Dose.root","RECREATE")
 
TNtuple * ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")
 
vector< Float_t > vec_dose
 
vector< Float_t > vec_iX
 
TString doseFileExp = "../../../experimentalData/proton/BraggPeak/62MeVInWater.out"
 
Float_t depthExp
 
Float_t EdepExp
 
Int_t nentries = (Int_t)ntupleExperimental -> GetEntries()
 
Float_t normFactor = EdepExp
 
TString doseFileSim = "../../../SimulationOutputs/proton/BraggPeak/Dose.out"
 
TNtuple * TNtupleSim = new TNtuple("SimTree","dose from ascii file", "iX:jY:kZ:dose")
 
Char_t n [5]
 
Float_t f1
 
Float_t f2
 
Float_t f3
 
Float_t f4
 
 nlines = 0
 
 do
 
Float_t iX
 
Float_t dose
 
Float_t sumDose = 0.
 
Float_t norm = 0.
 
Int_t oldX = iX
 
TCanvas * c1 = new TCanvas ("c1","c1",200,10,600,400)
 
 leg = new TLegend(0.50,0.60,0.20,0.70)
 

Function Documentation

leg AddEntry ( ntupleExperimental  ,
"Experiment"  ,
"P"   
)
leg AddEntry ( TNtupleSim  ,
"Simulation"  ,
"P"   
)
ntupleExperimental Draw ( "EdepExp:depthExp"  )
TNtupleSim Draw ( "dose:iX"  ,
""  ,
"same"   
)
leg Draw ( )
for ( )

Definition at line 32 of file comparison_ascii.C.

References Fill(), GetEntry(), and normFactor.

33  {
35  vec_dose.push_back(EdepExp);
36  vec_iX.push_back(depthExp);
37  }
TNtuple * ntupleExperimental
Float_t EdepExp
vector< Float_t > vec_iX
Float_t depthExp
vector< Float_t > vec_dose
ntupleExperimental GetEntry(0)
TNtupleSim GetEntry ( )

Referenced by for().

if ( !in.  is_open())

Definition at line 54 of file comparison_ascii.C.

54 {cout << "Error: Check file \"" << doseFileSim << "\"\n"; return;}
TString doseFileSim
in open ( doseFileSim  )
printf ( "%d Simulated points found\n ,
vec_iX.  size() 
)
cout<< "Reading file \" " << doseFileExp << "\" ... "; Long64_t nlines = ntupleExperimental -> ReadFile ( doseFileExp  ,
"depthExp:EdepExp"   
)
ntupleExperimental SetBranchAddress ( "EdepExp"  ,
EdepExp 
)
ntupleExperimental SetBranchAddress ( "depthExp"  ,
depthExp 
)
TNtupleSim SetBranchAddress ( "dose"  ,
dose 
)
TNtupleSim SetBranchAddress ( "iX"  ,
iX 
)
leg SetFillColor ( )
ntupleExperimental SetMarkerColor ( )
TNtupleSim SetMarkerSize ( 0.  8)
TNtupleSim SetMarkerStyle ( 26  )
ntupleExperimental SetMarkerStyle ( )
leg SetTextSize ( 0.  035)
while ( in.  good())

Variable Documentation

TCanvas* c1 = new TCanvas ("c1","c1",200,10,600,400)

Definition at line 113 of file comparison_ascii.C.

Float_t depthExp

Definition at line 23 of file comparison_ascii.C.

do
Initial value:
{
in >> f1 >> f2 >> f3 >> f4
Float_t f4
Float_t f2
Float_t f3
Float_t f1
ifstream in

Definition at line 61 of file comparison_ascii.C.

Float_t dose

Definition at line 71 of file comparison_ascii.C.

TString doseFileExp = "../../../experimentalData/proton/BraggPeak/62MeVInWater.out"

Definition at line 15 of file comparison_ascii.C.

TString doseFileSim = "../../../SimulationOutputs/proton/BraggPeak/Dose.out"

Definition at line 50 of file comparison_ascii.C.

Float_t EdepExp

Definition at line 23 of file comparison_ascii.C.

Float_t f1

Definition at line 56 of file comparison_ascii.C.

Float_t f2

Definition at line 56 of file comparison_ascii.C.

Float_t f3

Definition at line 56 of file comparison_ascii.C.

ifstream in
Initial value:
{
gROOT->Reset()

Definition at line 1 of file comparison_ascii.C.

Float_t iX

Definition at line 71 of file comparison_ascii.C.

leg = new TLegend(0.50,0.60,0.20,0.70)

Definition at line 131 of file comparison_ascii.C.

cout<< "Reading file \" " << doseFileSim << "\" ... "; in > n n n n

Definition at line 55 of file comparison_ascii.C.

Referenced by geoalgo::GeoAlgo::_Clamp_(), geoalgo::GeoAlgo::_ClosestPt_(), pma::VtxCandidate::Add(), lar::util::details::WeightTracker< Data_t >::add(), lar::util::details::FitDataCollector< T, D >::add_with_uncertainty(), util::SignalShaping::AddFilterFunction(), genf::GFAbsTrackRep::addNDF(), pma::Track3D::AddNode(), lar::details::bulk_allocator::BulkAllocatorBase< T >::AllocatedCount(), lar_pandora::PFParticleAnalysis::analyze(), trkf::TrackAna::anaStitch(), sim::MCTrack::AncestorProcess(), lar_content::DeltaRayMatchingAlgorithm::AreClustersMatched(), proxy::details::associationRangeBoundaries(), proxy::details::associationRanges(), art::PtrVector< T >::at(), pma::Track3D::AttachBackTo(), pma::Track3D::AttachTo(), pma::Track3D::AutoFlip(), pma::ProjectionMatchingAlg::autoFlip(), pma::Track3D::AverageDist2(), detsim::SimDriftElectrons::beginJob(), evd::RecoBaseDrawer::BezierTrack2D(), cmtool::CBAlgoPolyOverlap::Bool(), cmtool::CBAlgoStartInPoly::Bool(), TruncMean::CalcTruncMeanProfile(), evgen::NueAr40CCGenerator::CalculateCrossSections(), util::SignalShaping::CalculateDeconvKernel(), trkf::BezierTrackerAlgorithm::CalculateGeometricalElements(), trkf::SeedFinderAlgorithm::CalculateGeometricalElements(), pma::Track3D::CanFlip(), lar_content::CosmicRayTaggingTool::CheckAssociation(), lar_content::CosmicRayTrackMatchingAlgorithm::CheckMatchedClusters3D(), lar::util::details::WeightTracker< Data_t >::clear(), cmtool::CMFactorial(), trkf::SeedFinderAlgorithm::ConsolidateSeed(), util::SignalShaping::Convolute(), geo::vect::coord(), geo::CrossesBoundary(), util::SignalShaping::Deconvolute(), ExN03DetectorConstruction::DefineMaterials(), anab::FVectorWriter< N >::descriptionExists(), fhicl::OptionalSequence< T,-1ull >::do_prepare_elements_for_validation(), fhicl::Sequence< T,-1ull >::do_prepare_elements_for_validation(), art::BasicOutputOptionsHandler::doCheckOptions(), img::DataProviderAlg::downscaleMaxMean(), G4THitsCollection< T >::DrawAllHits(), evd::RecoBaseDrawer::DrawShower3D(), evd::RecoBaseDrawer::DrawShowerOrtho(), evd::RecoBaseDrawer::DrawTrack3D(), evd::RecoBaseDrawer::DrawTrackOrtho(), cluster::EndPointAlg::EndPoint(), trkf::BezierTrackerAlgorithm::EvaluateOccupancy(), util::FileCatalogMetadataExtras::expandTemplate(), f_alloc_int(), genf::GFTrack::fillGeoTrack(), art::RootSizeOnDisk::fillLevel2(), util::FileCatalogMetadataExtras::PerFileMetadata::fillMetadata(), trkf::KGTrack::fillTrack(), simfilter::FilterNoDirtNeutrinos::filter(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), lar_content::CosmicRaySplittingAlgorithm::FindBestSplitPosition(), pma::PMAlgVertexing::findKinksOnTracks(), trkf::SeedFinderAlgorithm::FindSeedAtEnd(), trkf::SeedFinderAlgorithm::FindSeeds(), lar::util::details::SimpleFitterInterface< T, D+1 >::FitParameter(), lar::util::details::SimplePolyFitterBase< T, 2U >::FitParameterErrors(), pma::Track3D::Flip(), mf::service::ELdestination::formSummary(), pma::PMAlgCosmicTagger::fullCrossingTagger(), pma::PMAlgCosmicTagger::fullHeightCrossing(), pma::PMAlgCosmicTagger::fullLengthCrossing(), pma::PMAlgCosmicTagger::fullWidthCrossing(), GammaFit(), art::detail::GetBasketSize(), pma::Track3D::GetBranches(), trkf::SeedFinderAlgorithm::GetCenterAndDirection(), pma::Track3D::GetDirection3D(), genf::GFTrackCand::GetHitIDs(), pma::GetHitsCount(), pma::PMAlgVertexing::getKinks(), pma::Track3D::GetMse(), sim::PhotonVoxelDef::GetNeighboringVoxelIDs(), G4HCofThisEvent::GetNumberOfCollections(), trkf::BezierTrack::GetPartialTrack(), trkf::BezierTrackerAlgorithm::GetSeedDirProjected(), lar_content::ThreeDTransverseTracksAlgorithm::GetSegmentOverlap(), lar_content::MissingTrackSegmentTool::GetSegmentOverlapMap(), lar_content::BoundedClusterMopUpAlgorithm::GetShowerPositionMap(), lar_content::ThreeDShowersAlgorithm::GetShowerPositionMaps(), G4THitsCollection< T >::GetSize(), art::detail::GetTotalSize(), pma::PMAlgVertexing::getVertices(), phot::PhotonVisibilityService::GetVisibility(), tf::Graph::Graph(), evdb::ParameterSetEdit::HandleTab(), art::EventSelector::identical(), art::Tracer::indent(), util::LazyVector< TF1 >::index_of(), pma::PMAlgTracker::init(), cosmic::CosmicTrackTagger::length(), keras::LayerDense::load_weights(), phot::PhotonLibrary::LoadLibraryFromFile(), util::SignalShaping::LockResponse(), main(), pma::Track3D::MakeFastProjection(), evdb::ColorScale::MakeHSVScale(), util::makePointerVector(), pma::Track3D::MakeProjection(), trkf::Track3DKalmanHitAlg::makeSeed(), trkf::BezierTrackerAlgorithm::MakeVertexJoins(), pma::PMAlgTracker::matchCluster(), pma::PMAlgTracker::matchTrack(), TruncMean::Mean(), lar::details::bulk_allocator::BulkAllocatorBase< T >::MemoryChunk_t::MemoryChunk_t(), pma::PMAlgVertexing::mergeBrokenTracks(), pma::ProjectionMatchingAlg::mergeTracks(), Metric(), sim::MCTrack::MotherProcess(), lar::util::details::WeightTracker< Data_t >::N(), AcceptFindNeighbors::nearestPoint(), pma::Element3D::NEnabledHits(), pma::Track3D::NEnabledHits(), pma::Track3D::NHits(), pma::PMAlgCosmicTagger::nonBeamT0Tag(), art::MixHelper::openAndReadMetaData_(), anab::operator<<(), art::operator<<(), pma::Track3D::Optimize(), shower::EMShowerAlg::OrderShowerHits(), trkf::BezierTrackerAlgorithm::OrganizeSeedsIntoTracks(), pma::PMAlgCosmicTagger::outOfDriftWindow(), evdb::ParameterSetEdit::ParameterSetEdit(), lar::debug::CallInfo_t::ParseString(), cluster::ClusterPCA::PerformClusterPCA(), lar::details::bulk_allocator::BulkAllocatorBase< T >::Preallocate(), evgen::SingleGen::presentOptions(), genf::GFBookkeeping::Print(), trkf::KGTrack::Print(), G4THitsCollection< T >::PrintAllHits(), art::detail::printBranchSummary(), art::detail::printTreeSummary(), art::InputSource::processConfiguration(), evgen::NueAr40CCGenerator::ProcessOneNeutrino(), opdet::FlashClusterMatch::produce(), vertex::VertexMatch::produce(), vertex::HarrisVertexFinder::produce(), vertex::VertexFinder2D::produce(), evgen::MarleyTimeGen::produce(), keras::read_1d_array(), lris::LArRawInputDriverJP250L::readNext(), pma::PMAlgTracker::reassignHits_1(), pma::PMAlgTracker::reassignHits_2(), cluster::ClusterParamsAlg::RefineStartPoints(), pma::Track3D::RemoveHits(), recob::Seed::Reverse(), tf::Graph::run(), genf::GFDetPlane::sane(), anab::FVectorWriter< N >::saveOutputs(), pma::Track3D::SelectRndHits(), evdb::ColorScale::SetBounds(), nutools::dbi::Table::SetConnectionTimeout(), cmtool::CBAlgoShortestDistSmallCluster::SetMaxHits(), cmtool::CBAlgoCenterOfMassSmall::SetMaxHitsSmallClus(), cmtool::CBAlgoCenterOfMass::SetMaxHitsSmallClus(), cmtool::CPAlgoNHits::SetMinHits(), cmtool::CBAlgoStartNearEnd::SetMinHits(), cmtool::CBAlgoStartInCone::SetMinHits(), cmtool::CBAlgoAngleIncompat::SetMinHits(), cmtool::CBAlgoShortestDistSmallCluster::SetMinHits(), cmtool::CBAlgoShortestDist::SetMinHits(), cmtool::CBAlgoShortestDistNonEndpoint::SetMinHits(), cmtool::CBAlgoAngleCompat::SetMinHits(), cmtool::CBAlgoAngleSeparate::SetMinHits(), cmtool::CBAlgoOutOfConeSeparate::SetMinHits(), cmtool::CBAlgoCenterOfMass::SetMinHitsBigClus(), cmtool::CBAlgoAngleAlign::SetMinNHits(), cmtool::CMManagerBase::SetMinNHits(), cmtool::CBAlgoTrackSeparate::SetMinNumHits(), nutools::dbi::ColumnDef::SetName(), genf::GFAbsTrackRep::setNDF(), genf::GFBookkeeping::setNhits(), genf::GFDetPlane::setNormal(), pma::TrkCandidateColl::setParentDaughterConnections(), detinfo::LArPropertiesStandard::SetReflectiveSurfaceNames(), pma::TrkCandidateColl::setTreeOriginAtFront(), cmtool::SimpleCombination(), pma::VtxCandidate::Size(), pma::Track3D::size(), trkf::Track3DKalmanHitAlg::smoothandextendTrack(), pma::Track3D::Split(), tss::Segmentation2D::splitHitsNaive(), art::HLTGlobalStatus::state_on_demand(), evdb::ParameterSetEditDialog::TabName(), pma::PMAlgCosmicTagger::tag(), pma::PMAlgCosmicTagger::tagApparentStopper(), pma::PMAlgCosmicTagger::tagTopFrontBack(), geo::vect::Tcoord(), evdb::ParameterSetEditRow::TextEntryReturnPressed(), lar_content::ThreeDLongitudinalTracksAlgorithm::ThreeDLongitudinalTracksAlgorithm(), simb::MCTrajectory::TotalLength(), trkf::trace(), cluster::HoughTransformCounters< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::unchecked_add_range_max(), cluster::HoughTransformCounters< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::unchecked_set_range(), evdb::Colors::UnpackColorScale(), pma::Track3D::UpdateParams(), pma::Track3D::UpdateProjection(), lar::details::bulk_allocator::BulkAllocatorBase< T >::UsedCount(), shower::EMShowerAlg::WeightedFit(), lar::BulkAllocator< T >::~BulkAllocator(), lar::details::bulk_allocator::BulkAllocatorBase< T >::~BulkAllocatorBase(), and cmtool::CBAlgoStartInPoly::~CBAlgoStartInPoly().

nentries = (Int_t)ntupleExperimental -> GetEntries()

Definition at line 29 of file comparison_ascii.C.

Float_t normFactor = EdepExp

Definition at line 31 of file comparison_ascii.C.

Referenced by for().

TNtuple* ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")

Definition at line 11 of file comparison_ascii.C.

Int_t oldX = iX

Definition at line 79 of file comparison_ascii.C.

Referenced by anab::CosmicTag::CosmicType().

Float_t sumDose = 0.

Definition at line 71 of file comparison_ascii.C.

TNtuple* TNtupleSim = new TNtuple("SimTree","dose from ascii file", "iX:jY:kZ:dose")

Definition at line 51 of file comparison_ascii.C.

vector<Float_t> vec_dose

Definition at line 13 of file comparison_ascii.C.

vector<Float_t> vec_iX

Definition at line 13 of file comparison_ascii.C.