CellSmearer.cxx

Go to the documentation of this file.
00001 // CellSmearer.cxx
00002 //
00003 // Implementation of the Cell Smearer class
00004 //
00005 // Only the smear() method is overridden
00006 // Based on JetSmearer, lowlumi, 0.1*0.1
00007 //
00008 // Authors: J.Couchman
00009 //
00010 //
00011 
00012 #include "AtlfastAlgs/CellSmearer.h"
00013 #include <cmath>
00014 #include <iostream>
00015 #include "CLHEP/Vector/LorentzVector.h"
00016 #include "CLHEP/Random/JamesRandom.h"
00017 #include "CLHEP/Random/RandGauss.h"
00018 #include "CLHEP/Units/SystemOfUnits.h"
00019 
00020 
00021 namespace Atlfast {
00022 
00023   HepLorentzVector CellSmearer::smear(const HepMC::GenParticle& particle){
00024     return smear(particle.momentum());
00025   }
00026 
00027   HepLorentzVector CellSmearer::smear (const HepLorentzVector& vec) {
00028 //........................................................
00029 //.....smear Cells energy
00030 //........................................................
00031 //     parametrizes smearing for hadronic energy deposition
00032 //     parametrization from L. Poggioli
00033 //     no pileup added
00034 
00035     float sigma=0.;
00036     HepLorentzVector smearedVec(vec);
00037     float aa, bb;
00038     float sqrtene = sqrt(vec.e()/GeV);
00039     float abseta  = fabs(vec.pseudoRapidity());
00040     while(1) {
00041       aa=randGauss()->fire();
00042       bb=randGauss()->fire();
00043       if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03;
00044       else            sigma = aa*1.0/sqrtene + bb*0.07;
00045       if(1.+sigma > .0) break;
00046     }
00047     smearedVec.setPx(vec.px()*(1.0+sigma));
00048     smearedVec.setPy(vec.py()*(1.0+sigma));
00049     smearedVec.setPz(vec.pz()*(1.0+sigma));
00050     smearedVec.setE(vec.e()*(1.0+sigma));
00051     return smearedVec;
00052     
00053   }
00054 
00055   //cct: implement the setSmearParameters method
00056   int CellSmearer::setSmearParameters (const std::vector<double>& /*smearValues*/){
00057     return 0;
00058   }
00059   //cct: implement the setSmearParamSchema method
00060   int CellSmearer::setSmearParamSchema ( const int /*smearSchema*/){
00061     return 0;
00062   }
00063   
00064 }//end of namespace bracket
00065 
00066 
00067 
00068 
00069 
00070 
00071 

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