6 #include "NuXAna/macros/Nus17/Nus17Exposures.h" 9 #include "CAFAna/Cuts/NueCutsFirstAna.h" 46 if (spill->
run < 17946) live = 24
e-6;
50 for (
int i=13;
i>-1; --
i){
51 int test = binary[
i] -
'0';
53 dbcount <= spill->diblast &&
56 dbcount <= spill->diblast &&
58 if (mydb >= 4) sum+= live*kNus17FiducialMass[mydb];
63 if (mydb >= 4) sum += live*kNus17FiducialMass[mydb];
68 if (spill->
run < 17946)
80 for (
int i=13;
i>-1; --
i){
81 int test = binary[
i] -
'0';
83 dbcount <= spill->diblast &&
86 dbcount <= spill->diblast &&
88 if (mydb >= 4) pot+= spill->
spillpot*kNus17FiducialMass[mydb];
93 if (mydb >= 4) pot += spill->
spillpot*kNus17FiducialMass[mydb];
106 TH1::SetDefaultSumw2();
109 TH1D* hLiveMass =
new TH1D(
"hLiveMass",
"livetime exposure;run;exposure (s #times kT)",12473, 12939.5, 25412.5);
110 TH1D* hLive =
new TH1D(
"hLive",
"livetime;run;livetime (s)",12473, 12939.5, 25412.5);
111 TH1D* hPOTMass =
new TH1D(
"hPOTMass",
"exposure;run;exposure (POT #times kT)",12473, 12939.5, 25412.5);
112 TH1D* hPOT =
new TH1D(
"hPOT",
"POT;run;POT",12473, 12939.5, 25412.5);
113 TH1D* hLiveMassT =
new TH1D(
"hLiveMassT",
"livetime exposure;run;exposure (s #times kT)",9900,1391000000,1490000000);
114 TH1D* hLiveT =
new TH1D(
"hLiveT",
"livetime;run;livetime (s)",9900,1391000000,1490000000);
115 TH1D* hPOTMassT =
new TH1D(
"hPOTMassT",
"exposure;run;exposure (POT #times kT)",9900,1391000000,1490000000);
116 TH1D* hPOTT =
new TH1D(
"hPOTT",
"POT;run;POT",9900,1391000000,1490000000);
120 std::vector<std::string> fPeriod;
121 if(period == 0) fPeriod = fNumiUnblind;
169 TFile*
outFile =
new TFile(outname.c_str(),
"RECREATE");
Cuts and Vars for the 2020 FD DiF Study.
std::vector< std::string > fnumi_period3
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 *kNus17FiducialMass[mydb];mydb=0;}dbcount++;}if(mydb >=4) sum+=live *kNus17FiducialMass[mydb];return sum;})
caf::Proxy< caf::SRHeader > hdr
caf::Proxy< float > spillpot
Proxy for caf::StandardRecord.
caf::Proxy< short unsigned int > dibfirst
const SpillVar kLive([](const caf::SRSpillProxy *spill){if(spill->run< 17946) return 24e-6;else return 12e-6;})
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
std::vector< std::string > MakeNumiUnblindList()
void SetSpillCut(const SpillCut &cut)
std::vector< std::string > fnumi_period1
const SpillVar kSpillTime([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})
virtual void AddSpillHistogram(TH1 *h, const SpillVar &var, const SpillCut &cut, const SpillVar &wei=kSpillUnweighted)
Uses include counting the total POT or spills in a run.
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 *kNus17FiducialMass[mydb];mydb=0;}dbcount++;}if(mydb >=4) pot+=spill->spillpot *kNus17FiducialMass[mydb];return pot;})
caf::Proxy< long unsigned int > spilltimesec
virtual void Go() override
Load all the registered spectra.
void make_nus17_pot(int period)
std::vector< std::string > fnumi_period2
caf::Proxy< unsigned int > run
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
std::vector< std::string > fnumi_period5
caf::Proxy< short unsigned int > dibmask
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
std::string to_string(ModuleType mt)
Template for Var and SpillVar.
const SpillVar fPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})