001
002
003
004
005
006
007
008
009
010
011
012 #include "AtlfastAlgs/CellSmearer.h"
013 #include <cmath>
014 #include <iostream>
015 #include "CLHEP/Vector/LorentzVector.h"
016 #include "CLHEP/Random/JamesRandom.h"
017 #include "CLHEP/Random/RandGauss.h"
018 #include "CLHEP/Units/SystemOfUnits.h"
019
020
021 namespace Atlfast {
022
023 HepLorentzVector CellSmearer::smear(const HepMC::GenParticle& particle){
024 HepLorentzVector hlv(particle.momentum().px(),particle.momentum().py(),particle.momentum().pz(),particle.momentum().e());
025 return smear(hlv);
026 }
027
028 HepLorentzVector CellSmearer::smear (const HepLorentzVector& vec) {
029
030
031
032
033
034
035
036 float sigma=0.;
037 HepLorentzVector smearedVec(vec);
038 float aa, bb;
039 float sqrtene = sqrt(vec.e()/GeV);
040 float abseta = fabs(vec.pseudoRapidity());
041 while(1) {
042 aa=randGauss()->fire();
043 bb=randGauss()->fire();
044 if(abseta < m_BarrelForwardEta) sigma = aa*0.5/sqrtene + bb*0.03;
045 else sigma = aa*1.0/sqrtene + bb*0.07;
046 if(1.+sigma > .0) break;
047 }
048 smearedVec.setPx(vec.px()*(1.0+sigma));
049 smearedVec.setPy(vec.py()*(1.0+sigma));
050 smearedVec.setPz(vec.pz()*(1.0+sigma));
051 smearedVec.setE(vec.e()*(1.0+sigma));
052 return smearedVec;
053
054 }
055
056
057 int CellSmearer::setSmearParameters (const std::vector<double>& ){
058 return 0;
059 }
060
061 int CellSmearer::setSmearParamSchema ( const int ){
062 return 0;
063 }
064
065 }
066
067
068
069
070
071
072
| 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.
|
|