26 #include "dk2nu/tree/dk2nu.h" 201 double GetWeight(
const std::vector<double> xdet,
226 #ifdef eventRates_cxx 228 eventRates::eventRates(
std::string input_user,
std::string version,
std::string macro,
std::string current,
std::string location,
std::string physics_list,
int n_files,
int start_index,
double potperfile,
bool on_grid,
bool dk2nu)
243 if(location==
"LBNEND") {
249 else if(location==
"LBNEFD") {
257 std::string input_flux_dir =
"/pnfs/dune/scratch/users/"+input_user+
"/fluxfiles/g4lbne/"+version+
"/"+physics_list+
"/"+macro+
"/"+current+
"/flux/";
258 if(input_user==
"beam")
259 input_flux_dir =
"/dune/data/beam/fluxfiles/g4lbne/"+version+
"/"+physics_list+
"/"+macro+
"/"+current+
"/flux/";
261 input_flux_dir =
getenv(
"_CONDOR_SCRATCH_DIR");
262 input_flux_dir = input_flux_dir +
"/";
265 std::vector<std::string> fFileVec;
268 for(
int i = start_index;
i< start_index+
n_files;
i++) {
271 std::ostringstream ss_5;
272 std::ostringstream ss_3;
278 std::string flux_file = input_flux_dir +
"g4lbne_"+version+
"_"+physics_list+
"_"+macro+
"_"+current+
"_"+index_string_3+
".root";
281 flux_file = input_flux_dir +
"g4lbne_"+version+
"_"+physics_list+
"_"+macro+
"_"+current+
"_dk2nu_"+index_string_5+
".root";
284 TFile
f(flux_file.c_str());
286 fFileVec.push_back(flux_file.c_str());
291 fTotalPOT = potperfile*(double)fFileVec.size();
299 std::ostringstream start_convert;
300 start_convert << start_index;
301 start_index_string = start_convert.str();
303 std::ostringstream end_convert;
304 end_convert << start_index +
n_files;
305 end_index_string = end_convert.str();
313 output_flux_dir =
"/dune/data/users/"+output_user+
"/fluxfiles/g4lbne/"+version+
"/"+physics_list+
"/"+macro+
"/"+current+
"/flux/";
314 system((
"mkdir -p "+output_flux_dir).c_str());
317 ffilename = output_flux_dir +
"histos_g4lbne_"+version+
"_"+physics_list+
"_"+macro+
"_"+
current;
320 ffilename = output_flux_dir +
"histos_g4lbne_"+version+
"_"+physics_list+
"_"+macro+
"_"+current+
"_"+start_index_string;
327 ntuple_name =
"dk2nuTree";
329 fChain =
new TChain(ntuple_name.c_str());
332 fChain -> Add(sit -> c_str());
338 rand3 =
new TRandom3(0);
345 delete fChain->GetCurrentFile();
352 return fChain->GetEntry(entry);
358 Long64_t centry =
fChain->LoadTree(entry);
359 if (centry < 0)
return centry;
360 if (!
fChain->InheritsFrom(TChain::Class()))
return centry;
361 TChain *chain = (TChain*)
fChain;
362 if (chain->GetTreeNumber() !=
fCurrent) {
453 dk2nu =
new bsim::Dk2Nu;
485 #endif // #ifdef eventRates_cxx double GetXSec(double nu_type, double nu_energy, std::string current)
TBranch * b_data_ppmedium
TBranch * b_data_NdxdzNear
TBranch * b_data_NenergyN
virtual void Show(Long64_t entry=-1)
TBranch * b_data_NdydzNear
TBranch * b_data_protonPz
TBranch * b_data_protonPx
Int_t fCurrent
pointer to the analyzed TTree or TChain
TBranch * b_data_beamHWidth
TBranch * b_data_NdydzFar
TBranch * b_data_NdxdzFar
void ReadXSecsFromFiles()
virtual Int_t Cut(Long64_t entry)
std::string getenv(std::string const &name)
void SetTitles(TH1 *h, const std::string &xtitle="", const std::string &ytitle="")
double GetOscillatedNeutrinoType(double ntype, double E)
Q_EXPORT QTSManip setw(int w)
Double_t fTotalPOT
current Tree number in a TChain
std::string GetPOTAsString(const double dpot)
virtual Int_t GetEntry(Long64_t entry)
double GetWeight(const std::vector< double > xdet, double &nu_wght, double &nu_energy)
TBranch * b_data_NenergyF
eventRates(std::string input_user, std::string version, std::string macro, std::string current, std::string location, std::string physics_list, int n_files, int start_index, double pot_per_file, bool on_grid, bool dk2nu)
virtual Long64_t LoadTree(Long64_t entry)
std::ifstream fdat_file[6]
TBranch * b_data_ppenergy
double f_e_arr[1500][6][2]
TBranch * b_data_protonPy
virtual void Init(TTree *tree)
Q_EXPORT QTSManip setfill(int f)
h
training ###############################
TBranch * b_data_beamVWidth
double f_xsec_arr[1500][6][2]
TBranch * b_data_hornCurrent