GENIEGenerator
Loading...
Searching...
No Matches
genie::OutgoingDarkGenerator Class Reference

Abstract class. Is used to pass common implementation to concrete implementations of the EventRecordVisitorI interface generating the primary lepton for a specific processes (QEL,DIS,RES,IMD,...) More...

#include <OutgoingDarkGenerator.h>

Inheritance diagram for genie::OutgoingDarkGenerator:
[legend]
Collaboration diagram for genie::OutgoingDarkGenerator:
[legend]

Public Member Functions

virtual void ProcessEventRecord (GHepRecord *evrec) const
virtual void SetPolarization (GHepRecord *ev) const
virtual TVector3 NucRestFrame2Lab (GHepRecord *ev) const
virtual void AddToEventRecord (GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
void Configure (const Registry &config)
void Configure (string config)
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.
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status.
virtual bool AllowReconfig (void) const
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm.
virtual void SetId (const AlgId &id)
 Set algorithm ID.
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.

Protected Member Functions

 OutgoingDarkGenerator ()
 OutgoingDarkGenerator (string name)
 OutgoingDarkGenerator (string name, string config)
virtual ~OutgoingDarkGenerator ()
void LoadConfig (void)
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.
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.
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.
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
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership
int MergeTopRegistry (const Registry &r)
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships.

Protected Attributes

bool fApplyCoulombCorrection
Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...)
AlgId fID
 algorithm name and configuration set
vector< Registry * > fConfVect
vector< bool > fOwnerships
 ownership for every registry in fConfVect
AlgStatus_t fStatus
 algorithm execution status
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool)

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)

Detailed Description

Abstract class. Is used to pass common implementation to concrete implementations of the EventRecordVisitorI interface generating the primary lepton for a specific processes (QEL,DIS,RES,IMD,...)

Author
Joshua Berger <jberger \at physics.wisc.edu> University of Wisconsin-Madison

Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool

Created:\n October 03, 2004
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 33 of file OutgoingDarkGenerator.h.

Constructor & Destructor Documentation

◆ OutgoingDarkGenerator() [1/3]

◆ OutgoingDarkGenerator() [2/3]

OutgoingDarkGenerator::OutgoingDarkGenerator ( string name)
protected

Definition at line 42 of file OutgoingDarkGenerator.cxx.

42 :
44{
45
46}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ OutgoingDarkGenerator() [3/3]

OutgoingDarkGenerator::OutgoingDarkGenerator ( string name,
string config )
protected

Definition at line 48 of file OutgoingDarkGenerator.cxx.

48 :
49EventRecordVisitorI(name, config)
50{
51
52}

References genie::EventRecordVisitorI::EventRecordVisitorI().

◆ ~OutgoingDarkGenerator()

OutgoingDarkGenerator::~OutgoingDarkGenerator ( )
protectedvirtual

Definition at line 54 of file OutgoingDarkGenerator.cxx.

55{
56
57}

Member Function Documentation

◆ AddToEventRecord()

void OutgoingDarkGenerator::AddToEventRecord ( GHepRecord * ev,
int pdgc,
const TLorentzVector & p4 ) const
virtual

Definition at line 144 of file OutgoingDarkGenerator.cxx.

146{
147// Adds the final state primary lepton GHepParticle to the event record.
148// To be called by all concrete OutgoingDarkGenerators before exiting.
149
150 Interaction * interaction = evrec->Summary();
151
152 GHepParticle * mom = evrec->Probe();
153 int imom = evrec->ProbePosition();
154
155 const TLorentzVector & vtx = *(mom->X4());
156
157 TLorentzVector x4l(vtx); // position 4-vector
158 TLorentzVector p4l(p4); // momentum 4-vector
159
160 GHepParticle * nucltgt = evrec->TargetNucleus();
161
162 bool is_ve = interaction->ProcInfo().IsInverseMuDecay() ||
163 interaction->ProcInfo().IsIMDAnnihilation() ||
164 interaction->ProcInfo().IsNuElectronElastic();
165
166 bool can_correct = fApplyCoulombCorrection && nucltgt!=0 && !is_ve;
167 if(can_correct) {
168 LOG("LeptonicVertex", pINFO)
169 << "Correcting f/s lepton energy for Coulomb effects";
170
171 double m = interaction->FSPrimLepton()->Mass();
172 double Z = nucltgt->Z();
173 double A = nucltgt->A();
174
175 // charge radius of nucleus in GeV^-1
176 double Rc = (1.1*TMath::Power(A,1./3.) + 0.86*TMath::Power(A,-1./3.))/0.197;
177
178 // shift of lepton energy in homogenous sphere with radius Rc
179 double Vo = 3*kAem*Z/(2*Rc);
180 Vo *= 0.75; // as suggested in R.Gran's note
181
182 double Elo = p4l.Energy();
183 double e = TMath::Min(Vo, Elo-m);
184 double El = TMath::Max(0., Elo-e);
185
186 LOG("LeptonicVertex", pINFO)
187 << "Lepton energy subtraction: E = " << Elo << " --> " << El;
188
189 double pmag_old = p4l.P();
190 double pmag_new = TMath::Sqrt(utils::math::NonNegative(El*El-m*m));
191 double scale = pmag_new / pmag_old;
192 LOG("LeptonicVertex", pDEBUG)
193 << "|pnew| = " << pmag_new << ", |pold| = " << pmag_old
194 << ", scale = " << scale;
195
196 double pxl = scale * p4l.Px();
197 double pyl = scale * p4l.Py();
198 double pzl = scale * p4l.Pz();
199
200 p4l.SetPxPyPzE(pxl,pyl,pzl,El);
201
202 TLorentzVector p4c = p4 - p4l;
203 TLorentzVector x4dummy(0,0,0,0);;
204
205 evrec->AddParticle(
206 kPdgCoulobtron, kIStStableFinalState, -1,-1,-1,-1, p4c, x4dummy);
207 }
208
209 evrec->AddParticle(pdgc, kIStStableFinalState, imom,-1,-1,-1, p4l, x4l);
210
211 // update the interaction summary
212 evrec->Summary()->KinePtr()->SetFSLeptonP4(p4l);
213}
#define pINFO
Definition Messenger.h:62
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
const TLorentzVector * X4(void) const
int Z(void) const
int A(void) const
const ProcessInfo & ProcInfo(void) const
Definition Interaction.h:70
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
bool IsNuElectronElastic(void) const
bool IsInverseMuDecay(void) const
bool IsIMDAnnihilation(void) const
const double e
double NonNegative(double x)
@ kIStStableFinalState
Definition GHepStatus.h:30
const int kPdgCoulobtron
Definition PDGCodes.h:213

References genie::GHepParticle::A(), genie::GHepRecord::AddParticle(), e, fApplyCoulombCorrection, genie::Interaction::FSPrimLepton(), genie::ProcessInfo::IsIMDAnnihilation(), genie::ProcessInfo::IsInverseMuDecay(), genie::ProcessInfo::IsNuElectronElastic(), genie::constants::kAem, genie::Interaction::KinePtr(), genie::kIStStableFinalState, genie::kPdgCoulobtron, LOG, genie::utils::math::NonNegative(), pDEBUG, pINFO, genie::GHepRecord::Probe(), genie::GHepRecord::ProbePosition(), genie::Interaction::ProcInfo(), genie::Kinematics::SetFSLeptonP4(), genie::GHepRecord::Summary(), genie::GHepRecord::TargetNucleus(), genie::GHepParticle::X4(), and genie::GHepParticle::Z().

Referenced by genie::DMEOutgoingDarkGenerator::ProcessEventRecord(), and ProcessEventRecord().

◆ Configure() [1/2]

void OutgoingDarkGenerator::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 254 of file OutgoingDarkGenerator.cxx.

255{
256 Algorithm::Configure(config);
257 this->LoadConfig();
258}
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62

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

◆ Configure() [2/2]

void OutgoingDarkGenerator::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 260 of file OutgoingDarkGenerator.cxx.

261{
262 Algorithm::Configure(config);
263 this->LoadConfig();
264}

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

◆ LoadConfig()

void OutgoingDarkGenerator::LoadConfig ( void )
protected

Definition at line 266 of file OutgoingDarkGenerator.cxx.

267{
268 GetParam( "ApplyCoulombCorrection", fApplyCoulombCorrection ) ;
269
270}
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const

References fApplyCoulombCorrection, and genie::Algorithm::GetParam().

Referenced by Configure(), and Configure().

◆ NucRestFrame2Lab()

TVector3 OutgoingDarkGenerator::NucRestFrame2Lab ( GHepRecord * ev) const
virtual

Definition at line 130 of file OutgoingDarkGenerator.cxx.

131{
132// Velocity for an active Lorentz transform taking the final state primary
133// lepton from the [nucleon rest frame] --> [LAB]
134
135 Interaction * interaction = evrec->Summary();
136 const InitialState & init_state = interaction->InitState();
137
138 const TLorentzVector & pnuc4 = init_state.Tgt().HitNucP4(); //[@LAB]
139 TVector3 beta = pnuc4.BoostVector();
140
141 return beta;
142}
const Target & Tgt(void) const
const InitialState & InitState(void) const
Definition Interaction.h:69
const TLorentzVector & HitNucP4(void) const
Definition Target.h:91

References genie::Target::HitNucP4(), genie::Interaction::InitState(), genie::GHepRecord::Summary(), and genie::InitialState::Tgt().

Referenced by ProcessEventRecord().

◆ ProcessEventRecord()

void OutgoingDarkGenerator::ProcessEventRecord ( GHepRecord * evrec) const
virtual

Implements genie::EventRecordVisitorI.

Reimplemented in genie::DMDISOutgoingDarkGenerator, genie::DMELOutgoingDarkGenerator, and genie::DMEOutgoingDarkGenerator.

Definition at line 59 of file OutgoingDarkGenerator.cxx.

60{
61// This method generates the final state dark matter
62
63 Interaction * interaction = evrec->Summary();
64
65 // Boost vector for [LAB] <-> [Nucleon Rest Frame] transforms
66 TVector3 beta = this->NucRestFrame2Lab(evrec);
67
68 // Neutrino 4p
69 TLorentzVector * p4v = evrec->Probe()->GetP4(); // v 4p @ LAB
70 p4v->Boost(-1.*beta); // v 4p @ Nucleon rest frame
71
72 // Look-up selected kinematics & other needed kinematical params
73 double Q2 = interaction->Kine().Q2(true);
74 double y = interaction->Kine().y(true);
75 double Ev = p4v->E();
76 double ml = interaction->FSPrimLepton()->Mass();
77 double ml2 = TMath::Power(ml,2);
78 double pv = TMath::Sqrt(TMath::Max(0.,Ev*Ev - ml2));
79
80 LOG("LeptonicVertex", pNOTICE)
81 << "Ev = " << Ev << ", Q2 = " << Q2 << ", y = " << y;
82
83 // Compute the final state primary lepton energy and momentum components
84 // along and perpendicular the neutrino direction
85 double El = Ev * (1. - y);
86 double plp = (2.*Ev*El - 2.*ml2 - Q2) / (2.*pv);
87 double plt = TMath::Sqrt(TMath::Max(0.,El*El-plp*plp-ml2)); // p(-|)
88
89 LOG("LeptonicVertex", pNOTICE)
90 << "fsl: E = " << El << ", |p//| = " << plp << ", [pT] = " << plt;
91
92 // Randomize transverse components
93 RandomGen * rnd = RandomGen::Instance();
94 double phi = 2*kPi * rnd->RndLep().Rndm();
95 double pltx = plt * TMath::Cos(phi);
96 double plty = plt * TMath::Sin(phi);
97
98 // Take a unit vector along the neutrino direction @ the nucleon rest frame
99 TVector3 unit_nudir = p4v->Vect().Unit();
100
101 // Rotate lepton momentum vector from the reference frame (x'y'z') where
102 // {z':(neutrino direction), z'x':(theta plane)} to the nucleon rest frame
103 TVector3 p3l(pltx,plty,plp);
104 p3l.RotateUz(unit_nudir);
105
106 // Lepton 4-momentum in the nucleon rest frame
107 TLorentzVector p4l(p3l,El);
108
109 LOG("LeptonicVertex", pNOTICE)
110 << "fsl @ NRF: " << utils::print::P4AsString(&p4l);
111
112 // Boost final state primary lepton to the lab frame
113 p4l.Boost(beta); // active Lorentz transform
114
115 LOG("LeptonicVertex", pNOTICE)
116 << "fsl @ LAB: " << utils::print::P4AsString(&p4l);
117
118 // Figure out the Final State Lepton PDG Code
119 int pdgc = interaction->FSPrimLepton()->PdgCode();
120
121 // Create a GHepParticle and add it to the event record
122 this->AddToEventRecord(evrec, pdgc, p4l);
123
124 // Set final state lepton polarization
125 this->SetPolarization(evrec);
126
127 delete p4v;
128}
#define pNOTICE
Definition Messenger.h:61
TLorentzVector * GetP4(void) const
virtual GHepParticle * Probe(void) const
virtual Interaction * Summary(void) const
const Kinematics & Kine(void) const
Definition Interaction.h:71
double Q2(bool selected=false) const
double y(bool selected=false) const
virtual void SetPolarization(GHepRecord *ev) const
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
virtual TVector3 NucRestFrame2Lab(GHepRecord *ev) const
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
double Q2(const Interaction *const i)
string P4AsString(const TLorentzVector *p)

References AddToEventRecord(), genie::Interaction::FSPrimLepton(), genie::GHepParticle::GetP4(), genie::RandomGen::Instance(), genie::Interaction::Kine(), genie::constants::kPi, LOG, NucRestFrame2Lab(), genie::utils::print::P4AsString(), pNOTICE, genie::GHepRecord::Probe(), genie::Kinematics::Q2(), genie::RandomGen::RndLep(), SetPolarization(), genie::GHepRecord::Summary(), and genie::Kinematics::y().

Referenced by genie::DMDISOutgoingDarkGenerator::ProcessEventRecord(), and genie::DMELOutgoingDarkGenerator::ProcessEventRecord().

◆ SetPolarization()

void OutgoingDarkGenerator::SetPolarization ( GHepRecord * ev) const
virtual

Definition at line 215 of file OutgoingDarkGenerator.cxx.

216{
217// Set the final state lepton polarization. A mass-less lepton would be fully
218// polarized. This would be exact for neutrinos and a very good approximation
219// for electrons for the energies this generator is going to be used. This is
220// not the case for muons and, mainly, for taus. I need to refine this later.
221// How? See Kuzmin, Lyubushkin and Naumov, hep-ph/0312107
222
223 // get the final state primary lepton
224 GHepParticle * fsl = ev->FinalStatePrimaryLepton();
225 if(!fsl) {
226 LOG("LeptonicVertex", pERROR)
227 << "Final state lepton not set yet! \n" << *ev;
228 return;
229 }
230
231 // get (px,py,pz) @ LAB
232 TVector3 plab(fsl->Px(), fsl->Py(), fsl->Pz());
233
234 // in the limit m/E->0: leptons are left-handed and their anti-particles
235 // are right-handed
236 int pdgc = fsl->Pdg();
237 if(pdg::IsNeutrino(pdgc) || pdg::IsElectron(pdgc) ||
238 pdg::IsMuon(pdgc) || pdg::IsTau(pdgc) ) {
239 plab *= -1; // left-handed
240 }
241
242 LOG("LeptonicVertex", pINFO)
243 << "Setting polarization angles for particle: " << fsl->Name();
244
245 fsl->SetPolarization(plab);
246
247 if(fsl->PolzIsSet()) {
248 LOG("LeptonicVertex", pINFO)
249 << "Polarization (rad): Polar = " << fsl->PolzPolarAngle()
250 << ", Azimuthal = " << fsl->PolzAzimuthAngle();
251 }
252}
#define pERROR
Definition Messenger.h:59
string Name(void) const
Name that corresponds to the PDG code.
int Pdg(void) const
double PolzAzimuthAngle(void) const
double PolzPolarAngle(void) const
double Px(void) const
Get Px.
double Pz(void) const
Get Pz.
double Py(void) const
Get Py.
void SetPolarization(double theta, double phi)
bool PolzIsSet(void) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
bool IsTau(int pdgc)
Definition PDGUtils.cxx:208
bool IsNeutrino(int pdgc)
Definition PDGUtils.cxx:110
bool IsElectron(int pdgc)
Definition PDGUtils.cxx:188
bool IsMuon(int pdgc)
Definition PDGUtils.cxx:198

References genie::GHepRecord::FinalStatePrimaryLepton(), genie::pdg::IsElectron(), genie::pdg::IsMuon(), genie::pdg::IsNeutrino(), genie::pdg::IsTau(), LOG, genie::GHepParticle::Name(), genie::GHepParticle::Pdg(), pERROR, pINFO, genie::GHepParticle::PolzAzimuthAngle(), genie::GHepParticle::PolzIsSet(), genie::GHepParticle::PolzPolarAngle(), genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), and genie::GHepParticle::SetPolarization().

Referenced by genie::DMEOutgoingDarkGenerator::ProcessEventRecord(), and ProcessEventRecord().

Member Data Documentation

◆ fApplyCoulombCorrection

bool genie::OutgoingDarkGenerator::fApplyCoulombCorrection
protected

Definition at line 62 of file OutgoingDarkGenerator.h.

Referenced by AddToEventRecord(), and LoadConfig().


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