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