MaCh3 DUNE 1.0.0
Reference Guide
Loading...
Searching...
No Matches
samplePDFDUNEBeamND.cpp
Go to the documentation of this file.
1#include <TROOT.h>
2
4#include "TString.h"
5#include <assert.h>
6#include <stdexcept>
7#include "TMath.h"
8#include "manager/manager.h"
9
10samplePDFDUNEBeamND::samplePDFDUNEBeamND(std::string mc_version_, covarianceXsec* xsec_cov_, covarianceOsc* osc_cov_) : samplePDFFDBase(mc_version_, xsec_cov_, osc_cov_) {
11 Initialise();
12}
13
16
18 dunendmcSamples.resize(nSamples,dunemc_base());
19
20 IsRHC = SampleManager->raw()["SampleBools"]["isrhc"].as<bool>();
21 SampleDetID = SampleManager->raw()["DetID"].as<int>();
22 iselike = SampleManager->raw()["SampleBools"]["iselike"].as<bool>();
23
24 tot_escale_nd_pos = -999;
27 had_escale_nd_pos = -999;
30 mu_escale_nd_pos = -999;
33 n_escale_nd_pos = -999;
36 em_escale_nd_pos = -999;
39 had_res_nd_pos = -999;
40 mu_res_nd_pos = -999;
41 n_res_nd_pos = -999;
42 em_res_nd_pos = -999;
43
44 /*
45 nNDDetectorSystPointers = funcParsIndex.size();
46 NDDetectorSystPointers = std::vector<const double*>(nNDDetectorSystPointers);
47
48 int func_it = 0;
49 for (std::vector<int>::iterator it = funcParsIndex.begin(); it != funcParsIndex.end(); ++it, ++func_it) {
50 std::string name = funcParsNames.at(func_it);
51
52 if (name == "TotalEScaleND") {
53 tot_escale_nd_pos = *it;
54 NDDetectorSystPointers[func_it] = XsecCov->retPointer(tot_escale_nd_pos);
55 }
56 else if (name == "TotalEScaleSqrtND") {
57 tot_escale_sqrt_nd_pos = *it;
58 NDDetectorSystPointers[func_it] = XsecCov->retPointer(tot_escale_sqrt_nd_pos);
59 }
60 else if (name == "TotalEScaleInvSqrtND") {
61 tot_escale_invsqrt_nd_pos = *it;
62 NDDetectorSystPointers[func_it] = XsecCov->retPointer(tot_escale_invsqrt_nd_pos);
63 }
64 else if (name == "HadEScaleND") {
65 had_escale_nd_pos = *it;
66 NDDetectorSystPointers[func_it] = XsecCov->retPointer(had_escale_nd_pos);
67 }
68 else if (name == "HadEScaleSqrtND") {
69 had_escale_sqrt_nd_pos = *it;
70 NDDetectorSystPointers[func_it] = XsecCov->retPointer(had_escale_sqrt_nd_pos);
71 }
72 else if (name == "HadEScaleInvSqrtND") {
73 had_escale_invsqrt_nd_pos = *it;
74 NDDetectorSystPointers[func_it] = XsecCov->retPointer(had_escale_invsqrt_nd_pos);
75 }
76 else if (name == "MuEScaleND") {
77 mu_escale_nd_pos = *it;
78 NDDetectorSystPointers[func_it] = XsecCov->retPointer(mu_escale_nd_pos);
79 }
80 else if (name == "MuEScaleSqrtND") {
81 mu_escale_sqrt_nd_pos = *it;
82 NDDetectorSystPointers[func_it] = XsecCov->retPointer(mu_escale_sqrt_nd_pos);
83 }
84 else if (name == "MuEScaleInvSqrtND") {
85 mu_escale_invsqrt_nd_pos = *it;
86 NDDetectorSystPointers[func_it] = XsecCov->retPointer(mu_escale_invsqrt_nd_pos);
87 }
88 else if (name == "NEScaleND") {
89 n_escale_nd_pos = *it;
90 NDDetectorSystPointers[func_it] = XsecCov->retPointer(n_escale_nd_pos);
91 }
92 else if (name == "NEScaleSqrtND") {
93 n_escale_sqrt_nd_pos = *it;
94 NDDetectorSystPointers[func_it] = XsecCov->retPointer(n_escale_sqrt_nd_pos);
95 }
96 else if (name == "NEScaleInvSqrtND") {
97 n_escale_invsqrt_nd_pos = *it;
98 NDDetectorSystPointers[func_it] = XsecCov->retPointer(n_escale_invsqrt_nd_pos);
99 }
100 else if (name == "EMEScaleND") {
101 em_escale_nd_pos = *it;
102 NDDetectorSystPointers[func_it] = XsecCov->retPointer(em_escale_nd_pos);
103 }
104 else if (name == "EMEScaleSqrtND") {
105 em_escale_sqrt_nd_pos = *it;
106 NDDetectorSystPointers[func_it] = XsecCov->retPointer(em_escale_sqrt_nd_pos);
107 }
108 else if (name == "EMEScaleInvSqrtND") {
109 em_escale_invsqrt_nd_pos = *it;
110 NDDetectorSystPointers[func_it] = XsecCov->retPointer(em_escale_invsqrt_nd_pos);
111 }
112 else if (name == "HadResND") {
113 had_res_nd_pos = *it;
114 NDDetectorSystPointers[func_it] = XsecCov->retPointer(had_res_nd_pos);
115 }
116 else if (name == "MuResND") {
117 mu_res_nd_pos = *it;
118 NDDetectorSystPointers[func_it] = XsecCov->retPointer(mu_res_nd_pos);
119 }
120 else if (name == "NResND") {
121 n_res_nd_pos = *it;
122 NDDetectorSystPointers[func_it] = XsecCov->retPointer(n_res_nd_pos);
123 }
124 else if (name == "EMResND") {
125 em_res_nd_pos = *it;
126 NDDetectorSystPointers[func_it] = XsecCov->retPointer(em_res_nd_pos);
127 }
128 else {
129 MACH3LOG_ERROR("Found a functional parameter which wasn't specified in the xml | samplePDFDUNEBeamND: {}",name);
130 throw MaCh3Exception(__FILE__, __LINE__);
131 }
132 }
133 */
134
135 std::cout << "-------------------------------------------------------------------" <<std::endl;
136}
137
140 if(XsecCov->GetNumParamsFromDetID(SampleDetID, kSpline) > 0){
141 MACH3LOG_INFO("Found {} splines for this sample so I will create a spline object", XsecCov->GetNumParamsFromDetID(SampleDetID, kSpline));
142 SplineHandler = std::unique_ptr<splineFDBase>(new splinesDUNE(XsecCov));
143 InitialiseSplineObject();
144 }
145 else{
146 MACH3LOG_INFO("Found {} splines for this sample so I will not load or evaluate splines", XsecCov->GetNumParamsFromDetID(SampleDetID, kSpline));
147 SplineHandler = nullptr;
148 }
149
150 return;
151}
152
154 for (int i = 0; i < (int)dunendmcSamples.size(); ++i) {
155 for (int j = 0; j < dunendmcSamples[i].nEvents; ++j) {
156 MCSamples[i].ntotal_weight_pointers[j] = 6;
157 MCSamples[i].total_weight_pointers[j].resize(MCSamples[i].ntotal_weight_pointers[j]);
158 MCSamples[i].total_weight_pointers[j][0] = &(dunendmcSamples[i].pot_s);
159 MCSamples[i].total_weight_pointers[j][1] = &(dunendmcSamples[i].norm_s);
160 MCSamples[i].total_weight_pointers[j][2] = MCSamples[i].osc_w_pointer[j];
161 MCSamples[i].total_weight_pointers[j][3] = &(dunendmcSamples[i].rw_berpaacvwgt[j]);
162 MCSamples[i].total_weight_pointers[j][4] = &(dunendmcSamples[i].flux_w[j]);
163 MCSamples[i].total_weight_pointers[j][5] = &(MCSamples[i].xsec_w[j]);
164 }
165 }
166}
167
169
170 dunemc_base *duneobj = &(dunendmcSamples[iSample]);
171 int nupdgUnosc = sample_nupdgunosc[iSample];
172 int nupdg = sample_nupdg[iSample];
173
174 MACH3LOG_INFO("-------------------------------------------------------------------");
175 MACH3LOG_INFO("input file: {}", mc_files.at(iSample));
176
177 _sampleFile = TFile::Open(mc_files.at(iSample).c_str(), "READ");
178 _data = (TTree*)_sampleFile->Get("caf");
179
180 if(_data){
181 MACH3LOG_INFO("Found \"caf\" tree in {}", mc_files[iSample]);
182 MACH3LOG_INFO("With number of entries: {}", _data->GetEntries());
183 }
184 else{
185 MACH3LOG_ERROR("Could not find \"caf\" tree in {}", mc_files[iSample]);
186 throw MaCh3Exception(__FILE__, __LINE__);
187 }
188
189 _data->SetBranchStatus("*", 0);
190 _data->SetBranchStatus("Ev", 1);
191 _data->SetBranchAddress("Ev", &_ev);
192 _data->SetBranchStatus("Ev_reco", 1);
193 _data->SetBranchAddress("Ev_reco", &_erec);
194 _data->SetBranchStatus("Elep_reco", 1);
195 _data->SetBranchAddress("Elep_reco", &_erec_lep);
196 _data->SetBranchStatus("mode",1);
197 _data->SetBranchAddress("mode",&_mode);
198 _data->SetBranchStatus("isCC", 1);
199 _data->SetBranchAddress("isCC", &_isCC);
200 _data->SetBranchStatus("reco_q", 1);
201 _data->SetBranchAddress("reco_q", &_reco_q);
202 _data->SetBranchStatus("nuPDGunosc", 1);
203 _data->SetBranchAddress("nuPDGunosc", &_nuPDGunosc);
204 _data->SetBranchStatus("nuPDG", 1);
205 _data->SetBranchAddress("nuPDG", &_nuPDG);
206 _data->SetBranchStatus("BeRPA_A_cvwgt", 1);
207 _data->SetBranchAddress("BeRPA_A_cvwgt", &_BeRPA_cvwgt);
208
209 _data->SetBranchStatus("eRecoP", 1);
210 _data->SetBranchAddress("eRecoP", &_eRecoP);
211 _data->SetBranchStatus("eRecoPip", 1);
212 _data->SetBranchAddress("eRecoPip", &_eRecoPip);
213 _data->SetBranchStatus("eRecoPim", 1);
214 _data->SetBranchAddress("eRecoPim", &_eRecoPim);
215 _data->SetBranchStatus("eRecoPi0", 1);
216 _data->SetBranchAddress("eRecoPi0", &_eRecoPi0);
217 _data->SetBranchStatus("eRecoN", 1);
218 _data->SetBranchAddress("eRecoN", &_eRecoN);
219
220 _data->SetBranchStatus("LepE", 1);
221 _data->SetBranchAddress("LepE", &_LepE);
222 _data->SetBranchStatus("eP", 1);
223 _data->SetBranchAddress("eP", &_eP);
224 _data->SetBranchStatus("ePip", 1);
225 _data->SetBranchAddress("ePip", &_ePip);
226 _data->SetBranchStatus("ePim", 1);
227 _data->SetBranchAddress("ePim", &_ePim);
228 _data->SetBranchStatus("ePi0", 1);
229 _data->SetBranchAddress("ePi0", &_ePi0);
230 _data->SetBranchStatus("eN", 1);
231 _data->SetBranchAddress("eN", &_eN);
232
233 if (!IsRHC) {
234 duneobj->norm_s = (1e21/1.5e21);
235 } else {
236 duneobj->norm_s = (1e21/1.905e21);
237 }
238 duneobj->pot_s = (pot)/1e21;
239
240 duneobj->nEvents = _data->GetEntries();
241
242 duneobj->rw_yrec = new double[duneobj->nEvents];
243 duneobj->rw_erec_lep = new double[duneobj->nEvents];
244 duneobj->rw_erec_had = new double[duneobj->nEvents];
245 duneobj->rw_etru = new double[duneobj->nEvents];
246 duneobj->rw_erec = new double[duneobj->nEvents];
247 duneobj->rw_erec_shifted = new double[duneobj->nEvents];
248 duneobj->rw_theta = new double[duneobj->nEvents];
249 duneobj->flux_w = new double[duneobj->nEvents];
250 duneobj->rw_isCC = new int[duneobj->nEvents];
251 duneobj->rw_reco_q = new double[duneobj->nEvents];
252 duneobj->rw_nuPDGunosc = new int[duneobj->nEvents];
253 duneobj->rw_nuPDG = new int[duneobj->nEvents];
254 duneobj->rw_berpaacvwgt = new double[duneobj->nEvents];
255
256 duneobj->rw_eRecoP = new double[duneobj->nEvents];
257 duneobj->rw_eRecoPip = new double[duneobj->nEvents];
258 duneobj->rw_eRecoPim = new double[duneobj->nEvents];
259 duneobj->rw_eRecoPi0 = new double[duneobj->nEvents];
260 duneobj->rw_eRecoN = new double[duneobj->nEvents];
261
262 duneobj->rw_LepE = new double[duneobj->nEvents];
263 duneobj->rw_eP = new double[duneobj->nEvents];
264 duneobj->rw_ePip = new double[duneobj->nEvents];
265 duneobj->rw_ePim = new double[duneobj->nEvents];
266 duneobj->rw_ePi0 = new double[duneobj->nEvents];
267 duneobj->rw_eN = new double[duneobj->nEvents];
268
269 duneobj->nupdg = new int[duneobj->nEvents];
270 duneobj->nupdgUnosc = new int[duneobj->nEvents];
271 duneobj->mode = new double[duneobj->nEvents];
272 duneobj->Target = new int[duneobj->nEvents];
273
274 _data->GetEntry(0);
275
276 //FILL DUNE STRUCT
277 for (int i = 0; i < duneobj->nEvents; ++i) { // Loop through tree
278 _data->GetEntry(i);
279
280 duneobj->nupdg[i] = sample_nupdg[iSample];
281 duneobj->nupdgUnosc[i] = sample_nupdgunosc[iSample];
282
283 duneobj->rw_erec[i] = (double)_erec;
284 duneobj->rw_erec_shifted[i] = (double)_erec;
285 duneobj->rw_erec_lep[i] = (double)_erec_lep;
286 duneobj->rw_erec_had[i] = (double)(_erec - _erec_lep);
287 duneobj->rw_yrec[i] = (double)((_erec - _erec_lep)/_erec);
288 duneobj->rw_etru[i] = (double)_ev; // in GeV
289 duneobj->rw_theta[i] = (double)_LepNuAngle;
290 duneobj->rw_isCC[i] = _isCC;
291 duneobj->rw_reco_q[i] = _reco_q;
292 duneobj->rw_nuPDGunosc[i] = _nuPDGunosc;
293 duneobj->rw_nuPDG[i] = _nuPDG;
294 duneobj->rw_berpaacvwgt[i] = (double)_BeRPA_cvwgt;
295
296 duneobj->rw_eRecoP[i] = (double)_eRecoP;
297 duneobj->rw_eRecoPip[i] = (double)_eRecoPip;
298 duneobj->rw_eRecoPim[i] = (double)_eRecoPim;
299 duneobj->rw_eRecoPi0[i] = (double)_eRecoPi0;
300 duneobj->rw_eRecoN[i] = (double)_eRecoN;
301
302 duneobj->rw_LepE[i] = (double)_LepE;
303 duneobj->rw_eP[i] = (double)_eP;
304 duneobj->rw_ePip[i] = (double)_ePip;
305 duneobj->rw_ePim[i] = (double)_ePim;
306 duneobj->rw_ePi0[i] = (double)_ePi0;
307 duneobj->rw_eN[i] = (double)_eN;
308
309 //Assume everything is on Argon for now....
310 duneobj->Target[i] = 40;
311
312 int mode= TMath::Abs(_mode);
313 duneobj->mode[i]=(double)GENIEMode_ToMaCh3Mode(mode, _isCC);
314
315 duneobj->flux_w[i] = 1.0;
316 }
317
318 _sampleFile->Close();
319 return duneobj->nEvents;
320}
321
322
323const double* samplePDFDUNEBeamND::GetPointerToKinematicParameter(KinematicTypes KinPar, int iSample, int iEvent) {
324 double* KinematicValue;
325
326 switch(KinPar){
328 KinematicValue = &dunendmcSamples[iSample].rw_etru[iEvent];
329 break;
330 case kRecoQ:
331 KinematicValue = &dunendmcSamples[iSample].rw_reco_q[iEvent];
332 break;
333 default:
334 MACH3LOG_ERROR("Did not recognise Kinematic Parameter type...");
335 throw MaCh3Exception(__FILE__, __LINE__);
336 }
337
338 return KinematicValue;
339}
340
341const double* samplePDFDUNEBeamND::GetPointerToKinematicParameter(double KinematicVariable, int iSample, int iEvent) {
342 KinematicTypes KinPar = (KinematicTypes) std::round(KinematicVariable);
343 return GetPointerToKinematicParameter(KinPar,iSample,iEvent);
344}
345
346const double* samplePDFDUNEBeamND::GetPointerToKinematicParameter(std::string KinematicParameter, int iSample, int iEvent) {
347 KinematicTypes KinPar = static_cast<KinematicTypes>(ReturnKinematicParameterFromString(KinematicParameter));
348 return GetPointerToKinematicParameter(KinPar,iSample,iEvent);
349}
350
351double samplePDFDUNEBeamND::ReturnKinematicParameter(double KinematicVariable, int iSample, int iEvent) {
352 return *GetPointerToKinematicParameter(KinematicVariable, iSample, iEvent);
353}
354
355double samplePDFDUNEBeamND::ReturnKinematicParameter(std::string KinematicParameter, int iSample, int iEvent) {
356 return *GetPointerToKinematicParameter(KinematicParameter, iSample, iEvent);
357}
358
360 dunemc_base *duneobj = &(dunendmcSamples[iSample]);
361 FarDetectorCoreInfo *fdobj = &(MCSamples[iSample]);
362
363 for(int iEvent = 0 ;iEvent < fdobj->nEvents ; ++iEvent){
364 fdobj->rw_etru[iEvent] = &(duneobj->rw_etru[iEvent]);
365 fdobj->mode[iEvent] = &(duneobj->mode[iEvent]);
366 fdobj->Target[iEvent] = &(duneobj->Target[iEvent]);
367 fdobj->isNC[iEvent] = !(duneobj->rw_isCC[iEvent]);
368 fdobj->nupdgUnosc[iEvent] = &(duneobj->nupdgUnosc[iEvent]);
369 fdobj->nupdg[iEvent] = &(duneobj->nupdg[iEvent]);
370 }
371}
372
373void samplePDFDUNEBeamND::applyShifts(int iSample, int iEvent) {
374 // reset erec back to original value
375
376 dunendmcSamples[iSample].rw_erec_shifted[iEvent] = dunendmcSamples[iSample].rw_erec[iEvent];
377
378 //Calculate values needed
379 double sqrtErecHad = sqrt(dunendmcSamples[iSample].rw_erec_had[iEvent]);
380 double sqrtErecLep = sqrt(dunendmcSamples[iSample].rw_erec_lep[iEvent]);
381 double sqrteRecoPi0 = sqrt(dunendmcSamples[iSample].rw_eRecoPi0[iEvent]);
382 double sqrteRecoN = sqrt(dunendmcSamples[iSample].rw_eRecoN[iEvent]);
383 double sumEhad = dunendmcSamples[iSample].rw_eRecoP[iEvent] + dunendmcSamples[iSample].rw_eRecoPip[iEvent] + dunendmcSamples[iSample].rw_eRecoPim[iEvent];
384 double sqrtSumEhad = sqrt(sumEhad);
385
386 double invSqrtErecHad = 1/(sqrtErecHad+0.1);
387 double invSqrtErecLep = 1/(sqrtErecLep+0.1);
388 double invSqrteRecoPi0 = 1/(sqrteRecoPi0+0.1);
389 double invSqrteRecoN = 1/(sqrteRecoN+0.1);
390 double invSqrtSumEhad = 1/(sqrtSumEhad+0.1);
391
392 bool CCnumu {dunendmcSamples[iSample].rw_isCC[iEvent]==1 && abs(dunendmcSamples[iSample].rw_nuPDG[iEvent])==14 && dunendmcSamples[iSample].nupdgUnosc[iEvent]==2};
393 bool CCnue {dunendmcSamples[iSample].rw_isCC[iEvent]==1 && abs(dunendmcSamples[iSample].rw_nuPDG[iEvent])==12 && dunendmcSamples[iSample].nupdgUnosc[iEvent]==1};
394 bool NotCCnumu {!(dunendmcSamples[iSample].rw_isCC[iEvent]==1 && abs(dunendmcSamples[iSample].rw_nuPDG[iEvent])==14) && dunendmcSamples[iSample].nupdgUnosc[iEvent]==2};
395
396
397 TotalEScaleND(NDDetectorSystPointers[0], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_had[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], NotCCnumu);
398
399 TotalEScaleSqrtND(NDDetectorSystPointers[1], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_had[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], sqrtErecHad, sqrtErecLep, NotCCnumu);
400
401 TotalEScaleInvSqrtND(NDDetectorSystPointers[2], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_had[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], invSqrtErecHad, invSqrtErecLep, NotCCnumu);
402
403 HadEScaleND(NDDetectorSystPointers[3], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], sumEhad);
404
405 HadEScaleSqrtND(NDDetectorSystPointers[4], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], sumEhad, sqrtSumEhad);
406
407 HadEScaleInvSqrtND(NDDetectorSystPointers[5], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], sumEhad, invSqrtSumEhad);
408
409 MuEScaleND(NDDetectorSystPointers[6], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], CCnumu);
410
411 MuEScaleSqrtND(NDDetectorSystPointers[7], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], sqrtErecLep, CCnumu);
412
413 MuEScaleInvSqrtND(NDDetectorSystPointers[8], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], invSqrtErecLep, CCnumu);
414
415 NEScaleND(NDDetectorSystPointers[9], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoN[iEvent]);
416
417 NEScaleSqrtND(NDDetectorSystPointers[10], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoN[iEvent], sqrteRecoN);
418
419 NEScaleInvSqrtND(NDDetectorSystPointers[11], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoN[iEvent], invSqrteRecoN);
420
421 EMEScaleND(NDDetectorSystPointers[12], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoPi0[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], CCnue);
422
423 EMEScaleSqrtND(NDDetectorSystPointers[13], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoPi0[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], sqrtErecLep, sqrteRecoPi0, CCnue);
424
425 EMEScaleInvSqrtND(NDDetectorSystPointers[14], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoPi0[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], invSqrtErecLep, invSqrteRecoPi0, CCnue);
426
427 HadResND(NDDetectorSystPointers[15], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoP[iEvent], dunendmcSamples[iSample].rw_eRecoPip[iEvent], dunendmcSamples[iSample].rw_eRecoPim[iEvent], dunendmcSamples[iSample].rw_eP[iEvent], dunendmcSamples[iSample].rw_ePip[iEvent], dunendmcSamples[iSample].rw_ePim[iEvent]);
428
429 MuResND(NDDetectorSystPointers[16], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], dunendmcSamples[iSample].rw_LepE[iEvent], CCnumu);
430
431 NResND(NDDetectorSystPointers[17], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoN[iEvent], dunendmcSamples[iSample].rw_eN[iEvent]);
432
433 EMResND(NDDetectorSystPointers[18], &dunendmcSamples[iSample].rw_erec_shifted[iEvent], dunendmcSamples[iSample].rw_eRecoPi0[iEvent], dunendmcSamples[iSample].rw_ePi0[iEvent], dunendmcSamples[iSample].rw_erec_lep[iEvent], dunendmcSamples[iSample].rw_LepE[iEvent], CCnue);
434
435}
436
437std::vector<double> samplePDFDUNEBeamND::ReturnKinematicParameterBinning(std::string KinematicParameterStr)
438{
439 std::vector<double> binningVector;
440 return binningVector;
441}
442
443int samplePDFDUNEBeamND::ReturnKinematicParameterFromString(std::string KinematicParameterStr) {
444 return -1;
445}
446
448 return "";
449}
void TotalEScaleInvSqrtND(const double *par, double *erec, double erecHad, double erecLep, double invSqrtErecHad, double invSqrtErecLep, bool NotCCnumu)
void EMEScaleSqrtND(const double *par, double *erec, double eRecoPi0, double erecLep, double sqrtErecLep, double sqrteRecoPi0, bool CCnue)
void MuEScaleSqrtND(const double *par, double *erec, double erecLep, double sqrtErecLep, bool CCnumu)
void EMResND(const double *par, double *erec, double eRecoPi0, double ePi0, double erecLep, double LepE, bool CCnue)
void NEScaleND(const double *par, double *erec, double eRecoN)
int GENIEMode_ToMaCh3Mode(int GENIE_mode, int isCC)
void NEScaleSqrtND(const double *par, double *erec, double eRecoN, double sqrteRecoN)
void EMEScaleND(const double *par, double *erec, double eRecoPi0, double erecLep, bool CCnue)
void TotalEScaleND(const double *par, double *erec, double erecHad, double erecLep, bool NotCCnumu)
void HadEScaleND(const double *par, double *erec, double sumEhad)
void NResND(const double *par, double *erec, double eRecoN, double eN)
void HadResND(const double *par, double *erec, double eRecoP, double eRecoPip, double eRecoPim, double eP, double ePip, double ePim)
void TotalEScaleSqrtND(const double *par, double *erec, double erecHad, double erecLep, double sqrtErecHad, double sqrtErecLep, bool NotCCnumu)
void EMEScaleInvSqrtND(const double *par, double *erec, double eRecoPi0, double erecLep, double invSqrtErecLep, double invSqrteRecoPi0, bool CCnue)
void HadEScaleSqrtND(const double *par, double *erec, double sumEhad, double sqrtSumEhad)
void HadEScaleInvSqrtND(const double *par, double *erec, double sumEhad, double invSqrtSumEhad)
void MuResND(const double *par, double *erec, double erecLep, double LepE, bool CCnumu)
void MuEScaleND(const double *par, double *erec, double erecLep, bool CCnumu)
void MuEScaleInvSqrtND(const double *par, double *erec, double erecLep, double invSqrtErecLep, bool CCnumu)
void NEScaleInvSqrtND(const double *par, double *erec, double eRecoN, double invSqrteRecoN)
samplePDFDUNEBeamND(std::string mc_version, covarianceXsec *xsec_cov, covarianceOsc *osc_cov)
samplePDFDUNE ND beam Constructor
int ReturnKinematicParameterFromString(std::string KinematicParameterStr)
Get kinematic parameter ID from string name.
std::vector< double > ReturnKinematicParameterBinning(std::string KinematicParameter)
Gets binning for a given parameter.
int setupExperimentMC(int iSample)
Function to setup MC from file.
void applyShifts(int iSample, int iEvent)
NOT IMPLEMENTED: Apply kinematic shifts.
std::vector< const double * > NDDetectorSystPointers
ND Detector Systematics.
void SetupWeightPointers()
Sets up pointers weights for each event (oscillation/xsec/etc.)
void SetupSplines()
Sets up splines.
void Init()
Initialises object.
void setupFDMC(int iSample)
Tells FD base which variables to point to/be set to.
TTree * _data
TTree containing sample Data.
std::vector< struct dunemc_base > dunendmcSamples
Array filled with MC samples for each oscillation channel.
TFile * _sampleFile
File containing sample objects.
KinematicTypes
Enum to identify kinematics.
double ReturnKinematicParameter(double KinematicVariable, int iSample, int iEvent)
Returns pointer to kinemtatic parameter for event in Structs DUNE.
const double * GetPointerToKinematicParameter(KinematicTypes KinPar, int iSample, int iEvent)
Returns pointer to kinemtatic parameter for event in Structs DUNE.
std::string ReturnStringFromKinematicParameter(int KinematicParameter)
Gets name of kinematic parmaeter.
double pot
Value of POT used for sample.
Specialisation of FD (binned) spline class.
Definition splinesDUNE.h:8
double * rw_eRecoP
Definition StructsDUNE.h:22
double * rw_erec_had
Definition StructsDUNE.h:19
double * rw_eRecoPim
Definition StructsDUNE.h:24
int * nupdgUnosc
Definition StructsDUNE.h:15
double * rw_erec_lep
Definition StructsDUNE.h:20
double * mode
Definition StructsDUNE.h:65
double * rw_berpaacvwgt
Definition StructsDUNE.h:46
double * rw_yrec
Definition StructsDUNE.h:21
double * rw_erec_shifted
Definition StructsDUNE.h:18
double * rw_ePip
Definition StructsDUNE.h:30
double pot_s
Definition StructsDUNE.h:59
double * rw_erec
Definition StructsDUNE.h:17
int * rw_isCC
Definition StructsDUNE.h:47
double * rw_eP
Definition StructsDUNE.h:29
double * rw_ePim
Definition StructsDUNE.h:31
double * flux_w
Definition StructsDUNE.h:63
double * rw_eRecoN
Definition StructsDUNE.h:26
double * rw_eN
Definition StructsDUNE.h:33
double * rw_etru
Definition StructsDUNE.h:35
int * rw_nuPDGunosc
Definition StructsDUNE.h:48
double * rw_theta
Definition StructsDUNE.h:37
double * rw_eRecoPi0
Definition StructsDUNE.h:25
double norm_s
Definition StructsDUNE.h:60
double * rw_eRecoPip
Definition StructsDUNE.h:23
double * rw_LepE
Definition StructsDUNE.h:28
double * rw_reco_q
Definition StructsDUNE.h:56
int * rw_nuPDG
Definition StructsDUNE.h:49
double * rw_ePi0
Definition StructsDUNE.h:32