JetSmearer.cxx

Go to the documentation of this file.
00001 // JetSmearer.cxx
00002 //
00003 // Implementation of the Jet Smearer class
00004 //
00005 // Only the smear() method is overridden
00006 //
00007 //
00008 // Authors: H.T. Phillips, P.Clarke, E.Richter-Was, P.Sherwood, R.Steward
00009 //
00010 //
00011 
00012 #include "AtlfastAlgs/JetSmearer.h"
00013 #include "AtlfastAlgs/PhotonSmearer.h"
00014 #include <cmath>
00015 #include <iostream>
00016 
00017 #include "CLHEP/Vector/LorentzVector.h"
00018 #include "CLHEP/Random/JamesRandom.h"
00019 #include "CLHEP/Random/RandGauss.h"
00020 
00021 #include "CLHEP/Units/SystemOfUnits.h"
00022 
00023 namespace Atlfast {
00024 
00025   HepLorentzVector JetSmearer::smear(const HepMC::GenParticle& particle){
00026     return smear(particle.momentum());
00027   }
00028 
00029   HepLorentzVector JetSmearer::smear (const HepLorentzVector& vec) {
00030     // do the smearing, copied verbatim (except for ROOT dependencies)
00031     // from Jetmaker codein Atlfast++
00032     //
00033     // This code has not otherwise been altered which is why it is all very
00034     // procedural
00035     //
00036     
00037     //........................................................
00038     //.....smear clusters energy
00039     //........................................................
00040     float sigma=0.;
00041     if ( vec.e() == 0 ) return vec;
00042     HepLorentzVector smearedVec(vec);
00043     
00044     
00045     //     parametrizes smearing for hadronic energy deposition
00046     //     parametrization from L. Poggioli
00047     //     pile-up added as in HADCALO
00048     
00049     float epileup = 0;
00050     float aa, bb, cc, dd;
00051     float abseta  = fabs(vec.pseudoRapidity());
00052     float rcone;
00053     //make sure momentum, energy is in GeV
00054     float sqrtene = sqrt(vec.e()/GeV);
00055     float pt      = vec.perp()/GeV;
00056     if (fabs(vec.pseudoRapidity()) <= m_BarrelForwardEta) {rcone=m_rconeb;}else{rcone=m_rconef;}
00057     if(rcone <= 0.4)                epileup = 0.4;
00058     if(rcone == 0.4)                epileup = 7.5;
00059     if(rcone > 0.4 && rcone <= 0.5) epileup = 12.0;
00060     if(rcone > 0.5 && rcone <= 0.7) epileup = 18.0;
00061     if(rcone > 0.7)                 epileup = 20.0;
00062     
00063     if(m_lumi <= 1) {
00064       while(1) {
00065         aa=randGauss()->fire();
00066         bb=randGauss()->fire();
00067         if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03;
00068         else            sigma = aa*1.0/sqrtene + bb*0.07;
00069         if(1.+sigma > .0) break;
00070       }
00071     } else if(m_lumi == 2) {
00072       while(1) {
00073         aa=randGauss()->fire();
00074         bb=randGauss()->fire();
00075         cc=randGauss()->fire();
00076         dd=randGauss()->fire();
00077         if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03  + cc*epileup/pt;
00078         else            sigma = aa*1.0/sqrtene + bb*0.07  + cc*epileup/pt;
00079         if(1.+sigma > .0) break;
00080       }
00081       
00082     }                                
00083     smearedVec.setPx(vec.px()*(1.0+sigma));
00084     smearedVec.setPy(vec.py()*(1.0+sigma));
00085     smearedVec.setPz(vec.pz()*(1.0+sigma));
00086     smearedVec.setE(vec.e()*(1.0+sigma));
00087     
00088     
00089     return smearedVec;
00090     
00091   }
00092   
00093   //cct: implement the setSmearParameters method
00094   int JetSmearer::setSmearParameters (const std::vector<double>& /*smearValues*/){
00095     return 0;
00096   }
00097   //cct: implement the setSmearParamSchema method
00098   int JetSmearer::setSmearParamSchema ( const int /*smearSchema*/){
00099     return 0;
00100   }
00101   
00102 }//end of namespace bracket
00103 
00104 
00105 
00106 
00107 
00108 
00109 

Generated on Mon Sep 24 14:19:12 2007 for AtlfastAlgs by  doxygen 1.5.1