001
002
003
004
005
006
007
008
009
010
011
012 #include "AtlfastAlgs/DefaultSmearer.h"
013
014 #include "CLHEP/Vector/LorentzVector.h"
015 #include "CLHEP/Random/JamesRandom.h"
016 #include "CLHEP/Random/RandGauss.h"
017 #include "CLHEP/Random/RandFlat.h"
018
019
020
021 namespace Atlfast {
022
023 DefaultSmearer::DefaultSmearer(const int aseed) {
024
025 HepRandomEngine* randomEngine = new HepJamesRandom( aseed );
026 m_randGauss = new RandGauss( randomEngine );
027 m_randFlat = new RandFlat( *randomEngine );
028 m_randSeed = aseed;
029 }
030
031
032 DefaultSmearer::~DefaultSmearer() {
033
034
035
036 if (m_randFlat) {
037 delete m_randFlat;
038 }
039
040 if (m_randGauss) {
041 delete m_randGauss;
042 }
043
044
045
046
047
048 }
049
050 HepLorentzVector DefaultSmearer::smear(const HepMC::GenParticle& particle){
051 HepLorentzVector hlv(particle.momentum().px(),particle.momentum().py(),particle.momentum().pz(),particle.momentum().e());
052 return smear(hlv);
053 }
054
055 HepLorentzVector DefaultSmearer::smear( const HepLorentzVector& avec) {
056
057
058
059 HepLorentzVector bvec;
060
061 bvec.setE( m_randGauss->fire(avec.e(), 1.0) );
062 bvec.setPx(m_randGauss->fire(avec.px(),1.0) );
063 bvec.setPy(m_randGauss->fire(avec.py(),1.0) );
064 bvec.setPz(m_randGauss->fire(avec.pz(),1.0) );
065
066 return bvec;
067 }
068
069
070 int DefaultSmearer::setSmearParameters (const std::vector<double>& ){
071 return 0;
072 }
073
074 int DefaultSmearer::setSmearParamSchema ( const int ){
075 return 0;
076 }
077
078 }
079
| 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.
|
|