Functions | Variables
make_nue_ana2018_pot.C File Reference
#include <bitset>
#include <iostream>
#include "CAFAna/Analysis/Exposures.h"
#include "CAFAna/Cuts/Cuts.h"
#include "CAFAna/Cuts/TimingCuts.h"
#include "CAFAna/Cuts/NueCutsFirstAna.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Core/Loaders.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Prediction/IPrediction.h"
#include "CAFAna/Prediction/PredictionGenerator.h"
#include "CAFAna/Vars/HistAxes.h"
#include "CAFAna/Core/EventList.h"
#include "StandardRecord/Proxy/SRProxy.h"
#include "TFile.h"
#include "TH1D.h"

Go to the source code of this file.

Functions

void make_nue_ana2018_pot ()
 

Variables

const SpillVar kSpillTime ([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})
 
const SpillVar kRun ([](const caf::SRSpillProxy *spill){return spill->run;})
 
const SpillVar kSpillPOT ([](const caf::SRSpillProxy *spill){return spill->spillpot;})
 
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 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;})
 
const Var kSliceTime ([](const caf::SRProxy *sr){return sr->hdr.unixtime;})
 

Function Documentation

void make_nue_ana2018_pot ( )

Definition at line 100 of file make_nue_ana2018_pot.C.

References ana::SpectrumLoaderBase::AddSpillHistogram(), ana::SpectrumLoader::Go(), ana::kCosmic, kLive, kLiveMass, kPOTMass, ana::kRun, ana::kSpillPOT, kSpillTime, ana::kStandardSpillCuts, outFile, and ana::SpectrumLoaderBase::SetSpillCut().

101 {
102  TH1::SetDefaultSumw2();
103 
104  //binned in unix time encompassing first analysis period
105  TH1D* hLiveMass = new TH1D("hLiveMass","livetime exposure;run;exposure (s #times kT)",16488, 12939.5, 29427.5);
106  TH1D* hLive = new TH1D("hLive","livetime;run;livetime (s)",16488, 12939.5, 29427.5);
107  TH1D* hPOTMass = new TH1D("hPOTMass","exposure;run;exposure (POT #times kT)",16488, 12939.5, 29427.5);
108  TH1D* hPOT = new TH1D("hPOT","POT;run;POT",16488, 12939.5, 29427.5);
109  TH1D* hLiveMassT = new TH1D("hLiveMassT","livetime exposure;run;exposure (s #times kT)",13900,1391000000,1530000000);
110  TH1D* hLiveT = new TH1D("hLiveT","livetime;run;livetime (s)",13900,1391000000,1530000000);
111  TH1D* hPOTMassT = new TH1D("hPOTMassT","exposure;run;exposure (POT #times kT)",13900,1391000000,1530000000);
112  TH1D* hPOTT = new TH1D("hPOTT","POT;run;POT",13900,1391000000,1530000000);
113 
114 
115  //load data files
116  SpectrumLoader loaderFDData("prod4_sumdecaf_fd_numi_rhc_full_goodruns_nue2018", kCosmic);
117 
118  loaderFDData.SetSpillCut(kStandardSpillCuts);
119  loaderFDData.AddSpillHistogram(hLiveMass,kRun,kStandardSpillCuts, kLiveMass);
120  loaderFDData.AddSpillHistogram(hLive,kRun,kStandardSpillCuts, kLive);
121  loaderFDData.AddSpillHistogram(hPOTMass,kRun,kStandardSpillCuts, kPOTMass);
122  loaderFDData.AddSpillHistogram(hPOT,kRun,kStandardSpillCuts, kSpillPOT);
123  loaderFDData.AddSpillHistogram(hLiveMassT,kSpillTime,kStandardSpillCuts, kLiveMass);
124  loaderFDData.AddSpillHistogram(hLiveT,kSpillTime,kStandardSpillCuts, kLive);
125  loaderFDData.AddSpillHistogram(hPOTMassT,kSpillTime,kStandardSpillCuts, kPOTMass);
126  loaderFDData.AddSpillHistogram(hPOTT,kSpillTime,kStandardSpillCuts, kSpillPOT);
127  loaderFDData.Go();
128 
129  TFile* outFile = new TFile("nue_ana2018_pot.root", "RECREATE");
130  hLiveMass->Write();
131  hLive->Write();
132  hPOTMass->Write();
133  hPOT->Write();
134  hLiveMassT->Write();
135  hLiveT->Write();
136  hPOTMassT->Write();
137  hPOTT->Write();
138  outFile->Close();
139 
140 }
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 kRun([](const caf::SRSpillProxy *spill){return spill->run;})
const SpillVar kSpillTime([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})
TFile * outFile
Definition: PlotXSec.C:135
const SpillVar kLive([](const caf::SRSpillProxy *spill){if(spill->run< 17946) return 24e-6;else return 12e-6;})
const SpillVar kSpillPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})
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;})
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49

Variable Documentation

const SpillVar kLive([](const caf::SRSpillProxy *spill){if(spill->run< 17946) return 24e-6;else return 12e-6;})

Referenced by make_nue_ana2018_pot().

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;})

Referenced by make_nue_ana2018_pot().

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;})

Referenced by make_nue_ana2018_pot().

const SpillVar kRun([](const caf::SRSpillProxy *spill){return spill->run;})
const Var kSliceTime([](const caf::SRProxy *sr){return sr->hdr.unixtime;})
const SpillVar kSpillPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})

Referenced by getData().

const SpillVar kSpillTime([](const caf::SRSpillProxy *spill){return spill->spilltimesec;})

Referenced by make_nue_ana2018_pot().