ncpi0Cuts.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 //////CAFAna libraries//////////
5 #include "CAFAna/Core/Cut.h"
9 #include "CAFAna/Vars/Vars.h"
13 #include "CAFAna/Cuts/Cuts.h"
14 #include "TMath.h"
15 #include "TVector3.h"
16 #include "TParticlePDG.h"
17 ///////////////////////////////
18 
19 
20 namespace ana
21 
22 {
23 
24  /*********************************************************************************************************************/
25 //kPi0
26 
27 
28 
29 
30 //Any Pi0 greater then 0.635 total energy.
31  const Cut kPi0([](const caf::SRProxy* sr)
32  {
33  float MassOfPi0=0.135;
34  float kinetic=-10;
35  float en = -99;
36 
37  //Check vtx
38  if(sr->vtx.nelastic == 0)
39  return false;
40  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
41  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
42 
43  //check nu
44  if(sr->mc.nnu == 0)
45  return false;
46  assert(sr->mc.nnu == 1);
47  if(sr->mc.nu[0].prim.size() == 0)
48  return false;
49 
50  //Loop over primaries and calculate pi0 KE
51  int nbofprim=sr->mc.nu[0].prim.size();
52  int countpi0=0;
53 
54  for(int i = 0; i < nbofprim; i++)
55  {
56  if(sr->mc.nu[0].prim[i].pdg == 111)
57  {
58  en= sr->mc.nu[0].prim[i].p.E;
59  //count if above threshold
60  // en = MassOfPion + KE
61  //std::cout << "Energy before energy cuts is: " << en << std::endl;
62  if(en > 0.3){ countpi0++;
63  //std::cout << "Energy is: " << en << std::endl;
64  }
65  }
66  }
67  //If there are pions greater then zero return true.
68  if(countpi0 > 0) return true;
69  return false;
70 
71  });
72 
73 
74 
75 
76  const SpillTruthCut kIsPi0ST([](const caf::SRNeutrinoProxy* truth)
77  {
78  return (!truth->iscc &&
79  truth->pdg == 111 &&
80  truth->pdgorig==111);
81  });
82  //All Pi0 less then 0.635 total energy
83  const Cut kPi0L([](const caf::SRProxy* sr)
84  {
85  float MassOfPi0=0.135;
86  float kinetic=-10;
87  float en = -99;
88 
89  //Check vtx
90  if(sr->vtx.nelastic == 0)
91  return false;
92  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
93  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
94 
95  //check nu
96  if(sr->mc.nnu == 0)
97  return false;
98  assert(sr->mc.nnu == 1);
99  if(sr->mc.nu[0].prim.size() == 0)
100  return false;
101 
102  //Loop over primaries and calculate pi0 KE
103  int nbofprim=sr->mc.nu[0].prim.size();
104  int countpi0=0;
105  int countpi0L=0;
106 
107  for(int i = 0; i < nbofprim; i++)
108  {
109  if(sr->mc.nu[0].prim[i].pdg == 111)
110  {
111  en= sr->mc.nu[0].prim[i].p.E;
112  //count any pi0
113  std::cout << "Energy L before energy cuts is: " << en << std::endl;
114  countpi0++;
115  //count any low energy pi0
116  if(en <= 0.3 && en > 0){ countpi0L++;
117  std::cout << "Energy L is: " << en << std::endl;
118  }
119  }
120  }
121  //if there are pions and all the pions are low energy return true
122  if(countpi0 > 0 && (countpi0L == countpi0)) return true;
123  return false;
124 
125  });
126 
127 /*********************************************************************************************************************/
128 
129  //// MC True Energy Cal E and Remid//////////
130  //Ensure that the total energy of the pi0 is greater than .5MeV.
131  //May need to change the energy cut.(obtained from Daisy)
132  //Calibrated deposited charge energy
133  const Cut kreco ([](const caf::SRProxy* sr)
134  {
135  float MassOfPi0=0.135;
136  float kinetic=-10;
137  float en = -99;
138  float totEn;
139  float reco;
140  if(sr->vtx.nelastic == 0 && sr->mc.nnu==0) return false;
141  totEn=(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE);
142  reco= (totEn-MassOfPi0);
143  if (reco > 0.5) return true;
144  return false;
145  });
146  //3 prong CalE reco
147  const Cut kIsRecoKinEn ([](const caf::SRProxy* sr)
148 
149  {
150  if(sr->mc.nnu == 0) return false;
151  if(sr->vtx.nelastic == 0) return false;
152  assert(sr->mc.nnu == 1);
153  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
154  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
155 
156  float MassOfPi0=0.135;
157  float totEn;
158  float RecoKE;
159  float Png1En=-99;
160  float Png2En=-99;
161  float Png3En=-99;
162 
163  Png1En=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE;
164  Png2En=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE;
165 
166  totEn=(Png1En+Png2En+Png3En);
167 
168 
169 
170  if ( totEn==0) return false;
171 
172  if ( totEn > 0.5 && totEn< 0.3) return true;
173 
174  return false;
175 
176  });
177 
178 
179 /*********************************************************************************************************************/
180 
181  //This cut is for the feducial volume below the near detector surface
182  const Cut kIsFiducial([](const caf::SRProxy* sr)
183  {
184  unsigned int bestidx = sr->trk.kalman.idxremid;
185 
186  if(sr->trk.kalman.ntracks <= bestidx )
187  return false;
188 
189  const caf::SRTrackProxy& trk = sr->trk.kalman.tracks[0];
190  TVector3 vtxmax(180,180,1000);
191  TVector3 vtxmin(-180,-180,50);
192  // 15 cm from edges
193 
194  bool isFiducial = (trk.start.X() < vtxmax.X() &&
195  trk.start.X() > vtxmin.X() &&
196  trk.start.Y() > vtxmin.Y() &&
197  trk.start.Y() < vtxmax.Y() &&
198  trk.start.Z() > vtxmin.Z() &&
199  trk.start.Z() < vtxmax.Z());
200  return isFiducial;
201 
202  });
203 
204 
205  const Cut kTrueVtxInFiducial([](const caf::SRProxy* sr){
206 
207  if(sr->mc.nnu==0) return false;
208  assert(sr->mc.nnu == 1);
209  if(sr->vtx.nelastic == 0) return false;
210  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
211  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
212 
213  if (sr->mc.nu[0].vtx.x < -130) return false;
214  if (sr->mc.nu[0].vtx.x > 160) return false;
215  if (sr->mc.nu[0].vtx.y < -176) return false;
216  if (sr->mc.nu[0].vtx.y > 160) return false;
217  if (sr->mc.nu[0].vtx.z < 225) return false;
218  if (sr->mc.nu[0].vtx.z > 1000) return false;
219 
220  return true;
221  });
222 
223  const TVector3 vtxmin(-130,-176,225);
224  const TVector3 vtxmax(160,160,1000);
225 
226  const SpillTruthCut kTrueFiducialST([]
227  (const caf::SRNeutrinoProxy* sr){
228  return (sr->vtx.X() < vtxmax.X() &&
229  sr->vtx.X() > vtxmin.X() &&
230  sr->vtx.Y() < vtxmax.Y() &&
231  sr->vtx.Y() > vtxmin.Y() &&
232  sr->vtx.Z() < vtxmax.Z() &&
233  sr->vtx.Z() > vtxmin.Z() );
234  });
235 
236  /*********************************************************************************************************************/
237 
238  //Numu
239  //Numu Cut
240  const Cut kNumu([](const caf::SRProxy* sr)
241  {
242  if(sr->vtx.nelastic == 0) return false;
243  if(sr->mc.nnu == 0) return false;
244 
245  return(sr->mc.nu[0].pdg == 14);
246  });
247 //This cut is for Numu tight containment
248  const Cut kNumuTightContainND([](const caf::SRProxy* sr)
249 
250  {
251 
252  unsigned int bestidx = sr->trk.kalman.idxremid;
253 
254  if(bestidx >= sr->trk.kalman.ntracks )
255 
256  return false;
257 
258  bool isContained = (sr->slc.ncellsfromedge > 4
259 
260  && sr->slc.firstplane > 4
261 
262  && sr->slc.lastplane < 212
263 
264  && ( sr->trk.kalman.tracks[0].stop.Z() < 1275
265 
266  || sr->sel.contain.kalyposattrans < 55 )
267 
268  // air gap
269 
270  && ( sr->energy.numu.ndhadcalcatE
271 
272  + sr->energy.numu.ndhadcaltranE ) < 0.03
273 
274  // too much E in mC for E estimation
275 
276  && sr->sel.contain.kalfwdcellnd > 4
277 
278  && sr->sel.contain.kalbakcellnd > 8);
279 
280  return isContained;
281  });
282  /*********************************************************************************************************************/
283 
284  //Create the containtment region which hits must be located in.
285  const Cut kContainment([](const caf::SRProxy* sr)
286  { //Check that there is a vertex, shower, and prongs.
287  if(sr->mc.nnu==0) return false;
288  if(sr->vtx.nelastic==0) return false;
289  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
290  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
291  for (unsigned int i=0; i<sr->vtx.elastic[0].fuzzyk.nshwlid; i++)
292  { //Define the area of containment.
293  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) < -160.0) return false;
294  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 120.0) return false;
295  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) < -180.0) return false;
296  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 155.0) return false;
297  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) < 200.0) return false;
298  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;
299  }
300  return true;
301  });
302  // Create the Containment region with shwlid prongs
303  const Cut kShwStopContainment([](const caf::SRProxy* sr)
304 
305  {
306  if(sr->mc.nnu==0) return false;
307  if(sr->vtx.nelastic==0) return false;
308  assert(sr->mc.nnu == 1);
309  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
310  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
311 
312  for (unsigned int i=0; i< sr->vtx.elastic[0].fuzzyk.nshwlid; i++){
313 
314  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) < -180.0) return false;
315  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 180.0) return false;
316  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) < -180.0) return false;
317  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 180.0) return false;
318  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) < 200.0) return false;
319  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;
320  }
321  return true;
322  });
323 
324 
325  /*********************************************************************************************************************/
326 
327 
328  //This cut is for NC Pi0 1 Prong CVN Gamma ID///////
329 
330 
331  const Cut kNpCVNgammaID ([](const caf::SRProxy* sr)
332  {
333  int nbofprongs = sr->vtx.elastic[0].fuzzyk.npng;
334  int nCVNPhotons = 0;
335  int nCVNPhotonsH = 0;
336 
337  if(sr->vtx.nelastic == 0) return false;
338  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
339 
340 
341  //loop over all 1 prong CVN photons
342  for( int pngid = 0; pngid < nbofprongs && (nbofprongs == 1); pngid++){
343 
344 
345  double prPID = sr->vtx.elastic[0].fuzzyk.png[pngid].cvnpart.photonid;
346  //count any 1 prong gamma
347  nCVNPhotons++;
348  //count any high 1 prong gamma > 0.7 Probability
349  if(prPID >=0.7 && prPID > 0)
350  nCVNPhotonsH++;
351  }
352  // Prong ID
353  if (nCVNPhotons > 0 && (nCVNPhotonsH==nCVNPhotons)) return true;
354  return false;
355  });
356 
357  const Cut kNpCVN1gammaID ([](const caf::SRProxy* sr) //prong1PDG
358  {
359  if(sr->vtx.nelastic == 0) return false;
360  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
361 
362  double prPID = sr->vtx.elastic[0].fuzzyk.png[0].cvnpart.photonid;
363 
364  //count any high 1 prong gamma > 0.7 Probability
365  if(prPID >=0.7) return true;
366  return false;
367  });
368 
369  const Cut kNpCVN2gammaID ([](const caf::SRProxy* sr)
370  {
371  if(sr->vtx.nelastic == 0) return false;
372  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
373 
374  double prPID = sr->vtx.elastic[0].fuzzyk.png[1].cvnpart.photonid;
375 
376  //count any high 2 prong gamma > 0.7 Probability
377  if(prPID >=0.9) return true;
378  return false;
379  });
380  const Cut kNpCVN3gammaID ([](const caf::SRProxy* sr)
381  {
382  if(sr->vtx.nelastic == 0) return false;
383  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
384 
385  double prPID = sr->vtx.elastic[0].fuzzyk.png[1].cvnpart.photonid;
386 
387  //count any high 2 prong gamma > 0.7 Probability
388  if(prPID <=0.2) return true;
389  return false;
390  });
391 
392 /*********************************************************************************************************************/
393 
394 ////PDG truth
395 
396  //prong1pdg
397  const Cut kNpPDG1gammaID ([](const caf::SRProxy* sr)
398  {
399  if(sr->vtx.nelastic == 0) return false;
400  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
401 
402  double GammaPID = sr->vtx.elastic[0].fuzzyk.png[0].truth.pdg;
403  double Pi0PID = sr->vtx.elastic[0].fuzzyk.png[0].truth.motherpdg;
404  //check the gamma comes from a Pi0
405  if(abs(GammaPID) == 22 && abs(Pi0PID) == 111 ) return true;
406  return false;
407  });
408 
409  //prong2pdg
410  const Cut kNpPDG2gammaID ([](const caf::SRProxy* sr)
411  {
412  if(sr->vtx.nelastic == 0) return false;
413  if(sr->vtx.elastic[0].fuzzyk.npng == 0) return false;
414 
415  double GammaPID = sr->vtx.elastic[0].fuzzyk.png[1].truth.pdg;
416  double Pi0PID = sr->vtx.elastic[0].fuzzyk.png[1].truth.motherpdg;
417  //check the gamma comes from a Pi0
418  if(abs(GammaPID) == 22 && abs(Pi0PID) == 111 ) return true;
419  return false;
420  });
421 
422 
423  /*********************************************************************************************************************/
424 
425 
426  //This cut is for RemID (based on the remid of the particle)
427  const Cut kPi0RemIDND([](const caf::SRProxy* sr)
428  {
429  return (sr->sel.remid.pid <0.36);
430  });
431 
432 
433  const Cut kIsReMId ([](const caf::SRProxy* sr)
434  {
435  if(sr->mc.nnu == 0) return false;
436  if(sr->vtx.nelastic == 0) return false;
437  assert(sr->mc.nnu == 1);
438  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
439  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
440  return (sr->sel.remid.pid < 0.36);
441  });
442 
443  /*********************************************************************************************************************/
444  /// CC and NC current cuts///
445 
446  //This is the kCurrent cut
447 
448  const Cut kNCurrent([](const caf::SRProxy *sr)
449  {
450  if(sr->vtx.nelastic == 0) return false;
451  if(sr->mc.nnu==0) return false;
452  assert(sr->mc.nnu==1);
453  // return !sr->mc.nu[0].iscc;
454  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
455  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
456 
457  return (sr->mc.nu[0].iscc == 0);
458  });
459  //This is the kCCurrent cut
460 
461  const Cut kCCurrent([](const caf::SRProxy *sr)
462  {
463  if(sr->vtx.nelastic == 0) return false;
464  if(sr->mc.nnu==0) return false;
465  assert(sr->mc.nnu==1);
466  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
467  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
468 
469  // return !sr->mc.nu[0].iscc;
470  return (sr->mc.nu[0].iscc == 1);
471  });
472 
473 
474  //Define charged current pi0 background events.
475  const Cut kCCPi0Bkg([](const caf::SRProxy* sr)
476  {
477  if(sr->mc.nnu == 0) return false;
478  if(sr->vtx.nelastic == 0) return false;
479  if(sr->mc.nu[0].prim.size() == 0) return false;
480  int nbofprim=sr->mc.nu[0].prim.size();
481  int countpi=0;
482  // bool ispi0=false;
483  for(int i=0;i<nbofprim;i++)
484  {
485  if(sr->mc.nu[0].prim[i].pdg==111) countpi++;
486  }
487  if (countpi > 0 && sr->mc.nu[0].iscc) return true;
488  return false;
489  });
490 
491  //Define neutral current pi0 background events.
492  const Cut kNCPi0Bkg([](const caf::SRProxy* sr)
493  {
494  if(sr->mc.nnu == 0) return false;
495  if(sr->vtx.nelastic == 0) return false;
496  if(sr->mc.nu[0].prim.size() == 0) return false;
497  int nbofprim=sr->mc.nu[0].prim.size();
498  int countpi=0;
499  // bool ispi0=false;
500  for(int i=0;i<nbofprim;i++)
501  {
502  if(sr->mc.nu[0].prim[i].pdg==111) countpi++;
503  }
504  if (countpi > 0 && sr->mc.nu[0].iscc==0) return true;
505  return false;
506  });
507 
508 
509 
510  //Define charged current no-pi0 background events.
511  const Cut kCCNonPi0Bkg([](const caf::SRProxy* sr)
512  {
513  if(sr->mc.nnu == 0) return false;
514  if(sr->vtx.nelastic == 0) return false;
515  if(sr->mc.nu[0].prim.size() == 0) return false;
516  int nbofprim=sr->mc.nu[0].prim.size();
517  int countpi=0;
518  // bool ispi0=false;
519  for(int i=0;i<nbofprim;i++)
520  {
521  if(sr->mc.nu[0].prim[i].pdg==111) countpi++;
522  }
523  if (countpi == 0 && sr->mc.nu[0].iscc) return true;
524  return false;
525  });
526 
527  //Define charged current no-pi0 background events.
528  const Cut kNCNonPi0Bkg([](const caf::SRProxy* sr)
529  {
530  if(sr->mc.nnu == 0) return false;
531  if(sr->vtx.nelastic == 0) return false;
532  if(sr->mc.nu[0].prim.size() == 0) return false;
533  int nbofprim=sr->mc.nu[0].prim.size();
534  int countpi=0;
535  // bool ispi0=false;
536  for(int i=0;i<nbofprim;i++)
537  {
538  if(sr->mc.nu[0].prim[i].pdg==111) countpi++;
539  }
540  if (countpi == 0 && sr->mc.nu[0].iscc==0) return true;
541  return false;
542  });
543 
544  //Define neutral current background events.
545  const Cut kNCBkg([](const caf::SRProxy* sr)
546  {
547  float MassOfPi0=0.135;
548  float kinetic=-10;
549  float en = -99;
550  if(sr->mc.nnu == 0) return false;
551  if(sr->vtx.nelastic == 0) return false;
552  if(sr->mc.nu[0].prim.size() == 0) return false;
553  int nbofprim=sr->mc.nu[0].prim.size();
554  int countpi=0;
555  for(int i = 0; i < nbofprim; i++)
556  {
557  if(sr->mc.nu[0].prim[i].pdg == 111)
558  { //May need to change kinetic energy.
559  en= sr->mc.nu[0].prim[i].p.E;
560  kinetic = en - MassOfPi0;
561  if(kinetic > 0.5) countpi++;
562  }
563  }
564  if (countpi == 0 && !sr->mc.nu[0].iscc) return true;
565  return false;
566  });
567 
568 
569 
570 
571  /*********************************************************************************************************************/
572 // Containment variable for NC events
573  const Cut kContainNC3P([](const caf::SRProxy* sr)
574  {
575  const caf::SRNueCosRejProxy& cr = sr->sel.nuecosrej;
576  if(std::min(cr.starteast, cr.stopeast) < 25) { return false; }
577  if(std::min(cr.startwest, cr.stopwest) < 25) { return false; }
578  if(std::min(cr.starttop, cr.stoptop) < 25) { return false; }
579  if(std::min(cr.startbottom, cr.stopbottom) < 25) { return false; }
580  if(std::min(cr.startfront, cr.stopfront) < 25) { return false; }
581  if(std::min(cr.startback, cr.stopback) < 25) { return false; }
582  return true;
583 
584  });
585 
586  /*********************************************************************************************************************/
587 
588 
589  //Vertex cuts////
590  //Choose the slices that have a single vertex in them.
591  const Cut kVtx ([](const caf::SRProxy* sr)
592  {
593  // if (sr->vtx.nelastic == 0) return false;
594  if(sr->vtx.nelastic == 0 && sr->mc.nnu == 0)return false;
595  return (sr->vtx.nelastic==0);
596  });
597 
598 /*********************************************************************************************************************/
599  //This cut is for 3 Prongs
600 
601 
602  const Cut k3Prongs ([](const caf::SRProxy* sr)
603 
604  {
605  //Check for nu
606  if(sr->mc.nnu==0) return false;
607  if(sr->vtx.nelastic==0) return false;
608  assert(sr->mc.nnu == 1);
609  //check for 3 prong
610  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
611  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
612  return (sr->vtx.elastic[0].fuzzyk.npng == 3 );
613 
614  });
615 
616  //This cut is for 2 prongs
617 
618  const Cut k2Prongs ([](const caf::SRProxy* sr)
619 
620  {
621  //Check for nu
622  if(sr->mc.nnu==0) return false;
623  if(sr->vtx.nelastic==0) return false;
624  assert(sr->mc.nnu == 1);
625  //check for 2 prong
626  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
627  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
628  return (sr->vtx.elastic[0].fuzzyk.npng == 2 );
629 
630  });
631  /*********************************************************************************************************************/
632  const Cut kVtxInFiducial([](const caf::SRProxy* sr){
633 
634  if(sr->mc.nnu==0) return false;
635  if(sr->vtx.nelastic==0) return false;
636  assert(sr->mc.nnu == 1);
637  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
638  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
639 
640  if (sr->vtx.elastic[0].vtx.x < -80) return false;
641  if (sr->vtx.elastic[0].vtx.x > 120) return false;
642  if (sr->vtx.elastic[0].vtx.y < -148) return false;
643  if (sr->vtx.elastic[0].vtx.y > 60) return false;
644  if (sr->vtx.elastic[0].vtx.z < 225) return false;
645  if (sr->vtx.elastic[0].vtx.z > 950) return false;
646 
647  return true;
648  });
649 
650 /*************************************************************************************************************************************/
651 
652 //Uncertainty investigation systematics
653  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
654  ///////////////////// /////////////////////////////
655  ///////////////////// ALL Pi0'S GREATER THEN SPECIFIED TOTAL ENERGY /////////////////////////////
656  ///////////////////// /////////////////////////////
657  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
658 
660 
661  {
662  public:
663  fIsPi0Variable(float b): fPi0(b)
664  {
665  }
666  bool operator()(const caf::SRProxy* sr) const
667  {
668  float MassOfPi0=0.135;
669  float kinetic=-10;
670  float en = -99;
671 
672  //Check vtx
673  if(sr->vtx.nelastic == 0)
674  return false;
675  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
676  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
677 
678  //check nu
679  if(sr->mc.nnu == 0)
680  return false;
681  assert(sr->mc.nnu == 1);
682  if(sr->mc.nu[0].prim.size() == 0)
683  return false;
684 
685  //Loop over primaries and calculate pi0 KE
686  int nbofprim=sr->mc.nu[0].prim.size();
687  int countpi0=0;
688 
689  for(int i = 0; i < nbofprim; i++)
690  {
691  if(sr->mc.nu[0].prim[i].pdg == 111)
692  {
693  en= sr->mc.nu[0].prim[i].p.E;
694  //count if above threshold
695  // en = MassOfPion + KE
696  if(en > fPi0) countpi0++;
697  }
698  }
699  //If there are pions greater then zero return true.
700  if(countpi0 > 0) return true;
701  return false;
702  }
703  protected:
704  float fPi0;
705  };
706 
707 /*********************************************************************************************************************/
708 
709  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
710  ///////////////////// /////////////////////////////
711  ///////////////////// ALL Pi0'S LESS THEN SPECIFIED TOTAL ENERGY /////////////////////////////
712  ///////////////////// /////////////////////////////
713  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
714 
716 
717  {
718  public:
719  fIsPi0LVariable(float c): fPi0L(c)
720  {
721  }
722  bool operator()(const caf::SRProxy* sr) const
723  {
724  float MassOfPi0=0.135;
725  float kinetic=-10;
726  float en = -99;
727 
728  //Check vtx
729  if(sr->vtx.nelastic == 0)
730  return false;
731  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
732  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
733 
734  //check nu
735  if(sr->mc.nnu == 0)
736  return false;
737  assert(sr->mc.nnu == 1);
738  if(sr->mc.nu[0].prim.size() == 0)
739  return false;
740 
741  //Loop over primaries and calculate pi0 KE
742  int nbofprim=sr->mc.nu[0].prim.size();
743  int countpi0=0;
744  int countpi0L=0;
745 
746  for(int i = 0; i < nbofprim; i++)
747  {
748  if(sr->mc.nu[0].prim[i].pdg == 111)
749  {
750  en= sr->mc.nu[0].prim[i].p.E;
751  //count any pi0
752  countpi0++;
753  //count any low energy pi0
754  if(en <= fPi0L && en > 0) countpi0L++;
755  }
756  }
757  //if there are pions and all the pions are low energy return true
758  if(countpi0 > 0 && (countpi0L == countpi0)) return true;
759  return false;
760  }
761  protected:
762  float fPi0L;
763  };
764 
765  const Cut kPi01(fIsPi0Variable(0.635));
766  const Cut kPi0L1(fIsPi0Variable(0.635));
767  const Cut kPi02(fIsPi0Variable(0.3));
768  const Cut kPi0L2(fIsPi0Variable(0.3));
769 
770  /*******************************************************************************************************************************************************************************************************/
771  const Cut kcut15hits([](const caf::SRProxy* sr){
772 
773  if(sr->mc.nnu==0) return false;
774  assert(sr->mc.nnu == 1);
775  if(sr->vtx.nelastic == 0) return false;
776  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
777  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
778 
779  float hit;
780  hit=sr->slc.nhit;
781  if (hit>15) return true;
782 
783  return false;
784  });
785 
786 
787 
788 
789  /*********************************************************************************************************************/
790  /// 3 prong analysis cuts////
791 
792  /////////MC true energy cuts/////////
793 
794  ///Preselection///
795 
797 
798  ///3 prong events preselection //////
800  const Cut k3ProngPreSel = kPreSelect && k3Prongs;
801  const Cut k3ProngPreSelCVN = kPreSelect && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
802 
803 
804 
805 ;
806  const Cut k3ProngPreSel2CVN = kPreSelect && k3Prongs && kPi0RemIDND && kNpCVN1gammaID && kNpCVN2gammaID;
807  const Cut k3ProngPreSelPDG = kPreSelect && k3Prongs && kPi0RemIDND && kNpPDG1gammaID && kNpPDG2gammaID;
808  const Cut k3ProngPreSelR = kPreSelect && k3Prongs && kPi0RemIDND;
809 //This is the Signal//////
810 
811  const Cut Signal = kNumu && kNCurrent && kPi0;
812 
813 
814  //This is 3 prong event preselection NC and CC nonPi0/////
815 
816  const Cut kIsCCNonPi0 = k3ProngPreSel2CVN && kCCurrent && !(kPi0||kPi0L);
817  const Cut kIsNCNonPi0 = k3ProngPreSel2CVN && kNCurrent && !(kPi0||kPi0L);
818  const Cut kIsCCNonPi0CVN = k3ProngPreSelCVN && kCCurrent && !(kPi0||kPi0L);
819  const Cut kIsNCNonPi0CVN = k3ProngPreSelCVN && kNCurrent && !(kPi0||kPi0L);
820  const Cut kIsCCNonPi03PR = k3ProngPreSelR && kCCurrent && !(kPi0||kPi0L);
821  const Cut kIsNCNonPi03PR = k3ProngPreSelR && kNCurrent && !(kPi0||kPi0L);
822  const Cut kIsCCNonPi03PRem = k3ProngPreSel && kCCurrent && !(kPi0||kPi0L); //RemID as a variable
823  const Cut kIsNCNonPi03PRem = k3ProngPreSel && kNCurrent && !(kPi0||kPi0L);
824  const Cut kIsCCNonPi0PDG = k3ProngPreSelPDG && kCCurrent && !(kPi0||kPi0L);
825  const Cut kIsNCNonPi0PDG = k3ProngPreSelPDG && kNCurrent && !(kPi0||kPi0L);
826  const Cut kIsCCNonPi0NoCut = NoCut3prong && kCCurrent && !(kPi0||kPi0L);
827  const Cut kIsNCNonPi0NoCut = NoCut3prong && kNCurrent && !(kPi0||kPi0L);
828 
829 //This is 3 prong event preselection NC and CC w/ pi0 & w/ pi0 < 0.635.
830 
831  const Cut kIsNCPi0 = k3ProngPreSel2CVN && kNCurrent && kPi0;
832  const Cut kIsNCPi0L = k3ProngPreSel2CVN && kNCurrent && kPi0L;
833  const Cut kIsCCPi0 = k3ProngPreSel2CVN && kCCurrent && (kPi0||kPi0L);
834  const Cut kIsNCPi0CVN = k3ProngPreSelCVN && kNCurrent && kPi0;
835  const Cut kIsNCPi0LCVN = k3ProngPreSelCVN && kNCurrent && kPi0L;
836  const Cut kIsCCPi0CVN = k3ProngPreSelCVN && kCCurrent && (kPi0||kPi0L);
837  const Cut kIsNCPi03PR = k3ProngPreSelR && kNCurrent && kPi0;
838  const Cut kIsNCPi0L3PR = k3ProngPreSelR && kNCurrent && kPi0L;
839  const Cut kIsCCPi03PR = k3ProngPreSelR && kCCurrent && (kPi0||kPi0L);
840  const Cut kIsNCPi03PRem = k3ProngPreSel && kNCurrent && kPi0;
841  const Cut kIsNCPi0L3PRem = k3ProngPreSel && kNCurrent && kPi0L;
842  const Cut kIsCCPi03PRem = k3ProngPreSel && kCCurrent && (kPi0||kPi0L);
843  const Cut kIsNCPi0PDG = k3ProngPreSelPDG && kNCurrent && kPi0;
844  const Cut kIsNCPi0LPDG = k3ProngPreSelPDG && kNCurrent && kPi0L;
845  const Cut kIsCCPi0PDG = k3ProngPreSelPDG && kCCurrent && (kPi0||kPi0L);
846  const Cut kIsNCPi0NoCut = NoCut3prong && kNCurrent && kPi0;
847  const Cut kIsNCPi0LNoCut = NoCut3prong && kNCurrent && kPi0L;
848  const Cut kIsCCPi0NoCut = NoCut3prong && kCCurrent && (kPi0||kPi0L);
849 
850  const Cut kISNCPi0Bkg = (kIsNCPi0 || kIsNCPi0L);
851 
852 //This Presel + Signal + 3Prongs
853 
854  const Cut kPreSelSig = k3ProngPreSel && Signal;
855 
856  /*********************************************************************************************************************/
857  /// 2 prong analysis cuts ///
858 
859  /////MC true energy cuts ///// 0.3
860 
861  /// 2 prong events cuts/////
863  const Cut k2ProngPreSel = kPreSelect && k2Prongs;
864  const Cut k2ProngPreSel2CVN = kPreSelect && k2Prongs && kPi0RemIDND && kNpCVN1gammaID && kNpCVN2gammaID ;
865  const Cut k2ProngPreSelCVN = kPreSelect && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
866  const Cut k2ProngPreSelR = kPreSelect && k2Prongs && kPi0RemIDND;
867 
868  //This is NC and CC nonPi0 bkg with 2 prongs, and presel.
869 
870  const Cut kIsCCNonPi02P = k2ProngPreSel2CVN && kCCurrent && !(kPi0||kPi0L);
871 
872 
873  const Cut kIsNCNonPi02P = k2ProngPreSel2CVN && kNCurrent && !(kPi0||kPi0L);
874 
875 
876  /////////////////////////////////////////////////////////////////////////////////////////////
877  const Cut kIsCCNonPi02P2 = k2ProngPreSelCVN && kCCurrent && !(kPi0||kPi0L);
878  const Cut kIsNCNonPi02P2 = k2ProngPreSelCVN && kNCurrent && !(kPi0||kPi0L);
879 
880  const Cut kIsCCNonPi02PR = k2ProngPreSelR && kCCurrent && !(kPi0||kPi0L);
881  const Cut kIsNCNonPi02PR = k2ProngPreSelR && kNCurrent && !(kPi0||kPi0L);
882  const Cut kIsCCNonPi02PRem = k2ProngPreSel && kCCurrent && !(kPi0||kPi0L); //RemID as a Variable
883  const Cut kIsNCNonPi02PRem = k2ProngPreSel && kNCurrent && !(kPi0||kPi0L);
884  const Cut kIsCCNonPi02PNoCut = NoCut2prong && kCCurrent && !(kPi0||kPi0L);
885  const Cut kIsNCNonPi02PNoCut = NoCut2prong && kNCurrent && !(kPi0||kPi0L);
886  const Cut kIsNCPi02PNoCut = NoCut2prong && kNCurrent && kPi0;
887  const Cut kIsNCPi02PLNoCut = NoCut2prong && kNCurrent && kPi0L;
888  const Cut kIsCCPi02PNoCut = NoCut2prong && kCCurrent && (kPi0||kPi0L);
889 //This is NC and CC pi0 bkg with 2 prongs, and presel.
890 
891  const Cut kIsNCPi02P = k2ProngPreSel2CVN && kNCurrent && kPi0;
892  const Cut kIsNCPi02P1Cut = k2ProngPreSelCVN && kNCurrent && kPi0;
893 
894  const Cut kIsNCPi0L2P = k2ProngPreSel2CVN && kNCurrent && kPi0L;
895  const Cut kIsNCPi0L2P1Cut = k2ProngPreSelCVN && kNCurrent && kPi0L;
896 
897  const Cut kIsCCPi02P = k2ProngPreSel2CVN && kCCurrent && (kPi0||kPi0L);
898  const Cut kIsCCPi02P1Cut = k2ProngPreSelCVN && kCCurrent && (kPi0||kPi0L);
899 
900  ////////////////////////////////////////////////////////////////////////////////////////////////
901  const Cut kIsNCPi0L2P2 = k2ProngPreSelCVN && kNCurrent && kPi0L;
902  const Cut kIsNCPi02P2 = k2ProngPreSelCVN && kNCurrent && kPi0;
903  const Cut kIsCCPi02P2 = k2ProngPreSelCVN && kCCurrent && (kPi0||kPi0L);
904 
905  const Cut kIsNCPi02PR = k2ProngPreSelR && kNCurrent && kPi0;
906  const Cut kIsNCPi0L2PR = k2ProngPreSelR && kNCurrent && kPi0L;
907  const Cut kIsCCPi02PR = k2ProngPreSelR && kCCurrent && (kPi0||kPi0L);
908  const Cut kIsNCPi02PRem = k2ProngPreSel && kNCurrent && kPi0;
909  const Cut kIsNCPi0L2PRem = k2ProngPreSel && kNCurrent && kPi0L;
910  const Cut kIsCCPi02PRem = k2ProngPreSel && kCCurrent && (kPi0||kPi0L);
911 
912  const Cut kIsNCPi0L2PNoCut = NoCut2prong && kNCurrent && kPi0L;
913 
914 
915  //This Presel + Signal + 2Prongs
916 
917  const Cut kPreSelSig2P = k2ProngPreSel && Signal;
918 
919  //Particle Investigation Cuts//
920 
921  const Cut k2ProngPreSel3CVN = kPreSelect && k2Prongs && kPi0RemIDND && kNpCVN1gammaID && kNpCVN3gammaID;
922  const Cut kIsCCNonPi0PI = k2ProngPreSel3CVN && kCCurrent && !(kPi0||kPi0L);
923  const Cut kIsNCNonPi0PI = k2ProngPreSel3CVN && kNCurrent && !(kPi0||kPi0L);
924  const Cut kIsNCPi0PI = k2ProngPreSel3CVN && kNCurrent && kPi0;
925  const Cut kIsNCPi0LPI = k2ProngPreSel3CVN && kNCurrent && kPi0L;
926  const Cut kIsCCPi0PI = k2ProngPreSel3CVN && kCCurrent && (kPi0||kPi0L);
927 
928  /*********************************************************************************************************************/
929 
930 
931  //// CalE PreSelection //////
932 
933  const Cut kPreSelectCalE = kIsFiducial && kContainment && kreco; //total background
934  const Cut kPreSelectTightCalE = kIsFiducial && kNumuTightContainND && kreco;
935  const Cut kPreSelectCalERemId = kIsFiducial && kContainment && kreco; //total background
937  //// 3 prong events CalE cuts//////
938 
939  const Cut k3ProngBkgCalE = kPreSelectCalE && k3Prongs;
940  const Cut k3ProngNCCalEPi0 = kPreSelectCalE && kPi0 && kNCurrent && k3Prongs;//signal
941  const Cut k3ProngCCCalEPi0 = kPreSelectCalE && kPi0 && !kNCurrent && k3Prongs;
942 
943 
944 
945  /*********************************************************************************************************************/
946 
947 
948 
949 
950  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
951  ///////////////////// /////////////////////////////
952  ///////////////////// FIDUCIAL PARAMETRIZED CUT /////////////////////////////
953  ///////////////////// /////////////////////////////
954  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
955 
957  {
958  public:
959  fIsFiducialVariable(int a): fFid(a)
960  {
961  }
962  bool operator()(const caf::SRProxy* sr ) const
963  {
964  unsigned int bestidx = sr->trk.kalman.idxremid;
965 
966  if(sr->trk.kalman.ntracks <= bestidx )
967  return false;
968 
969  const caf::SRTrackProxy& trk = sr->trk.kalman.tracks[0];
970  TVector3 vtxmax(fFid,fFid,1000);
971  TVector3 vtxmin(-fFid,-fFid,50);
972 
973  bool isFiducial = (trk.start.X() < vtxmax.X() &&
974  trk.start.X() > vtxmin.X() &&
975  trk.start.Y() > vtxmin.Y() &&
976  trk.start.Y() < vtxmax.Y() &&
977  trk.start.Z() > vtxmin.Z() &&
978  trk.start.Z() < vtxmax.Z());
979  return isFiducial;
980 
981  }
982  protected:
983  int fFid;
984  };
985 
986  const Cut kIsFid1(fIsFiducialVariable(80));
987  const Cut kIsFid2(fIsFiducialVariable(90));
988  const Cut kIsFid3(fIsFiducialVariable(100));
989  const Cut kIsFid4(fIsFiducialVariable(110));
990  const Cut kIsFid5(fIsFiducialVariable(120));
991  const Cut kIsFid6(fIsFiducialVariable(130));
992  const Cut kIsFid7(fIsFiducialVariable(140));
993  const Cut kIsFid8(fIsFiducialVariable(150));
994  const Cut kIsFid9(fIsFiducialVariable(160));
995  const Cut kIsFid10(fIsFiducialVariable(170));
996  const Cut kIsFid11(fIsFiducialVariable(180));
997 
998 /*********************************************************************************************************************/
999 
1000  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1001  ///////////////////// /////////////////////////////
1002  ///////////////////// FIDUCIAL OPTIMIZATION ANALYSIS CUTS /////////////////////////////
1003  ///////////////////// (3 PRONG) /////////////////////////////
1004  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1005 
1006  ///FIDUCIAL OPTIMIZATION ANALYSYS 3 PRONG NO CUTS 0.635 GeV THRESHOLD///
1007 
1008  const Cut NoCutopti1Pi01 = k3Prongs && kIsFid1 && kNCurrent && kPi01;
1009  const Cut NoCutopti2Pi01 = k3Prongs && kIsFid2 && kNCurrent && kPi01;
1010  const Cut NoCutopti3Pi01 = k3Prongs && kIsFid3 && kNCurrent && kPi01;
1011  const Cut NoCutopti4Pi01 = k3Prongs && kIsFid4 && kNCurrent && kPi01;
1012  const Cut NoCutopti5Pi01 = k3Prongs && kIsFid5 && kNCurrent && kPi01;
1013  const Cut NoCutopti6Pi01 = k3Prongs && kIsFid6 && kNCurrent && kPi01;
1014  const Cut NoCutopti7Pi01 = k3Prongs && kIsFid7 && kNCurrent && kPi01;
1015  const Cut NoCutopti8Pi01 = k3Prongs && kIsFid8 && kNCurrent && kPi01;
1016  const Cut NoCutopti9Pi01 = k3Prongs && kIsFid9 && kNCurrent && kPi01;
1017  const Cut NoCutopti10Pi01 = k3Prongs && kIsFid10 && kNCurrent && kPi01;
1018  const Cut NoCutopti11Pi01 = k3Prongs && kIsFid11 && kNCurrent && kPi01;
1019 
1020 
1021  ///FIDUCIAL OPTIMIZATION ANALYSYS 3 PRONG NO CUTS 0.3 GeV THRESHOLD///
1022 
1023  const Cut NoCutopti1Pi02 = k3Prongs && kIsFid1 && kNCurrent && kPi02;
1024  const Cut NoCutopti2Pi02 = k3Prongs && kIsFid2 && kNCurrent && kPi02;
1025  const Cut NoCutopti3Pi02 = k3Prongs && kIsFid3 && kNCurrent && kPi02;
1026  const Cut NoCutopti4Pi02 = k3Prongs && kIsFid4 && kNCurrent && kPi02;
1027  const Cut NoCutopti5Pi02 = k3Prongs && kIsFid5 && kNCurrent && kPi02;
1028  const Cut NoCutopti6Pi02 = k3Prongs && kIsFid6 && kNCurrent && kPi02;
1029  const Cut NoCutopti7Pi02 = k3Prongs && kIsFid7 && kNCurrent && kPi02;
1030  const Cut NoCutopti8Pi02 = k3Prongs && kIsFid8 && kNCurrent && kPi02;
1031  const Cut NoCutopti9Pi02 = k3Prongs && kIsFid9 && kNCurrent && kPi02;
1032  const Cut NoCutopti10Pi02 = k3Prongs && kIsFid10 && kNCurrent && kPi02;
1033  const Cut NoCutopti11Pi02 = k3Prongs && kIsFid11 && kNCurrent && kPi02;
1034 
1035  ///FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG TOTAL PRESELECTION CUTS///
1036 
1037  const Cut OptiCutFid1TP = kIsFid1 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1038  const Cut OptiCutFid2TP = kIsFid2 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1039  const Cut OptiCutFid3TP = kIsFid3 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1040  const Cut OptiCutFid4TP = kIsFid4 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1041  const Cut OptiCutFid5TP = kIsFid5 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1042  const Cut OptiCutFid6TP = kIsFid6 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1043  const Cut OptiCutFid7TP = kIsFid7 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1044  const Cut OptiCutFid8TP = kIsFid8 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1045  const Cut OptiCutFid9TP = kIsFid9 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1046  const Cut OptiCutFid10TP = kIsFid10 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1047  const Cut OptiCutFid11TP = kIsFid11 && kContainment && k3Prongs && kPi0RemIDND && kNpCVN1gammaID;
1048 
1049 
1050  ///FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG CUTS 0.635 GeV THRESHOLD///
1051 
1052  const Cut OptiCutFid1Pi01 = kIsFid1 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1053  const Cut OptiCutFid2Pi01 = kIsFid2 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1054  const Cut OptiCutFid3Pi01 = kIsFid3 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1055  const Cut OptiCutFid4Pi01 = kIsFid4 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1056  const Cut OptiCutFid5Pi01 = kIsFid5 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1057  const Cut OptiCutFid6Pi01 = kIsFid6 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1058  const Cut OptiCutFid7Pi01 = kIsFid7 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1059  const Cut OptiCutFid8Pi01 = kIsFid8 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1060  const Cut OptiCutFid9Pi01 = kIsFid9 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1061  const Cut OptiCutFid10Pi01 = kIsFid10 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1062  const Cut OptiCutFid11Pi01 = kIsFid11 && kContainment && k3Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1063 
1064  ///FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG CUTS 0.3 GeV THRESHOLD///
1065 
1066  const Cut OptiCutFid1Pi02 = kIsFid1 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1067  const Cut OptiCutFid2Pi02 = kIsFid2 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1068  const Cut OptiCutFid3Pi02 = kIsFid3 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1069  const Cut OptiCutFid4Pi02 = kIsFid4 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1070  const Cut OptiCutFid5Pi02 = kIsFid5 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1071  const Cut OptiCutFid6Pi02 = kIsFid6 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1072  const Cut OptiCutFid7Pi02 = kIsFid7 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1073  const Cut OptiCutFid8Pi02 = kIsFid8 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1074  const Cut OptiCutFid9Pi02 = kIsFid9 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1075  const Cut OptiCutFid10Pi02 = kIsFid10 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1076  const Cut OptiCutFid11Pi02 = kIsFid11 && kContainment && k3Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1077 
1078 /*********************************************************************************************************************/
1079 
1080  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1081  ///////////////////// /////////////////////////////
1082  ///////////////////// FIDUCIAL OPTIMIZATION ANALYSIS CUTS /////////////////////////////
1083  ///////////////////// (2 PRONG) /////////////////////////////
1084  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1085 
1086  ///FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG TOTAL PRESELECTION CUTS///
1087 
1088  //for denominator: kIsSignal + kTrueVtxInFiducial
1089  //for signal: OPticutFidTPPng2 + kIsSignal
1090 
1091 
1092  const Cut kIsSignal01L = kNCurrent && kPi0;//done
1093 
1096 
1097  const Cut kIsSignal02 = kNCurrent && kPi02; //done
1098  const Cut kIsSignal02L = kNCurrent && kPi0L2;//done
1099  const Cut kIsPreSel = kVtxInFiducial && kContainment && k2Prongs && kPi0RemIDND && kcut15hits ;
1100  const Cut OptiCutFid2TPPng2 = kIsFid2 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1101  const Cut OptiCutFid3TPPng2 = kIsFid3 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1102  const Cut OptiCutFid4TPPng2 = kIsFid4 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1103  const Cut OptiCutFid5TPPng2 = kIsFid5 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1104  const Cut OptiCutFid6TPPng2 = kIsFid6 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1105  const Cut OptiCutFid7TPPng2 = kIsFid7 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1106  const Cut OptiCutFid8TPPng2 = kIsFid8 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1107  const Cut OptiCutFid9TPPng2 = kIsFid9 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1108  const Cut OptiCutFid10TPPng2 = kIsFid10 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1109  const Cut OptiCutFid11TPPng2 = kIsFid11 && kContainment && k2Prongs && kPi0RemIDND && kNpCVN1gammaID;
1110 
1111  ///FIDUCIAL OPTIMIZATION ANALYSYS 2 PRONG NO CUTS 0.635 GeV THRESHOLD///
1112 
1114  const Cut NoCutopti2Pi01Png2 = k2Prongs && kIsFid2 && kNCurrent && kPi01;
1115  const Cut NoCutopti3Pi01Png2 = k2Prongs && kIsFid3 && kNCurrent && kPi01;
1116  const Cut NoCutopti4Pi01Png2 = k2Prongs && kIsFid4 && kNCurrent && kPi01;
1117  const Cut NoCutopti5Pi01Png2 = k2Prongs && kIsFid5 && kNCurrent && kPi01;
1118  const Cut NoCutopti6Pi01Png2 = k2Prongs && kIsFid6 && kNCurrent && kPi01;
1119  const Cut NoCutopti7Pi01Png2 = k2Prongs && kIsFid7 && kNCurrent && kPi01;
1120  const Cut NoCutopti8Pi01Png2 = k2Prongs && kIsFid8 && kNCurrent && kPi01;
1121  const Cut NoCutopti9Pi01Png2 = k2Prongs && kIsFid9 && kNCurrent && kPi01;
1122  const Cut NoCutopti10Pi01Png2 = k2Prongs && kIsFid10 && kNCurrent && kPi01;
1123  const Cut NoCutopti11Pi01Png2 = k2Prongs && kIsFid11 && kNCurrent && kPi01;
1124 
1125  ///FIDUCIAL OPTIMIZATION ANALYSYS 2 PRONG NO CUTS 0.3 GeV THRESHOLD///
1126 
1127  const Cut TrueSignalVtxFid = kVtxInFiducial && kNCurrent && kPi0 ; //kPi02(high energy 0.3 GeV) is done, falta kpi02L(low energy 0.3 L) is done,kPi01(high energy 0.635 GeV) is done, kpi01L (low energy 0.635 GeV).
1128  const SpillTruthCut TrueSignalVtxFidS = kTrueFiducialST && kIsPi0ST ;
1129  const Cut NoCutopti2Pi02Png2 = k2Prongs && kIsFid2 && kNCurrent && kPi02;
1130  const Cut NoCutopti3Pi02Png2 = k2Prongs && kIsFid3 && kNCurrent && kPi02;
1131  const Cut NoCutopti4Pi02Png2 = k2Prongs && kIsFid4 && kNCurrent && kPi02;
1132  const Cut NoCutopti5Pi02Png2 = k2Prongs && kIsFid5 && kNCurrent && kPi02;
1133  const Cut NoCutopti6Pi02Png2 = k2Prongs && kIsFid6 && kNCurrent && kPi02;
1134  const Cut NoCutopti7Pi02Png2 = k2Prongs && kIsFid7 && kNCurrent && kPi02;
1135  const Cut NoCutopti8Pi02Png2 = k2Prongs && kIsFid8 && kNCurrent && kPi02;
1136  const Cut NoCutopti9Pi02Png2 = k2Prongs && kIsFid9 && kNCurrent && kPi02;
1137  const Cut NoCutopti10Pi02Png2 = k2Prongs && kIsFid10 && kNCurrent && kPi02;
1138  const Cut NoCutopti11Pi02Png2 = k2Prongs && kIsFid11 && kNCurrent && kPi02;
1139 
1140  ///FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG CUTS 0.635 GeV THRESHOLD///
1141 
1142  const Cut OptiCutFid1Pi01Png2 = kIsFid1 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1143  const Cut OptiCutFid2Pi01Png2 = kIsFid2 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1144  const Cut OptiCutFid3Pi01Png2 = kIsFid3 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1145  const Cut OptiCutFid4Pi01Png2 = kIsFid4 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1146  const Cut OptiCutFid5Pi01Png2 = kIsFid5 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1147  const Cut OptiCutFid6Pi01Png2 = kIsFid6 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1148  const Cut OptiCutFid7Pi01Png2 = kIsFid7 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1149  const Cut OptiCutFid8Pi01Png2 = kIsFid8 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1150  const Cut OptiCutFid9Pi01Png2 = kIsFid9 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1151  const Cut OptiCutFid10Pi01Png2 = kIsFid10 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1152  const Cut OptiCutFid11Pi01Png2 = kIsFid11 && kContainment && k2Prongs && kPi0RemIDND && kPi01 && kNCurrent && kNpCVN1gammaID;
1153 
1154  ///FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG CUTS 0.3 GeV THRESHOLD///
1155 
1156  const Cut OptiCutFid1Pi02Png2 = kIsFid1 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1157  const Cut OptiCutFid2Pi02Png2 = kIsFid2 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1158  const Cut OptiCutFid3Pi02Png2 = kIsFid3 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1159  const Cut OptiCutFid4Pi02Png2 = kIsFid4 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1160  const Cut OptiCutFid5Pi02Png2 = kIsFid5 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1161  const Cut OptiCutFid6Pi02Png2 = kIsFid6 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1162  const Cut OptiCutFid7Pi02Png2 = kIsFid7 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1163  const Cut OptiCutFid8Pi02Png2 = kIsFid8 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1164  const Cut OptiCutFid9Pi02Png2 = kIsFid9 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1165  const Cut OptiCutFid10Pi02Png2 = kIsFid10 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1166  const Cut OptiCutFid11Pi02Png2 = kIsFid11 && kContainment && k2Prongs && kPi0RemIDND && kPi02 && kNCurrent && kNpCVN1gammaID;
1167 
1168 
1169  //Background with pi0 at 0.3GeV and 2 prong///
1170 
1171  const Cut OptiCutFid1Pi02LPng2Bkg = kVtxInFiducial && kContainment && k2Prongs && kPi0RemIDND && !kPi0L2 && !kNCurrent; //done
1172  const Cut OptiCutFid1Pi02Png2Bkg = kVtxInFiducial && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent; //done
1173  const Cut OptiCutFid1Pi01LPng2Bkg = kVtxInFiducial && kContainment && k2Prongs && kPi0RemIDND && !kPi0 && !kNCurrent; //currently being used in systematics
1174  const Cut OptiCutFid1Pi01Png2Bkg = kVtxInFiducial && kContainment && k2Prongs && kPi0RemIDND && !kPi01 && !kNCurrent;//done
1175 
1176 
1177  const Cut OptiCutFid2Pi02Png2Bkg = kIsFid2 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1178  const Cut OptiCutFid3Pi02Png2Bkg = kIsFid3 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1179  const Cut OptiCutFid4Pi02Png2Bkg = kIsFid4 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1180  const Cut OptiCutFid5Pi02Png2Bkg = kIsFid5 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1181  const Cut OptiCutFid6Pi02Png2Bkg = kIsFid6 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1182  const Cut OptiCutFid7Pi02Png2Bkg = kIsFid7 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1183  const Cut OptiCutFid8Pi02Png2Bkg = kIsFid8 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1184  const Cut OptiCutFid9Pi02Png2Bkg = kIsFid9 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1185  const Cut OptiCutFid10Pi02Png2Bkg = kIsFid10 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1186  const Cut OptiCutFid11Pi02Png2Bkg = kIsFid11 && kContainment && k2Prongs && kPi0RemIDND && !kPi02 && !kNCurrent && kNpCVN1gammaID;
1187 
1188 
1189 //////// Data reco energy cuts /////////
1190 
1192 
1193  /* const Cut kcut15hitsData([](const caf::SRProxy* sr){ */
1194 
1195  /* //if(sr->mc.nnu==0) return false; */
1196  /* //assert(sr->mc.nnu == 1); */
1197  /* if(sr->vtx.nelastic == 0) return false; */
1198  /* if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false; */
1199  /* if(sr->vtx.elastic[0].fuzzyk.npng==0) return false; */
1200 
1201  /* float hit; */
1202  /* hit=sr->slc.nhit; */
1203  /* if (hit>10) return true; */
1204 
1205  /* return false; */
1206  /* }); */
1207 
1208  const Cut kContainmentData([](const caf::SRProxy* sr)
1209  { //Check that there is a vertex, shower, and prongs.
1210  //if(sr->mc.nnu==0) return false;
1211  if(sr->vtx.nelastic==0) return false;
1212  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
1213  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
1214  for (unsigned int i=0; i<sr->vtx.elastic[0].fuzzyk.nshwlid; i++)
1215  { //Define the area of containment.
1216  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) < -160.0) return false;
1217  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 120.0) return false;
1218  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) < -180.0) return false;
1219  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 155.0) return false;
1220  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) < 200.0) return false;
1221  if ((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;
1222  }
1223  return true;
1224  });
1225 const Cut kVtxInFiducialData ([](const caf::SRProxy* sr){
1226 
1227  //if(sr->mc.nnu==0) return false;
1228  if(sr->vtx.nelastic==0) return false;
1229  //assert(sr->mc.nnu == 1);
1230  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
1231  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
1232 
1233  if (sr->vtx.elastic[0].vtx.x < -80) return false;
1234  if (sr->vtx.elastic[0].vtx.x > 120) return false;
1235  if (sr->vtx.elastic[0].vtx.y < -148) return false;
1236  if (sr->vtx.elastic[0].vtx.y > 60) return false;
1237  if (sr->vtx.elastic[0].vtx.z < 225) return false;
1238  if (sr->vtx.elastic[0].vtx.z > 950) return false;
1239 
1240  return true;
1241  });
1242 
1243  const Cut k2ProngsData ([](const caf::SRProxy* sr)
1244 
1245  {
1246  //Check for nu
1247  //if(sr->mc.nnu==0) return false;
1248  if(sr->vtx.nelastic==0) return false;
1249  //assert(sr->mc.nnu == 1);
1250  //check for 2 prong
1251  if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
1252  if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
1253  return (sr->vtx.elastic[0].fuzzyk.npng == 2 );
1254 
1255  });
1256 
1259  const Cut kPreSelectData2 = kPreSelectData && kPi0RemIDND;
1260  const Cut kPreSelectData3 = kPreSelectData && kPi0RemIDND && kNpCVN1gammaID;
1261  const Cut k2ProngPreSel2CVNData = kPreSelectData && kPi0RemIDND && kNpCVN1gammaID && kNpCVN2gammaID;
1262 
1263 
1264 
1265 
1266 
1267 
1268 
1269 
1270 
1271 
1272 
1273 
1274 
1275 
1276 
1277 
1278 
1279  ///Other style of cuts for alternative systematics////
1280  //Cuts for Systematics CVN OPtimization///
1281  //Definitions
1282  /* struct SelDef{ */
1283  /* std::string name; */
1284  /* // std::string name; */
1285  /* Cut cut; */
1286  /* }; */
1287 
1288  /* struct SelDefST{ */
1289  /* std::string name; */
1290  /* SpillTruthCut cut; */
1291  /* }; */
1292  /* const int kcCvnSels = 5; */
1293  /* const int kcCvnSelsST =1; */
1294 
1295  /* const SelDef cvn_selection[kcCvnSels] = { */
1296  /* //{"recoEcut", k2ProngPreSel2CVN}, //Do recoE loop, or investigate. */
1297  /* {"presel",kIsPreSel}, */
1298  /* {"presel_signal",kIsPreSel && kIsSignal}, */
1299  /* {"presel_background",kIsPreSel && !kIsSignal}, */
1300  /* }; */
1301 
1302  /* const SelDefST cvn_selection_st[kcCvnSelsST] = { */
1303  /* {"spilltruth", TrueSignalVtxFidS}, */
1304  /* }; */
1305 
1306 
1307 } // end of namespace
const Cut OptiCutFid3Pi01
Definition: ncpi0Cuts.h:1054
caf::Proxy< size_t > npng
Definition: SRProxy.h:2037
const Cut kIsCCPi03PR
Definition: ncpi0Cuts.h:839
const Cut OptiCutFid7Pi01Png2
Definition: ncpi0Cuts.h:1148
const Cut k3ProngNCCalEPi0
Definition: ncpi0Cuts.h:940
const Cut kIsSignal02L
Definition: ncpi0Cuts.h:1098
const Cut NoCutopti6Pi01Png2
Definition: ncpi0Cuts.h:1118
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2039
const Cut OptiCutFid5TP
Definition: ncpi0Cuts.h:1041
const Cut kPi0L1(fIsPi0Variable(0.635))
const Cut kPi02(fIsPi0Variable(0.3))
const Cut kISNCPi0Bkg
Definition: ncpi0Cuts.h:850
const Cut OptiCutFid10Pi01
Definition: ncpi0Cuts.h:1061
const Cut OptiCutFid10TPPng2
Definition: ncpi0Cuts.h:1108
const Cut kIsNCPi0NoCut
Definition: ncpi0Cuts.h:846
const Cut OptiCutFid11TPPng2
Definition: ncpi0Cuts.h:1109
const Cut NoCutopti11Pi01
Definition: ncpi0Cuts.h:1018
const Cut kIsNCNonPi0PI
Definition: ncpi0Cuts.h:923
const Cut OptiCutFid2Pi02Png2
Definition: ncpi0Cuts.h:1157
const Cut OptiCutFid9TP
Definition: ncpi0Cuts.h:1045
const Cut NoCutopti10Pi02
Definition: ncpi0Cuts.h:1032
const Cut OptiCutFid8Pi01
Definition: ncpi0Cuts.h:1059
const Cut OptiCutFid4TP
Definition: ncpi0Cuts.h:1040
const Cut NoCutopti9Pi02Png2
Definition: ncpi0Cuts.h:1136
const Cut NoCutopti7Pi01
Definition: ncpi0Cuts.h:1014
const Cut kIsNCPi0CVN
Definition: ncpi0Cuts.h:834
const Cut NoCutopti5Pi02Png2
Definition: ncpi0Cuts.h:1132
const Cut OptiCutFid8Pi02Png2Bkg
Definition: ncpi0Cuts.h:1183
const Cut kCCurrent([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;return(sr->mc.nu[0].iscc==1);})
const Cut OptiCutFid1Pi02LPng2Bkg
Definition: ncpi0Cuts.h:1171
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2058
const Cut kPi0L2(fIsPi0Variable(0.3))
const Cut OptiCutFid1Pi01LPng2Bkg
Definition: ncpi0Cuts.h:1173
const Cut OptiCutFid3Pi02Png2Bkg
Definition: ncpi0Cuts.h:1178
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kIsFid6(fIsFiducialVariable(130))
const Cut Signal
Definition: ncpi0Cuts.h:811
const Cut k2ProngPreSel3CVN
Definition: ncpi0Cuts.h:921
const Cut kIsFid9(fIsFiducialVariable(160))
const Cut kIsFid11(fIsFiducialVariable(180))
const Cut OptiCutFid4Pi02Png2Bkg
Definition: ncpi0Cuts.h:1179
const Cut NoCutopti6Pi01
Definition: ncpi0Cuts.h:1013
const Cut OptiCutFid6TP
Definition: ncpi0Cuts.h:1042
const Cut OptiCutFid6TPPng2
Definition: ncpi0Cuts.h:1104
const Cut kIsNCPi0PI
Definition: ncpi0Cuts.h:924
caf::Proxy< int > kalfwdcellnd
Definition: SRProxy.h:822
const Cut kNumuTightContainND([](const caf::SRProxy *sr){if(sr->vtx.nelastic< 1) return false;int ibesttrk=kBestTrack(sr);for(unsigned int i=0;i< sr->vtx.elastic[0].fuzzyk.nshwlid;++i){TVector3 start=sr->vtx.elastic[0].fuzzyk.png[i].shwlid.start;TVector3 stop=sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 20.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(int i=0;i< int(sr->trk.kalman.ntracks);++i){if(i==ibesttrk) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275|| sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return false;return((sr->trk.kalman.tracks[ibesttrk].stop.Z()< 1275 ||sr->trk.kalman.tracks[ibesttrk].trkyposattrans< 55) &&sr->trk.kalman.tracks[ibesttrk].trkfwdcellnd > 5 &&sr->trk.kalman.tracks[ibesttrk].trkbakcellnd > 10);})
Definition: NumuCCIncCuts.h:29
const Cut kIsCCNonPi0PI
Definition: ncpi0Cuts.h:922
caf::Proxy< float > ndhadcaltranE
Definition: SRProxy.h:178
const Cut kIsCCNonPi0CVN
Definition: ncpi0Cuts.h:818
const Cut kIsNCNonPi02P
Definition: ncpi0Cuts.h:873
const Cut kcut15hits([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;float hit;hit=sr->slc.nhit;if(hit >15) return true;return false;})
const Cut kreco([](const caf::SRProxy *sr){float MassOfPi0=0.135;float kinetic=-10;float en=-99;float totEn;float reco;if(sr->vtx.nelastic==0 &&sr->mc.nnu==0) return false;totEn=(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE);reco=(totEn-MassOfPi0);if(reco > 0.5) return true;return false;})
caf::Proxy< unsigned int > idxremid
Definition: SRProxy.h:1776
const TVector3 vtxmin(-130,-176, 225)
const Cut OptiCutFid11Pi01
Definition: ncpi0Cuts.h:1062
const Cut kIsCCNonPi03PR
Definition: ncpi0Cuts.h:820
caf::Proxy< size_t > ntracks
Definition: SRProxy.h:1777
const Cut OptiCutFid7Pi02Png2Bkg
Definition: ncpi0Cuts.h:1182
const Cut NoCutopti2Pi01Png2
Definition: ncpi0Cuts.h:1114
const Cut kIsNCPi0PDG
Definition: ncpi0Cuts.h:843
const Cut kIsNCPi0L3PRem
Definition: ncpi0Cuts.h:841
const Cut NoCutopti4Pi02
Definition: ncpi0Cuts.h:1026
const Cut NoCutopti3Pi01Png2
Definition: ncpi0Cuts.h:1115
const Cut kPreSelectTightCalE
Definition: ncpi0Cuts.h:934
const Cut k2ProngsData([](const caf::SRProxy *sr){ if(sr->vtx.nelastic==0) return false; if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;return(sr->vtx.elastic[0].fuzzyk.npng==2);})
const Cut kIsNCPi02P2
Definition: ncpi0Cuts.h:902
const Cut kIsCCNonPi0
Definition: ncpi0Cuts.h:816
const Cut k3ProngPreSelPDG
Definition: ncpi0Cuts.h:807
caf::Proxy< caf::SRContain > contain
Definition: SRProxy.h:1250
caf::Proxy< caf::SRNumuEnergy > numu
Definition: SRProxy.h:213
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2125
const Cut NoCutopti11Pi02Png2
Definition: ncpi0Cuts.h:1138
const Cut kIsCCPi02PRem
Definition: ncpi0Cuts.h:910
const Cut NoCutopti8Pi02
Definition: ncpi0Cuts.h:1030
const Cut kIsNCPi0LNoCut
Definition: ncpi0Cuts.h:847
const Cut kIsFid4(fIsFiducialVariable(110))
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:617
const Cut NoCutopti1Pi01Png2
FIDUCIAL OPTIMIZATION ANALYSYS 2 PRONG NO CUTS 0.635 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1113
const Cut NoCutopti6Pi02
Definition: ncpi0Cuts.h:1028
const Cut kIsRecoKinEn([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;float MassOfPi0=0.135;float totEn;float RecoKE;float Png1En=-99;float Png2En=-99;float Png3En=-99;Png1En=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE;Png2En=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE;totEn=(Png1En+Png2En+Png3En);if(totEn==0) return false;if(totEn > 0.5 &&totEn< 0.3) return true;return false;})
caf::Proxy< float > pid
Definition: SRProxy.h:1135
const Cut NoCutopti1Pi01
FIDUCIAL OPTIMIZATION ANALYSYS 3 PRONG NO CUTS 0.635 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1008
const Cut TrueSignalVtxFid
FIDUCIAL OPTIMIZATION ANALYSYS 2 PRONG NO CUTS 0.3 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1127
const Cut kIsNCPi0
Definition: ncpi0Cuts.h:831
const Cut NoCutopti4Pi01Png2
Definition: ncpi0Cuts.h:1116
const Cut OptiCutFid7Pi02Png2
Definition: ncpi0Cuts.h:1162
const Cut kIsNCPi0L3PR
Definition: ncpi0Cuts.h:838
const Cut kNCurrent([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;return(sr->mc.nu[0].iscc==0);})
CC and NC current cuts///.
const Cut OptiCutFid5Pi02Png2
Definition: ncpi0Cuts.h:1160
const Cut NoCutopti8Pi02Png2
Definition: ncpi0Cuts.h:1135
const Cut OptiCutFid11Pi02Png2
Definition: ncpi0Cuts.h:1166
const Cut kIsNCPi03PR
Definition: ncpi0Cuts.h:837
fIsPi0LVariable(float c)
Definition: ncpi0Cuts.h:719
const Cut k2ProngPreSel2CVNData
Definition: ncpi0Cuts.h:1261
void abs(TH1 *hist)
const Cut kIsCCPi02P1Cut
Definition: ncpi0Cuts.h:898
const SpillTruthCut kIsPi0ST([](const caf::SRNeutrinoProxy *truth){return(!truth->iscc && truth->pdg==111 && truth->pdgorig==111);})
const NuTruthCut kTrueFiducialST([](const caf::SRNeutrinoProxy *sr){return(sr->vtx.X()< vtxmax.X()&& sr->vtx.X() > vtxmin.X()&& sr->vtx.Y() > vtxmin.Y()&& sr->vtx.Y()< vtxmax.Y()&& sr->vtx.Z() > vtxmin.Z()&& sr->vtx.Z()< vtxmax.Z());})
Definition: NumuCCIncCuts.h:31
const Cut kPreSelectTightCalERemID
Definition: ncpi0Cuts.h:936
const Cut kIsNCPi0L2P
Definition: ncpi0Cuts.h:894
caf::Proxy< short int > nnu
Definition: SRProxy.h:616
const Cut OptiCutFid10Pi02Png2Bkg
Definition: ncpi0Cuts.h:1185
const Cut k3ProngPreSel2CVN
Definition: ncpi0Cuts.h:806
const Cut kIsNCNonPi02P2
Definition: ncpi0Cuts.h:878
const Cut kNumu([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->mc.nnu==0) return false;return(sr->mc.nu[0].pdg==14);})
const Cut kIsCCPi03PRem
Definition: ncpi0Cuts.h:842
const Cut kNpCVN3gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double prPID=sr->vtx.elastic[0].fuzzyk.png[1].cvnpart.photonid;if(prPID<=0.2) return true;return false;})
caf::Proxy< caf::SREnergyBranch > energy
Definition: SRProxy.h:2135
const Cut kIsSignal01L
FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG TOTAL PRESELECTION CUTS///.
Definition: ncpi0Cuts.h:1092
const Cut kIsNCPi0L
Definition: ncpi0Cuts.h:832
const Cut kIsCCNonPi02PRem
Definition: ncpi0Cuts.h:882
const Cut kIsNCNonPi0PDG
Definition: ncpi0Cuts.h:825
const Cut k2ProngPreSel
Definition: ncpi0Cuts.h:863
const Cut OptiCutFid9Pi02
Definition: ncpi0Cuts.h:1074
const Cut OptiCutFid10Pi01Png2
Definition: ncpi0Cuts.h:1151
const Cut OptiCutFid8Pi01Png2
Definition: ncpi0Cuts.h:1149
const Cut kIsNCNonPi02PRem
Definition: ncpi0Cuts.h:883
const Cut kIsNCPi02PNoCut
Definition: ncpi0Cuts.h:886
const Cut kIsCCPi02PR
Definition: ncpi0Cuts.h:907
const Cut OptiCutFid5Pi02
Definition: ncpi0Cuts.h:1070
const Cut NoCutopti11Pi02
Definition: ncpi0Cuts.h:1033
const Cut OptiCutFid5Pi02Png2Bkg
Definition: ncpi0Cuts.h:1180
const Cut OptiCutFid2TP
Definition: ncpi0Cuts.h:1038
const Cut OptiCutFid2Pi01Png2
Definition: ncpi0Cuts.h:1143
const Cut OptiCutFid8TP
Definition: ncpi0Cuts.h:1044
const Cut kIsFid7(fIsFiducialVariable(140))
const Cut kIsNCPi0L2P2
Definition: ncpi0Cuts.h:901
const Cut kIsFid8(fIsFiducialVariable(150))
const Cut OptiCutFid7Pi01
Definition: ncpi0Cuts.h:1058
const Cut kIsTotBkg
Definition: ncpi0Cuts.h:1095
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2117
const Cut OptiCutFid11TP
Definition: ncpi0Cuts.h:1047
caf::Proxy< caf::SRNueCosRej > nuecosrej
Definition: SRProxy.h:1264
const Cut NoCutopti9Pi01Png2
Definition: ncpi0Cuts.h:1121
const Cut kIsCCNonPi02P2
Definition: ncpi0Cuts.h:877
Track finder for cosmic rays.
caf::Proxy< int > kalbakcellnd
Definition: SRProxy.h:817
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2042
const Cut OptiCutFid10Pi02Png2
Definition: ncpi0Cuts.h:1165
const Cut OptiCutFid6Pi01Png2
Definition: ncpi0Cuts.h:1147
const Cut kIsCCPi0NoCut
Definition: ncpi0Cuts.h:848
const Cut k2Prongs([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;return(sr->vtx.elastic[0].fuzzyk.npng==2);})
const Cut kIsCCPi02P
Definition: ncpi0Cuts.h:897
const Cut kIsFid10(fIsFiducialVariable(170))
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1314
const Cut k2ProngPreSelR
Definition: ncpi0Cuts.h:866
const Cut NoCutopti8Pi01
Definition: ncpi0Cuts.h:1015
const Cut NoCutopti9Pi01
Definition: ncpi0Cuts.h:1016
const Cut k2ProngPreSelCVN
Definition: ncpi0Cuts.h:865
const Cut kNpCVN2gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double prPID=sr->vtx.elastic[0].fuzzyk.png[1].cvnpart.photonid;if(prPID >=0.9) return true;return false;})
const Cut OptiCutFid8TPPng2
Definition: ncpi0Cuts.h:1106
const Cut NoCut3prong
3 prong events preselection //////
Definition: ncpi0Cuts.h:799
caf::Proxy< float > z
Definition: SRProxy.h:107
const Cut k3ProngCCCalEPi0
Definition: ncpi0Cuts.h:941
if(dump)
const Cut kIsCCPi0CVN
Definition: ncpi0Cuts.h:836
bool operator()(const caf::SRProxy *sr) const
Definition: ncpi0Cuts.h:722
const Cut kIsCCPi0PDG
Definition: ncpi0Cuts.h:845
const Cut kIsCCPi02P2
Definition: ncpi0Cuts.h:903
const Cut kIsNCNonPi03PR
Definition: ncpi0Cuts.h:821
const Cut kIsCCPi02PNoCut
Definition: ncpi0Cuts.h:888
caf::Proxy< caf::SRTrackBranch > trk
Definition: SRProxy.h:2144
const Cut kNueNDCont([](const caf::SRProxy *sr){bool cut=false;if(!sr->vtx.elastic.IsValid) return cut;if(sr->vtx.elastic.fuzzyk.npng==0) return cut;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return cut;if(sr->slc.nhit< 20) return cut;if(std::min(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.X(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.X())< -180.0) return cut;if(std::max(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.X(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.X()) > 180.0) return cut;if(std::min(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.Y(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.Y())< -180.0) return cut;if(std::max(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.Y(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.Y()) > 180.0) return cut;if(std::min(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.Z(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.Z())< 25.0) return cut;if(std::max(sr->vtx.elastic.fuzzyk.png[0].shwlid.start.Z(), sr->vtx.elastic.fuzzyk.png[0].shwlid.stop.Z()) > 1225.0) return cut;if(sr->vtx.elastic.vtx.X()< -140.0) return cut;if(sr->vtx.elastic.vtx.X() > 140.0) return cut;if(sr->vtx.elastic.vtx.Y()< -140.0) return cut;if(sr->vtx.elastic.vtx.Y() > 140.0) return cut;if(sr->vtx.elastic.vtx.Z()< 100.0) return cut;if(sr->vtx.elastic.vtx.Z() > 550.0) return cut;if(sr->vtx.elastic.fuzzyk.png[sr->vtx.elastic.fuzzyk.longestidx].len > 600.0) return cut;if(sr->slc.calE > 5.0) return cut;if(sr->vtx.elastic.fuzzyk.png[sr->vtx.elastic.fuzzyk.longestidx].shwlid.gap > 150.0) return cut;cut=true;return cut;})
Definition: Cuts.h:84
const Cut kShwStopContainment([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;for(unsigned int i=0;i< sr->vtx.elastic[0].fuzzyk.nshwlid;i++){if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x)< -180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y)< -180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z)< 200.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;}return true;})
const Cut kIsNCPi0L2P1Cut
Definition: ncpi0Cuts.h:895
const Cut kIsNCNonPi02PNoCut
Definition: ncpi0Cuts.h:885
caf::Proxy< float > x
Definition: SRProxy.h:105
const Cut NoCutopti11Pi01Png2
Definition: ncpi0Cuts.h:1123
const Cut NoCutopti5Pi02
Definition: ncpi0Cuts.h:1027
const Cut kIsSignal02
Definition: ncpi0Cuts.h:1097
const Cut NoCutopti5Pi01Png2
Definition: ncpi0Cuts.h:1117
const SpillTruthCut TrueSignalVtxFidS
Definition: ncpi0Cuts.h:1128
const Cut NoCutopti5Pi01
Definition: ncpi0Cuts.h:1012
const double a
const Cut OptiCutFid1Pi01Png2Bkg
Definition: ncpi0Cuts.h:1174
const Cut kNCBkg([](const caf::SRProxy *sr){float MassOfPi0=0.135;float kinetic=-10;float en=-99;if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111){en=sr->mc.nu[0].prim[i].p.E;kinetic=en-MassOfPi0;if(kinetic > 0.5) countpi++;}}if(countpi==0 &&!sr->mc.nu[0].iscc) return true;return false;})
const Cut kIsNCNonPi0CVN
Definition: ncpi0Cuts.h:819
const Cut NoCutopti4Pi02Png2
Definition: ncpi0Cuts.h:1131
const Cut OptiCutFid1Pi02
FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG CUTS 0.3 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1066
const Cut kPreSelSig
Definition: ncpi0Cuts.h:854
const Cut kIsCCNonPi03PRem
Definition: ncpi0Cuts.h:822
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
const Cut OptiCutFid1TP
FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG TOTAL PRESELECTION CUTS///.
Definition: ncpi0Cuts.h:1037
caf::Proxy< unsigned int > ncellsfromedge
Definition: SRProxy.h:1312
const Cut kPreSelectCalE
Definition: ncpi0Cuts.h:933
const Cut OptiCutFid11Pi02Png2Bkg
Definition: ncpi0Cuts.h:1186
const Cut k3ProngBkgCalE
Definition: ncpi0Cuts.h:939
const Cut kIsNCPi0LPI
Definition: ncpi0Cuts.h:925
const Cut k3ProngPreSelCVN
Definition: ncpi0Cuts.h:801
const Cut OptiCutFid3TPPng2
Definition: ncpi0Cuts.h:1101
const Cut kIsNCPi02P
Definition: ncpi0Cuts.h:891
const Cut OptiCutFid4TPPng2
Definition: ncpi0Cuts.h:1102
caf::StandardRecord * sr
const Cut kNCBkgData
Definition: ncpi0Cuts.h:1191
caf::Proxy< unsigned int > lastplane
Definition: SRProxy.h:1308
const Cut kIsCCNonPi0NoCut
Definition: ncpi0Cuts.h:826
const Cut kIsCCPi0
Definition: ncpi0Cuts.h:833
const Cut kIsNCNonPi03PRem
Definition: ncpi0Cuts.h:823
const Cut kIsNCPi0L2PRem
Definition: ncpi0Cuts.h:909
caf::Proxy< caf::SRRemid > remid
Definition: SRProxy.h:1268
const Cut kIsNCPi02P1Cut
Definition: ncpi0Cuts.h:892
const Cut NoCutopti6Pi02Png2
Definition: ncpi0Cuts.h:1133
const Cut OptiCutFid6Pi01
Definition: ncpi0Cuts.h:1057
const Cut kIsNCNonPi0NoCut
Definition: ncpi0Cuts.h:827
const Cut OptiCutFid4Pi02Png2
Definition: ncpi0Cuts.h:1159
const Cut kNpCVN1gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double prPID=sr->vtx.elastic[0].fuzzyk.png[0].cvnpart.photonid;if(prPID >=0.7) return true;return false;})
const Cut kContainment([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;for(unsigned int i=0;i< sr->vtx.elastic[0].fuzzyk.nshwlid;i++){if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x)< -160.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 120.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y)< -180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 155.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z)< 200.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;}return true;})
const Cut OptiCutFid8Pi02
Definition: ncpi0Cuts.h:1073
const Cut OptiCutFid5Pi01Png2
Definition: ncpi0Cuts.h:1146
const Cut kIsCCNonPi0PDG
Definition: ncpi0Cuts.h:824
const Cut OptiCutFid8Pi02Png2
Definition: ncpi0Cuts.h:1163
const Cut NoCutopti1Pi02
FIDUCIAL OPTIMIZATION ANALYSYS 3 PRONG NO CUTS 0.3 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1023
const Cut NoCutopti10Pi01
Definition: ncpi0Cuts.h:1017
const Cut kIsPreSel
Definition: ncpi0Cuts.h:1099
const Cut kIsNCPi0LCVN
Definition: ncpi0Cuts.h:835
const Cut OptiCutFid3Pi02
Definition: ncpi0Cuts.h:1068
const Cut NoCutopti10Pi01Png2
Definition: ncpi0Cuts.h:1122
const Cut kIsFiducial([](const caf::SRProxy *sr){int ibesttrk=kBestTrack(sr);if(sr->trk.kalman.ntracks< 1) return false;if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return false;bool isfid=(sr->trk.kalman.tracks[ibesttrk].start.X()< vtxmax.X()&&sr->trk.kalman.tracks[ibesttrk].start.X() > vtxmin.X()&&sr->trk.kalman.tracks[ibesttrk].start.Y() > vtxmin.Y()&&sr->trk.kalman.tracks[ibesttrk].start.Y()< vtxmax.Y()&&sr->trk.kalman.tracks[ibesttrk].start.Z() > vtxmin.Z()&&sr->trk.kalman.tracks[ibesttrk].start.Z()< vtxmax.Z());return isfid;})
Definition: NumuCCIncCuts.h:27
const Cut kPreSelectData2
Definition: ncpi0Cuts.h:1259
const Cut kIsFid3(fIsFiducialVariable(100))
const Cut OptiCutFid1Pi01
FIDUCIAL OPTIMIZATION ANALYSIS 3 PRONG CUTS 0.635 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1052
OStream cout
Definition: OStream.cxx:6
const Cut NoCutopti9Pi02
Definition: ncpi0Cuts.h:1031
const Cut OptiCutFid6Pi02
Definition: ncpi0Cuts.h:1071
const Cut kNpCVNgammaID([](const caf::SRProxy *sr){int nbofprongs=sr->vtx.elastic[0].fuzzyk.npng;int nCVNPhotons=0;int nCVNPhotonsH=0;if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;for(int pngid=0;pngid< nbofprongs &&(nbofprongs==1);pngid++){double prPID=sr->vtx.elastic[0].fuzzyk.png[pngid].cvnpart.photonid;nCVNPhotons++;if(prPID >=0.7 &&prPID > 0) nCVNPhotonsH++;}if(nCVNPhotons > 0 &&(nCVNPhotonsH==nCVNPhotons)) return true;return false;})
const Cut OptiCutFid5Pi01
Definition: ncpi0Cuts.h:1056
const Cut k3ProngPreSel
Definition: ncpi0Cuts.h:800
const Cut kCCNonPi0Bkg([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111) countpi++;}if(countpi==0 &&sr->mc.nu[0].iscc) return true;return false;})
const Cut k2ProngPreSel2CVN
Definition: ncpi0Cuts.h:864
const Cut NoCutopti8Pi01Png2
Definition: ncpi0Cuts.h:1120
const Cut kIsNCPi03PRem
Definition: ncpi0Cuts.h:840
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2137
const Cut kPreSelectData3
Definition: ncpi0Cuts.h:1260
const Cut kPreSelSig2P
Definition: ncpi0Cuts.h:917
const Cut kIsNCPi0L2PR
Definition: ncpi0Cuts.h:906
const Cut OptiCutFid9Pi02Png2Bkg
Definition: ncpi0Cuts.h:1184
const Cut kNpPDG1gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double GammaPID=sr->vtx.elastic[0].fuzzyk.png[0].truth.pdg;double Pi0PID=sr->vtx.elastic[0].fuzzyk.png[0].truth.motherpdg;if(abs(GammaPID)==22 &&abs(Pi0PID)==111) return true;return false;})
const Cut OptiCutFid4Pi01Png2
Definition: ncpi0Cuts.h:1145
caf::Proxy< float > ndhadcalcatE
Definition: SRProxy.h:177
caf::Proxy< caf::SRKalman > kalman
Definition: SRProxy.h:1796
const Cut OptiCutFid2Pi02
Definition: ncpi0Cuts.h:1067
const Cut OptiCutFid1Pi01Png2
FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG CUTS 0.635 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1142
const Cut kContainNC3P([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 25){return false;}if(std::min(cr.startwest, cr.stopwest)< 25){return false;}if(std::min(cr.starttop, cr.stoptop) < 25){return false;}if(std::min(cr.startbottom, cr.stopbottom)< 25){return false;}if(std::min(cr.startfront, cr.stopfront)< 25){return false;}if(std::min(cr.startback, cr.stopback)< 25){return false;}return true;})
const Cut kNpPDG2gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double GammaPID=sr->vtx.elastic[0].fuzzyk.png[1].truth.pdg;double Pi0PID=sr->vtx.elastic[0].fuzzyk.png[1].truth.motherpdg;if(abs(GammaPID)==22 &&abs(Pi0PID)==111) return true;return false;})
const Cut kPreSelect
3 prong analysis cuts////
Definition: ncpi0Cuts.h:796
const Cut OptiCutFid11Pi01Png2
Definition: ncpi0Cuts.h:1152
const Cut NoCutopti3Pi02Png2
Definition: ncpi0Cuts.h:1130
bool operator()(const caf::SRProxy *sr) const
Definition: ncpi0Cuts.h:962
const Cut NoCutopti7Pi02
Definition: ncpi0Cuts.h:1029
const Cut kPreSelectCalERemId
Definition: ncpi0Cuts.h:935
const Cut OptiCutFid9TPPng2
Definition: ncpi0Cuts.h:1107
const Cut kIsFid2(fIsFiducialVariable(90))
const Cut OptiCutFid9Pi01
Definition: ncpi0Cuts.h:1060
const Cut NoCutopti2Pi02Png2
Definition: ncpi0Cuts.h:1129
const Cut NoCutopti10Pi02Png2
Definition: ncpi0Cuts.h:1137
const Cut NoCutopti3Pi01
Definition: ncpi0Cuts.h:1010
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2141
const Cut OptiCutFid3Pi02Png2
Definition: ncpi0Cuts.h:1158
const Cut kIsCCNonPi02P
Definition: ncpi0Cuts.h:870
const Cut kIsCCNonPi02PNoCut
Definition: ncpi0Cuts.h:884
const Cut kPi0RemIDND([](const caf::SRProxy *sr){return(sr->sel.remid.pid< 0.36);})
const Cut NoCutopti2Pi01
Definition: ncpi0Cuts.h:1009
caf::Proxy< float > y
Definition: SRProxy.h:106
const Cut k3Prongs([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;return(sr->vtx.elastic[0].fuzzyk.npng==3);})
const Cut OptiCutFid2Pi01
Definition: ncpi0Cuts.h:1053
const Cut kPreSelectDataNoCuts
Definition: ncpi0Cuts.h:1257
fIsPi0Variable(float b)
Definition: ncpi0Cuts.h:663
const Cut kNCNonPi0Bkg([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111) countpi++;}if(countpi==0 &&sr->mc.nu[0].iscc==0) return true;return false;})
const Cut NoCutopti3Pi02
Definition: ncpi0Cuts.h:1025
const Cut kVtxInFiducialData([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->vtx.elastic[0].vtx.x< -80) return false;if(sr->vtx.elastic[0].vtx.x > 120) return false;if(sr->vtx.elastic[0].vtx.y< -148) return false;if(sr->vtx.elastic[0].vtx.y > 60) return false;if(sr->vtx.elastic[0].vtx.z< 225) return false;if(sr->vtx.elastic[0].vtx.z > 950) return false;return true;})
Definition: structs.h:12
const Cut OptiCutFid4Pi02
Definition: ncpi0Cuts.h:1069
const Cut kIsCCNonPi02PR
Definition: ncpi0Cuts.h:880
const Cut kIsNCPi0LPDG
Definition: ncpi0Cuts.h:844
const Cut kVtxInFiducial([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->vtx.elastic[0].vtx.x< -80) return false;if(sr->vtx.elastic[0].vtx.x > 120) return false;if(sr->vtx.elastic[0].vtx.y< -148) return false;if(sr->vtx.elastic[0].vtx.y > 60) return false;if(sr->vtx.elastic[0].vtx.z< 225) return false;if(sr->vtx.elastic[0].vtx.z > 950) return false;return true;})
const Cut OptiCutFid11Pi02
Definition: ncpi0Cuts.h:1076
const Cut kTrueVtxInFiducial
const Cut NoCutopti2Pi02
Definition: ncpi0Cuts.h:1024
const Cut kIsFid1(fIsFiducialVariable(80))
const Cut OptiCutFid2Pi02Png2Bkg
Definition: ncpi0Cuts.h:1177
const Cut OptiCutFid3Pi01Png2
Definition: ncpi0Cuts.h:1144
const Cut kPi0L([](const caf::SRProxy *sr){float MassOfPi0=0.135;float kinetic=-10;float en=-99;if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi0=0;int countpi0L=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111){en=sr->mc.nu[0].prim[i].p.E;std::cout<< "Energy L before energy cuts is: "<< en<< std::endl;countpi0++;if(en<=0.3 &&en > 0){countpi0L++;std::cout<< "Energy L is: "<< en<< std::endl;}}}if(countpi0 > 0 &&(countpi0L==countpi0)) return true;return false;})
const Cut OptiCutFid9Pi01Png2
Definition: ncpi0Cuts.h:1150
const hit & b
Definition: hits.cxx:21
const Cut kIsNCPi02PLNoCut
Definition: ncpi0Cuts.h:887
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:2072
const Cut OptiCutFid9Pi02Png2
Definition: ncpi0Cuts.h:1164
const Cut NoCutopti7Pi01Png2
Definition: ncpi0Cuts.h:1119
const Cut kVtx([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0 &&sr->mc.nnu==0) return false;return(sr->vtx.nelastic==0);})
const Cut OptiCutFid1Pi02Png2Bkg
Definition: ncpi0Cuts.h:1172
assert(nhit_max >=nhit_nbins)
const Cut OptiCutFid2TPPng2
Definition: ncpi0Cuts.h:1100
const Cut NoCutopti7Pi02Png2
Definition: ncpi0Cuts.h:1134
const Cut OptiCutFid7TP
Definition: ncpi0Cuts.h:1043
const Cut OptiCutFid7Pi02
Definition: ncpi0Cuts.h:1072
const Cut kIsNCPi02PRem
Definition: ncpi0Cuts.h:908
caf::Proxy< unsigned int > firstplane
Definition: SRProxy.h:1304
const Cut kIsNCPi0L2PNoCut
Definition: ncpi0Cuts.h:912
caf::Proxy< float > kalyposattrans
Definition: SRProxy.h:825
const Cut NoCutopti4Pi01
Definition: ncpi0Cuts.h:1011
const Cut OptiCutFid7TPPng2
Definition: ncpi0Cuts.h:1105
caf::Proxy< std::vector< caf::SRKalmanTrack > > tracks
Definition: SRProxy.h:1779
const Cut OptiCutFid5TPPng2
Definition: ncpi0Cuts.h:1103
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2140
T min(const caf::Proxy< T > &a, T b)
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2145
bool operator()(const caf::SRProxy *sr) const
Definition: ncpi0Cuts.h:666
const TVector3 vtxmax(160, 160, 1000)
const Cut kIsFid5(fIsFiducialVariable(120))
const Cut kIsNCNonPi02PR
Definition: ncpi0Cuts.h:881
const Cut OptiCutFid6Pi02Png2
Definition: ncpi0Cuts.h:1161
const Cut NoCut2prong
2 prong analysis cuts ///
Definition: ncpi0Cuts.h:862
#define for
Definition: msvc_pragmas.h:3
const Cut kNCPi0Bkg([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111) countpi++;}if(countpi > 0 &&sr->mc.nu[0].iscc==0) return true;return false;})
const Cut kPi01(fIsPi0Variable(0.635))
const Cut OptiCutFid6Pi02Png2Bkg
Definition: ncpi0Cuts.h:1181
const Cut kIsSignal
Definition: ncpi0Cuts.h:1094
const Cut kIsNCPi02PR
Definition: ncpi0Cuts.h:905
const Cut OptiCutFid10Pi02
Definition: ncpi0Cuts.h:1075
const Cut OptiCutFid3TP
Definition: ncpi0Cuts.h:1039
const Cut kIsCCPi0PI
Definition: ncpi0Cuts.h:926
const Cut kPi0([](const caf::SRProxy *sr){float MassOfPi0=0.135;float kinetic=-10;float en=-99;if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi0=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111){en=sr->mc.nu[0].prim[i].p.E; if(en > 0.3){countpi0++;}}}if(countpi0 > 0) return true;return false;})
const Cut OptiCutFid4Pi01
Definition: ncpi0Cuts.h:1055
const Cut OptiCutFid10TP
Definition: ncpi0Cuts.h:1046
const Cut kPreSelectData
Definition: ncpi0Cuts.h:1258
const Cut OptiCutFid1Pi02Png2
FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG CUTS 0.3 GeV THRESHOLD///.
Definition: ncpi0Cuts.h:1156
const Cut kContainmentData([](const caf::SRProxy *sr){ if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;for(unsigned int i=0;i< sr->vtx.elastic[0].fuzzyk.nshwlid;i++){if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x)< -160.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.x) > 120.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y)< -180.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.y) > 155.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z)< 200.0) return false;if((sr->vtx.elastic[0].fuzzyk.png[i].shwlid.stop.z) > 1200.0) return false;}return true;})
const Cut kIsNCNonPi0
Definition: ncpi0Cuts.h:817
const Cut kCCPi0Bkg([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111) countpi++;}if(countpi > 0 &&sr->mc.nu[0].iscc) return true;return false;})
const Cut kIsReMId([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;if(sr->vtx.nelastic==0) return false;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;return(sr->sel.remid.pid< 0.36);})
const Cut k3ProngPreSelR
Definition: ncpi0Cuts.h:808