102 TH1::SetDefaultSumw2();
105 TH1D* hLiveMass =
new TH1D(
"hLiveMass",
"livetime exposure;run;exposure (s #times kT)",12473, 12939.5, 25412.5);
106 TH1D* hLive =
new TH1D(
"hLive",
"livetime;run;livetime (s)",12473, 12939.5, 25412.5);
107 TH1D* hPOTMass =
new TH1D(
"hPOTMass",
"exposure;run;exposure (POT #times kT)",12473, 12939.5, 25412.5);
108 TH1D* hPOT =
new TH1D(
"hPOT",
"POT;run;POT",12473, 12939.5, 25412.5);
109 TH1D* hLiveMassT =
new TH1D(
"hLiveMassT",
"livetime exposure;run;exposure (s #times kT)",9900,1391000000,1490000000);
110 TH1D* hLiveT =
new TH1D(
"hLiveT",
"livetime;run;livetime (s)",9900,1391000000,1490000000);
111 TH1D* hPOTMassT =
new TH1D(
"hPOTMassT",
"exposure;run;exposure (POT #times kT)",9900,1391000000,1490000000);
112 TH1D* hPOTT =
new TH1D(
"hPOTT",
"POT;run;POT",9900,1391000000,1490000000);
116 SpectrumLoader loaderFDData(
"/pnfs/nova/persistent/production/concat/R17-03-01-prod3reco.k/full/prod_decaf_R17-03-01-prod3reco.k_fd_numi_fhc_full_v1_goodruns_nue2017/*.root",
kCosmic);
129 TFile*
outFile =
new TFile(
"nue_third_ana_pot.root",
"RECREATE");
const SpillVar fPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})
const SpillVar kSpillTime([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})
const SpillVar kLiveMass([](const caf::SRSpillProxy *spill){std::string binary=std::bitset< 14 >(spill->dibmask).to_string();double live=12e-6;if(spill->run< 17946) live=24e-6;double sum=0;int dbcount=1;int mydb=0;for(int i=13;i >-1;--i){int test=binary[i]- '0';if(dbcount >=spill->dibfirst && dbcount<=spill->diblast && test==1) mydb++;if(dbcount >=spill->dibfirst && dbcount<=spill->diblast && test==0){if(mydb >=4) sum+=live *kAna2017FiducialMass[mydb];mydb=0;}dbcount++;}if(mydb >=4) sum+=live *kAna2017FiducialMass[mydb];return sum;})
const SpillVar kLive([](const caf::SRSpillProxy *spill){if(spill->run< 17946) return 24e-6;else return 12e-6;})
const SpillVar fPOTMass([](const caf::SRSpillProxy *spill){std::string binary=std::bitset< 14 >(spill->dibmask).to_string();double pot=0;int dbcount=1;int mydb=0;for(int i=13;i >-1;--i){int test=binary[i]- '0';if(dbcount >=spill->dibfirst && dbcount<=spill->diblast && test==1) mydb++;if(dbcount >=spill->dibfirst && dbcount<=spill->diblast && test==0){if(mydb >=4) pot+=spill->spillpot *kAna2017FiducialMass[mydb];mydb=0;}dbcount++;}if(mydb >=4) pot+=spill->spillpot *kAna2017FiducialMass[mydb];return pot;})
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const SpillVar kRun([](const caf::SRSpillProxy *spill){return spill->run;})
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.