HEDISGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2018, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Alfonso Garcia <alfonsog \at nikhef.nl>
8  NIKHEF
9 
10  For the class documentation see the corresponding header file.
11 
12 */
13 //____________________________________________________________________________
14 
23 
24 #include <RVersion.h>
25 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,6)
26 #include <TMCParticle.h>
27 #else
28 #include <TMCParticle6.h>
29 #endif
30 
31 using namespace genie;
32 using namespace genie::utils::math;
33 
34 //___________________________________________________________________________
36 HadronicSystemGenerator("genie::HEDISGenerator")
37 {
38  this->Initialize();
39 }
40 //___________________________________________________________________________
42 HadronicSystemGenerator("genie::HEDISGenerator", config)
43 {
44  this->Initialize();
45 }
46 //___________________________________________________________________________
48 {
49 
50 }
51 //____________________________________________________________________________
53 {
54 
55 }
56 //___________________________________________________________________________
58 {
59 // This method generates the final state hadronic system
60 
61  //-- Add the target remnant
62  this->AddTargetNucleusRemnant(evrec);
63 
64  //-- Add the primary lepton
65  this->AddPrimaryLepton(evrec);
66 
67  //-- Run the hadronization model and get the fragmentation products
69 
70 }
71 //___________________________________________________________________________
73 {
74 
75  Interaction * interaction = evrec->Summary();
76 
77  // Neutrino 4p
78  LongLorentzVector p4v( * evrec->Probe()->P4() );
79  LOG("HEDISGenerator", pINFO) << "NEUTRINO @ LAB' => E = " << p4v.E() << " // m = " << p4v.M() << " // p = " << p4v.P();
80  LOG("HEDISGenerator", pINFO) << " dir = " << p4v.Dx() << " , " << p4v.Dy() << " , " << p4v.Dz();
81 
82  // Look-up selected kinematics & other needed kinematical params
83  long double Q2 = interaction->Kine().Q2(true);
84  long double y = interaction->Kine().y(true);
85  long double Ev = p4v.E();
86  long double ml = interaction->FSPrimLepton()->Mass();
87  long double ml2 = powl(ml,2);
88 
89  // Compute the final state primary lepton energy and momentum components
90  // along and perpendicular the neutrino direction
91  long double El = (1-y)*Ev;
92  long double plp = El - 0.5*(Q2+ml2)/Ev; // p(//)
93  long double plt = sqrtl(fmaxl(0.,El*El-plp*plp-ml2)); // p(-|)
94  // Randomize transverse components
96  long double phi = 2 * constants::kPi * rnd->RndLep().Rndm();
97  long double pltx = plt * cosl(phi);
98  long double plty = plt * sinl(phi);
99 
100  // Lepton 4-momentum in the LAB frame
101  LongLorentzVector p4llong( pltx, plty, plp, El );
102  p4llong.Rotate(p4v);
103  LOG("HEDISGenerator", pINFO) << "LEPTON @ LAB' => E = " << p4llong.E() << " // m = " << p4llong.M() << " // p = " << p4llong.P();
104  LOG("HEDISGenerator", pINFO) << " dir = " << p4llong.Dx() << " , " << p4llong.Dy() << " , " << p4llong.Dz();
105 
106  // Translate from long double to double
107  TLorentzVector p4l( (double)p4llong.Px(), (double)p4llong.Py(), (double)p4llong.Pz(), (double)p4llong.E() );
108 
109  // Add lepton to EventRecord
110  int pdgl = interaction->FSPrimLepton()->PdgCode();
111  evrec->AddParticle(pdgl, kIStStableFinalState, evrec->ProbePosition(),-1,-1,-1, p4l, *(evrec->Probe()->X4()));
112  evrec->Summary()->KinePtr()->SetFSLeptonP4(p4l);
113 
114 }
115 //___________________________________________________________________________
117 {
118  Algorithm::Configure(config);
119  this->LoadConfig();
120 }
121 //____________________________________________________________________________
123 {
124  Algorithm::Configure(config);
125  this->LoadConfig();
126 }
127 //____________________________________________________________________________
129 {
131 
132  //-- Get the requested hadronization model
134  dynamic_cast<const EventRecordVisitorI *> (this->SubAlg("Hadronizer"));
135  assert(fHadronizationModel);
136 
137 }
void AddPrimaryLepton(GHepRecord *evrec) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
Definition: RandomGen.h:62
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
void AddTargetNucleusRemnant(GHepRecord *event_rec) const
void ProcessEventRecord(GHepRecord *evrec) const
void Initialize(void) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
Simple mathematical utilities not found in ROOT&#39;s TMath.
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:277
double y(bool selected=false) const
Definition: Kinematics.cxx:112
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void SetFSLeptonP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:297
static Config * config
Definition: config.cpp:1054
const Kinematics & Kine(void) const
Definition: Interaction.h:71
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
#define pINFO
Definition: Messenger.h:62
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
const EventRecordVisitorI * fHadronizationModel
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
Abstract class. Is used to pass some commonly recurring methods to all concrete implementations of th...
double Q2(bool selected=false) const
Definition: Kinematics.cxx:125
virtual int ProbePosition(void) const
Definition: GHepRecord.cxx:345
void Rotate(LongLorentzVector axis)
Definition: MathUtils.h:68
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
static const double kPi
Definition: Constants.h:37
void Configure(const Registry &config)
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345