CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 
23 //#include "GeneratorInterface/ExhumeInterface/interface/PythiaRecord.h"
25 
27 
28 //#include "CLHEP/HepMC/include/PythiaWrapper6_2.h"
29 //#include "CLHEP/HepMC/ConvertHEPEVT.h"
30 //#include "CLHEP/HepMC/CBhepevt.h"
31 
32 namespace CLHEP {
33  class HepRandomEngine;
34 }
35 
37 namespace Exhume {
38 
39  typedef std::pair<double, double> fEntry;
40  typedef std::pair<const char *, char *> PCharPair;
41  typedef std::pair<const char *, const void *> PConstVoidPair;
42 
43  class CrossSection {
44  public:
46  virtual ~CrossSection();
47  virtual void MaximiseSubParameters() = 0;
48  virtual void SetPartons() = 0;
49  virtual void SetSubParameters() = 0;
50  virtual double SubParameterRange() = 0;
51  virtual double SubParameterWeight() = 0;
52 
53  double AlphaS(const double &);
54 
55  inline void SetRandomEngine(CLHEP::HepRandomEngine *engine) { randomEngine = engine; }
56 
57  inline double GetRg(const double &x_, const double &Qt) { return (Rg_(x_, Qt)); };
58 
59  //.....
60  inline double Differential() {
61  if (x1 > 1.0 || x2 > 1.0) {
62  return (0.0);
63  }
64 
65  //return( SubProcess() );
66 
67  //Factor of 2/sqrt(sHat) because we integrate dM not dln(M^2)
68  return (2.0 * InvSqrtsHat * Lumi() * SubProcess() * exp(B * (t1 + t2)));
69  };
70  //.....
71 
72  inline double GetB() { return (B); };
73 
74  inline double GetRoot_s() { return (root_s); };
75 
76  inline std::map<double, double> Getfg2Map() { return (fg2Map); };
77 
78  inline CLHEP::HepLorentzVector GetProton1() { return (Proton1); };
79 
80  inline CLHEP::HepLorentzVector GetProton2() { return (Proton2); };
81 
82  inline std::vector<Particle> GetPartons() { return (Partons); };
83 
84  inline double Getx1() { return (x1); };
85 
86  inline double Getx2() { return (x2); };
87 
88  inline double Gett1() { return (t1); };
89 
90  inline double Gett2() { return (t2); };
91 
92  inline double GetsHat() { return (sHat); };
93 
94  inline double GetSqrtsHat() { return (SqrtsHat); };
95 
96  inline double GetEta() { return (y); };
97 
98  inline double GetPhi1() { return (Phi1); };
99 
100  inline double GetPhi2() { return (Phi2); };
101 
102  void Hadronise();
103  void SetKinematics(const double &, const double &, const double &, const double &, const double &, const double &);
104 
105  inline std::string GetName() { return (Name); };
106 
107  private:
108  void AlphaSInit();
109 
110  double Fg1Fg2(const double &, const double &, const double &);
111  double Fg1Fg2(const int &, const double &, const double &);
112 
113  inline double Fg_Qt2(const double &Qt2_, const double &x_, const double &xp_) {
114  double grad = 5.0 * (Txg(1.1 * Qt2_, x_) - Txg(0.9 * Qt2_, x_)) / Qt2_;
115 
116  //protect from Qt2 == 0
117 
118  if (grad != grad) {
119  return (0.0);
120  }
121  return (grad);
122  };
123 
124  template <typename T_>
125  inline void insert(const std::string _name_, const T_ _x_) {
126  PMap.insert(std::pair<std::string, PConstVoidPair>(_name_, PConstVoidPair(typeid(_x_).name(), _x_)));
127  }
128 
129  virtual double SubProcess() = 0;
130 
131  void LumiInit();
132  double Lumi();
133  double Lumi_();
134  void NoMem();
135  void ReadCard(const std::string &);
136  double Splitting(const double &);
137  double T(const double &);
138  double TFast(const double &);
139 
141  std::map<double, std::map<double, double> > TMap2d;
142  std::map<double, std::map<double, double> >::iterator TMjuHigh, TMjuLow;
143 
144  double Txg(const double &, const double &);
145 
146  double Rg1Rg2(const double &);
147  double Rg_(const double &, double);
148 
149  std::map<double, std::map<double, double> > RgMap2d;
150  std::map<double, std::map<double, double> >::iterator RgHigh[2], RgLow[2];
152 
154 
155  double PDF;
156 
157  double ASFreeze, ASConst;
158  //.............................
159  //Used for Lumi function:
160 
162  unsigned int LumAccuracy, LumNStart;
165  double LumConst;
167 
168  std::map<std::string, PConstVoidPair> PMap;
169  std::map<const char *, char *> TypeMap;
170  std::map<double, double> fg2Map;
171 
172  //...............................
173  //Used for T:
174  double TConst;
175  int Tn, Tn_1;
176  double *TFunc;
177 
178  //...............................
179  //Used for Splitting:
180  double Inv3;
181 
183 
184  protected:
186 
187  std::complex<double> F0(const double &);
188  std::complex<double> f(const double &);
189  std::complex<double> Fsf(const double &);
190 
191  //PPhi is azimuthal angle between protons.
192  //InvSqrtsHat = 1/sHat
193  //Others are obvious.
195  Mju, LnMju2, Pt1, Pt2, Pt1DotPt2, x1x2, ey;
196 
198 
200 
201  double MuonMass, TauMass;
202 
204 
206  double root_s, s, Invs;
207 
208  CLHEP::HepLorentzVector CentralVector;
209  CLHEP::HepLorentzVector Proton1, Proton2, P1In, P2In;
210  /*
211  struct Particle {
212  CLHEP::HepLorentzVector p;
213  int id;
214  };
215  */
216 
217  std::vector<Particle> Partons;
219 
220  double Gev2fb;
221 
223 
224  CLHEP::HepRandomEngine *randomEngine;
225  };
226 } // namespace Exhume
227 
228 #endif
229 
double Txg(const double &, const double &)
std::map< double, std::map< double, double > >::iterator RgLow[2]
Definition: CrossSection.h:150
unsigned int LumAccuracy
Definition: CrossSection.h:162
CLHEP::HepLorentzVector CentralVector
Definition: CrossSection.h:208
CrossSection(const edm::ParameterSet &)
void insert(const std::string _name_, const T_ _x_)
Definition: CrossSection.h:125
std::string lhapdfSetPath_
Definition: CrossSection.h:222
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:105
std::vector< Particle > Partons
Definition: CrossSection.h:217
std::pair< const char *, const void * > PConstVoidPair
Definition: CrossSection.h:41
std::complex< double > Fsf(const double &)
std::pair< double, double > fEntry
Definition: CrossSection.h:39
std::pair< const char *, char * > PCharPair
Definition: CrossSection.h:40
CLHEP::HepLorentzVector Proton2
Definition: CrossSection.h:209
std::map< double, double > fg2Map
Definition: CrossSection.h:170
CLHEP::HepLorentzVector GetProton1()
Definition: CrossSection.h:78
std::vector< Particle > GetPartons()
Definition: CrossSection.h:82
std::map< double, std::map< double, double > > TMap2d
Definition: CrossSection.h:141
void SetKinematics(const double &, const double &, const double &, const double &, const double &, const double &)
std::map< const char *, char * > TypeMap
Definition: CrossSection.h:169
std::map< double, std::map< double, double > >::iterator TMjuLow
Definition: CrossSection.h:142
CLHEP::HepLorentzVector Proton1
Definition: CrossSection.h:209
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:142
double Splitting(const double &)
double Fg_Qt2(const double &Qt2_, const double &x_, const double &xp_)
Definition: CrossSection.h:113
std::map< double, double > Getfg2Map()
Definition: CrossSection.h:76
CLHEP::HepLorentzVector GetProton2()
Definition: CrossSection.h:80
CLHEP::HepLorentzVector P1In
Definition: CrossSection.h:209
double Rg_(const double &, double)
CLHEP::HepRandomEngine * randomEngine
Definition: CrossSection.h:224
void SetRandomEngine(CLHEP::HepRandomEngine *engine)
Definition: CrossSection.h:55
std::map< double, std::map< double, double > > RgMap2d
Definition: CrossSection.h:149
std::map< std::string, PConstVoidPair > PMap
Definition: CrossSection.h:168
virtual double SubParameterRange()=0
unsigned int LumNStart
Definition: CrossSection.h:162
virtual double SubProcess()=0
virtual void SetPartons()=0
CLHEP::HepLorentzVector P2In
Definition: CrossSection.h:209
double GetRg(const double &x_, const double &Qt)
Definition: CrossSection.h:57
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:150