GENIEGenerator
Loading...
Searching...
No Matches
ReinSehgalSPPPXSec.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
22
23using namespace genie;
24using namespace genie::constants;
25
26//____________________________________________________________________________
28XSecAlgorithmI("genie::ReinSehgalSPPPXSec")
29{
30
31}
32//____________________________________________________________________________
34XSecAlgorithmI("genie::ReinSehgalSPPPXSec", config)
35{
36
37}
38//____________________________________________________________________________
43//____________________________________________________________________________
45 const Interaction * interaction, KinePhaseSpace_t kps) const
46{
47 if(! this -> ValidProcess (interaction) ) return 0.;
48 if(! this -> ValidKinematics (interaction) ) return 0.;
49#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
50 LOG("ReinSehgalSpp", pDEBUG)
51 << "Computing a cross section for " << *interaction;
52#endif
53 //-- Check whether a resonance has been specified
54 // If yes, compute only the contribution of this resonance at the
55 // specified exclusive state
56
57 Resonance_t inpres = interaction->ExclTag().Resonance();
58 if(inpres != kNoResonance) {
59#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
60 LOG("ReinSehgalSpp", pDEBUG)
61 << "Computing only the contribution from: " << utils::res::AsString(inpres);
62#endif
63 if(!fResList.Find(inpres)) {
64 LOG("ReinSehgalSpp", pWARN)
65 << "Resonance: " << utils::res::AsString(inpres) << " was not found in my list";
66 return 0;
67 }
68 //-- Compute the contribution of this resonance
69 //-- Get the Breit-Wigner weighted xsec for exciting the resonance
70
71 return fSingleResXSecModel->XSec(interaction,kps);
72 }
73
74 //-- Loop over the specified list of baryon resonances and compute
75 // the cross section for the input exclusive channel
76
77 return this->XSecNRES(interaction,kps);
78}
79//____________________________________________________________________________
81 const Interaction * interaction, KinePhaseSpace_t kps) const
82{
83// computes the 1pi cros section taking into account the contribution of all
84// specified baryon resonances
85
86 unsigned int nres = fResList.NResonances();
87#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
88 LOG("ReinSehgalSpp", pDEBUG)
89 << "Computing SPP cross section using " << nres << " resonances";
90#endif
91
92 //-- Get 1pi exclusive channel
93 SppChannel_t spp_channel = SppChannel::FromInteraction(interaction);
94#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
95 LOG("ReinSehgalSpp", pDEBUG)
96 << "SPP channel " << SppChannel::AsString(spp_channel);
97#endif
98
99 double xsec = 0;
100 for(unsigned int ires = 0; ires < nres; ires++) {
101
102 //-- Get next resonance from the resonance list
103 Resonance_t res = fResList.ResonanceId(ires);
104
105 //-- Set current resonance to interaction object
106 interaction->ExclTagPtr()->SetResonance(res);
107
108 //-- Get the BR for the (resonance) -> (exclusive final state)
109 double br = SppChannel::BranchingRatio(/*spp_channel,*/ res);
110
111 //-- Get the Isospin Clebsch-Gordon coefficient for the given resonance
112 // and exclusive final state
113 double igg = SppChannel::IsospinWeight(spp_channel, res);
114
115 //-- Compute the weighted xsec
116 // (total weight = Breit-Wigner * BR * isospin Clebsch-Gordon)
117 double res_xsec_contrib = fSingleResXSecModel->XSec(interaction,kps)*br*igg;
118#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
119 LOG("ReinSehgalSpp", pDEBUG)
120 << "Contrib. from [" << utils::res::AsString(res) << "] = "
121 << "<Clebsch-Gordon = " << igg
122 << "> * <BR(->1pi) = " << br
123 << "> * <Breit-Wigner * d^nxsec/dK^n = " << rxsec
124 << "> = " << res_xsec_contrib;
125#endif
126
127 //-- Add contribution of this resonance to the cross section
128 xsec += res_xsec_contrib;
129 }
130
131 //-- delete the resonance from the input interaction
132 interaction->ExclTagPtr()->SetResonance(kNoResonance);
133
134 return xsec;
135}
136//____________________________________________________________________________
137double ReinSehgalSPPPXSec::Integral(const Interaction * interaction) const
138{
139 return fXSecIntegrator->Integrate(this,interaction);
140}
141//____________________________________________________________________________
142bool ReinSehgalSPPPXSec::ValidProcess(const Interaction * interaction) const
143{
144 if(interaction->TestBit(kISkipProcessChk)) return true;
145
146 //-- Get the requested SPP channel
147 SppChannel_t spp_channel = SppChannel::FromInteraction(interaction);
148 if( spp_channel == kSppNull ) {
149 LOG("ReinSehgalSpp", pERROR)
150 << "\n *** Insufficient SPP exclusive final state information!";
151 return false;
152 }
153#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
154 LOG("ReinSehgalSpp", pDEBUG)
155 << "Reaction: " << SppChannel::AsString(spp_channel);
156#endif
157 return true;
158}
159//____________________________________________________________________________
161{
162 Algorithm::Configure(config);
163 this->LoadConfig();
164}
165//____________________________________________________________________________
167{
168 Algorithm::Configure(config);
169 this->LoadConfig();
170}
171//____________________________________________________________________________
173{
174// load the single resonance cross section algorithm specified in the config.
175
177 dynamic_cast<const XSecAlgorithmI *> (this->SubAlg("SingleRESDiffXSecAlg"));
178 assert(fSingleResXSecModel);
179
180 //-- Create a BaryonResList by decoding the resonance list from
181 // the XML input
182 // The list of resonances can be specified as a string with
183 // comma separated resonance names (eg "P33(1233),S11(1535),D13(1520)")
184 // The BaryonResList can also decode lists of pdg-codes or
185 // resonance-ids (Resonance_t enumerations).
186 // Support for this will be added here as well.
187
188 fResList.Clear();
189
190
191 string resonances ;
192 GetParam( "ResonanceNameList", resonances ) ;
193 fResList.DecodeFromNameList(resonances);
194
195 //-- load the differential cross section integrator
197 dynamic_cast<const XSecIntegratorI *> (this->SubAlg("XSec-Integrator"));
198 assert(fXSecIntegrator);
199}
200//____________________________________________________________________________
#define pERROR
Definition Messenger.h:59
#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
#define pWARN
Definition Messenger.h:60
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
const Algorithm * SubAlg(const RgKey &registry_key) const
Summary information for an interaction.
Definition Interaction.h:56
const XclsTag & ExclTag(void) const
Definition Interaction.h:72
XclsTag * ExclTagPtr(void) const
Definition Interaction.h:77
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
const XSecAlgorithmI * fSingleResXSecModel
void Configure(const Registry &config)
double XSecNRES(const Interaction *i, KinePhaseSpace_t k) const
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
double Integral(const Interaction *i) const
const XSecIntegratorI * fXSecIntegrator
static string AsString(SppChannel_t channel)
Definition SppChannel.h:76
static SppChannel_t FromInteraction(const Interaction *interaction)
Definition SppChannel.h:402
static double IsospinWeight(SppChannel_t channel, Resonance_t res)
Definition SppChannel.h:238
static double BranchingRatio(Resonance_t res)
Definition SppChannel.h:357
virtual bool ValidKinematics(const Interaction *i) const
Is the input kinematical point a physically allowed one?
Cross Section Integrator Interface.
void SetResonance(Resonance_t res)
Definition XclsTag.cxx:128
Resonance_t Resonance(void) const
Definition XclsTag.h:69
Basic constants.
const char * AsString(Resonance_t res)
resonance id -> string
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
enum genie::EResonance Resonance_t
@ kSppNull
Definition SppChannel.h:46
enum genie::EKinePhaseSpace KinePhaseSpace_t
enum genie::ESppChannel SppChannel_t
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition Interaction.h:47