ParametersNumuCCpi.cxx
Go to the documentation of this file.
1 //
2 // ParametersNumuCCpi.cpp
3 // nova-mrb
4 //
5 // Created by Paul Sail on 10/06/16.
6 // Copyright © 2016 Paul Sail. All rights reserved.
7 //
8 #include <bitset>
9 #include <limits>
12 #include "Geometry/Geometry.h"
17 
18 
19 //------------------------------------------------------------------------------
20 /* This is a constructor that initialises the fpdgCode variable so the initialised numbers won't by chance be the same as the values we want.
21 skim::ParametersNumuCCpi::ParametersNumuCCpi()
22  : fParameters.fpdgCode({std::numeric_limits<int>::max(),
23  std::numeric_limits<int>::max()})
24 */
26 {
27 
28 }
29 
30 //------------------------------------------------------------------------------
32 {
35 
36  // pdg variable
37  fParameters.fpdgCode = pdg.PdgCode(); // added on 8/30/2016
38  //fParameters.fpdgCodeMu = pdg.PdgCode(); // added on 9/16/2016
39  //fParameters.fpdgCodeChargedPi = pdg.PdgCode(); // added on 9/16/2016
40 
41  return;
42 }
43 
44 ////------------------------------------------------------------------------------
45 //skim::ParametersNumuCCpi::ParametersNumuCCpi(caf::StandardRecord const& sr,
46 // bool const& isData)
47 //{
48 // fParameters.fpdgCode = sr.mc.nu[0].prim[0].pdg; // updated after 08/30/2016
49 // //fParameters.fpdgCodeMu = sr.mc.nu[0].prim[0].pdg; // Added on 09/16/2016
50 // //fParameters.fpdgCodeChargedPi = sr.mc.nu[0].prim[0].pdg; // Added on 09/16/2016 - use 0 or 1 for prim[?]
51 //
52 // return;
53 //}
54 
55 //------------------------------------------------------------------------------
57 {
58 
59  std::map<std::string, std::pair<double, double> > comps;
60 
61  comps["pdgCode"] = std::make_pair(fParameters.fpdgCode, compCuts.fpdgCode ); // added om 8/30/2016
62  //comps["pdgCodeMu"] = std::make_pair(fParameters.fpdgCodeMu, compCuts.fpdgCodeMu ); // added om 9/16/2016
63  //comps["pdgCodeChargedPi"] = std::make_pair(fParameters.fpdgCodeChargedPi, compCuts.fpdgCodeChargedPI ); // added om 9/16/2016
64 
65  double fracDiff = 0.;
66 
67  for(auto itr : comps){
68 
69  auto skimSR = itr.second;
70  fracDiff = std::abs((skimSR.first - skimSR.second)/skimSR.first);
71  if( fracDiff > 1.e-3)
72  LOG_VERBATIM("ParametersNumuCCpi")
73  << itr.first << ": " << skimSR.first << " " << skimSR.second << " " << fracDiff;
74  }
75 
76  return;
77 }
78 
79 //------------------------------------------------------------------------------
81 {
82 
83 }
84 namespace skim{
85  //------------------------------------------------------------------------------
86  std::ostream& operator<< (std::ostream& o, skim::ParametersNumuCCpi const& p)
87  {
88  o <<"\npdgCode\t" << p.ParametersStruct().fpdgCode; // added on 8/30/2016
89  //<<"\npdgCodeMu\t" << p.ParametersStruct().fpdgCodeMu // added on 9/16/2016
90  //<<"\npdgCodeChargedPi\t" << p.ParametersStruct().fpdgCodeChargedPi; // added on 9/16/2016
91 
92  return o;
93  }
94 }
95 
int PdgCode() const
Definition: MCParticle.h:211
TH2 * rh
Definition: drawXsec.C:5
NumuCCpiCutParameters const & ParametersStruct() const
NumuCCpiCutParameters fParameters
the relevant parameters to cut on for a numuCCpi selection
const char * p
Definition: xmltok.h:285
A collection of associated CellHits.
Definition: Cluster.h:47
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
float abs(float number)
Definition: d0nt_math.hpp:39
Module to create a summary of total POT seen in a job.
Definition: Evaluator.h:27
friend std::ostream & operator<<(std::ostream &o, ParametersNumuCCpi const &p)
std::vector< std::string > comps
void Compare(NumuCCpiCutParameters const &compCuts)
void geom(int which=0)
Definition: geom.C:163
#define LOG_VERBATIM(category)
Float_t e
Definition: plot.C:35
Encapsulate the geometry of one entire detector (near, far, ndos)