Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 // DefaultSmearer.cxx
002 //
003 // Implementation of Default Smearer class
004 //
005 // Namespace Atlfast::
006 //
007 //--------------------------------------------------------------------
008 //
009 // Authors: H.T. Phillips, P. Clarke, E. Richter-Was, P. Sherwood, R. Steward
010 //
011 //
012 #include "AtlfastAlgs/DefaultSmearer.h"
013 // CLHEP includes
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     // instantiate the random number engine based on the seed and store it
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     // we check to see if our random engine and gauss are still set and if so kill them
035     
036     if (m_randFlat) {
037       delete m_randFlat;
038     }
039     
040     if (m_randGauss) {
041       delete m_randGauss;
042     }
043     
044     //    if (m_randomEngine) {
045     //      delete m_randomEngine;
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     // do the actual business... to fake it up, just smear in each variable ofthe four vector with width 1.0
057     // for testing purposes only
058 
059     HepLorentzVector bvec;
060     // set each component by smearing around the central value with width 1.0
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   //cct: implement the setSmearParameters method
070   int DefaultSmearer::setSmearParameters (const std::vector<double>& /*smearValues*/){
071     return 0;
072   }
073   //cct: implement the setSmearParamSchema method
074   int DefaultSmearer::setSmearParamSchema ( const int /*smearSchema*/){
075     return 0;
076   }
077   
078 } // end of namespace bracket
079 

source navigation ] diff markup ] identifier search ] general search ]

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. Valid HTML 4.01!