CMS 3D CMS Logo

CrossSection.h

Go to the documentation of this file.
00001 //-*-C++-*-
00002 //-*-CrossSection.h-*-
00003 //   Written by James Monk and Andrew Pilkington
00005 
00006 #ifndef CROSSSECTION_HH
00007 #define CROSSSECTION_HH
00008 
00009 #include <cmath>
00010 #include <complex.h>
00011 #include <cstdlib>
00012 #include <iostream>
00013 #include <map>
00014 #include <string>
00015 #include <utility>
00016 #include <vector>
00017 
00018 #include "CLHEP/config/CLHEP.h"
00019 #include "CLHEP/Vector/LorentzVector.h"
00020 #include "CLHEP/Vector/ThreeVector.h"
00021 
00022 #include "GeneratorInterface/ExhumeInterface/interface/I.h"
00023 #include "GeneratorInterface/ExhumeInterface/interface/PI.h"
00024 //#include "GeneratorInterface/ExhumeInterface/interface/PythiaRecord.h"
00025 #include "GeneratorInterface/ExhumeInterface/interface/Particle.h"
00026 
00027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00028 
00029 //#include "CLHEP/HepMC/include/PythiaWrapper6_2.h"
00030 //#include "CLHEP/HepMC/ConvertHEPEVT.h"
00031 //#include "CLHEP/HepMC/CBhepevt.h"
00032 
00034 namespace Exhume{
00035   
00036   typedef std::pair<double,double> fEntry;
00037   typedef std::pair<const char*,char*> PCharPair;
00038   typedef std::pair<const char*,const void*> PConstVoidPair;
00039   
00040   class CrossSection{
00041 
00042   public:
00043 
00044     CrossSection(const edm::ParameterSet&);
00045     virtual ~CrossSection();
00046     virtual void MaximiseSubParameters()=0;
00047     virtual void SetPartons()=0;
00048     virtual void SetSubParameters()=0;
00049     virtual double SubParameterRange()=0;
00050     virtual double SubParameterWeight()=0;
00051 
00052     double AlphaS(const double&);
00053 
00054     inline double GetRg(const double &x_, const double &Qt){
00055 
00056       return(Rg_(x_, Qt) );
00057     };
00058 
00059     //.....
00060     inline double Differential(){
00061 
00062       if(x1>1.0 || x2 > 1.0){
00063         return(0.0);
00064       }
00065 
00066       //return( SubProcess() );
00067 
00068       //Factor of 2/sqrt(sHat) because we integrate dM not dln(M^2)
00069       return( 2.0 * InvSqrtsHat * Lumi() * SubProcess() * exp(B*(t1 + t2))); 
00070     };
00071     //.....
00072 
00073     inline double GetB(){
00074       return(B);
00075     };
00076 
00077     inline double GetRoot_s(){
00078       return(root_s);
00079     };
00080 
00081     inline std::map<double,double> Getfg2Map(){
00082       return(fg2Map);
00083     };
00084 
00085     inline HepLorentzVector GetProton1(){
00086       return(Proton1);
00087     };
00088 
00089     inline HepLorentzVector GetProton2(){
00090       return(Proton2);
00091     };
00092 
00093     inline std::vector<Particle> GetPartons(){
00094       return(Partons);
00095     };
00096 
00097     inline double Getx1(){
00098       return(x1);
00099     };
00100     
00101     inline double Getx2(){
00102       return(x2);
00103     };
00104 
00105     inline double Gett1(){
00106       return(t1);
00107     };
00108 
00109     inline double Gett2(){
00110       return(t2);
00111     };
00112     
00113     inline double GetsHat(){
00114       return(sHat);
00115     };
00116 
00117     inline double GetSqrtsHat(){
00118       return(SqrtsHat);
00119     };
00120 
00121     inline double GetEta(){
00122       return(y);
00123     };
00124 
00125     inline double GetPhi1(){
00126       return(Phi1);
00127     };
00128 
00129     inline double GetPhi2(){
00130       return(Phi2);
00131     };
00132 
00133     void Hadronise();
00134     void SetKinematics(const double&, const double&,
00135                        const double&, const double&, 
00136                        const double&, const double&);
00137 
00138     inline std::string GetName(){
00139       return(Name);
00140     };
00141 
00142   private:
00143 
00144     void AlphaSInit();
00145 
00146     double Fg1Fg2(const double&, const double&, const double&);
00147     double Fg1Fg2(const int&, const double&, const double&);
00148 
00149     inline double Fg_Qt2(const double &Qt2_, 
00150                          const double &x_, const double &xp_){
00151 
00152       double grad = 5.0 * (Txg(1.1 * Qt2_, x_) - Txg(0.9 * Qt2_, x_) ) / Qt2_;
00153 
00154       //protect from Qt2 == 0
00155 
00156       if(grad!=grad){
00157 
00158         return(0.0);
00159       }
00160       return(grad);    
00161     };
00162     
00163     template <typename T_>
00164     inline void insert(const std::string _name_, const T_ _x_){
00165       PMap.insert
00166         (std::pair<std::string,PConstVoidPair>
00167          (_name_,PConstVoidPair(typeid(_x_).name(),_x_)));
00168     }
00169 
00170     virtual double SubProcess() = 0;
00171 
00172     void LumiInit();
00173     double Lumi();
00174     double Lumi_();
00175     void NoMem();
00176     void   ReadCard(const std::string&);
00177     double Splitting(const double&);
00178     double T(const double&);
00179     double TFast(const double&);
00180 
00181     bool TBegin, TInterpolate;
00182     std::map<double, std::map<double, double> > TMap2d;
00183     std::map<double, std::map<double, double> >::iterator TMjuHigh, TMjuLow;
00184 
00185     double Txg(const double&, const double&);
00186 
00187     double Rg1Rg2(const double&);
00188     double Rg_(const double&, double);
00189 
00190     std::map<double, std::map<double, double> > RgMap2d;
00191     std::map<double, std::map<double, double> >::iterator RgHigh[2], RgLow[2];
00192     bool RgInterpolate[2], RgBegin;
00193 
00194     double B,
00195       Freeze,
00196       LambdaQCD,
00197       Rg,
00198       Survive;
00199 
00200     double PDF;
00201       
00202     double ASFreeze, ASConst;
00203     //.............................
00204     //Used for Lumi function:
00205     
00206     double MinQt2, MidQt2, InvMidQt2, InvMidQt4, InvMaxQt2,
00207       LumSimpsIncr;
00208     unsigned int LumAccuracy, LumNStart;
00209     int LumNSimps, LumNSimps_1;
00210     double *LumSimpsFunc, *_Qt2, *_Qt, *_KtLow, *_KtHigh, 
00211       *_AlphaS, *_CfAs_2PIRg, *_NcAs_2PI;
00212     double LumConst;
00213     double Inv2PI, Nc_2PI, Cf_2PIRg;
00214 
00215     std::map<std::string,PConstVoidPair> PMap;
00216     std::map<const char*,char*> TypeMap;
00217     std::map<double, double> fg2Map;
00218 
00219     //...............................
00220     //Used for T:
00221     double TConst;
00222     int Tn, Tn_1;
00223     double *TFunc;
00224 
00225     //...............................
00226     //Used for Splitting:
00227     double Inv3;
00228 
00229     int Proton1Id, Proton2Id;
00230 
00231   protected:
00232 
00233     std::string Name;
00234 
00235     complex<double> F0(const double&);
00236     complex<double> f(const double&);
00237     complex<double> Fsf(const double&);
00238 
00239     //PPhi is azimuthal angle between protons.  
00240     //InvSqrtsHat = 1/sHat
00241     //Others are obvious.
00242     double x1, x1p, x2, x2p, t1, t2, sHat,  SqrtsHat,
00243       sHat2, InvsHat, InvsHat2, InvSqrtsHat, y, PPhi, Phi1, Phi2,
00244       Mju2, Mju, LnMju2,
00245       Pt1, Pt2, Pt1DotPt2,
00246       x1x2, ey;
00247 
00248     double AlphaEw,
00249       gw,
00250       HiggsVev,
00251       LambdaW;
00252 
00253     double BottomMass,
00254       CharmMass,
00255       StrangeMass,
00256       TopMass;
00257 
00258     double MuonMass,
00259       TauMass;
00260 
00261     double HiggsMass,
00262       WMass,
00263       ZMass;
00264 
00265     int FNAL_or_LHC;
00266     double root_s,
00267       s, Invs;
00268 
00269     HepLorentzVector CentralVector;
00270     HepLorentzVector Proton1, Proton2, P1In, P2In;
00271     /*
00272     struct Particle {
00273       HepLorentzVector p;
00274       int id;
00275     };
00276     */
00277 
00278     std::vector<Particle> Partons;
00279     double Invsx1x2, InvV1MinusV2;
00280 
00281     double Gev2fb;
00282 
00283     std::string lhapdfSetPath_; 
00284   };
00285 }
00286 
00287 #endif

Generated on Tue Jun 9 17:36:53 2009 for CMSSW by  doxygen 1.5.4