MRDiFStudy_FHC_Step2.C
Go to the documentation of this file.
1 
2 #include "CAFAna/Core/Binning.h"
3 #include "CAFAna/Core/Spectrum.h"
5 #include "CAFAna/Core/Var.h"
6 #include "CAFAna/Core/MultiVar.h"
7 
8 #include "CAFAna/Cuts/Cuts.h"
10 #include "CAFAna/Cuts/TimingCuts.h"
11 #include "CAFAna/Cuts/SpillCuts.h"
13 #include "CAFAna/Cuts/TruthCuts.h"
14 
16 //#include "MRDiFCutsAndVars.h"
17 
18 
19 #include "CAFAna/Vars/Vars.h"
21 
23 
24 #include <cassert>
25 
26 #include "TFile.h"
27 #include "TCanvas.h"
28 #include "TH2.h"
29 #include "TH1.h"
30 #include "TStyle.h"
31 #include "TLegend.h"
32 #include "TLatex.h"
33 #include "TArrayD.h"
34 #include "TTree.h"
35 #include "TLeaf.h"
36 #include "stdio.h"
37 #include <sstream>
38 #include <string>
39 #include <iostream>
40 #include <fstream>
41 #include <string>
42 
43 
44 using namespace ana;
45 using namespace std;
46 
47 //need global histos that'll turn into the angle weights
50 //TH1D* hPreselCRY=0;
51 //TH1D* hPreselData=0;
52 
53 
54 
56 {
57 
58  //datasets to run over
59  const std::string filenameCosmicsData = "prod_mrdifcaf_R19-11-18-prod5reco.i_fd_cosmic_fhc_full_v1_goodruns";
60  const std::string filenameCRYMC = "prod_mrdifcaf_R19-11-18-prod5reco.m_fd_cry_fhc_full_v3";
61  const std::string filenameGENIEFluxswap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_fluxswap_fhc_nova_v08_full_v1";
62 
63  //input step 1 file - has the angle distributions used to make the weights
64  //TFile *f1 = new TFile("3FlavorAna/Ana2020/MRstudies/MRDiF_FD_FHC_Step1.root", "READ");
65  TFile *f1 = TFile::Open(pnfs2xrootd("/pnfs/nova/scratch/users/amhall/DiF/FHC/MRDiF_FD_FHC_Step1.root").c_str());
66  f1->cd();
67 
68  //pull in those angle spectra
69  auto sShwAnglePreselCosmicsData=*Spectrum::LoadFrom(f1, "sShwAngleCorePreselCosmicsData");
70  auto sShwAnglePreselCRYMC=*Spectrum::LoadFrom(f1, "sShwAngleCorePreselCRYMC");
71  auto sShwAnglePreselGENIEFluxswap=*Spectrum::LoadFrom(f1, "sShwAngleCorePreselGENIEFluxswap");
72 
73  //get applicable exposures for normalizing
74  double mylivetime=sShwAnglePreselCosmicsData.Livetime();
75  double myPOT=sShwAnglePreselGENIEFluxswap.POT();
76 
77  hPreselGENIE_forCRY=sShwAnglePreselGENIEFluxswap.ToTH1(myPOT);
78  hPreselGENIE_forData=sShwAnglePreselGENIEFluxswap.ToTH1(myPOT);
79 
80  TH1D* hPreselCRY=sShwAnglePreselCRYMC.ToTH1(mylivetime,kLivetime);
81  TH1D* hPreselData=sShwAnglePreselCosmicsData.ToTH1(mylivetime,kLivetime);
82 
83  hPreselGENIE_forCRY->Rebin();
84  hPreselGENIE_forData->Rebin();
85  hPreselCRY->Rebin();
86  hPreselData->Rebin();
87 
88  hPreselGENIE_forCRY->Scale(hPreselCRY->Integral()/hPreselGENIE_forCRY->Integral());
89  hPreselGENIE_forCRY->Divide(hPreselCRY);
90 
91  hPreselGENIE_forData->Scale(hPreselData->Integral()/hPreselGENIE_forData->Integral());
92  hPreselGENIE_forData->Divide(hPreselData);
93 
94  //now we have to define some variables before we can define the weights properly
95 
96  const Var kShwAngle([](const caf::SRProxy* sr)
97  {
98  double maxe = -99.0;
99  int maxi = 999.0;
100  double cosz = -1.0;
101 
102  if(!sr->vtx.elastic.IsValid) return -99999.0;
103  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
104 
105  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
106  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
107  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
108  maxi = i;
109  cosz = sr->vtx.elastic.fuzzyk.png[i].shwlid.dir.z;
110  }
111  }
112  return cosz;
113  });
114 
115  const Var kShwE( [](const caf::SRProxy* sr)
116  {
117  double maxe = -99.0;
118  int maxi = 999;
119 
120  if(!sr->vtx.elastic.IsValid) return -99999.0;
121  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
122 
123  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
124  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
125  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
126  maxi = i;
127  }
128  }
129  return maxe;
130 
131  });
132 
133  //now we can define the weights as Vars
134  //CRY weights
135  const Var kCRYMC1Dweights( [kShwAngle, kShwE](const caf::SRProxy* sr)
136  {
137  double myweight=1.0;
138  double myWgtVar;
139  myWgtVar = kShwAngle(sr);
140  int bin=hPreselGENIE_forCRY->FindBin(myWgtVar);
141  myweight=hPreselGENIE_forCRY->GetBinContent(bin);
142  if(myweight>=0)return myweight;
143  else return 1.0;
144  });
145 
146 
147  //Data weights
148  const Var kData1Dweights( [kShwAngle, kShwE](const caf::SRProxy* sr)
149  {
150  double myweight=1.0;
151  double myWgtVar;
152  myWgtVar = kShwAngle(sr);
153  int bin=hPreselGENIE_forData->FindBin(myWgtVar);
154  myweight=hPreselGENIE_forData->GetBinContent(bin);
155  if(myweight>=0)return myweight;
156  else return 1.0;
157  });
158 
159 
160  //-----------------------------------------------------------------------------------
161 
162  //now the rest of the desired variables we need to define
163 
164 const Var kShwStartX(
165  [](const caf::SRProxy *sr)
166  {
167 
168  double maxe = -99.0;
169  int maxi = 999;
170  double startx = -99999;
171 
172  if(!sr->vtx.elastic.IsValid) return -99999.0;
173  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
174 
175  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
176  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
177  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
178  maxi = i;
179  startx = sr->vtx.elastic.fuzzyk.png[i].shwlid.start.x;
180  }
181  }
182 
183  return startx;
184 
185  });
186 
187 
188 
189  const Var kShwStartY(
190  [](const caf::SRProxy *sr)
191  {
192 
193  double maxe = -99.0;
194  int maxi = 999;
195  double starty = -99999;
196 
197  if(!sr->vtx.elastic.IsValid) return -99999.0;
198  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
199 
200  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
201  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
202  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
203  maxi = i;
204  starty = sr->vtx.elastic.fuzzyk.png[i].shwlid.start.y;
205  }
206  }
207 
208  return starty;
209 
210  });
211 
212 
213 
214  const Var kShwStartZ(
215  [](const caf::SRProxy *sr)
216  {
217 
218  double maxe = -99.0;
219  int maxi = 999;
220  double startz = -99999;
221 
222  if(!sr->vtx.elastic.IsValid) return -99999.0;
223  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
224 
225  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
226  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
227  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
228  maxi = i;
229  startz = sr->vtx.elastic.fuzzyk.png[i].shwlid.start.z;
230  }
231  }
232 
233  return startz;
234 
235  });
236 
237 
238  const Var kShwWidth(
239  [](const caf::SRProxy* sr)
240  {
241 
242  double maxe = -99.0;
243  int maxi = 999;
244  double width = -999;
245 
246  if(!sr->vtx.elastic.IsValid) return -99999.0;
247  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
248 
249  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
250  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
251  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
252  maxi = i;
253  width = sr->vtx.elastic.fuzzyk.png[i].shwlid.width;
254  }
255  }
256 
257  return width;
258 
259  });
260 
261 
262 
263 
264  const Var kShwLength(
265  [](const caf::SRProxy* sr)
266  {
267 
268  double maxe = -99.0;
269  int maxi = 999;
270  double length = -999;
271 
272  if(!sr->vtx.elastic.IsValid) return -99999.0;
273  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
274 
275  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
276  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
277  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
278  maxi = i;
279  length = sr->vtx.elastic.fuzzyk.png[i].shwlid.len;
280  }
281  }
282 
283  return length;
284 
285  });
286 
287 
288  const Var kEPerHit = kCaloE / kNHit;
289 
290  const Var kShwNHit(
291  [](const caf::SRProxy* sr)
292  {
293 
294  double maxe = -99.0;
295  int maxi = 999;
296  double nhit = -999;
297 
298  if(!sr->vtx.elastic.IsValid) return -99999.0;
299  if(sr->vtx.elastic.fuzzyk.png.size() < 1) return -99999.0;
300 
301  for(unsigned int i=0;i<sr->vtx.elastic.fuzzyk.png.size();i++){
302  if(maxe < sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){
303  maxe = sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;
304  maxi = i;
305  nhit = sr->vtx.elastic.fuzzyk.png[i].shwlid.nhit;
306  }
307  }
308 
309  return nhit;
310 
311  });
312 
313 const Var kVtxX([](const caf::SRProxy* sr)
314  {
315  if (!sr->vtx.elastic.IsValid || !(sr->vtx.elastic.fuzzyk.png.size() >0)) return -99999.0;
316  double vtx = sr->vtx.elastic.vtx.x;
317  return vtx;
318  });
319 
320  const Var kVtxY([](const caf::SRProxy* sr)
321  {
322  if (!sr->vtx.elastic.IsValid || !(sr->vtx.elastic.fuzzyk.png.size() >0)) return -99999.0;
323  double vtx = sr->vtx.elastic.vtx.y;
324  return vtx;
325  });
326 
327  const Var kVtxZ([](const caf::SRProxy* sr)
328  {
329  if (!sr->vtx.elastic.IsValid || !(sr->vtx.elastic.fuzzyk.png.size() >0)) return -99999.0;
330  double vtx = sr->vtx.elastic.vtx.z;
331  return vtx;
332  });
333 
334  //cut to ignore angle bins where we had data points, but not MC.
335  const Cut kShwAngleCut = (kShwAngle >= 0.5 && kShwAngle < 0.9667);
336 
337  //Binning
338  const Binning ShwEbin= Binning::Simple(120, 0.0, 5.0);
339  const Binning ShwWidthbin= Binning::Simple(100, 0.0, 10.0);
340  const Binning ShwLengthbin= Binning::Simple(100, 0.0, 1000.0);
341  const Binning ShwAnglebin= Binning::Simple(30, 0.0, 1.0);
342  const Binning ShwStartXbin= Binning::Simple(800, -800, 800);
343  const Binning ShwStartYbin= Binning::Simple(800, -800, 800);
344  const Binning ShwStartZbin= Binning::Simple(3000,0,6000);
345  const Binning ShwCVNebin= Binning::Simple(120, 0.0, 1.000);
346  const Binning NHitbin= Binning::Simple(120,0.0,150);
347  const Binning EPerHitbin= Binning::Simple(200, 0, 0.5);
348  const Binning distVerticalbin = Binning::Simple(3260, 0, 1600); //this binning was an accident. was supposed to be 320 not 3260
349  const Binning distHorizontalbin= Binning::Simple(320, 0, 1600);
350  const Binning distLengthbin= Binning::Simple(3000, 0, 6000);
351 
352 
353  //some structure to make making the sprectra easier
354  struct Plot{const char* name; Var var; const Binning binning;};
355 
356  const std::vector<Plot> plots = {
357  {"Shower Angle (cos_theta_z)", kShwAngle, ShwAnglebin},
358  {"Number of Hits in Slice", kNHit, NHitbin },
359  {"Number of Hits in Shower", kShwNHit, NHitbin},
360  {"Energy in Shower (GeV)", kShwE, ShwEbin },
361  {"Energy per Hit (CaloE/NHit)", kEPerHit, EPerHitbin},
362  {"CVNe - loosptpt", kCVNe_looseptp, ShwCVNebin},
363  {"Shower Width", kShwWidth, ShwWidthbin},
364  {"Shower Length", kShwLength, ShwLengthbin},
365  {"Shower Start X", kShwStartX, ShwStartXbin},
366  {"Shower Start Y", kShwStartY, ShwStartYbin},
367  {"Shower Start Z", kShwStartZ, ShwStartZbin},
368  {"Vtx X", kVtxX, ShwStartXbin},
369  {"Vtx Y", kVtxY, ShwStartYbin},
370  {"Vtx Z", kVtxZ, ShwStartZbin},
371  {"Distance to Top", kdistTop, distVerticalbin},
372  {"Distance to Bottom", kdistBottom, distVerticalbin},
373  {"Distance to East", kdistEast, distHorizontalbin},
374  {"Distance to West", kdistWest, distHorizontalbin},
375  {"Distance to Front", kdistFront, distLengthbin},
376  {"Distance to Back", kdistBack, distLengthbin}
377  };
378 
379  //and define our loaders
380  SpectrumLoader loaderCosmicsData(filenameCosmicsData, kCosmic);
381  SpectrumLoader loaderCRYMC(filenameCRYMC, kCosmic);
382  SpectrumLoader loaderGENIE(filenameGENIEFluxswap);
383  loaderGENIE.SetSpillCut(kStandardSpillCuts);
384 
385  std::vector<Spectrum*> sDataPresel, sCRYMCPresel, sGENIEPresel, sData, sCRYMC, sGENIE;
386  std::vector<Spectrum*> sDataPreselWtd, sCRYMCPreselWtd, sDataWtd, sCRYMCWtd;
387 
388  for(const Plot& p: plots){
389 
390  sDataPresel.push_back( new Spectrum(p.name, p.binning, loaderCosmicsData, p.var, kDiFPreselectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR ));
391  sData.push_back( new Spectrum(p.name, p.binning, loaderCosmicsData, p.var, kDiFSelectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR ));
392  sDataPreselWtd.push_back( new Spectrum(p.name, p.binning, loaderCosmicsData, p.var, kDiFPreselectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR, kNoShift, kData1Dweights));
393  sDataWtd.push_back( new Spectrum(p.name, p.binning, loaderCosmicsData, p.var, kDiFSelectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR, kNoShift, kData1Dweights));
394 
395  sCRYMCPresel.push_back( new Spectrum(p.name, p.binning, loaderCRYMC, p.var, kDiFPreselectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR ));
396  sCRYMC.push_back( new Spectrum(p.name, p.binning, loaderCRYMC, p.var, kDiFSelectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR ));
397  sCRYMCPreselWtd.push_back(new Spectrum(p.name, p.binning, loaderCRYMC, p.var, kDiFPreselectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR, kNoShift, kCRYMC1Dweights));
398  sCRYMCWtd.push_back( new Spectrum(p.name, p.binning, loaderCRYMC, p.var, kDiFSelectionCut && kShwAngleCut && kInCosmicTimingWindow_FD_MR, kNoShift, kCRYMC1Dweights));
399 
400  sGENIEPresel.push_back( new Spectrum(p.name, p.binning, loaderGENIE, p.var, kDiFPreselectionCut && kShwAngleCut ));
401  sGENIE.push_back( new Spectrum(p.name, p.binning, loaderGENIE, p.var, kDiFSelectionCut && kShwAngleCut ));
402 
403  }
404 
405  loaderCosmicsData.Go();
406  loaderCRYMC.Go();
407  loaderGENIE.Go();
408 
409 
410  //and save the spectra to a file
411 
412  TFile *outFile = new TFile("MRDiF_FD_FHC_Step2_v2_clean.root", "recreate");
413  char cname[128];
414 
415  for (unsigned int i=0; i<sDataPresel.size(); i++){
416  sprintf(cname, "sDataPresel_V%d", i);
417  sDataPresel[i]->SaveTo(outFile, cname);
418  sprintf(cname, "sData_V%d", i);
419  sData[i]->SaveTo(outFile, cname);
420  sprintf(cname, "sDataPreselWtd_V%d", i);
421  sDataPreselWtd[i]->SaveTo(outFile, cname);
422  sprintf(cname, "sDataWtd_V%d", i);
423  sDataWtd[i]->SaveTo(outFile, cname);
424 
425  sprintf(cname, "sCRYMCPresel_V%d", i);
426  sCRYMCPresel[i]->SaveTo(outFile, cname);
427  sprintf(cname, "sCRYMC_V%d", i);
428  sCRYMC[i]->SaveTo(outFile, cname);
429  sprintf(cname, "sCRYMCPreselWtd_V%d", i);
430  sCRYMCPreselWtd[i]->SaveTo(outFile, cname);
431  sprintf(cname, "sCRYMCWtd_V%d", i);
432  sCRYMCWtd[i]->SaveTo(outFile, cname);
433 
434  sprintf(cname, "sGENIEPresel_V%d", i);
435  sGENIEPresel[i]->SaveTo(outFile, cname);
436  sprintf(cname, "sGENIE_V%d", i);
437  sGENIE[i]->SaveTo(outFile, cname);
438  }
439 
440 }
const Var kShwE([](const caf::SRProxy *sr){double maxe=-99.0;if(!sr->vtx.elastic.IsValid) return-99999.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-99999.0;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;i++){if(maxe< sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){maxe=sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;}}return maxe;})
Definition: MRVars.h:9
const Var kShwNHit
const XML_Char * name
Definition: expat.h:151
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const char * p
Definition: xmltok.h:285
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const Var kdistEast([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float x_val=sr->vtx.elastic.vtx.x;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.x;if(tmp > x_val) x_val=tmp;}float dist_to_east=765-x_val;return dist_to_east;})
const Var kShwStartY
nhit
Definition: demo1.py:25
void SetSpillCut(const SpillCut &cut)
std::string pnfs2xrootd(std::string loc, bool unauth)
Definition: UtilsExt.cxx:237
const Cut kDiFPreselectionCut
const Var kEPerHit([](const caf::SRProxy *sr){if(sr->slc.nhit >0) return 1000.0 *(sr->slc.calE/sr->slc.nhit);else return-5.;})
Definition: NueVarsExtra.h:14
const Var kVtxX
const Var kShwWidth
const Var kdistBottom([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float y_val=sr->vtx.elastic.vtx.y;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.y;if(tmp< y_val) y_val=tmp;}float dist_to_bot=y_val+749;return dist_to_bot;})
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
Double_t maxi
Definition: plot.C:28
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
====================================================================== ///
Definition: CutFlow_Data.C:28
length
Definition: demo0.py:21
caf::Proxy< float > z
Definition: SRProxy.h:108
const Var kShwStartX
TFile * outFile
Definition: PlotXSec.C:135
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:535
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
caf::Proxy< float > x
Definition: SRProxy.h:106
const Var kNHit
Definition: Vars.cxx:71
const std::vector< Plot > plots
const Var kdistFront([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float z_val=sr->vtx.elastic.vtx.z;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.z;if(tmp< z_val) z_val=tmp;}return z_val;})
const Cut kDiFSelectionCut
caf::StandardRecord * sr
virtual void Go() override
Load all the registered spectra.
Float_t f1
float bin[41]
Definition: plottest35.C:14
std::vector< float > Spectrum
Definition: Constants.h:610
void MRDiFStudy_FHC_Step2()
const SystShifts kNoShift
Definition: SystShifts.cxx:21
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2058
const Var kVtxY
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
caf::Proxy< float > y
Definition: SRProxy.h:107
const Var kdistBack([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float z_val=sr->vtx.elastic.vtx.z;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.z;if(tmp > z_val) z_val=tmp;}return 5962-z_val;})
const Var kVtxZ
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:2073
const Cut kInCosmicTimingWindow_FD_MR
Definition: TimingCuts.cxx:170
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
const Var kShwAngle([](const caf::SRProxy *sr){double maxe=-99.0;double cosz=-1.0;if(!sr->vtx.elastic.IsValid) return-99999.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-99999.0;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;i++){if(maxe< sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE){maxe=sr->vtx.elastic.fuzzyk.png[i].shwlid.shwE;cosz=sr->vtx.elastic.fuzzyk.png[i].shwlid.dir.z;}}return cosz;})
Definition: MRVars.h:8
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146
const Var kShwStartZ
TH1D * hPreselGENIE_forData
TH1D * hPreselGENIE_forCRY
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107
const Var kCVNe_looseptp
Definition: Vars.cxx:36
const Var kdistWest([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float x_val=sr->vtx.elastic.vtx.x;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.x;if(tmp< x_val) x_val=tmp;}float dist_to_west=x_val+758;return dist_to_west;})
const Var kdistTop([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid||!(sr->vtx.elastic.fuzzyk.png.size() >0)) return(float)-5;float y_val=sr->vtx.elastic.vtx.y;for(unsigned int pngID=0;pngID< sr->vtx.elastic.fuzzyk.png.size();pngID++){float tmp=sr->vtx.elastic.fuzzyk.png[pngID].shwlid.stop.y;if(tmp > y_val) y_val=tmp;}float dist_to_top=765-y_val;return dist_to_top;})
enum BeamMode string