LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 Experimental points found\n ,
nlines   
)
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 f3

Definition at line 56 of file comparison_ascii.C.

Referenced by NestAlg::GetLiquidElectronDriftSpeed().

Float_t f4

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::SignalShaper::AddFilterFunction(), 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(), cluster::DBScan3DAlg::append_at_end(), phot::IPhotonMappingTransformations::applyOpDetMapping(), ArParticleHPCapture::ApplyYourself(), lar_cluster3d::ConvexHull::Area(), 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::DriftElectronstoPlane::beginJob(), detsim::SimDriftElectrons::beginJob(), cmtool::CBAlgoPolyOverlap::Bool(), TruncMean::CalcTruncMeanProfile(), evgen::NueAr40CCGenerator::CalculateCrossSections(), util::SignalShaper::CalculateDeconvKernel(), util::SignalShaping::CalculateDeconvKernel(), 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::LArFFTW::Convolute(), util::SignalShaping::Convolute(), geo::vect::coord(), util::LArFFTW::Correlate(), cluster::DBScan3DAlg::create_node(), geo::CrossesBoundary(), util::LArFFTW::Deconvolute(), 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(), geo::GeometryBuilderStandard::doExtractGeometryObjects(), phot::PhotonVisibilityService::doGetVisibilityOfOpLib(), img::DataProviderAlg::downscaleMaxMean(), G4THitsCollection< T >::DrawAllHits(), evd::RecoBaseDrawer::DrawShower3D(), evd::RecoBaseDrawer::DrawShowerOrtho(), evd::RecoBaseDrawer::DrawTrack3D(), evd::RecoBaseDrawer::DrawTrackOrtho(), cluster::EndPointAlg::EndPoint(), art::PerScheduleContainer< std::unique_ptr< art::EventPrincipal > >::expand_to_num_schedules(), f_alloc_int(), genf::GFTrack::fillGeoTrack(), trkf::KGTrack::fillTrack(), simfilter::FilterNoDirtNeutrinos::filter(), vertex::FeatureVertexFinder::Find2dClusterVertexCandidates(), lar_content::CosmicRaySplittingAlgorithm::FindBestSplitPosition(), pmtana::RiseTimeGaussFit::findFirstMax(), pma::PMAlgVertexing::findKinksOnTracks(), trkf::SeedFinderAlgorithm::FindSeedAtEnd(), trkf::SeedFinderAlgorithm::FindSeeds(), lar::util::details::SimpleFitterInterface< T, D+1 >::FitParameter(), lar::util::details::SimplePolyFitterBase< T, D >::FitParameter(), lar::util::details::SimplePolyFitterBase< T, D >::FitParameterError(), 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(), geo::vect::details::CoordManagerImpl< Vector, 1U >::get(), geo::vect::details::CoordManagerImpl< Vector, 2U >::get(), geo::vect::details::CoordManagerImpl< Vector, 3U >::get(), geo::vect::details::CoordManagerImpl< Vector, 4U >::get(), lar_content::VertexRefinementAlgorithm::GetBestFitPoint(), pma::Track3D::GetBranches(), trkf::SeedFinderAlgorithm::GetCenterAndDirection(), pma::Track3D::GetDirection3D(), genf::GFTrackCand::GetHitIDs(), pma::PMAlgVertexing::getKinks(), pma::Track3D::GetMse(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetNearbyMuonPfos(), sim::PhotonVoxelDef::GetNeighboringVoxelIDsImpl(), G4HCofThisEvent::GetNumberOfCollections(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetProjectedPositions(), lar_content::ThreeViewTransverseTracksAlgorithm::GetSegmentOverlap(), lar_content::MissingTrackSegmentTool::GetSegmentOverlapMap(), lar_content::BoundedClusterMopUpAlgorithm::GetShowerPositionMap(), lar_content::ThreeViewShowersAlgorithm::GetShowerPositionMaps(), G4THitsCollection< T >::GetSize(), pma::PMAlgVertexing::getVertices(), tf::Graph::Graph(), evdb::ParameterSetEdit::HandleTab(), util::LazyVector< TF1 >::index_of(), pma::PMAlgTracker::init(), keras::LayerDense::load_weights(), genie::flux::GPowerSpectrumAtmoFlux::LoadFluxData(), phot::PhotonLibrary::LoadLibraryFromFile(), util::SignalShaper::LockResponse(), util::SignalShaping::LockResponse(), art::Tracer::log_with_indent(), util::details::PointerVectorMaker< Coll, typename >::make(), util::details::PointerVectorMaker< Coll, std::enable_if_t< util::is_unique_ptr_v< typename Coll::value_type > > >::make(), pma::Track3D::MakeFastProjection(), evdb::ColorScale::MakeHSVScale(), pma::Track3D::MakeProjection(), trkf::Track3DKalmanHitAlg::makeSeed(), 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(), evwgh::WeightCalc::MultiGaussianSmearing(), lar::util::details::WeightTracker< Data_t >::N(), AcceptFindNeighbors::nearestPoint(), pma::Element3D::NEnabledHits(), pma::Track3D::NEnabledHits(), art::IDNumber< Level::Event >::next(), pma::Track3D::NHits(), pma::PMAlgCosmicTagger::nonBeamT0Tag(), dump::raw::OpDetWaveformDumper::operator()(), util::MappedContainer< Cont, Mapping >::IteratorBase< Container, Reference >::operator+(), util::operator+(), geo::vect::operator+(), util::MappedContainer< Cont, Mapping >::IteratorBase< Container, Reference >::operator+=(), util::MappedContainer< Cont, Mapping >::IteratorBase< Container, Reference >::operator-(), util::MappedContainer< Cont, Mapping >::IteratorBase< Container, Reference >::operator-=(), art::operator<<(), anab::operator<<(), util::MappedContainer< Cont, Mapping >::IteratorBase< Container, Reference >::operator[](), pma::Track3D::Optimize(), shower::EMShowerAlg::OrderShowerHits(), pma::PMAlgCosmicTagger::outOfDriftWindow(), lar::util::details::SimplePolyFitterBase< T, D >::Param(), evdb::ParameterSetEdit::ParameterSetEdit(), evdb::ParameterSetEditRow::ParameterSetEditRow(), lar::debug::CallInfo_t::ParseString(), art::TriggerNamesService::pathResults(), cluster::ClusterPCA::PerformClusterPCA(), trkf::TrackMomentumCalculator::plotRecoTracks_(), lar::details::bulk_allocator::BulkAllocatorBase< T >::Preallocate(), evgen::larg4SingleGen::presentOptions(), evgen::SingleGen::presentOptions(), genf::GFBookkeeping::Print(), trkf::KGTrack::Print(), G4THitsCollection< T >::PrintAllHits(), reco::shower::ShowerElementHolder::PrintElements(), reco::shower::ShowerProducedPtrsHolder::PrintPtrs(), evgen::NueAr40CCGenerator::ProcessOneNeutrino(), phot::PDFastSimANN::produce(), vertex::VertexFinder2D::produce(), NuGraphInference::produce(), phot::PDFastSimPAR::produce(), phot::PhotonLibraryPropagation::produce(), evg::AddGenieEventsToArt::produce(), evgen::MarleyTimeGen::produce(), keras::read_1d_array(), geo::fhicl::readIDsequence(), lris::LArRawInputDriverJP250L::readNext(), pma::PMAlgTracker::reassignHits_1(), pma::Track3D::RemoveHits(), recob::Seed::Reverse(), tf::Graph::run(), tf::Graph::runx(), genf::GFDetPlane::sane(), anab::FVectorWriter< N >::saveOutputs(), pma::Track3D::SelectRndHits(), evdb::ColorScale::SetBounds(), nutools::dbi::Table::SetConnectionTimeout(), cmtool::CBAlgoCenterOfMass::SetMaxHitsSmallClus(), cmtool::CBAlgoCenterOfMassSmall::SetMaxHitsSmallClus(), cmtool::CPAlgoNHits::SetMinHits(), cmtool::CBAlgoStartNearEnd::SetMinHits(), cmtool::CBAlgoAngleIncompat::SetMinHits(), cmtool::CBAlgoAngleSeparate::SetMinHits(), cmtool::CBAlgoAngleCompat::SetMinHits(), cmtool::CBAlgoOutOfConeSeparate::SetMinHits(), cmtool::CBAlgoCenterOfMass::SetMinHitsBigClus(), cmtool::CBAlgoAngleAlign::SetMinNHits(), cmtool::CMManagerBase::SetMinNHits(), nutools::dbi::ColumnDef::SetName(), genf::GFAbsTrackRep::setNDF(), genf::GFBookkeeping::setNhits(), genf::GFDetPlane::setNormal(), pma::TrkCandidateColl::setParentDaughterConnections(), detinfo::LArPropertiesStandard::SetReflectiveSurfaceNames(), pma::TrkCandidateColl::setTreeOriginAtFront(), shower::LArPandoraShowerAlg::ShowerCentre(), cmtool::SimpleCombination(), pma::VtxCandidate::Size(), pma::Track3D::size(), trkf::Track3DKalmanHitAlg::smoothandextendTrack(), pma::Track3D::Split(), tss::Segmentation2D::splitHitsNaive(), cluster::DBScan3DAlg::spread(), evdb::ParameterSetEditDialog::TabName(), pma::PMAlgCosmicTagger::tag(), pma::PMAlgCosmicTagger::tagApparentStopper(), pma::PMAlgCosmicTagger::tagTopFrontBack(), geo::vect::Tcoord(), evdb::ParameterSetEditRow::TextEntryReturnPressed(), lar_content::ThreeViewLongitudinalTracksAlgorithm::ThreeViewLongitudinalTracksAlgorithm(), 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(), ShowerRecoTools::Shower2DLinearRegressionTrackHitFinder::WeightedFit(), shower::EMShowerAlg::WeightedFit(), nnet::PointIdTrainingData::WeightedFit(), lar::BulkAllocator< T >::~BulkAllocator(), lar::details::bulk_allocator::BulkAllocatorBase< T >::~BulkAllocatorBase(), and larg4::MCTruthEventActionService::~MCTruthEventActionService().

nentries = (Int_t)ntupleExperimental -> GetEntries()

Definition at line 29 of file comparison_ascii.C.

nlines = 0

Definition at line 57 of file comparison_ascii.C.

Referenced by tca::Print2DShowers(), and ReadASCII().

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.