herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
BaryonFormFactor.h
1 // -*- C++ -*-
2 #ifndef HERWIG_BaryonFormFactor_H
3 #define HERWIG_BaryonFormFactor_H
4 //
5 // This is the declaration of the BaryonFormFactor class.
6 //
7 #include "ThePEG/Interface/Interfaced.h"
8 #include "BaryonFormFactor.fh"
9 #include "ThePEG/Config/Complex.h"
10 
11 namespace Herwig {
12 using namespace ThePEG;
13 
92 
93 public:
94 
98  BaryonFormFactor() : _numbermodes() {}
99 
106  void persistentOutput(PersistentOStream & os) const;
107 
113  void persistentInput(PersistentIStream & is, int version);
115 
119  static void Init();
120 
121 protected:
122 
129  virtual IBPtr clone() const {return new_ptr(*this);}
130 
135  virtual IBPtr fullclone() const {return new_ptr(*this);}
137 
138 public:
139 
142 
150  int formFactorNumber(int in,int out,bool & cc) const {
151  int output(-1);
152  unsigned int ix(0);
153  if(_incomingid.size()==0){return output;}
154  do {
155  if(_incomingid[ix]== in && _outgoingid[ix]== out) {
156  cc=false;
157  output=ix;
158  }
159  else if (_incomingid[ix]==-in && _outgoingid[ix]==-out) {
160  cc=true;
161  output=ix;
162  }
163  ++ix;
164  }
165  while(ix<_incomingid.size()&&output<0);
166  return output;
167  }
168 
175  void particleID(int iloc,int& id0,int& id1) {
176  id0=_incomingid[iloc];
177  id1=_outgoingid[iloc];
178  }
179 
190  void formFactorInfo(int iloc,int & ispin,int & ospin,int & spect1,
191  int & spect2, int & inquark,int & outquark) {
192  ispin = _incomingJ[iloc];
193  ospin = _outgoingJ[iloc];
194  spect1 = _spectator1[iloc];
195  spect2 = _spectator2[iloc];
196  inquark = _inquark[iloc];
197  outquark = _outquark[iloc];
198  }
199 
211  void formFactorInfo(int in,int out,int & ispin,int & ospin,int & spect1,
212  int & spect2, int & inquark,int & outquark) {
213  bool dummy;
214  unsigned int ix=formFactorNumber(in,out,dummy);
215  formFactorInfo(ix,ispin,ospin,spect1,spect2,inquark,outquark);
216  }
217 
221  unsigned int numberOfFactors() const {return _incomingid.size();}
223 
224 public:
225 
247  virtual void SpinHalfSpinHalfFormFactor(Energy2 q2,int iloc, int id0, int id1,
248  Energy m0, Energy m1,
249  Complex & f1v,Complex & f2v,Complex & f3v,
250  Complex & f1a,Complex & f2a,Complex & f3a);
251 
273  virtual void SpinHalfSpinThreeHalfFormFactor(Energy2 q2,int iloc, int id0, int id1,
274  Energy m0, Energy m1,
275  Complex & g1v,Complex & g2v,Complex & g3v,
276  Complex & g4v,Complex & g1a,Complex & g2a,
277  Complex & g3a,Complex & g4a);
279 
286  virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
287 
288 protected:
289 
301  void addFormFactor(int in,int out,int inspin, int outspin, int spect1,
302  int spect2, int inquark,int outquark) {
303  _incomingid.push_back(in);
304  _outgoingid.push_back(out);
305  _incomingJ.push_back(inspin);
306  _outgoingJ.push_back(outspin);
307  _spectator1.push_back(spect1);
308  _spectator2.push_back(spect2);
309  _inquark.push_back(inquark);
310  _outquark.push_back(outquark);
311  }
312 
317  void initialModes(unsigned int nmodes) {_numbermodes=nmodes;}
318 
322  unsigned int initialModes() const {return _numbermodes;}
323 
324 protected:
325 
333  virtual void doinit();
335 
336 private:
337 
341  BaryonFormFactor & operator=(const BaryonFormFactor &) = delete;
342 
343  private:
344 
348  vector<int> _incomingid;
349 
353  vector<int> _outgoingid;
354 
358  vector<int> _incomingJ;
359 
363  vector<int> _outgoingJ;
364 
368  vector<int> _spectator1;
369 
373  vector<int> _spectator2;
374 
378  vector<int> _inquark;
379 
383  vector<int> _outquark;
384 
388  unsigned int _numbermodes;
389 };
390 
391 }
392 
393 #endif /* HERWIG_BaryonFormFactor_H */
int formFactorNumber(int in, int out, bool &cc) const
Find the location for a given pair of particle.
vector< int > _outgoingJ
spin of the outgoing particle
std::complex< double > Complex
vector< int > _incomingid
the id&#39;s of the incoming particles
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
vector< int > _spectator2
the id of the second spectator quark
vector< int > _incomingJ
spin of the incoming particle
void initialModes(unsigned int nmodes)
Set initial number of modes.
void particleID(int iloc, int &id0, int &id1)
Get the particle ids for an entry.
BaryonFormFactor()
Default constructor.
void formFactorInfo(int in, int out, int &ispin, int &ospin, int &spect1, int &spect2, int &inquark, int &outquark)
Information on the form factor.
vector< int > _outgoingid
the id&#39;s of the outgoing particles
vector< int > _spectator1
the id of the first spectator quark
vector< int > _inquark
the id of the decaying quark
The BaryonFormFactor class is the base class for the implementation of the form-factors for the weak ...
unsigned int initialModes() const
Get the initial number of modes.
-*- C++ -*-
virtual IBPtr clone() const
Make a simple clone of this object.
unsigned int _numbermodes
The initial number of modes.
vector< int > _outquark
the id of the outgoing quark
void addFormFactor(int in, int out, int inspin, int outspin, int spect1, int spect2, int inquark, int outquark)
Add a form factor to the list.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void formFactorInfo(int iloc, int &ispin, int &ospin, int &spect1, int &spect2, int &inquark, int &outquark)
Information on the form factor.
unsigned int numberOfFactors() const
number of form factors