Atlfast::DefaultSmearer Class Reference

Default implementation of the ISmearer interface. More...

#include <DefaultSmearer.h>

Inheritance diagram for Atlfast::DefaultSmearer:

Inheritance graph
[legend]
Collaboration diagram for Atlfast::DefaultSmearer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DefaultSmearer (const int aseed)
virtual ~DefaultSmearer ()
virtual HepLorentzVector smear (const HepMC::GenParticle &)
virtual HepLorentzVector smear (const HepLorentzVector &)
virtual int setSmearParameters (const std::vector< double > &smearValues)
virtual int setSmearParamSchema (const int smearSchema)
RandGauss * randGauss ()
RandFlat * randFlat ()

Private Attributes

RandGauss * m_randGauss
RandFlat * m_randFlat
int m_randSeed

Detailed Description

Default implementation of the ISmearer interface.

This class manages the generation of random numbers and implements the smear() function required by ISmearer

Definition at line 35 of file DefaultSmearer.h.


Constructor & Destructor Documentation

Atlfast::DefaultSmearer::DefaultSmearer ( const int  aseed  ) 

Construct given a random number seed.

Definition at line 23 of file DefaultSmearer.cxx.

00023                                                 {
00024     // instantiate the random number engine based on the seed and store it
00025     HepRandomEngine* randomEngine = new HepJamesRandom( aseed );
00026     m_randGauss    = new RandGauss( randomEngine );
00027     m_randFlat     = new RandFlat( *randomEngine );
00028     m_randSeed     = aseed;
00029   }

Atlfast::DefaultSmearer::~DefaultSmearer (  )  [virtual]

Default destructor

Definition at line 32 of file DefaultSmearer.cxx.

00032                                   {
00033 
00034     // we check to see if our random engine and gauss are still set and if so kill them
00035     
00036     if (m_randFlat) {
00037       delete m_randFlat;
00038     }
00039     
00040     if (m_randGauss) {
00041       delete m_randGauss;
00042     }
00043     
00044     //    if (m_randomEngine) {
00045     //      delete m_randomEngine;
00046     //    }
00047     
00048   }


Member Function Documentation

HepLorentzVector Atlfast::DefaultSmearer::smear ( const HepMC::GenParticle &   )  [virtual]

Smear method for HepMC::GenParticle

Implements Atlfast::ISmearer.

Reimplemented in Atlfast::CellSmearer, Atlfast::ElectronSmearer, Atlfast::JetSmearer, Atlfast::MuonSmearer, and Atlfast::PhotonSmearer.

Definition at line 50 of file DefaultSmearer.cxx.

00050                                                                         {
00051     return smear(particle.momentum());
00052   }

HepLorentzVector Atlfast::DefaultSmearer::smear ( const HepLorentzVector &   )  [virtual]

Smear method for HepLorentzVector

Implements Atlfast::ISmearer.

Reimplemented in Atlfast::CellSmearer, Atlfast::ElectronSmearer, Atlfast::JetSmearer, Atlfast::MuonSmearer, and Atlfast::PhotonSmearer.

Definition at line 54 of file DefaultSmearer.cxx.

00054                                                                       {
00055     // do the actual business... to fake it up, just smear in each variable ofthe four vector with width 1.0
00056     // for testing purposes only
00057 
00058     HepLorentzVector bvec;
00059     // set each component by smearing around the central value with width 1.0
00060     bvec.setE( m_randGauss->fire(avec.e(), 1.0) );
00061     bvec.setPx(m_randGauss->fire(avec.px(),1.0) );
00062     bvec.setPy(m_randGauss->fire(avec.py(),1.0) );
00063     bvec.setPz(m_randGauss->fire(avec.pz(),1.0) );
00064 
00065     return bvec;
00066   }

int Atlfast::DefaultSmearer::setSmearParameters ( const std::vector< double > &  smearValues  )  [virtual]

Sets the smearing parameters

Implements Atlfast::ISmearer.

Reimplemented in Atlfast::CellSmearer, Atlfast::ElectronSmearer, Atlfast::JetSmearer, Atlfast::MuonSmearer, and Atlfast::PhotonSmearer.

Definition at line 69 of file DefaultSmearer.cxx.

00069                                                                                  {
00070     return 0;
00071   }

int Atlfast::DefaultSmearer::setSmearParamSchema ( const int  smearSchema  )  [virtual]

Sets the smearing schema

Implements Atlfast::ISmearer.

Reimplemented in Atlfast::CellSmearer, Atlfast::ElectronSmearer, Atlfast::JetSmearer, Atlfast::MuonSmearer, and Atlfast::PhotonSmearer.

Definition at line 73 of file DefaultSmearer.cxx.

00073                                                                     {
00074     return 0;
00075   }

RandGauss* Atlfast::DefaultSmearer::randGauss (  )  [inline]

Hook for subclasses etc. to get their hands on a randGauss object

Definition at line 65 of file DefaultSmearer.h.

00065 { return m_randGauss;}

RandFlat* Atlfast::DefaultSmearer::randFlat (  )  [inline]

Hook for subclasses etc. to get their hands on a randFlat object

Definition at line 71 of file DefaultSmearer.h.

00071 { return m_randFlat;}


Member Data Documentation

RandGauss* Atlfast::DefaultSmearer::m_randGauss [private]

Gaussian thrower. (you may need more coplex ones, you can add them in your derived classes)

Definition at line 93 of file DefaultSmearer.h.

RandFlat* Atlfast::DefaultSmearer::m_randFlat [private]

Flat thrower. (you may need more coplex ones, you can add them in your derived classes)

Definition at line 99 of file DefaultSmearer.h.

int Atlfast::DefaultSmearer::m_randSeed [private]

Random seed

Definition at line 107 of file DefaultSmearer.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:37 2007 for AtlfastAlgs by  doxygen 1.5.1