All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NuAnaAlg.h
Go to the documentation of this file.
1 #ifndef SBND_NUANA_ALG_H
2 #define SBND_NUANA_ALG_H
3 
4 
5 #include "art/Framework/Services/Registry/ServiceHandle.h"
6 #include "art/Framework/Principal/Event.h"
7 #include "art/Framework/Principal/Handle.h"
9 
10 #include "nusimdata/SimulationBase/MCParticle.h"
11 #include "nugen/NuReweight/art/NuReweight.h" //GENIEReweight.h"
12 #include "nusimdata/SimulationBase/MCNeutrino.h"
13 #include "nusimdata/SimulationBase/MCTruth.h"
14 #include "nusimdata/SimulationBase/GTruth.h"
15 #include "nusimdata/SimulationBase/MCFlux.h"
16 
17 #include "TVector3.h"
18 #include "TLorentzVector.h"
19 #include "TRandom.h"
20 
21 #include <memory>
22 
23 namespace sbnd{
24 
29 
30  class NuAnaAlg
31  {
32  public:
33 
34  NuAnaAlg();
35  // ~NuAnaAlg();
36 
37  void configureGeometry(art::ServiceHandle<geo::Geometry> );
38 
39  void configureReWeight(const std::vector<reweight> &,
40  const std::vector<std::vector<float>>&);
41  // std::vector<float>&,
42  // int);
43 
44  void calcWeight( art::Ptr<simb::MCTruth>,
45  art::Ptr<simb::GTruth >,
46  std::vector<std::vector<float>>& );
47 
48  void packFluxWeight( art::Ptr<simb::MCFlux > flux,
49  std::vector<std::vector<float>>&);
50 
51  unsigned int prepareSigmas(int, unsigned int,
52  std::vector<std::vector<float> > & );
53 
54  void parseWeights(const std::vector<std::string> &,
55  std::vector<reweight> &);
56 
57  // get the basic neutrino info:
58  void packNeutrinoInfo(simb::MCNeutrino * neutrino,
59  int& nuchan,
60  int& inno,
61  double& enugen,
62  int& isCC,
63  int& mode,
64  double& thetaLep,
65  double& phiLep,
66  double& Elep,
67  std::vector<float>& neutMom,
68  std::vector<float>& vertex);
69 
70  // Pack up the flux info:
71  void packFluxInfo(art::Ptr<simb::MCFlux > flux,
72  int& ptype, int& tptype, int& ndecay,
73  std::vector<float>& neutVertexInWindow,
74  std::vector<float>& ParentVertex,
75  std::vector<float>& nuParentMomAtDecay,
76  std::vector<float>& nuParentMomAtProd,
77  std::vector<float>& nuParentMomTargetExit);
78 
79  // Pack up the genie info:
80  void packGenieInfo(art::Ptr<simb::MCTruth> truth,
81  std::vector<int> & GeniePDG,
82  std::vector<std::vector<float>>& GenieMomentum,
83  std::vector<std::string>& GenieProc,
84  int& NPi0FinalState,
85  int& NGamma,
86  int& NChargedPions);
87 
88  void packLarg4Info(art::Handle< std::vector<simb::MCParticle> > mclarg4, int, int, int, int,
89  std::vector<std::vector<float> > & leptonPos,
90  std::vector<std::vector<float> > & leptonMom,
91  std::vector<std::vector<float> > & p1PhotonConversionPos,
92  std::vector<std::vector<float> > & p1PhotonConversionMom,
93  std::vector<std::vector<float> > & p2PhotonConversionPos,
94  std::vector<std::vector<float> > & p2PhotonConversionMom,
95  std::vector<std::vector<float> > & miscPhotonConversionPos,
96  std::vector<std::vector<float> > & miscPhotonConversionMom,
97  std::vector<std::vector<float> > & pionPos,
98  std::vector<std::vector<float> > & pionMom,
99  std::vector<std::vector<std::vector<float> > > & chargedPionPos,
100  std::vector<std::vector<std::vector<float> > > & chargedPionMom,
101  std::vector<int> & chargePionSign);
102 
103  private:
104 
105  art::Ptr<simb::MCParticle> getParticleByID(
106  art::Handle< std::vector<simb::MCParticle> > & mclistLARG4, int ) const;
107  art::Ptr<simb::MCParticle> getParticleByPDG(
108  art::Handle< std::vector<simb::MCParticle> > & mclistLARG4, int ) const;
109 
110 
111  void pack4Vector(const TLorentzVector& input, std::vector<float>& output) const;
112  void pack3Vector(const TVector3& input, std::vector<float>& output) const;
113 
114  bool isInTPC(const TVector3 &) const;
115  void GetPhotonConversionInfo( art::Ptr<simb::MCParticle> photon,
116  TLorentzVector& ConversionPos,
117  TLorentzVector& ConversionMom);
118  // The reweighting utility class:
119  // std::unique_ptr<rwgt::NuReweight> reweight;
120  std::vector<std::vector<rwgt::NuReweight *> > reweightVector;
121 
122  // geometry boundaries:
123  double xlow, xhigh, ylow, yhigh, zlow, zhigh;
124 
125 
126  /* data */
127  };
128 }
129 
130 #endif
void pack4Vector(const TLorentzVector &input, std::vector< float > &output) const
Definition: NuAnaAlg.cxx:671
process_name vertex
Definition: cheaterreco.fcl:51
void GetPhotonConversionInfo(art::Ptr< simb::MCParticle > photon, TLorentzVector &ConversionPos, TLorentzVector &ConversionMom)
Definition: NuAnaAlg.cxx:432
process_name can override from command line with o or output photon
Definition: runPID.fcl:28
bool isInTPC(const TVector3 &) const
Definition: NuAnaAlg.cxx:423
double xhigh
Definition: NuAnaAlg.h:123
reweight
Definition: NuAnaAlg.h:25
art::Ptr< simb::MCParticle > getParticleByPDG(art::Handle< std::vector< simb::MCParticle > > &mclistLARG4, int) const
Definition: NuAnaAlg.cxx:409
double xlow
Definition: NuAnaAlg.h:123
void packFluxWeight(art::Ptr< simb::MCFlux > flux, std::vector< std::vector< float >> &)
Definition: NuAnaAlg.cxx:712
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
double zhigh
Definition: NuAnaAlg.h:123
void configureReWeight(const std::vector< reweight > &, const std::vector< std::vector< float >> &)
Definition: NuAnaAlg.cxx:44
void packGenieInfo(art::Ptr< simb::MCTruth > truth, std::vector< int > &GeniePDG, std::vector< std::vector< float >> &GenieMomentum, std::vector< std::string > &GenieProc, int &NPi0FinalState, int &NGamma, int &NChargedPions)
Definition: NuAnaAlg.cxx:371
const char mode
Definition: noise_ana.cxx:20
void packFluxInfo(art::Ptr< simb::MCFlux > flux, int &ptype, int &tptype, int &ndecay, std::vector< float > &neutVertexInWindow, std::vector< float > &ParentVertex, std::vector< float > &nuParentMomAtDecay, std::vector< float > &nuParentMomAtProd, std::vector< float > &nuParentMomTargetExit)
Definition: NuAnaAlg.cxx:333
art::Ptr< simb::MCParticle > getParticleByID(art::Handle< std::vector< simb::MCParticle > > &mclistLARG4, int) const
Definition: NuAnaAlg.cxx:396
double ylow
Definition: NuAnaAlg.h:123
void pack3Vector(const TVector3 &input, std::vector< float > &output) const
Definition: NuAnaAlg.cxx:680
void packLarg4Info(art::Handle< std::vector< simb::MCParticle > > mclarg4, int, int, int, int, std::vector< std::vector< float > > &leptonPos, std::vector< std::vector< float > > &leptonMom, std::vector< std::vector< float > > &p1PhotonConversionPos, std::vector< std::vector< float > > &p1PhotonConversionMom, std::vector< std::vector< float > > &p2PhotonConversionPos, std::vector< std::vector< float > > &p2PhotonConversionMom, std::vector< std::vector< float > > &miscPhotonConversionPos, std::vector< std::vector< float > > &miscPhotonConversionMom, std::vector< std::vector< float > > &pionPos, std::vector< std::vector< float > > &pionMom, std::vector< std::vector< std::vector< float > > > &chargedPionPos, std::vector< std::vector< std::vector< float > > > &chargedPionMom, std::vector< int > &chargePionSign)
Definition: NuAnaAlg.cxx:493
double yhigh
Definition: NuAnaAlg.h:123
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
void configureGeometry(art::ServiceHandle< geo::Geometry >)
Definition: NuAnaAlg.cxx:14
void parseWeights(const std::vector< std::string > &, std::vector< reweight > &)
Definition: NuAnaAlg.cxx:229
stream1 can override from command line with o or output services user sbnd
unsigned int prepareSigmas(int, unsigned int, std::vector< std::vector< float > > &)
Definition: NuAnaAlg.cxx:211
std::vector< std::vector< rwgt::NuReweight * > > reweightVector
Definition: NuAnaAlg.h:120
void packNeutrinoInfo(simb::MCNeutrino *neutrino, int &nuchan, int &inno, double &enugen, int &isCC, int &mode, double &thetaLep, double &phiLep, double &Elep, std::vector< float > &neutMom, std::vector< float > &vertex)
Definition: NuAnaAlg.cxx:287
void calcWeight(art::Ptr< simb::MCTruth >, art::Ptr< simb::GTruth >, std::vector< std::vector< float >> &)
Definition: NuAnaAlg.cxx:257
art framework interface to geometry description
double zlow
Definition: NuAnaAlg.h:123