#include <DefaultSmearer.h>
Inheritance diagram for Atlfast::DefaultSmearer:


Public Methods | |
| DefaultSmearer (const int aseed) | |
| Construct given a random number seed. | |
| virtual | ~DefaultSmearer () |
| virtual HepLorentzVector | smear (const HepLorentzVector &) |
| Smear method decleration provided by ISmearer interface. | |
| RandGauss * | randGauss () |
| Hook for subclasses etc. | |
Private Attributes | |
| RandGauss * | m_randGauss |
| Gaussian thrower. | |
| int | m_randSeed |
| Random seed. | |
It manages the generation of random numbers and implements the smear() function required by ISmear
Definition at line 33 of file DefaultSmearer.h.
|
|
Construct given a random number seed.
Definition at line 24 of file DefaultSmearer.cxx. References m_randGauss, and m_randSeed.
00024 {
00025 // instantiate the random number engine based on the seed and store it
00026 HepRandomEngine* randomEngine = new HepJamesRandom( aseed );
00027 m_randGauss = new RandGauss( randomEngine );
00028 m_randSeed = aseed;
00029 }
|
|
|
Definition at line 32 of file DefaultSmearer.cxx. References m_randGauss.
00032 {
00033 // we check to see if our random engine and gauss are still set and if so kill them
00034 // if (m_randomEngine) {
00035 // delete m_randomEngine;
00036 // }
00037 if (m_randGauss) {
00038 delete m_randGauss;
00039 }
00040 }
|
|
|
Smear method decleration provided by ISmearer interface.
Implements Atlfast::ISmearer. Reimplemented in Atlfast::CellSmearer, Atlfast::ElectronSmearer, Atlfast::JetSmearer, Atlfast::MuonSmearer, and Atlfast::PhotonSmearer. Definition at line 42 of file DefaultSmearer.cxx. References m_randGauss.
00042 {
00043 // do the actual business... to fake it up, just smear in each variable ofthe four vector with width 1.0
00044 // for testing purposes only
00045
00046 HepLorentzVector bvec;
00047 // set each component by smearing around the central value with width 1.0
00048 bvec.setE( m_randGauss->fire(avec.e(), 1.0) );
00049 bvec.setPx(m_randGauss->fire(avec.px(),1.0) );
00050 bvec.setPy(m_randGauss->fire(avec.py(),1.0) );
00051 bvec.setPz(m_randGauss->fire(avec.pz(),1.0) );
00052
00053 return bvec;
00054 }
|
|
|
Hook for subclasses etc. to get their hands on a randGauss object Definition at line 55 of file DefaultSmearer.h. References m_randGauss. Referenced by Atlfast::MuonSmearer::resol2(), Atlfast::MuonSmearer::resol3(), Atlfast::MuonSmearer::resol4(), Atlfast::MuonSmearer::resolid1(), Atlfast::MuonSmearer::resolid2(), Atlfast::MuonSmearer::resolms(), Atlfast::PhotonSmearer::smear(), Atlfast::JetSmearer::smear(), Atlfast::ElectronSmearer::smear(), and Atlfast::CellSmearer::smear().
00055 { return m_randGauss;}
|
|
|
Gaussian thrower. (you may need more coplex ones, you can add them in your derived classes) Definition at line 77 of file DefaultSmearer.h. Referenced by DefaultSmearer(), randGauss(), smear(), and ~DefaultSmearer(). |
|
|
Random seed.
Definition at line 85 of file DefaultSmearer.h. Referenced by DefaultSmearer(). |
1.3-rc1