GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HNLDecayer.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::hnl::Decayer
5 
6 \brief Heavy Neutral Lepton final-state product generator
7 
8 \author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9  University of Liverpool
10  John Plows <komninos-john.plows \at physics.ox.ac.uk>
11 
12 \created February 10, 2020
13 
14 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
15  For the full text of the license visit http://copyright.genie-mc.org
16 */
17 //____________________________________________________________________________
18 
19 #ifndef _HNL_DECAYER_H_
20 #define _HNL_DECAYER_H_
21 
22 #include <cassert>
23 
24 #include <TGenPhaseSpace.h>
25 #include <TH3.h>
26 
29 
30 #include "Tools/Flux/GNuMIFlux.h"
31 
33 
36 
37 namespace genie {
38 
39 namespace hnl {
40 
42 
43 public:
44  Decayer();
45  Decayer(string config);
46  ~Decayer();
47 
48  // implement the DecayRecordVisitorI interface
49  void ProcessEventRecord (GHepRecord * event) const;
50 
51  // overload the Algorithm::Configure() methods to load private data
52  // members from configuration options
53  void Configure(const Registry & config);
54  void Configure(string config);
55 
56  double GetHNLLifetime() const;
57  double GetHNLMass() const;
58  std::vector< double > GetHNLCouplings() const;
59  bool IsHNLMajorana() const;
60 
61  // string consists of 10 bits, mass increasing from least significant to most significant bit
62  // 0 if uninteresting, 1 if interesting
63  std::string GetHNLInterestingChannels() const;
64 
65  // additional particle-gun config
66  std::vector< double > GetPGunOrigin() const;
67  std::vector< double > GetPGunDOrigin() const;
68  double GetPGunEnergy() const;
69  std::vector< double > GetPGunDirection() const; // returns 3 directional cosines -- Cartesian coords
70  std::vector< double > GetPGunDeviation() const; // returns (dtheta, dphi) -- spherical coords
71 
72 private:
73 
74  void LoadConfig (void);
75  void AddInitialState (GHepRecord * event) const;
76  void GenerateDecayProducts (GHepRecord * event) const;
77  void UpdateEventRecord (GHepRecord * event) const;
78  void SetHNLCouplings (double Ue42, double Um42, double Ut42) const;
79  void SetBeam2User (std::vector<double> translation, std::vector<double> rotation) const;
80  void SetProdVtxPosition (const TLorentzVector & v4) const; // in detector coordinates
81 
82  // get information about parent and polarisation from HNLFluxCreator
83  void ReadCreationInfo( GHepRecord * event ) const;
84 
85  // Construct a SimpleHNL to get information about lifetime, interesting channels
87 
88  // these 2 are legacy methods. Not to be used anymore
89  std::vector< double > * GenerateDecayPosition (GHepRecord * event) const;
90  std::vector< double > * GenerateMomentum (GHepRecord * event) const;
91 
92  // PolMag is a bit of a misnomer. It is a polarisation modulus, i.e. not positive semidefinite.
93  double CalcPolMag (int parPdg, int lepPdg, double M) const;
94  double CalcPolMod (double polMag, int lepPdg, int hadPdg, double M) const;
95 
96  bool UnpolarisedDecay (TGenPhaseSpace & fPSG, PDGCodeList pdgv, double wm) const;
97  bool PolarisedDecay (TGenPhaseSpace & fPSG, PDGCodeList pdgv, double wm, TVector3 vPolDir) const;
98 
99  mutable int fCurrInitStatePdg;
101 
103  mutable std::vector<double> fPolDir;
104 
105  mutable bool fIsConfigLoaded = false;
106 
107  mutable double fMass;
108  mutable double fUe42 = -1.0, fUm42 = -1.0, fUt42 = -1.0;
109  mutable bool fIsMajorana = false;
110  //mutable int fType = 2;
111 
112  mutable bool fDoPol = false;
113 
114  mutable std::vector< genie::hnl::HNLDecayMode_t > fIntChannels;
115  mutable int fChanBits[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
116 
117  //mutable double fAngularDeviation = -1.0;
118  mutable std::vector< double > fB2UTranslation;
119  mutable double fTx = -1.0, fTy = -1.0, fTz = -1.0;
120  mutable std::vector< double > fB2URotation;
121  mutable double fR1 = -1.0, fR2 = -1.0, fR3 = -1.0;
122 
123  mutable TH3D * fProdVtxHist = 0;
124  mutable TLorentzVector * fProdVtx = 0;
125  mutable TLorentzVector * fISMom = 0;
126 
127  mutable double fPGOx = 0.0, fPGOy = 0.0, fPGOz = 0.0;
128  mutable double fPGDx = 0.0, fPGDy = 0.0, fPGDz = 0.0;
129  mutable double fPGE = 0.0;
130  mutable double fPGCx = 0.0, fPGCy = 0.0, fPGCz = 0.0;
131  mutable double fPGDTheta = 0.0, fPGDPhi = 0.0;
132 
133  mutable bool fGetCMFrameInstead = false;
134 };
135 
136 } // hnl namespace
137 
138 } // genie namespace
139 
140 #endif // _HNL_DECAYER_H_
bool IsHNLMajorana() const
Definition: HNLDecayer.cxx:722
std::vector< double > fPolDir
Definition: HNLDecayer.h:103
Heavy Neutral Lepton final-state product generator.
Definition: HNLDecayer.h:41
void LoadConfig(void)
Definition: HNLDecayer.cxx:419
std::vector< double > * GenerateDecayPosition(GHepRecord *event) const
Definition: HNLDecayer.cxx:326
std::vector< double > fB2URotation
Definition: HNLDecayer.h:120
HNL object.
Definition: SimpleHNL.h:36
bool UnpolarisedDecay(TGenPhaseSpace &fPSG, PDGCodeList pdgv, double wm) const
Definition: HNLDecayer.cxx:550
void Configure(const Registry &config)
Definition: HNLDecayer.cxx:407
std::vector< double > * GenerateMomentum(GHepRecord *event) const
Definition: HNLDecayer.cxx:351
genie::hnl::HNLDecayMode_t fCurrDecayMode
Definition: HNLDecayer.h:100
void UpdateEventRecord(GHepRecord *event) const
Definition: HNLDecayer.cxx:378
A list of PDG codes.
Definition: PDGCodeList.h:32
double GetHNLMass() const
Definition: HNLDecayer.cxx:710
double GetPGunEnergy() const
Definition: HNLDecayer.cxx:750
bool PolarisedDecay(TGenPhaseSpace &fPSG, PDGCodeList pdgv, double wm, TVector3 vPolDir) const
Definition: HNLDecayer.cxx:590
void GenerateDecayProducts(GHepRecord *event) const
Definition: HNLDecayer.cxx:121
void SetProdVtxPosition(const TLorentzVector &v4) const
Definition: HNLDecayer.cxx:511
TLorentzVector * fISMom
Definition: HNLDecayer.h:125
std::vector< double > GetPGunDirection() const
Definition: HNLDecayer.cxx:755
double GetHNLLifetime() const
Definition: HNLDecayer.cxx:705
void ReadCreationInfo(GHepRecord *event) const
Definition: HNLDecayer.cxx:518
genie::hnl::SimpleHNL GetHNLInstance() const
Definition: HNLDecayer.cxx:499
enum genie::hnl::EHNLDecayMode HNLDecayMode_t
double CalcPolMod(double polMag, int lepPdg, int hadPdg, double M) const
Definition: HNLDecayer.cxx:688
std::vector< double > GetPGunOrigin() const
Definition: HNLDecayer.cxx:736
std::vector< double > GetPGunDeviation() const
Definition: HNLDecayer.cxx:762
std::vector< double > GetPGunDOrigin() const
Definition: HNLDecayer.cxx:743
void AddInitialState(GHepRecord *event) const
Definition: HNLDecayer.cxx:73
std::vector< genie::hnl::HNLDecayMode_t > fIntChannels
Definition: HNLDecayer.h:114
std::string GetHNLInterestingChannels() const
Definition: HNLDecayer.cxx:727
void SetHNLCouplings(double Ue42, double Um42, double Ut42) const
Definition: HNLDecayer.cxx:481
void SetBeam2User(std::vector< double > translation, std::vector< double > rotation) const
Definition: HNLDecayer.cxx:488
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
TLorentzVector * fProdVtx
Definition: HNLDecayer.h:124
double CalcPolMag(int parPdg, int lepPdg, double M) const
Definition: HNLDecayer.cxx:671
std::vector< double > GetHNLCouplings() const
Definition: HNLDecayer.cxx:715
std::vector< double > fB2UTranslation
Definition: HNLDecayer.h:118
void ProcessEventRecord(GHepRecord *event) const
Definition: HNLDecayer.cxx:54
Expands the EventRecordVisitorI interface to include public interfaces for the HNL Decayer module...
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...