6 #include "CAFAna/Cuts/NueCutsFirstAna.h" 42 if (spill->
run < 17946) live = 24
e-6;
46 for (
int i=13;
i>-1; --
i){
47 int test = binary[
i] -
'0';
49 dbcount <= spill->diblast &&
52 dbcount <= spill->diblast &&
64 if (spill->
run < 17946)
76 for (
int i=13;
i>-1; --
i){
77 int test = binary[
i] -
'0';
79 dbcount <= spill->diblast &&
82 dbcount <= spill->diblast &&
102 TH1::SetDefaultSumw2();
105 TH1D* hLiveMass =
new TH1D(
"hLiveMass",
"livetime exposure;run;exposure (s #times kT)",19458, 12939.5, 32397.5);
106 TH1D* hLive =
new TH1D(
"hLive",
"livetime;run;livetime (s)",19458, 12939.5, 32397.5);
107 TH1D* hPOTMass =
new TH1D(
"hPOTMass",
"exposure;run;exposure (POT #times kT)",19458, 12939.5, 32397.5);
108 TH1D* hPOT =
new TH1D(
"hPOT",
"POT;run;POT",19458, 12939.5, 32397.5);
109 TH1D* hLiveMassT =
new TH1D(
"hLiveMassT",
"livetime exposure;run;exposure (s #times kT)",16900,1391000000,1560000000);
110 TH1D* hLiveT =
new TH1D(
"hLiveT",
"livetime;run;livetime (s)",16900,1391000000,1560000000);
111 TH1D* hPOTMassT =
new TH1D(
"hPOTMassT",
"exposure;run;exposure (POT #times kT)",16900,1391000000,1560000000);
112 TH1D* hPOTT =
new TH1D(
"hPOTT",
"POT;run;POT",16900,1391000000,1560000000);
129 TFile*
outFile =
new TFile(
"nue_ana2019_rhc_pot.root",
"RECREATE");
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;})
void make_nue_ana2019_rhc_ub_pot()
Cuts and Vars for the 2020 FD DiF Study.
caf::Proxy< caf::SRHeader > hdr
caf::Proxy< float > spillpot
Proxy for caf::StandardRecord.
caf::Proxy< short unsigned int > dibfirst
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
void SetSpillCut(const SpillCut &cut)
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 Var kSpillPOT
Return the POT for the spill.
const SpillVar kLive([](const caf::SRSpillProxy *spill){if(spill->run< 17946) return 24e-6;else return 12e-6;})
caf::Proxy< long unsigned int > spilltimesec
virtual void Go() override
Load all the registered spectra.
const SpillVar kPOTMass([](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;})
caf::Proxy< unsigned int > run
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
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 double kAna2017FiducialMass[15]
const SpillVar kSpillTime([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})