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

Generates an intermediate baryon resonance for exclusive interactions proceeding through resonance productions and adds it to the event record. The resonance is selected based on its contribution to the selected exclusive reaction cross section. Is a concrete implementation of the EventRecordVisitorI interface. More...

#include <RSPPResonanceSelector.h>

Inheritance diagram for genie::RSPPResonanceSelector:
genie::HadronicSystemGenerator genie::EventRecordVisitorI genie::Algorithm

Public Member Functions

 RSPPResonanceSelector ()
 
 RSPPResonanceSelector (string config)
 
 ~RSPPResonanceSelector ()
 
void ProcessEventRecord (GHepRecord *event_rec) const
 
void Configure (const Registry &config)
 
void Configure (string param_set)
 
- 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 LoadConfig (void)
 
Resonance_t SelectResonance (GHepRecord *event_rec) const
 
void AddResonance (GHepRecord *event_rec) const
 

Private Attributes

BaryonResList fResList
 baryon resonances taken into account 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)
 
- 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
 
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< 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

Generates an intermediate baryon resonance for exclusive interactions proceeding through resonance productions and adds it to the event record. The resonance is selected based on its contribution to the selected exclusive reaction cross section. Is a concrete implementation of the EventRecordVisitorI interface.

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

November 18, 2004

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

Definition at line 31 of file RSPPResonanceSelector.h.

Constructor & Destructor Documentation

RSPPResonanceSelector::RSPPResonanceSelector ( )

Definition at line 34 of file RSPPResonanceSelector.cxx.

34  :
35 HadronicSystemGenerator("genie::RSPPResonanceSelector")
36 {
37 
38 }
RSPPResonanceSelector::RSPPResonanceSelector ( string  config)

Definition at line 40 of file RSPPResonanceSelector.cxx.

40  :
41 HadronicSystemGenerator("genie::RSPPResonanceSelector", config)
42 {
43 
44 }
static Config * config
Definition: config.cpp:1054
RSPPResonanceSelector::~RSPPResonanceSelector ( )

Definition at line 46 of file RSPPResonanceSelector.cxx.

47 {
48 
49 }

Member Function Documentation

void RSPPResonanceSelector::AddResonance ( GHepRecord event_rec) const
private

Definition at line 155 of file RSPPResonanceSelector.cxx.

156 {
157  // compute RES p4 = p4(neutrino) + p4(hit nucleon) - p4(primary lepton)
158  TLorentzVector p4 = this->Hadronic4pLAB(evrec);
159 
160  //-- Determine the RES pdg code (from the selected Resonance_t & charge)
161  Interaction * interaction = evrec->Summary();
162  Resonance_t res = interaction->ExclTag().Resonance();
163  int charge = this->ResonanceCharge(evrec);
164  int pdgc = utils::res::PdgCode(res,charge);
165 
166  LOG("RESSelector", pNOTICE)
167  << "Adding RES with PDGC = " << pdgc << ", Q = " << charge;
168 
169  //-- Add the resonance at the EventRecord
171  int mom = evrec->HitNucleonPosition();
172 
173  evrec->AddParticle(
174  pdgc, ist, mom,-1,-1,-1, p4.Px(),p4.Py(),p4.Pz(),p4.E(), 0,0,0,0);
175 }
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
enum genie::EResonance Resonance_t
Summary information for an interaction.
Definition: Interaction.h:56
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Resonance_t Resonance(void) const
Definition: XclsTag.h:69
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
int ResonanceCharge(GHepRecord *event_rec) const
#define pNOTICE
Definition: Messenger.h:61
enum genie::EGHepStatus GHepStatus_t
void RSPPResonanceSelector::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 177 of file RSPPResonanceSelector.cxx.

178 {
179  Algorithm::Configure(config);
180  this->LoadConfig();
181 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void RSPPResonanceSelector::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 183 of file RSPPResonanceSelector.cxx.

184 {
185  Algorithm::Configure(param_set);
186  this->LoadConfig();
187 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void RSPPResonanceSelector::LoadConfig ( void  )
private

Definition at line 189 of file RSPPResonanceSelector.cxx.

190 {
191  fResList.Clear();
192  string resonances = "";
193  this->GetParam("ResonanceNameList", resonances);
194  SLOG("RESSelector", pDEBUG) << "Resonance list: " << resonances;
195 
196  fResList.DecodeFromNameList(resonances);
197  LOG("RESSelector", pINFO) << fResList;
198 }
void DecodeFromNameList(string list, string delimiter=",")
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
BaryonResList fResList
baryon resonances taken into account
#define pDEBUG
Definition: Messenger.h:63
void RSPPResonanceSelector::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Implements genie::EventRecordVisitorI.

Definition at line 51 of file RSPPResonanceSelector.cxx.

52 {
53  //-- select a baryon resonance
54  Resonance_t res = this->SelectResonance(evrec);
55  assert(res != kNoResonance);
56 
57  //-- add the resonance at the event summary
58  Interaction * interaction = evrec->Summary();
59  interaction->ExclTagPtr()->SetResonance(res);
60 
61  //-- add an entry at the GHep event record & the event summary
62  this->AddResonance(evrec);
63 }
Resonance_t SelectResonance(GHepRecord *event_rec) const
enum genie::EResonance Resonance_t
void SetResonance(Resonance_t res)
Definition: XclsTag.cxx:128
Summary information for an interaction.
Definition: Interaction.h:56
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
void AddResonance(GHepRecord *event_rec) const
Resonance_t RSPPResonanceSelector::SelectResonance ( GHepRecord event_rec) const
private

Definition at line 65 of file RSPPResonanceSelector.cxx.

66 {
67 // Select a baryon resonance from a list of considered resonances based on
68 // their differential d^2xsec/dWdQ^2 cross sections
69 
70  LOG("RESSelector", pNOTICE) << "Selecting a baryon resonance";
71 
72  Interaction * interaction = evrec->Summary();
73 
74  //-- Figure out what the resonance charge should be.
75  int q_res = this->ResonanceCharge(evrec);
76 
77  //-- Use selected kinematics
78  interaction->KinePtr()->UseSelectedKinematics();
79 
80  //-- Trust kinematics and process type already set.
81  interaction->SetBit(kISkipProcessChk);
82  interaction->SetBit(kISkipKinematicChk);
83 
84  //-- Access cross section algorithm for running thread
85  // The algorithm must be able to compute the RES contribution to
86  // the specified RES/SPP channel
88  const EventGeneratorI * evg = rtinfo->RunningThread();
89  const XSecAlgorithmI * xsecalg = evg->CrossSectionAlg();
90 
91  //-- Loop over all considered baryon resonances and compute the double
92  // differential cross section for the selected kinematical variables
93 
94  double xsec_sum = 0;
95  unsigned int nres = fResList.NResonances();
96  vector<double> xsec_vec(nres);
97 
98  for(unsigned int ires = 0; ires < nres; ires++) {
99 
100  //-- Current resonance
101  Resonance_t res = fResList.ResonanceId(ires);
102 
103  //-- Set the current resonance at the interaction summary
104  // compute the differential cross section d^2xsec/dWdQ^2
105  // (do it only for resonances that can conserve charge)
106  interaction->ExclTagPtr()->SetResonance(res);
107 
108  double xsec = 0;
109  bool skip = (q_res==2 && !utils::res::IsDelta(res));
110 
111  if(!skip) xsec = xsecalg->XSec(interaction,kPSWQ2fE);
112  else {
113  SLOG("RESSelector", pNOTICE)
114  << "RES: " << utils::res::AsString(res)
115  << " would not conserve charge -- skipping it";
116  }
117  //-- For the ith resonance store the sum of (xsec) * (breit-wigner)
118  // for the resonances in the range [0,i]
119  xsec_sum += xsec;
120  xsec_vec[ires] = xsec_sum;
121 
122  SLOG("RESSelector", pNOTICE)
123  << "Resonances (0->" << ires << "): "
124  << "Sum{ BW(W) * d^2xsec(E,W,Q^2)/dWd*Q^2 } = " << xsec_sum;
125  } // res
126 
127  //-- Reset 'trust' bits
128  interaction->ResetBit(kISkipProcessChk);
129  interaction->ResetBit(kISkipKinematicChk);
130 
131  //-- Reset running kinematics
132  interaction->KinePtr()->ClearRunningValues();
133 
134  //-- Use the computed differential cross sections to select a resonance
135  RandomGen * rnd = RandomGen::Instance();
136  double R = xsec_sum * rnd->RndGen().Rndm();
137 
138  SLOG("RESSelector", pDEBUG) << "R = " << R;
139 
140  for(unsigned int ires = 0; ires < nres; ires++) {
141  SLOG("RESSelector", pDEBUG)
142  << "SUM-XSEC(0->" << ires <<") = " << xsec_vec[ires];
143 
144  if(R < xsec_vec[ires]) {
145  Resonance_t sres = fResList.ResonanceId(ires); // selected RES.
146  LOG("RESSelector", pNOTICE)
147  << "Selected RES = " << utils::res::AsString(sres);
148  return sres;
149  }
150  }
151  LOG("RESSelector", pERROR) << "** Failed to select a resonance";
152  return kNoResonance;
153 }
bool IsDelta(Resonance_t res)
is it a Delta resonance?
Cross Section Calculation Interface.
#define pERROR
Definition: Messenger.h:59
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
Defines the EventGeneratorI interface.
enum genie::EResonance Resonance_t
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
unsigned int NResonances(void) const
void SetResonance(Resonance_t res)
Definition: XclsTag.cxx:128
Summary information for an interaction.
Definition: Interaction.h:56
void UseSelectedKinematics(void)
Definition: Kinematics.cxx:359
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition: Interaction.h:48
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
static RunningThreadInfo * Instance(void)
int ResonanceCharge(GHepRecord *event_rec) const
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition: RandomGen.h:80
const char * AsString(Resonance_t res)
resonance id -> string
#define pNOTICE
Definition: Messenger.h:61
void ClearRunningValues(void)
Definition: Kinematics.cxx:347
const EventGeneratorI * RunningThread(void)
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
Keep info on the event generation thread currently on charge. This is used so that event generation m...
BaryonResList fResList
baryon resonances taken into account
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
#define pDEBUG
Definition: Messenger.h:63
Resonance_t ResonanceId(unsigned int ires) const

Member Data Documentation

BaryonResList genie::RSPPResonanceSelector::fResList
private

baryon resonances taken into account

Definition at line 52 of file RSPPResonanceSelector.h.


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