CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CrossSection.h
Go to the documentation of this file.
1 //-*-C++-*-
2 //-*-CrossSection.h-*-
3 // Written by James Monk and Andrew Pilkington
5 
6 #ifndef CROSSSECTION_HH
7 #define CROSSSECTION_HH
8 
9 #include <cmath>
10 #include <complex>
11 #include <cstdlib>
12 #include <iostream>
13 #include <map>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 //#include "CLHEP/config/CLHEP.h"
19 #include "CLHEP/Vector/LorentzVector.h"
20 #include "CLHEP/Vector/ThreeVector.h"
21 
24 //#include "GeneratorInterface/ExhumeInterface/interface/PythiaRecord.h"
26 
28 
29 //#include "CLHEP/HepMC/include/PythiaWrapper6_2.h"
30 //#include "CLHEP/HepMC/ConvertHEPEVT.h"
31 //#include "CLHEP/HepMC/CBhepevt.h"
32 
33 namespace CLHEP {
34 class HepRandomEngine;
35 }
36 
38 namespace Exhume{
39 
40  typedef std::pair<double,double> fEntry;
41  typedef std::pair<const char*,char*> PCharPair;
42  typedef std::pair<const char*,const void*> PConstVoidPair;
43 
44  class CrossSection{
45 
46  public:
47 
49  virtual ~CrossSection();
50  virtual void MaximiseSubParameters()=0;
51  virtual void SetPartons()=0;
52  virtual void SetSubParameters()=0;
53  virtual double SubParameterRange()=0;
54  virtual double SubParameterWeight()=0;
55 
56  double AlphaS(const double&);
57 
58  inline void SetRandomEngine(CLHEP::HepRandomEngine* engine){randomEngine = engine;}
59 
60  inline double GetRg(const double &x_, const double &Qt){
61 
62  return(Rg_(x_, Qt) );
63  };
64 
65  //.....
66  inline double Differential(){
67 
68  if(x1>1.0 || x2 > 1.0){
69  return(0.0);
70  }
71 
72  //return( SubProcess() );
73 
74  //Factor of 2/sqrt(sHat) because we integrate dM not dln(M^2)
75  return( 2.0 * InvSqrtsHat * Lumi() * SubProcess() * exp(B*(t1 + t2)));
76  };
77  //.....
78 
79  inline double GetB(){
80  return(B);
81  };
82 
83  inline double GetRoot_s(){
84  return(root_s);
85  };
86 
87  inline std::map<double,double> Getfg2Map(){
88  return(fg2Map);
89  };
90 
91  inline CLHEP::HepLorentzVector GetProton1(){
92  return(Proton1);
93  };
94 
95  inline CLHEP::HepLorentzVector GetProton2(){
96  return(Proton2);
97  };
98 
99  inline std::vector<Particle> GetPartons(){
100  return(Partons);
101  };
102 
103  inline double Getx1(){
104  return(x1);
105  };
106 
107  inline double Getx2(){
108  return(x2);
109  };
110 
111  inline double Gett1(){
112  return(t1);
113  };
114 
115  inline double Gett2(){
116  return(t2);
117  };
118 
119  inline double GetsHat(){
120  return(sHat);
121  };
122 
123  inline double GetSqrtsHat(){
124  return(SqrtsHat);
125  };
126 
127  inline double GetEta(){
128  return(y);
129  };
130 
131  inline double GetPhi1(){
132  return(Phi1);
133  };
134 
135  inline double GetPhi2(){
136  return(Phi2);
137  };
138 
139  void Hadronise();
140  void SetKinematics(const double&, const double&,
141  const double&, const double&,
142  const double&, const double&);
143 
145  return(Name);
146  };
147 
148  private:
149 
150  void AlphaSInit();
151 
152  double Fg1Fg2(const double&, const double&, const double&);
153  double Fg1Fg2(const int&, const double&, const double&);
154 
155  inline double Fg_Qt2(const double &Qt2_,
156  const double &x_, const double &xp_){
157 
158  double grad = 5.0 * (Txg(1.1 * Qt2_, x_) - Txg(0.9 * Qt2_, x_) ) / Qt2_;
159 
160  //protect from Qt2 == 0
161 
162  if(grad!=grad){
163 
164  return(0.0);
165  }
166  return(grad);
167  };
168 
169  template <typename T_>
170  inline void insert(const std::string _name_, const T_ _x_){
171  PMap.insert
172  (std::pair<std::string,PConstVoidPair>
173  (_name_,PConstVoidPair(typeid(_x_).name(),_x_)));
174  }
175 
176  virtual double SubProcess() = 0;
177 
178  void LumiInit();
179  double Lumi();
180  double Lumi_();
181  void NoMem();
182  void ReadCard(const std::string&);
183  double Splitting(const double&);
184  double T(const double&);
185  double TFast(const double&);
186 
188  std::map<double, std::map<double, double> > TMap2d;
189  std::map<double, std::map<double, double> >::iterator TMjuHigh, TMjuLow;
190 
191  double Txg(const double&, const double&);
192 
193  double Rg1Rg2(const double&);
194  double Rg_(const double&, double);
195 
196  std::map<double, std::map<double, double> > RgMap2d;
197  std::map<double, std::map<double, double> >::iterator RgHigh[2], RgLow[2];
199 
200  double B,
201  Freeze,
202  LambdaQCD,
203  Rg,
204  Survive;
205 
206  double PDF;
207 
208  double ASFreeze, ASConst;
209  //.............................
210  //Used for Lumi function:
211 
213  LumSimpsIncr;
214  unsigned int LumAccuracy, LumNStart;
216  double *LumSimpsFunc, *_Qt2, *_Qt, *_KtLow, *_KtHigh,
218  double LumConst;
220 
221  std::map<std::string,PConstVoidPair> PMap;
222  std::map<const char*,char*> TypeMap;
223  std::map<double, double> fg2Map;
224 
225  //...............................
226  //Used for T:
227  double TConst;
228  int Tn, Tn_1;
229  double *TFunc;
230 
231  //...............................
232  //Used for Splitting:
233  double Inv3;
234 
236 
237  protected:
238 
240 
241  std::complex<double> F0(const double&);
242  std::complex<double> f(const double&);
243  std::complex<double> Fsf(const double&);
244 
245  //PPhi is azimuthal angle between protons.
246  //InvSqrtsHat = 1/sHat
247  //Others are obvious.
248  double x1, x1p, x2, x2p, t1, t2, sHat, SqrtsHat,
250  Mju2, Mju, LnMju2,
251  Pt1, Pt2, Pt1DotPt2,
252  x1x2, ey;
253 
254  double AlphaEw,
255  gw,
256  HiggsVev,
257  LambdaW;
258 
259  double BottomMass,
260  CharmMass,
261  StrangeMass,
262  TopMass;
263 
264  double MuonMass,
265  TauMass;
266 
267  double HiggsMass,
268  WMass,
269  ZMass;
270 
272  double root_s,
273  s, Invs;
274 
275  CLHEP::HepLorentzVector CentralVector;
276  CLHEP::HepLorentzVector Proton1, Proton2, P1In, P2In;
277  /*
278  struct Particle {
279  CLHEP::HepLorentzVector p;
280  int id;
281  };
282  */
283 
284  std::vector<Particle> Partons;
286 
287  double Gev2fb;
288 
290 
291  CLHEP::HepRandomEngine* randomEngine;
292  };
293 }
294 
295 #endif
296 
double Txg(const double &, const double &)
std::map< double, std::map< double, double > >::iterator RgLow[2]
Definition: CrossSection.h:197
unsigned int LumAccuracy
Definition: CrossSection.h:214
CLHEP::HepLorentzVector CentralVector
Definition: CrossSection.h:275
CrossSection(const edm::ParameterSet &)
void insert(const std::string _name_, const T_ _x_)
Definition: CrossSection.h:170
std::map< std::string, PConstVoidPair > PMap
Definition: CrossSection.h:221
std::string lhapdfSetPath_
Definition: CrossSection.h:289
std::complex< double > f(const double &)
double T(const double &)
double Rg1Rg2(const double &)
std::complex< double > F0(const double &)
std::string GetName()
Definition: CrossSection.h:144
std::vector< Particle > Partons
Definition: CrossSection.h:284
std::complex< double > Fsf(const double &)
CLHEP::HepLorentzVector Proton2
Definition: CrossSection.h:276
std::map< double, double > fg2Map
Definition: CrossSection.h:223
CLHEP::HepLorentzVector GetProton1()
Definition: CrossSection.h:91
std::vector< Particle > GetPartons()
Definition: CrossSection.h:99
std::map< double, std::map< double, double > > TMap2d
Definition: CrossSection.h:188
std::map< const char *, char * > TypeMap
Definition: CrossSection.h:222
void SetKinematics(const double &, const double &, const double &, const double &, const double &, const double &)
std::map< double, std::map< double, double > >::iterator TMjuLow
Definition: CrossSection.h:189
CLHEP::HepLorentzVector Proton1
Definition: CrossSection.h:276
std::pair< const char *, const void * > PConstVoidPair
Definition: CrossSection.h:42
std::pair< const char *, char * > PCharPair
Definition: CrossSection.h:41
double TFast(const double &)
double AlphaS(const double &)
virtual double SubParameterWeight()=0
void ReadCard(const std::string &)
virtual void SetSubParameters()=0
std::map< double, std::map< double, double > >::iterator TMjuHigh
Definition: CrossSection.h:189
double Splitting(const double &)
double Fg_Qt2(const double &Qt2_, const double &x_, const double &xp_)
Definition: CrossSection.h:155
CLHEP::HepLorentzVector GetProton2()
Definition: CrossSection.h:95
CLHEP::HepLorentzVector P1In
Definition: CrossSection.h:276
std::pair< double, double > fEntry
Definition: CrossSection.h:40
double Rg_(const double &, double)
CLHEP::HepRandomEngine * randomEngine
Definition: CrossSection.h:291
void SetRandomEngine(CLHEP::HepRandomEngine *engine)
Definition: CrossSection.h:58
std::map< double, std::map< double, double > > RgMap2d
Definition: CrossSection.h:196
virtual double SubParameterRange()=0
unsigned int LumNStart
Definition: CrossSection.h:214
std::map< double, double > Getfg2Map()
Definition: CrossSection.h:87
virtual double SubProcess()=0
virtual void SetPartons()=0
CLHEP::HepLorentzVector P2In
Definition: CrossSection.h:276
double GetRg(const double &x_, const double &Qt)
Definition: CrossSection.h:60
double Fg1Fg2(const double &, const double &, const double &)
virtual void MaximiseSubParameters()=0
std::map< double, std::map< double, double > >::iterator RgHigh[2]
Definition: CrossSection.h:197