Functions | Variables
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"   
)
vec_iX clear ( )
in close ( )
ntupleExperimental Draw ( "EdepExp:depthExp"  )
TNtupleSim Draw ( "dose:iX"  ,
""  ,
"same"   
)
leg Draw ( )
TNtupleSim Fill ( f1  ,
f2  ,
f3  ,
f4   
)

Referenced by for().

for ( )

Definition at line 32 of file comparison_ascii.C.

References Fill(), GetEntry(), submit_hadd::l, 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 ( nlines<=  0)

Definition at line 19 of file comparison_ascii.C.

References om::cout, and printf().

19 {cout << "Error: Check file \"" << doseFileExp << "\"\n"; return;}
TString doseFileExp
OStream cout
Definition: OStream.cxx:6
if ( !in.  is_open())

Definition at line 54 of file comparison_ascii.C.

References om::cout.

54 {cout << "Error: Check file \"" << doseFileSim << "\"\n"; return;}
OStream cout
Definition: OStream.cxx:6
TString doseFileSim
in open ( doseFileSim  )
printf ( "%d Experimental points found\n ,
nlines   
)

Referenced by TCAttrib::_cleanup(), rawdata::RawDigit::ADC(), mcchk::NullAna::analyze(), spilltime::analyze(), cvn::CVNCosmicEventDump::analyze(), braggPeak(), checkBeam(), ana2019::ColorStream::ColorStream(), CountEvents(), countmass(), CPUSpeed(), d3sigma_calc(), d4sigma_calc(), d4sigma_hist(), d4sigma_plot(), rawfileparser::RawFileParser::dumpBuffer(), fragmentAngularDistribution(), fragmentAngularDistributionGM(), fragmentAngularDistributionHistogram(), fragmentEnergy(), fragmentEnergyDistributionDifferentAngles(), fragmentYieldsPlot(), photrans::ImprovedTransport::GetPosCorr(), om::ComparisonBox::HandleFileBrowse(), if(), kinematics(), LZ4HC_encodeSequence(), MarshaledObj::MarshaledObj(), neut_code_from_rootracker(), shadow::NOVASLocate::NOVASLocate(), rawfileparser::RawFileParser::open(), mcdatadaq::Sorter::print(), novaddt::HoughPoint::print(), geo::CoordinateTransformation::print(), mcdatadaq::GlobalEventTime::printEventTime(), daqchannelmap::DAQChannelMapOLD::printHex(), daqdataformats::DCMSimulator::printMicroSlice(), mcdatadaq::GlobalEventTime::printNanoSliceTime(), ShmRdWr::read_(), read_t2k_rootracker(), daqdataformats::RawMilliSlice::readData(), readExfor(), readMyTextFile(), daq2raw::NOvASocketInputDriver::readNext(), gov::fnal::cd::rms::provider::DDSTopicReaderClass< TT_ >::receiveMessage(), rootlogon(), ShmRdWr::semtake(), sha1_forRMS_hmac(), DAQChannelMapTests::testBasicChannelGetOffline(), DAQChannelMapTests::testBasicChannelGetOnline(), DAQChannelMapTests::testBasicOfflineChannelGet(), DAQChannelMapTests::testDiBlockLookups(), DAQChannelMapTests::testDiBlockLookupsOffline(), DAQChannelMapTests::testPlaneLookupsOffline(), DAQChannelMapTests::testViewLookups(), DAQChannelMapTests::testViewLookupsOffline(), ShmRdWr::tprint(), daqdataformats::RawMilliSlice::tprintf(), daqdataformats::VERSION_NAMESPACE::RawDataBlock::tprintf(), and validation().

printf ( "%d Simulated points found\n ,
vec_iX.  size() 
)
cout<< "Reading file \" " << doseFileExp << "\" ... "; Long64_t nlines = ntupleExperimental -> ReadFile ( doseFileExp  ,
"depthExp:EdepExp"   
)
TNtupleSim Reset ( )

Definition at line 120 of file LIDTrainingDedx.cxx.

121  {
122  for( int idet=0; idet < kNumXYRegion; ++idet){
123  for( int iebin=0; iebin < kNumEnergyBin; ++iebin){
124  for( int iplane=0; iplane < kNumTransversePlane; ++iplane){
125  htransdedx[idet][iebin][iplane]->Reset();
126  }
127  }
128  }
129  for( int idet=0; idet < kNumXYRegion; ++idet){
130  for( int iebin=0; iebin < kNumEnergyBin; ++iebin){
131  for( int iplane=0; iplane < kNumLongitudinalPlane; ++iplane){
132  hlongdedx[idet][iebin][iplane]->Reset();
133  }
134  }
135  }
136 
137  fChain->Reset();
138  }// Reset all histograms
TH1D * htransdedx[kNumXYRegion][kNumEnergyBin][kNumTransversePlane]
static const int kNumTransversePlane
Number of "transverse" planes considered for dE/dx histograms ("planes" transverse to shower axis)...
static const int kNumXYRegion
Number of XY regions into which detector is divided for dE/dx histograms.
TH1D * hlongdedx[kNumXYRegion][kNumEnergyBin][kNumLongitudinalPlane]
TChain * fChain
static const int kNumEnergyBin
Number of energy bins into which detector is divided for dE/dx histograms.
static const int kNumLongitudinalPlane
Number of longitudinal planes considered for dE/dx histograms.
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.

Referenced by bdtstudyplotter(), braggPeak(), checkBeam(), ComparePredictions(), CompareSpectra(), CompareSpectraDataMC(), corrected_PE(), corrected_PE_mean(), efficiencycalc(), comi::DataCheck::endJob(), FindSignPoint(), fragmentAngularDistribution(), fragmentAngularDistributionGM(), fragmentAngularDistributionHistogram(), fragmentEnergy(), fragmentEnergyDistributionDifferentAngles(), fragmentYieldsPlot(), G4Facet::G4Facet(), getPlots(), getPlotsFromNtupleFD(), getPlotsFromNtupleND(), HadEFit(), HadFit2sp(), HadFit4sp(), HadFitCC4sp(), Landau(), photrans::ImprovedTransport::LoadHistos(), LOverEPlot(), make_eff_plots_areaNorm(), MakeFracPlot(), MakeProfileHadEFD(), MakeProfileHadEND(), MakeProfileMuEFD(), MakeProfileMuEND(), MakeStackNME(), MakingProfile(), MakingProfileActCatcherND(), MakingProfileAllCatcherND(), MakingProfileHadCC(), MakingProfileHadCCND(), MakingProfileHadNonQE(), MakingProfileHadNonQEND(), MakingProfileHadQE(), MakingProfileHadQEND(), MakingProfileND(), MRDiFStudy_FHC_Step2(), MRDiFStudy_RHC_Step2(), genie::StrumiaVissaniIBDPXSec::MtxElm(), multihough_production_validation(), MuonFit(), MuonFit4sp(), MuonFitLin(), myfunc(), stan::optimization::newton_step(), nue_fnex_vs_caf_one_to_one(), plot(), plotHist_SpectrumCVNID(), readExfor(), resolutionplotter(), runGCylindTH1FluxDriver(), slicer_production_validation(), SmoothWithFourierFit(), TEST(), evdb::ParameterSetEditRow::TextEntryReturnPressed(), thresholdshadowing(), twodvtxcontplotter(), uncorrected_PE(), om::PlotViewer::UpdateCompare(), vertexstudyploter(), stan::optimization::WolfeLineSearch(), genie::AivazisCharmPXSecLO::XSec(), and zerosstudy().

Float_t f2
Float_t f3
Float_t f4
TFile* file = new TFile("Dose.root","RECREATE")

Definition at line 5 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.

Referenced by CalcFiberLoopCorr(), and TransverseEff().

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.

nentries = (Int_t)ntupleExperimental -> GetEntries()

Definition at line 29 of file comparison_ascii.C.

nlines = 0
norm = 0.

Definition at line 71 of file comparison_ascii.C.

Referenced by novaddt::ADCShapeFit(), calib::ADCShapeFit(), stan::math::autocorrelation(), evdb::ButtonBar::ButtonBar(), bwnorm(), ana::CalcMECDoubleGaussEnh(), ana::CalcMECDoubleGaussEnhShiftedParam(), ana::CalcMECGaussEnh(), slid::NuEEnergyAlg::CellEnergy(), compareEvents(), genie::utils::nuclear::DensityGaus(), genie::utils::nuclear::DensityWoodsSaxon(), DrawBins(), ana::DataMCPair::DrawMCNormSyst(), DataMCPair::DrawMCNormSyst(), osc::_PMNS< T >::EvalEqn22(), fnex::CovarianceFitHelper::FillSpectrum(), cosrej::CosRejFxs::fitchisq(), numusand::NumuSandFxs::fitchisq(), Gaus(), novaddt::GetExpectations(), calib::GetExpectations(), cosrej::CosRejFxs::getFits(), ReadBDTA::GetMvaValue__(), ana::LikelihoodCovMxExperiment::LikelihoodCovMxNewton(), ana::GaussianPriorSystShifts::LogPrior(), cmf::CovarianceFitHelper::Make1DSpectra(), slid::NuEEnergyAlg::NonStdCellEnergy(), cmf::PlotUtilities::NormalizeBinContents(), ReadBDTA::NormVariable(), OnMonPlotMaker(), osc::_OscCalcAnalytic< T >::P(), osc::OscCalcGeneral::P(), osc::PMNS_Sterile::P(), osc::_PMNS< T >::P(), osc::_PMNSOpt< T >::P(), print_norm(), remid::RecoMuon::produce(), genie::utils::phys::R99118(), fnex::CalibSystHistMaker::ReadEventListTree(), ScaleHist(), SetAxis(), TEST(), calib::ADCShapeFitTable::TNS(), ana::Spectrum::ToTH2NormX(), stan::math::unit_vector_constrain(), fnex::CorrSpec_NoExtrapNuE::UpdateCorrectedHistograms(), fnex::CorrSpec_SimpleExtrap::UpdateCorrectedHistograms(), fnex::CorrSpec_MichelDecomp::UpdateCorrectedHistograms(), fnex::CorrSpec_PropDecomp::UpdateCorrectedHistograms(), fnex::CorrSpec_NoExtrapNuMu::UpdateCorrectedHistograms(), fnex::CorrSpec_SimpleNuMuExtrap::UpdateCorrectedHistograms(), fnex::CorrSpec_BENDecomp::UpdateCorrectedHistograms(), slid::NuEEnergyAlg::VertexEnergy(), and zheevh3().

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.

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.