Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::FermiMover Class Reference

It visits the event record & computes a Fermi motion momentum for initial state nucleons bound in nuclei. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <FermiMover.h>

Inheritance diagram for genie::FermiMover:
genie::EventRecordVisitorI genie::Algorithm

Public Member Functions

 FermiMover ()
 
 FermiMover (string config)
 
 ~FermiMover ()
 
void ProcessEventRecord (GHepRecord *event_rec) 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...
 

Private Member Functions

void KickHitNucleon (GHepRecord *evrec) const
 give hit nucleon a momentum More...
 
void AddTargetNucleusRemnant (GHepRecord *evrec) const
 add a recoiled nucleus remnant More...
 
void LoadConfig (void)
 

Private Attributes

bool fKeepNuclOnMassShell
 keep hit bound nucleon on the mass shell? More...
 
const NuclearModelIfNuclModel
 nuclear model More...
 
const SecondNucleonEmissionIfSecondEmitter
 

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

Detailed Description

It visits the event record & computes a Fermi motion momentum for initial state nucleons bound in nuclei. Is a concrete implementation of the EventRecordVisitorI interface.

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

October 08, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 35 of file FermiMover.h.

Constructor & Destructor Documentation

FermiMover::FermiMover ( )

Definition at line 65 of file FermiMover.cxx.

65  :
66 EventRecordVisitorI("genie::FermiMover")
67 {
68 
69 }
FermiMover::FermiMover ( string  config)

Definition at line 71 of file FermiMover.cxx.

71  :
72 EventRecordVisitorI("genie::FermiMover", config)
73 {
74 
75 }
static Config * config
Definition: config.cpp:1054
FermiMover::~FermiMover ( )

Definition at line 77 of file FermiMover.cxx.

78 {
79 
80 }

Member Function Documentation

void FermiMover::AddTargetNucleusRemnant ( GHepRecord evrec) const
private

add a recoiled nucleus remnant

Definition at line 224 of file FermiMover.cxx.

225 {
226 // add the remnant nuclear target at the GHEP record
227 
228  LOG("FermiMover", pINFO) << "Adding final state nucleus";
229 
230  double Px = 0;
231  double Py = 0;
232  double Pz = 0;
233  double E = 0;
234 
235  GHepParticle * nucleus = evrec->TargetNucleus();
236  int A = nucleus->A();
237  int Z = nucleus->Z();
238 
239  int fd = nucleus->FirstDaughter();
240  int ld = nucleus->LastDaughter();
241 
242  for(int id = fd; id <= ld; id++) {
243 
244  // compute A,Z for final state nucleus & get its PDG code and its mass
245  GHepParticle * particle = evrec->Particle(id);
246  assert(particle);
247  int pdgc = particle->Pdg();
248  bool is_p = pdg::IsProton (pdgc);
249  bool is_n = pdg::IsNeutron(pdgc);
250 
251  if (is_p) Z--;
252  if (is_p || is_n) A--;
253 
254  Px += particle->Px();
255  Py += particle->Py();
256  Pz += particle->Pz();
257  E += particle->E();
258 
259  }//daughters
260 
261  TParticlePDG * remn = 0;
262  int ipdgc = pdg::IonPdgCode(A, Z);
263  remn = PDGLibrary::Instance()->Find(ipdgc);
264  if(!remn) {
265  LOG("HadronicVtx", pFATAL)
266  << "No particle with [A = " << A << ", Z = " << Z
267  << ", pdgc = " << ipdgc << "] in PDGLibrary!";
268  assert(remn);
269  }
270 
271  double Mi = nucleus->Mass();
272  Px *= -1;
273  Py *= -1;
274  Pz *= -1;
275  E = Mi-E;
276 
277  // Add the nucleus to the event record
278  LOG("FermiMover", pINFO)
279  << "Adding nucleus [A = " << A << ", Z = " << Z
280  << ", pdgc = " << ipdgc << "]";
281 
282  int imom = evrec->TargetNucleusPosition();
283  evrec->AddParticle(
284  ipdgc,kIStStableFinalState, imom,-1,-1,-1, Px,Py,Pz,E, 0,0,0,0);
285 }
int Z(void) const
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
double E(void) const
Get energy.
Definition: GHepParticle.h:91
int FirstDaughter(void) const
Definition: GHepParticle.h:68
#define pFATAL
Definition: Messenger.h:56
double Mass(void) const
Mass that corresponds to the PDG code.
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
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
int LastDaughter(void) const
Definition: GHepParticle.h:69
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:286
#define pINFO
Definition: Messenger.h:62
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
E
Definition: 018_def.c:13
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
#define A
Definition: memgrp.cpp:38
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
int A(void) const
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:362
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
void FermiMover::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 287 of file FermiMover.cxx.

288 {
289  Algorithm::Configure(config);
290  this->LoadConfig();
291 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
Definition: FermiMover.cxx:299
void FermiMover::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 293 of file FermiMover.cxx.

294 {
296  this->LoadConfig();
297 }
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void LoadConfig(void)
Definition: FermiMover.cxx:299
void FermiMover::KickHitNucleon ( GHepRecord evrec) const
private

give hit nucleon a momentum

Definition at line 100 of file FermiMover.cxx.

101 {
102  Interaction * interaction = evrec -> Summary();
103  InitialState * init_state = interaction -> InitStatePtr();
104  Target * tgt = init_state -> TgtPtr();
105 
106  // do nothing for non-nuclear targets
107  if(!tgt->IsNucleus()) return;
108 
109  TLorentzVector * p4 = tgt->HitNucP4Ptr();
110 
111  // do nothing if the struct nucleon 4-momentum was set (eg as part of the
112  // initial state selection)
113  if(p4->Px()>0 || p4->Py()>0 || p4->Pz()>0) return;
114 
115  // access the hit nucleon and target nucleus at the GHEP record
116  GHepParticle * nucleon = evrec->HitNucleon();
117  GHepParticle * nucleus = evrec->TargetNucleus();
118  assert(nucleon);
119  assert(nucleus);
120 
121  // generate a Fermi momentum & removal energy
122  // call GenerateNucleon with a radius in case the model is LocalFGM
123  double rad = nucleon->X4()->Vect().Mag();
124  fNuclModel->GenerateNucleon(*tgt,rad);
125 
126  TVector3 p3 = fNuclModel->Momentum3();
127  double w = fNuclModel->RemovalEnergy();
128 
129  LOG("FermiMover", pINFO)
130  << "Generated nucleon momentum: ("
131  << p3.Px() << ", " << p3.Py() << ", " << p3.Pz() << "), "
132  << "|p| = " << p3.Mag();
133  LOG("FermiMover", pINFO)
134  << "Generated nucleon removal energy: w = " << w;
135 
136  double pF2 = p3.Mag2(); // (fermi momentum)^2
137 
138  nucleon->SetRemovalEnergy(w);
139 
140  // struck nucleon energy:
141  // two possible prescriptions depending on whether you want to force
142  // the sruck nucleon to be on the mass-shell or not...
143 
144  double EN=0;
146 
147  // EffectiveSF treatment
148  if (interaction_type == kFermiMoveEffectiveSF1p1h) {
149  EN = nucleon->Mass() - w - pF2 / (2 * (nucleus->Mass() - nucleon->Mass()));
150  } else if (interaction_type == kFermiMoveEffectiveSF2p2h_eject ||
151  interaction_type == kFermiMoveEffectiveSF2p2h_noeject) {
152 
153  int other_nucleon_pdg = nucleon->Pdg() == kPdgProton ? kPdgNeutron : kPdgProton ;
154  TParticlePDG * other_nucleon = PDGLibrary::Instance()->Find( other_nucleon_pdg );
155 
156  TParticlePDG * deuteron = PDGLibrary::Instance()->Find(1000010020);
157  EN = deuteron->Mass() - 2 * w - TMath::Sqrt(pF2 + other_nucleon->Mass() * other_nucleon->Mass());
158 
159  // Do default Fermi Moving
160  } else {
161  if (!fKeepNuclOnMassShell) {
162  //-- compute A,Z for final state nucleus & get its PDG code
163  int nucleon_pdgc = nucleon->Pdg();
164  bool is_p = pdg::IsProton(nucleon_pdgc);
165  int Z = (is_p) ? nucleus->Z()-1 : nucleus->Z();
166  int A = nucleus->A() - 1;
167 
168  TParticlePDG * fnucleus = 0;
169  int ipdgc = pdg::IonPdgCode(A, Z);
170  fnucleus = PDGLibrary::Instance()->Find(ipdgc);
171  if(!fnucleus) {
172  LOG("FermiMover", pFATAL)
173  << "No particle with [A = " << A << ", Z = " << Z
174  << ", pdgc = " << ipdgc << "] in PDGLibrary!";
175  exit(1);
176  }
177  //-- compute the energy of the struck (off the mass-shell) nucleus
178 
179  double Mf = fnucleus -> Mass(); // remnant nucleus mass
180  double Mi = nucleus -> Mass(); // initial nucleus mass
181 
182  EN = Mi - TMath::Sqrt(pF2 + Mf*Mf);
183  } else {
184  double MN = nucleon->Mass();
185  double MN2 = TMath::Power(MN,2);
186  EN = TMath::Sqrt(MN2+pF2);
187  }
188 
189  }
190 
191  //-- update the struck nucleon 4p at the interaction summary and at
192  // the GHEP record
193  p4->SetPx( p3.Px() );
194  p4->SetPy( p3.Py() );
195  p4->SetPz( p3.Pz() );
196  p4->SetE ( EN );
197 
198  nucleon->SetMomentum(*p4); // update GHEP value
199 
200  // Sometimes, for interactions near threshold, Fermi momentum might bring
201  // the neutrino energy in the nucleon rest frame below threshold (for the
202  // selected interaction). In this case mark the event as unphysical and
203  // abort the current thread.
204  const KPhaseSpace & kps = interaction->PhaseSpace();
205  if(!kps.IsAboveThreshold()) {
206  LOG("FermiMover", pNOTICE)
207  << "Event below threshold after generating Fermi momentum";
208 
209  double Ethr = kps.Threshold();
210  double Ev = init_state->ProbeE(kRfHitNucRest);
211  LOG("FermiMover", pNOTICE)
212  << "Ev (@ nucleon rest frame) = " << Ev << ", Ethr = " << Ethr;
213 
214  evrec->EventFlags()->SetBitNumber(kBelowThrNRF, true);
216  exception.SetReason("E < Ethr after generating nucleon Fermi momentum");
217  exception.SwitchOnFastForward();
218  throw exception;
219  }
220 
221 
222 }
int Z(void) const
const KPhaseSpace & PhaseSpace(void) const
Definition: Interaction.h:73
static constexpr double rad
Definition: Units.h:164
double RemovalEnergy(void) const
Definition: NuclearModelI.h:65
double Threshold(void) const
Energy threshold.
Definition: KPhaseSpace.cxx:80
#define pFATAL
Definition: Messenger.h:56
bool IsNucleus(void) const
Definition: Target.cxx:272
double Mass(Resonance_t res)
resonance mass (GeV)
void SetMomentum(const TLorentzVector &p4)
double Mass(void) const
Mass that corresponds to the PDG code.
const TVector3 & Momentum3(void) const
Definition: NuclearModelI.h:75
FermiMoverInteractionType_t GetFermiMoverInteractionType(void) const
Definition: NuclearModelI.h:80
int Pdg(void) const
Definition: GHepParticle.h:63
Summary information for an interaction.
Definition: Interaction.h:56
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
Kinematical phase space.
Definition: KPhaseSpace.h:33
const NuclearModelI * fNuclModel
nuclear model
Definition: FermiMover.h:59
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:286
#define pINFO
Definition: Messenger.h:62
enum genie::EFermiMoverInteractionType FermiMoverInteractionType_t
void SetRemovalEnergy(double Erm)
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
virtual TBits * EventFlags(void) const
Definition: GHepRecord.h:117
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:306
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.
#define A
Definition: memgrp.cpp:38
virtual bool GenerateNucleon(const Target &) const =0
const int kPdgProton
Definition: PDGCodes.h:81
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
int A(void) const
#define pNOTICE
Definition: Messenger.h:61
bool fKeepNuclOnMassShell
keep hit bound nucleon on the mass shell?
Definition: FermiMover.h:58
double ProbeE(RefFrame_t rf) const
const int kPdgNeutron
Definition: PDGCodes.h:83
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Initial State information.
Definition: InitialState.h:48
void FermiMover::LoadConfig ( void  )
private

Definition at line 299 of file FermiMover.cxx.

300 {
301  RgKey nuclkey = "NuclearModel";
302  fNuclModel = 0;
303  fNuclModel = dynamic_cast<const NuclearModelI *> (this->SubAlg(nuclkey));
304  assert(fNuclModel);
305 
306  this->GetParamDef("KeepHitNuclOnMassShell", fKeepNuclOnMassShell, false);
307 
308  RgKey nuclearrecoilkey = "SecondNucleonEmitter" ;
309  fSecondEmitter = dynamic_cast<const SecondNucleonEmissionI *> (this->SubAlg(nuclearrecoilkey));
310 
311  assert(fSecondEmitter);
312 
313 }
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
Definition: NuclearModelI.h:46
const SecondNucleonEmissionI * fSecondEmitter
Definition: FermiMover.h:61
const NuclearModelI * fNuclModel
nuclear model
Definition: FermiMover.h:59
Interface to drive the a second nucleon emission from a nucleus Specfic impelmentations will have dif...
string RgKey
bool GetParamDef(const RgKey &name, T &p, const T &def) const
bool fKeepNuclOnMassShell
keep hit bound nucleon on the mass shell?
Definition: FermiMover.h:58
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345
void FermiMover::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 82 of file FermiMover.cxx.

83 {
84  // skip if not a nuclear target
85  if(! evrec->Summary()->InitState().Tgt().IsNucleus()) return;
86 
87  // skip if no hit nucleon is set
88  if(! evrec->HitNucleon()) return;
89 
90  // give hit nucleon a Fermi momentum
91  this->KickHitNucleon(evrec);
92 
93  // handle the addition of the recoil nucleon
95 
96  // add a recoiled nucleus remnant
97  this->AddTargetNucleusRemnant(evrec);
98 }
void ProcessEventRecord(GHepRecord *event_rec) const
Definition: FermiMover.cxx:82
void KickHitNucleon(GHepRecord *evrec) const
give hit nucleon a momentum
Definition: FermiMover.cxx:100
const SecondNucleonEmissionI * fSecondEmitter
Definition: FermiMover.h:61
void AddTargetNucleusRemnant(GHepRecord *evrec) const
add a recoiled nucleus remnant
Definition: FermiMover.cxx:224

Member Data Documentation

bool genie::FermiMover::fKeepNuclOnMassShell
private

keep hit bound nucleon on the mass shell?

Definition at line 58 of file FermiMover.h.

const NuclearModelI* genie::FermiMover::fNuclModel
private

nuclear model

Definition at line 59 of file FermiMover.h.

const SecondNucleonEmissionI* genie::FermiMover::fSecondEmitter
private

Definition at line 61 of file FermiMover.h.


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