Functions | Variables
make_nue_thirdana_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_thirdana_pot ()
 

Variables

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

Function Documentation

void make_nue_thirdana_pot ( )

Definition at line 100 of file make_nue_thirdana_pot.C.

References ana::SpectrumLoaderBase::AddSpillHistogram(), fPOT, fPOTMass, ana::SpectrumLoader::Go(), ana::kCosmic, kLive, kLiveMass, ana::kRun, 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)",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);
113 
114 
115  //load data files
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);
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, fPOTMass);
122  loaderFDData.AddSpillHistogram(hPOT,kRun,kStandardSpillCuts, fPOT);
123  loaderFDData.AddSpillHistogram(hLiveMassT,kSpillTime,kStandardSpillCuts, kLiveMass);
124  loaderFDData.AddSpillHistogram(hLiveT,kSpillTime,kStandardSpillCuts, kLive);
125  loaderFDData.AddSpillHistogram(hPOTMassT,kSpillTime,kStandardSpillCuts, fPOTMass);
126  loaderFDData.AddSpillHistogram(hPOTT,kSpillTime,kStandardSpillCuts, fPOT);
127  loaderFDData.Go();
128 
129  TFile* outFile = new TFile("nue_third_ana_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 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;})
TFile * outFile
Definition: PlotXSec.C:135
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&#39;re doing something special.
Definition: SpillCuts.h:49

Variable Documentation

const SpillVar fPOT([](const caf::SRSpillProxy *spill){return spill->spillpot;})
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;})

Referenced by make_nue_thirdana_pot().

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

Referenced by make_nue_thirdana_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_thirdana_pot().

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

Referenced by resolution_event_tree().

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