GENIEGenerator
Loading...
Searching...
No Matches
HEDISGenerator.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, 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
22
23using namespace genie;
24using namespace genie::utils::math;
25
26//___________________________________________________________________________
28HadronicSystemGenerator("genie::HEDISGenerator")
29{
30 this->Initialize();
31}
32//___________________________________________________________________________
34HadronicSystemGenerator("genie::HEDISGenerator", config)
35{
36 this->Initialize();
37}
38//___________________________________________________________________________
43//____________________________________________________________________________
45{
46
47}
48//___________________________________________________________________________
50{
51// This method generates the final state hadronic system
52
53 //-- Add the target remnant
54 this->AddTargetNucleusRemnant(evrec);
55 GHepParticle * target = evrec -> TargetNucleus();
57
58 //-- Add the primary lepton
59 this->AddPrimaryLepton(evrec);
60
61 //-- Run the hadronization model and get the fragmentation products
62 fHadronizationModel->ProcessEventRecord(evrec);
63
64}
65//___________________________________________________________________________
67{
68
69 Interaction * interaction = evrec->Summary();
70
71 // Neutrino 4p
72 LongLorentzVector p4v( * evrec->Probe()->P4() );
73 LOG("HEDISGenerator", pINFO) << "NEUTRINO @ LAB' => E = " << p4v.E() << " // m = " << p4v.M() << " // p = " << p4v.P();
74 LOG("HEDISGenerator", pINFO) << " dir = " << p4v.Dx() << " , " << p4v.Dy() << " , " << p4v.Dz();
75
76 // Look-up selected kinematics & other needed kinematical params
77 long double Q2 = interaction->Kine().Q2(true);
78 long double y = interaction->Kine().y(true);
79 long double Ev = p4v.E();
80 long double ml = interaction->FSPrimLepton()->Mass();
81 long double ml2 = powl(ml,2);
82
83 // Compute the final state primary lepton energy and momentum components
84 // along and perpendicular the neutrino direction
85 long double El = (1-y)*Ev;
86 long double plp = El - 0.5*(Q2+ml2)/Ev; // p(//)
87 long double plt = sqrtl(fmaxl(0.,El*El-plp*plp-ml2)); // p(-|)
88 // Randomize transverse components
90 long double phi = 2 * constants::kPi * rnd->RndLep().Rndm();
91 long double pltx = plt * cosl(phi);
92 long double plty = plt * sinl(phi);
93
94 // Lepton 4-momentum in the LAB frame
95 LongLorentzVector p4llong( pltx, plty, plp, El );
96 p4llong.Rotate(p4v);
97 LOG("HEDISGenerator", pINFO) << "LEPTON @ LAB' => E = " << p4llong.E() << " // m = " << p4llong.M() << " // p = " << p4llong.P();
98 LOG("HEDISGenerator", pINFO) << " dir = " << p4llong.Dx() << " , " << p4llong.Dy() << " , " << p4llong.Dz();
99
100 // Translate from long double to double
101 TLorentzVector p4l( (double)p4llong.Px(), (double)p4llong.Py(), (double)p4llong.Pz(), (double)p4llong.E() );
102
103 // Add lepton to EventRecord
104 int pdgl = interaction->FSPrimLepton()->PdgCode();
105 evrec->AddParticle(pdgl, kIStStableFinalState, evrec->ProbePosition(),-1,-1,-1, p4l, *(evrec->Probe()->X4()));
106 evrec->Summary()->KinePtr()->SetFSLeptonP4(p4l);
107
108}
109//___________________________________________________________________________
115//____________________________________________________________________________
121//____________________________________________________________________________
123{
125
126 //-- Get the requested hadronization model
128 dynamic_cast<const EventRecordVisitorI *> (this->SubAlg("Hadronizer"));
129 assert(fHadronizationModel);
130
131}
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
const Algorithm * SubAlg(const RgKey &registry_key) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
STDHEP-like event record entry that can fit a particle or a nucleus.
const TLorentzVector * P4(void) const
const TLorentzVector * X4(void) const
void SetStatus(GHepStatus_t s)
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual int ProbePosition(void) const
virtual GHepParticle * Probe(void) const
virtual Interaction * Summary(void) const
virtual void AddParticle(const GHepParticle &p)
virtual int RemnantNucleusPosition(void) const
virtual GHepParticle * Particle(int position) const
void Configure(const Registry &config)
void AddPrimaryLepton(GHepRecord *evrec) const
void Initialize(void) const
const EventRecordVisitorI * fHadronizationModel
void ProcessEventRecord(GHepRecord *evrec) const
void AddTargetNucleusRemnant(GHepRecord *event_rec) const
Summary information for an interaction.
Definition Interaction.h:56
const Kinematics & Kine(void) const
Definition Interaction.h:71
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
Kinematics * KinePtr(void) const
Definition Interaction.h:76
double Q2(bool selected=false) const
double y(bool selected=false) const
void SetFSLeptonP4(const TLorentzVector &p4)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition RandomGen.h:29
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
TRandom3 & RndLep(void) const
rnd number generator used by final state primary lepton generators
Definition RandomGen.h:62
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
void Rotate(LongLorentzVector axis)
Definition MathUtils.h:68
Simple functions for loading and reading nucleus dependent keys from config files.
Simple mathematical utilities not found in ROOT's TMath.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
@ kIStFinalStateNuclearRemnant
Definition GHepStatus.h:38
@ kIStStableFinalState
Definition GHepStatus.h:30