ReinSehgalSPPPXSec.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 */
9 //____________________________________________________________________________
10 
22 
23 using namespace genie;
24 using namespace genie::constants;
25 
26 //____________________________________________________________________________
28 XSecAlgorithmI("genie::ReinSehgalSPPPXSec")
29 {
30 
31 }
32 //____________________________________________________________________________
34 XSecAlgorithmI("genie::ReinSehgalSPPPXSec", config)
35 {
36 
37 }
38 //____________________________________________________________________________
40 {
41 
42 }
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 //____________________________________________________________________________
138 {
139  return fXSecIntegrator->Integrate(this,interaction);
140 }
141 //____________________________________________________________________________
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 //____________________________________________________________________________
Cross Section Calculation Interface.
static SppChannel_t FromInteraction(const Interaction *interaction)
Definition: SppChannel.h:276
Basic constants.
double Integral(const Interaction *i) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
#define pERROR
Definition: Messenger.h:59
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
static double IsospinWeight(SppChannel_t channel, Resonance_t res)
Definition: SppChannel.h:200
enum genie::EKinePhaseSpace KinePhaseSpace_t
enum genie::EResonance Resonance_t
unsigned int NResonances(void) const
void SetResonance(Resonance_t res)
Definition: XclsTag.cxx:128
enum genie::ESppChannel SppChannel_t
static string AsString(SppChannel_t channel)
Definition: SppChannel.h:65
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:96
static Config * config
Definition: config.cpp:1054
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
Resonance_t Resonance(void) const
Definition: XclsTag.h:69
#define pWARN
Definition: Messenger.h:60
static double BranchingRatio(SppChannel_t, Resonance_t res)
Definition: SppChannel.h:244
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:65
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.
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:63
Resonance_t ResonanceId(unsigned int ires) const
const Algorithm * SubAlg(const RgKey &registry_key) const
Definition: Algorithm.cxx:345