001
002
003
004
005
006
007
008
009
010
011
012 #include "AtlfastAlgs/JetSmearer.h"
013 #include <cmath>
014 #include <iostream>
015
016 #include "CLHEP/Vector/LorentzVector.h"
017 #include "CLHEP/Random/JamesRandom.h"
018 #include "CLHEP/Random/RandGauss.h"
019
020 #include "CLHEP/Units/SystemOfUnits.h"
021
022 namespace Atlfast {
023
024
025
026
027
028
029
030
031 HepLorentzVector JetSmearer::smear(const HepMC::GenParticle& particle){
032 HepLorentzVector hlv(particle.momentum().px(),particle.momentum().py(),particle.momentum().pz(),particle.momentum().e());
033 return smear(hlv);
034 }
035
036 HepLorentzVector JetSmearer::smear (const HepLorentzVector& vec) {
037
038
039
040
041
042
043
044
045
046
047 float sigma=0.;
048 if ( vec.e() == 0 ) return vec;
049 HepLorentzVector smearedVec(vec);
050
051
052
053
054
055
056 float epileup = 0;
057 float aa, bb, cc, dd;
058 float abseta = fabs(vec.pseudoRapidity());
059 float rcone;
060
061
062
063 float sqrtene = sqrt(vec.e()/GeV);
064 float pt = vec.perp()/GeV;
065 if (fabs(vec.pseudoRapidity()) <= m_BarrelForwardEta) {rcone=m_rconeb;}else{rcone=m_rconef;}
066 if(rcone <= 0.4) epileup = 0.4;
067 if(rcone == 0.4) epileup = 7.5;
068 if(rcone > 0.4 && rcone <= 0.5) epileup = 12.0;
069 if(rcone > 0.5 && rcone <= 0.7) epileup = 18.0;
070 if(rcone > 0.7) epileup = 20.0;
071
072 if(m_lumi <= 1) {
073 while(1) {
074 aa=randGauss()->fire();
075 bb=randGauss()->fire();
076 if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03;
077 else sigma = aa*1.0/sqrtene + bb*0.07;
078 if(1.+sigma > .0) break;
079 }
080 } else if(m_lumi == 2) {
081 while(1) {
082 aa=randGauss()->fire();
083 bb=randGauss()->fire();
084 cc=randGauss()->fire();
085 dd=randGauss()->fire();
086 if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03 + cc*epileup/pt;
087 else sigma = aa*1.0/sqrtene + bb*0.07 + cc*epileup/pt;
088 if(1.+sigma > .0) break;
089 }
090
091 }
092 smearedVec.setPx(vec.px()*(1.0+sigma));
093 smearedVec.setPy(vec.py()*(1.0+sigma));
094 smearedVec.setPz(vec.pz()*(1.0+sigma));
095 smearedVec.setE(vec.e()*(1.0+sigma));
096
097
098 return smearedVec;
099
100 }
101
102
103 int JetSmearer::setSmearParameters (const std::vector<double>& ){
104 return 0;
105 }
106
107 int JetSmearer::setSmearParamSchema ( const int ){
108 return 0;
109 }
110
111 }
112
113
114
115
116
117
118
| Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
|
This page was automatically generated by the
LXR engine.
|
|