Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ElectronSmearer.cxx

Go to the documentation of this file.
00001 // ElectronSmearer.cxx
00002 //
00003 // Implementation of the Electron 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 #include "AtlfastAlgs/ElectronSmearer.h"
00012 
00013 #include <cmath>
00014 
00015 #include "CLHEP/Vector/LorentzVector.h"
00016 
00017 
00018 #include "CLHEP/Random/JamesRandom.h"
00019 #include "CLHEP/Random/RandGauss.h"
00020 
00021 namespace Atlfast {
00022 
00023   HepLorentzVector ElectronSmearer::smear (const HepLorentzVector& avec) {
00024     // do the smearing, copied verbatim (except for ROOT dependencies)
00025     // from electronmaker codein Atlfast++
00026     //
00027     // This code has not otherwise been altered which is why it is all very
00028     // procedural
00029     //
00030     // Parametrisation was by L.Poggioli
00031 
00032     double rpilup = 0.0;
00033     double aa, bb, sigph1, sigph, sigpu;
00034     double sqrtene = sqrt(avec.e());
00035     double abseta  = fabs(avec.pseudoRapidity());
00036 
00037     while (1) {
00038       aa=randGauss()->fire();
00039       //bb=randGauss()->fire();
00040       sigph1 = aa*0.12/sqrtene;
00041       if (1.0 + sigph1 <= 0.0) continue;
00042       sigph = sigph1;
00043       if (abseta < 1.4) {
00044         while (1) {
00045           aa=randGauss()->fire();
00046           bb=randGauss()->fire();
00047           sigph1 = aa*0.245/avec.perp() + bb*0.007;
00048           if (1.0+sigph1 > 0) break;
00049         }
00050       } else {
00051         while (1) {
00052           aa=randGauss()->fire();
00053           bb=randGauss()->fire();
00054           sigph1 = aa*0.306*((2.4-abseta)+0.228)/avec.e() + bb*0.007;
00055           if (1.0+sigph1 > 0) break;
00056         }
00057       }
00058       sigph += sigph1;
00059       if (m_lumi == 2) {
00060         if (abseta < 0.6) rpilup = 0.32;
00061         if (abseta > 0.6 && abseta < 1.4) rpilup = 0.295;
00062         if (abseta > 1.4) rpilup = 0.27;
00063         while (1) {
00064           aa=randGauss()->fire();
00065           //bb=randGauss()->fire();
00066           sigpu = aa*rpilup/avec.perp();
00067           if (1.0+sigpu > 0) break;
00068         }
00069         sigph += sigpu;
00070       }
00071       if (1.0 + sigph > 0) break;
00072     }
00073 
00074     //now sigph is the electron "sigma" and we do the following a la Atlfast++ electron maker:
00075     HepLorentzVector bvec(avec.px()*(1.0+sigph), avec.py()*(1.0+sigph), avec.pz()*(1.0+sigph), avec.e() *(1.0+sigph));
00076 
00077     return bvec;
00078   }
00079 
00080 } // end of namespace bracket

Generated on Tue Mar 18 11:18:23 2003 for AtlfastAlgs by doxygen1.3-rc1