herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
ScalarFormFactor.h
1 // -*- C++ -*-
2 //
3 // ScalarFormFactor.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef HERWIG_ScalarFormFactor_H
10 #define HERWIG_ScalarFormFactor_H
11 //
12 // This is the declaration of the ScalarFormFactor class.
13 //
14 #include "ThePEG/Interface/Interfaced.h"
15 #include "ScalarFormFactor.fh"
16 #include "ThePEG/Config/Complex.h"
17 
18 namespace Herwig {
19 using namespace ThePEG;
20 
98 
99 public:
100 
104  ScalarFormFactor() : _numbermodes(0) {}
105 
106 public:
107 
114  void persistentOutput(PersistentOStream & os) const;
115 
121  void persistentInput(PersistentIStream & is, int version);
123 
127  static void Init();
128 
129 protected:
130 
137  virtual IBPtr clone() const {return new_ptr(*this);}
138 
143  virtual IBPtr fullclone() const {return new_ptr(*this);}
145 
146 public:
147 
150 
158  int formFactorNumber(int in,int out,bool & cc) const {
159  if(_incomingid.size()==0) return -1;
160  int output(-1);unsigned int ix(0);
161  do {
162  if(_incomingid[ix]== in && _outgoingid[ix]== out) {
163  cc=false;
164  output=ix;
165  }
166  else if (_incomingid[ix]==-in && _outgoingid[ix]==-out) {
167  cc=true;
168  output=ix;
169  }
170  else if(_incomingid[ix]==-in && _outgoingid[ix]==out &&
171  (abs(_outgoingid[ix])/100)%10==(abs(_outgoingid[ix])/10)%10) {
172  cc=true;
173  output=ix;
174  }
175  ++ix;
176  }
177  while(ix<_incomingid.size()&&output<0);
178  return output;
179  }
180 
187  void particleID(unsigned int iloc,int& id0,int& id1) const {
188  id0=_incomingid[iloc];
189  id1=_outgoingid[iloc];
190  }
191 
200  void formFactorInfo(unsigned int & iloc,int & ispin,int & spect,
201  int & inquark, int & outquark) const {
202  ispin = _outgoingJ[iloc];
203  spect = _spectator[iloc];
204  inquark = _inquark[iloc];
205  outquark = _outquark[iloc];
206  }
207 
217  void formFactorInfo(int in,int out,int & ispin,
218  int & spect,int & inquark, int & outquark) const {
219  bool dummy;
220  unsigned int ix(formFactorNumber(in,out,dummy));
221  formFactorInfo(ix,ispin,spect,inquark,outquark);
222  }
223 
227  unsigned int numberOfFactors() const {return _incomingid.size();}
229 
230 public:
231 
247  virtual void ScalarScalarFormFactor(Energy2 q2,unsigned int iloc,int id0,int id1,
248  Energy m0,Energy m1,Complex & f0,
249  Complex & fp) const;
250 
266  virtual void ScalarVectorFormFactor(Energy2 q2, unsigned int iloc, int id0, int id1,
267  Energy m0, Energy m1,Complex & A0,
268  Complex & A1,Complex & A2, Complex & V) const;
269 
285  virtual void ScalarTensorFormFactor(Energy2 q2,unsigned int iloc,int id0,int id1,
286  Energy m0, Energy m1, complex<InvEnergy2> & h,
287  Complex & k, complex<InvEnergy2> & bp,
288  complex<InvEnergy2> & bm) const;
289 
303  virtual void ScalarScalarSigmaFormFactor(Energy2 q2,unsigned int iloc,int id0,int id1,
304  Energy m0, Energy m1,Complex & fT) const;
305 
321  virtual void ScalarVectorSigmaFormFactor(Energy2 q2,unsigned int iloc,int id0,int id1,
322  Energy m0, Energy m1, Complex & T1,
323  Complex & T2, Complex & T3) const;
324 
326 
333  virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
334 
335 protected:
336 
346  void addFormFactor(int in,int out,int spin, int spect,
347  int inquark, int outquark) {
348  _incomingid.push_back(in);
349  _outgoingid.push_back(out);
350  _outgoingJ.push_back(spin);
351  _spectator.push_back(spect);
352  _inquark.push_back(inquark);
353  _outquark.push_back(outquark);
354  }
355 
360  void initialModes(unsigned int nmodes) {_numbermodes=nmodes;}
361 
365  unsigned int initialModes() const {return _numbermodes;}
366 
367 protected:
368 
376  virtual void doinit();
378 
379 private:
380 
384  ScalarFormFactor & operator=(const ScalarFormFactor &) = delete;
385 
386  private:
387 
391  vector<int> _incomingid;
392 
396  vector<int> _outgoingid;
397 
401  vector<int> _outgoingJ;
402 
406  vector<int> _spectator;
407 
411  vector<int> _inquark;
412 
416  vector<int> _outquark;
417 
421  unsigned int _numbermodes;
422 
423 };
424 
425 }
426 
427 #endif /* HERWIG_ScalarFormFactor_H */
The ScalarFormFactor class is the base class for the form factors for the weak decay of scalar to sca...
int formFactorNumber(int in, int out, bool &cc) const
Find the location for a given pair of particle.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
vector< int > _outgoingJ
spin of the outgoing particle
std::complex< double > Complex
void formFactorInfo(unsigned int &iloc, int &ispin, int &spect, int &inquark, int &outquark) const
Information on the form factor.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
void particleID(unsigned int iloc, int &id0, int &id1) const
Get the particle ids for an entry.
void initialModes(unsigned int nmodes)
Set initial number of modes.
ScalarFormFactor()
Default constructor.
vector< int > _inquark
the id of the decaying quark
virtual IBPtr clone() const
Make a simple clone of this object.
vector< int > _incomingid
the id&#39;s of the incoming particles
unsigned int _numbermodes
The initial number of modes.
vector< int > _outgoingid
the id&#39;s of the outgoing particles
vector< int > _outquark
the id of the outgoing quark
vector< int > _spectator
the id of the spectator quark
unsigned int numberOfFactors() const
number of form factors
void addFormFactor(int in, int out, int spin, int spect, int inquark, int outquark)
Add a form factor to the list.
unsigned int initialModes() const
Get the initial number of modes.
-*- C++ -*-
void formFactorInfo(int in, int out, int &ispin, int &spect, int &inquark, int &outquark) const
Information on the form factor.