GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::HEDISGenerator Class Reference

Generates the final state leptonic and hadronic system in v HEDIS interactions. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <HEDISGenerator.h>

Inheritance diagram for genie::HEDISGenerator:
Inheritance graph
[legend]
Collaboration diagram for genie::HEDISGenerator:
Collaboration graph
[legend]

Public Member Functions

 HEDISGenerator ()
 
 HEDISGenerator (string config)
 
 ~HEDISGenerator ()
 
void Initialize (void) const
 
void ProcessEventRecord (GHepRecord *evrec) const
 
void Configure (const Registry &config)
 
void Configure (string config)
 
- Public Member Functions inherited from genie::HadronicSystemGenerator
void AddTargetNucleusRemnant (GHepRecord *event_rec) const
 
void AddFinalHadronicSyst (GHepRecord *event_rec) const
 
void PreHadronTransportDecays (GHepRecord *event_rec) const
 
TLorentzVector Hadronic4pLAB (GHepRecord *event_rec) const
 
TLorentzVector MomentumTransferLAB (GHepRecord *event_rec) const
 
TVector3 HCM2LAB (GHepRecord *event_rec) const
 
int HadronShowerCharge (GHepRecord *event_rec) const
 
int ResonanceCharge (GHepRecord *event_rec) const
 
- Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void FindConfig (void)
 
virtual const RegistryGetConfig (void) const
 
RegistryGetOwnedConfig (void)
 
virtual const AlgIdId (void) const
 Get algorithm ID. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
virtual void SetId (string name, string config)
 
const AlgorithmSubAlg (const RgKey &registry_key) const
 
void AdoptConfig (void)
 
void AdoptSubstructure (void)
 
virtual void Print (ostream &stream) const
 Print algorithm info. More...
 

Private Member Functions

void AddPrimaryLepton (GHepRecord *evrec) const
 
void LoadConfig (void)
 

Private Attributes

const EventRecordVisitorIfHadronizationModel
 

Additional Inherited Members

- Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
 
static string BuildParamVectSizeKey (const std::string &comm_name)
 
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
 
static string BuildParamMatRowSizeKey (const std::string &comm_name)
 
static string BuildParamMatColSizeKey (const std::string &comm_name)
 
- Protected Member Functions inherited from genie::HadronicSystemGenerator
 HadronicSystemGenerator ()
 
 HadronicSystemGenerator (string name)
 
 HadronicSystemGenerator (string name, string config)
 
 ~HadronicSystemGenerator ()
 
- Protected Member Functions inherited from genie::EventRecordVisitorI
 EventRecordVisitorI ()
 
 EventRecordVisitorI (string name)
 
 EventRecordVisitorI (string name, string config)
 
- Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 
 Algorithm (string name)
 
 Algorithm (string name, string config)
 
void Initialize (void)
 
void DeleteConfig (void)
 
void DeleteSubstructure (void)
 
RegistryExtractLocalConfig (const Registry &in) const
 
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More...
 
template<class T >
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
 
template<class T >
bool GetParamDef (const RgKey &name, T &p, const T &def) const
 
template<class T >
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters. More...
 
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
template<class T >
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters. More...
 
template<class T >
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
 
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::HadronicSystemGenerator
const EventRecordVisitorIfPreINukeDecayer
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Generates the final state leptonic and hadronic system in v HEDIS interactions. Is a concrete implementation of the EventRecordVisitorI interface.

Author
Alfonso Garcia <alfonsog nikhef.nl> NIKHEF
Created:
August 28, 2019
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 29 of file HEDISGenerator.h.

Constructor & Destructor Documentation

HEDISGenerator::HEDISGenerator ( )

Definition at line 35 of file HEDISGenerator.cxx.

References Initialize().

35  :
36 HadronicSystemGenerator("genie::HEDISGenerator")
37 {
38  this->Initialize();
39 }
void Initialize(void) const
HEDISGenerator::HEDISGenerator ( string  config)

Definition at line 41 of file HEDISGenerator.cxx.

References Initialize().

41  :
42 HadronicSystemGenerator("genie::HEDISGenerator", config)
43 {
44  this->Initialize();
45 }
void Initialize(void) const
HEDISGenerator::~HEDISGenerator ( )

Definition at line 47 of file HEDISGenerator.cxx.

48 {
49 
50 }

Member Function Documentation

void HEDISGenerator::AddPrimaryLepton ( GHepRecord evrec) const
private

Definition at line 74 of file HEDISGenerator.cxx.

References genie::GHepRecord::AddParticle(), genie::utils::math::LongLorentzVector::Dx(), genie::utils::math::LongLorentzVector::Dy(), genie::utils::math::LongLorentzVector::Dz(), genie::utils::math::LongLorentzVector::E(), genie::Interaction::FSPrimLepton(), genie::RandomGen::Instance(), genie::Interaction::Kine(), genie::Interaction::KinePtr(), genie::kIStStableFinalState, genie::constants::kPi, LOG, genie::utils::math::LongLorentzVector::M(), genie::utils::math::LongLorentzVector::P(), genie::GHepParticle::P4(), pINFO, genie::GHepRecord::Probe(), genie::GHepRecord::ProbePosition(), genie::utils::math::LongLorentzVector::Px(), genie::utils::math::LongLorentzVector::Py(), genie::utils::math::LongLorentzVector::Pz(), genie::Kinematics::Q2(), genie::utils::kinematics::Q2(), genie::RandomGen::RndLep(), genie::utils::math::LongLorentzVector::Rotate(), genie::Kinematics::SetFSLeptonP4(), genie::GHepRecord::Summary(), genie::GHepParticle::X4(), and genie::Kinematics::y().

Referenced by ProcessEventRecord().

75 {
76 
77  Interaction * interaction = evrec->Summary();
78 
79  // Neutrino 4p
80  LongLorentzVector p4v( * evrec->Probe()->P4() );
81  LOG("HEDISGenerator", pINFO) << "NEUTRINO @ LAB' => E = " << p4v.E() << " // m = " << p4v.M() << " // p = " << p4v.P();
82  LOG("HEDISGenerator", pINFO) << " dir = " << p4v.Dx() << " , " << p4v.Dy() << " , " << p4v.Dz();
83 
84  // Look-up selected kinematics & other needed kinematical params
85  long double Q2 = interaction->Kine().Q2(true);
86  long double y = interaction->Kine().y(true);
87  long double Ev = p4v.E();
88  long double ml = interaction->FSPrimLepton()->Mass();
89  long double ml2 = powl(ml,2);
90 
91  // Compute the final state primary lepton energy and momentum components
92  // along and perpendicular the neutrino direction
93  long double El = (1-y)*Ev;
94  long double plp = El - 0.5*(Q2+ml2)/Ev; // p(//)
95  long double plt = sqrtl(fmaxl(0.,El*El-plp*plp-ml2)); // p(-|)
96  // Randomize transverse components
98  long double phi = 2 * constants::kPi * rnd->RndLep().Rndm();
99  long double pltx = plt * cosl(phi);
100  long double plty = plt * sinl(phi);
101 
102  // Lepton 4-momentum in the LAB frame
103  LongLorentzVector p4llong( pltx, plty, plp, El );
104  p4llong.Rotate(p4v);
105  LOG("HEDISGenerator", pINFO) << "LEPTON @ LAB' => E = " << p4llong.E() << " // m = " << p4llong.M() << " // p = " << p4llong.P();
106  LOG("HEDISGenerator", pINFO) << " dir = " << p4llong.Dx() << " , " << p4llong.Dy() << " , " << p4llong.Dz();
107 
108  // Translate from long double to double
109  TLorentzVector p4l( (double)p4llong.Px(), (double)p4llong.Py(), (double)p4llong.Pz(), (double)p4llong.E() );
110 
111  // Add lepton to EventRecord
112  int pdgl = interaction->FSPrimLepton()->PdgCode();
113  evrec->AddParticle(pdgl, kIStStableFinalState, evrec->ProbePosition(),-1,-1,-1, p4l, *(evrec->Probe()->X4()));
114  evrec->Summary()->KinePtr()->SetFSLeptonP4(p4l);
115 
116 }
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:1077
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
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:284
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
const Kinematics & Kine(void) const
Definition: Interaction.h:71
#define pINFO
Definition: Messenger.h:62
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:499
double Q2(bool selected=false) const
Definition: Kinematics.cxx:125
virtual int ProbePosition(void) const
Definition: GHepRecord.cxx:352
void HEDISGenerator::Configure ( const Registry config)
virtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 118 of file HEDISGenerator.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

119 {
120  Algorithm::Configure(config);
121  this->LoadConfig();
122 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void HEDISGenerator::Configure ( string  config)
virtual

Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration

Reimplemented from genie::Algorithm.

Definition at line 124 of file HEDISGenerator.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

125 {
126  Algorithm::Configure(config);
127  this->LoadConfig();
128 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void HEDISGenerator::Initialize ( void  ) const

Definition at line 52 of file HEDISGenerator.cxx.

Referenced by HEDISGenerator().

53 {
54 
55 }
void HEDISGenerator::LoadConfig ( void  )
private

Definition at line 130 of file HEDISGenerator.cxx.

References fHadronizationModel, and genie::Algorithm::SubAlg().

Referenced by Configure().

131 {
133 
134  //-- Get the requested hadronization model
136  dynamic_cast<const EventRecordVisitorI *> (this->SubAlg("Hadronizer"));
137  assert(fHadronizationModel);
138 
139 }
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
const EventRecordVisitorI * fHadronizationModel
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345
void HEDISGenerator::ProcessEventRecord ( GHepRecord evrec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 57 of file HEDISGenerator.cxx.

References AddPrimaryLepton(), genie::HadronicSystemGenerator::AddTargetNucleusRemnant(), fHadronizationModel, genie::kIStFinalStateNuclearRemnant, genie::GHepRecord::Particle(), genie::EventRecordVisitorI::ProcessEventRecord(), and genie::GHepRecord::RemnantNucleusPosition().

58 {
59 // This method generates the final state hadronic system
60 
61  //-- Add the target remnant
62  this->AddTargetNucleusRemnant(evrec);
63  GHepParticle * target = evrec -> TargetNucleus();
64  if(target) evrec->Particle(evrec->RemnantNucleusPosition())->SetStatus(kIStFinalStateNuclearRemnant);
65 
66  //-- Add the primary lepton
67  this->AddPrimaryLepton(evrec);
68 
69  //-- Run the hadronization model and get the fragmentation products
71 
72 }
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
void AddPrimaryLepton(GHepRecord *evrec) const
virtual int RemnantNucleusPosition(void) const
Definition: GHepRecord.cxx:397
void AddTargetNucleusRemnant(GHepRecord *event_rec) const
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
const EventRecordVisitorI * fHadronizationModel
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39

Member Data Documentation

const EventRecordVisitorI* genie::HEDISGenerator::fHadronizationModel
private

Definition at line 51 of file HEDISGenerator.h.

Referenced by LoadConfig(), and ProcessEventRecord().


The documentation for this class was generated from the following files: