GENIEGenerator
Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for genie::RSPPResonanceSelector:
[legend]

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

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

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.
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 inherited from genie::HadronicSystemGenerator
const EventRecordVisitorIfPreINukeDecayer
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)

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 <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n November 18, 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 31 of file RSPPResonanceSelector.h.

Constructor & Destructor Documentation

◆ RSPPResonanceSelector() [1/2]

RSPPResonanceSelector::RSPPResonanceSelector ( )

Definition at line 34 of file RSPPResonanceSelector.cxx.

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

References genie::HadronicSystemGenerator::HadronicSystemGenerator().

◆ RSPPResonanceSelector() [2/2]

RSPPResonanceSelector::RSPPResonanceSelector ( string config)

Definition at line 40 of file RSPPResonanceSelector.cxx.

40 :
41HadronicSystemGenerator("genie::RSPPResonanceSelector", config)
42{
43
44}

References genie::HadronicSystemGenerator::HadronicSystemGenerator().

◆ ~RSPPResonanceSelector()

RSPPResonanceSelector::~RSPPResonanceSelector ( )

Definition at line 46 of file RSPPResonanceSelector.cxx.

47{
48
49}

Member Function Documentation

◆ AddResonance()

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}
#define pNOTICE
Definition Messenger.h:61
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
TLorentzVector Hadronic4pLAB(GHepRecord *event_rec) const
int ResonanceCharge(GHepRecord *event_rec) const
const XclsTag & ExclTag(void) const
Definition Interaction.h:72
Resonance_t Resonance(void) const
Definition XclsTag.h:69
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
@ kIStPreDecayResonantState
Definition GHepStatus.h:36
enum genie::EResonance Resonance_t
enum genie::EGHepStatus GHepStatus_t

References genie::GHepRecord::AddParticle(), genie::Interaction::ExclTag(), genie::HadronicSystemGenerator::Hadronic4pLAB(), genie::GHepRecord::HitNucleonPosition(), genie::kIStPreDecayResonantState, LOG, genie::utils::res::PdgCode(), pNOTICE, genie::XclsTag::Resonance(), genie::HadronicSystemGenerator::ResonanceCharge(), and genie::GHepRecord::Summary().

Referenced by ProcessEventRecord().

◆ Configure() [1/2]

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

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

◆ Configure() [2/2]

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}

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

◆ LoadConfig()

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}
#define pINFO
Definition Messenger.h:62
#define pDEBUG
Definition Messenger.h:63
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition Messenger.h:84
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
BaryonResList fResList
baryon resonances taken into account

References fResList, genie::Algorithm::GetParam(), LOG, pDEBUG, pINFO, and SLOG.

Referenced by Configure(), and Configure().

◆ ProcessEventRecord()

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}
XclsTag * ExclTagPtr(void) const
Definition Interaction.h:77
Resonance_t SelectResonance(GHepRecord *event_rec) const
void AddResonance(GHepRecord *event_rec) const
void SetResonance(Resonance_t res)
Definition XclsTag.cxx:128

References AddResonance(), genie::Interaction::ExclTagPtr(), genie::kNoResonance, SelectResonance(), genie::XclsTag::SetResonance(), and genie::GHepRecord::Summary().

◆ SelectResonance()

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
87 RunningThreadInfo * rtinfo = RunningThreadInfo::Instance();
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}
#define pERROR
Definition Messenger.h:59
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
Kinematics * KinePtr(void) const
Definition Interaction.h:76
void ClearRunningValues(void)
void UseSelectedKinematics(void)
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
TRandom3 & RndGen(void) const
rnd number generator for generic usage
Definition RandomGen.h:80
static RunningThreadInfo * Instance(void)
const EventGeneratorI * RunningThread(void)
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
bool IsDelta(Resonance_t res)
is it a Delta resonance?
const char * AsString(Resonance_t res)
resonance id -> string
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition Interaction.h:48
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition Interaction.h:47

References genie::utils::res::AsString(), genie::Kinematics::ClearRunningValues(), genie::EventGeneratorI::CrossSectionAlg(), genie::Interaction::ExclTagPtr(), fResList, genie::RandomGen::Instance(), genie::RunningThreadInfo::Instance(), genie::utils::res::IsDelta(), genie::Interaction::KinePtr(), genie::kISkipKinematicChk, genie::kISkipProcessChk, genie::kNoResonance, genie::kPSWQ2fE, LOG, pDEBUG, pERROR, pNOTICE, genie::HadronicSystemGenerator::ResonanceCharge(), genie::RandomGen::RndGen(), genie::RunningThreadInfo::RunningThread(), genie::XclsTag::SetResonance(), SLOG, genie::GHepRecord::Summary(), genie::Kinematics::UseSelectedKinematics(), and genie::XSecAlgorithmI::XSec().

Referenced by ProcessEventRecord().

Member Data Documentation

◆ fResList

BaryonResList genie::RSPPResonanceSelector::fResList
private

baryon resonances taken into account

Definition at line 52 of file RSPPResonanceSelector.h.

Referenced by LoadConfig(), and SelectResonance().


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