Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
genie::EventRecordVisitorI genie::Algorithm genie::DMDISOutgoingDarkGenerator genie::DMELOutgoingDarkGenerator genie::DMEOutgoingDarkGenerator

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. 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...
 

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. 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
 
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

bool fApplyCoulombCorrection
 
- 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< boolfOwnerships
 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...
 

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)
 

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 physics.wisc.edu> University of Wisconsin-Madison

Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

October 03, 2004

Copyright (c) 2003-2020, 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::OutgoingDarkGenerator ( )
protected

Definition at line 36 of file OutgoingDarkGenerator.cxx.

36  :
38 {
39 
40 }
OutgoingDarkGenerator::OutgoingDarkGenerator ( string  name)
protected

Definition at line 42 of file OutgoingDarkGenerator.cxx.

42  :
44 {
45 
46 }
static QCString name
Definition: declinfo.cpp:673
OutgoingDarkGenerator::OutgoingDarkGenerator ( string  name,
string  config 
)
protected

Definition at line 48 of file OutgoingDarkGenerator.cxx.

48  :
50 {
51 
52 }
static QCString name
Definition: declinfo.cpp:673
static Config * config
Definition: config.cpp:1054
OutgoingDarkGenerator::~OutgoingDarkGenerator ( )
protectedvirtual

Definition at line 54 of file OutgoingDarkGenerator.cxx.

55 {
56 
57 }

Member Function Documentation

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 }
int Z(void) const
bool IsInverseMuDecay(void) const
const int kPdgCoulobtron
Definition: PDGCodes.h:213
bool IsIMDAnnihilation(void) const
static const double kAem
Definition: Constants.h:56
Summary information for an interaction.
Definition: Interaction.h:56
const double e
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsNuElectronElastic(void) const
#define pINFO
Definition: Messenger.h:62
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
#define A
Definition: memgrp.cpp:38
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
double NonNegative(double x)
Definition: MathUtils.cxx:273
int A(void) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
#define pDEBUG
Definition: Messenger.h:63
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
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 {
263  this->LoadConfig();
264 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
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
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 }
double beta(double KE, const simb::MCParticle *part)
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:91
const InitialState & InitState(void) const
Definition: Interaction.h:69
const Target & Tgt(void) const
Definition: InitialState.h:66
Initial State information.
Definition: InitialState.h:48
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
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 }
double beta(double KE, const simb::MCParticle *part)
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
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
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: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
TLorentzVector * GetP4(void) const
virtual void SetPolarization(GHepRecord *ev) const
const Kinematics & Kine(void) const
Definition: Interaction.h:71
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
virtual TVector3 NucRestFrame2Lab(GHepRecord *ev) const
double Q2(bool selected=false) const
Definition: Kinematics.cxx:125
#define pNOTICE
Definition: Messenger.h:61
static const double kPi
Definition: Constants.h:37
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
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 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
#define pERROR
Definition: Messenger.h:59
double PolzPolarAngle(void) const
Definition: GHepParticle.h:119
void SetPolarization(double theta, double phi)
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
int Pdg(void) const
Definition: GHepParticle.h:63
string Name(void) const
Name that corresponds to the PDG code.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:326
bool IsTau(int pdgc)
Definition: PDGUtils.cxx:205
#define pINFO
Definition: Messenger.h:62
bool IsMuon(int pdgc)
Definition: PDGUtils.cxx:195
bool PolzIsSet(void) const
double PolzAzimuthAngle(void) const
Definition: GHepParticle.h:120
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
bool IsElectron(int pdgc)
Definition: PDGUtils.cxx:185
double Py(void) const
Get Py.
Definition: GHepParticle.h:89

Member Data Documentation

bool genie::OutgoingDarkGenerator::fApplyCoulombCorrection
protected

Definition at line 62 of file OutgoingDarkGenerator.h.


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