Atlfast::GlobalEventDataMaker Class Reference

Sets all the static GlobalEventData values. More...

#include <GlobalEventDataMaker.h>

Collaboration diagram for Atlfast::GlobalEventDataMaker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GlobalEventDataMaker (const std::string &name, ISvcLocator *pSvcLocator)
 ~GlobalEventDataMaker ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

int m_lumi
bool m_fieldOn
double m_fieldStrength
std::vector< int > m_invisibles
int m_randSeed
double m_barrelForwardEta
std::string m_mcLocation
bool m_justHardScatter
std::vector< int > m_monopoleIDs

Static Private Attributes

static const int DEFAULT_lumi
static const int DEFAULT_randSeed
static const bool DEFAULT_fieldOn
static const double DEFAULT_barrelForwardEta

Detailed Description

Sets all the static GlobalEventData values.

Done mostly via the GlobalEventData::setValues method.

Author:
Jon Couchman
GlobalEventDataMaker.jpg

GlobalEventDataMaker sequence

Definition at line 22 of file GlobalEventDataMaker.h.


Constructor & Destructor Documentation

Atlfast::GlobalEventDataMaker::GlobalEventDataMaker ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor

Definition at line 28 of file GlobalEventDataMaker.cxx.

00032     : Algorithm( name, pSvcLocator )
00033   {
00034     // Set the parameter defaults.
00035     m_lumi              = 1;
00036     m_fieldOn           = true;
00037     m_fieldStrength     = -999.9;
00038     m_barrelForwardEta  = 3.2;
00039     m_randSeed          = 12345;
00040     m_mcLocation        = "GEN_EVENT";
00041     m_justHardScatter   = true;
00042 
00043     m_invisibles.push_back(12);
00044     m_invisibles.push_back(14);
00045     m_invisibles.push_back(16);
00046     m_invisibles.push_back(1000022);
00047 
00048     // Declare the parameters to Gaudi so that
00049     // they can be over-written via the job options file
00050     declareProperty( "Luminosity",       m_lumi );
00051     declareProperty( "Invisibles",       m_invisibles );
00052     declareProperty( "BFieldOn",         m_fieldOn ) ;
00053     declareProperty( "BFieldStrength",   m_fieldStrength ) ;
00054     declareProperty( "RandomSeed",       m_randSeed ) ;
00055     declareProperty( "BarrelForwardEta", m_barrelForwardEta ) ;
00056     declareProperty( "McLocation",       m_mcLocation ) ;
00057     declareProperty( "MonopoleIDs",      m_monopoleIDs );
00058     declareProperty( "JustHardScatter",  m_justHardScatter );
00059     
00060   }

Atlfast::GlobalEventDataMaker::~GlobalEventDataMaker (  ) 

Default Destructor

Definition at line 66 of file GlobalEventDataMaker.cxx.

00066                                               {
00067     MsgStream log( messageService(), name() ) ;
00068     log << MSG::INFO << "destructor, Global Event Data" << endreq;
00069   }


Member Function Documentation

StatusCode Atlfast::GlobalEventDataMaker::initialize (  ) 

standard Athena-Algorithm method

Definition at line 75 of file GlobalEventDataMaker.cxx.

00076   {
00077     MsgStream log( messageService(), name() ) ;
00078     log << MSG::DEBUG << "Initialising" << endreq; 
00079     log << MSG::DEBUG << "Making Invisibles" << endreq; 
00080     m_invisibles.push_back(ParticleCodes::NU_E);
00081     m_invisibles.push_back(ParticleCodes::NU_MU);
00082     m_invisibles.push_back(ParticleCodes::NU_TAU);
00083     std::vector<int>::iterator ibe = m_invisibles.begin();
00084     std::vector<int>::iterator originalEnd = m_invisibles.end();
00085     std::vector<int>::iterator ien;
00086     sort(ibe, originalEnd);
00087     ien=unique(ibe, originalEnd);
00088     m_invisibles.erase(ien, originalEnd);
00089     
00090     // Monopole IDs
00091     std::vector<int>::iterator mbe = m_monopoleIDs.begin();
00092     std::vector<int>::iterator mOriginalEnd = m_monopoleIDs.end();
00093     std::vector<int>::iterator men;
00094     sort(mbe, mOriginalEnd);
00095     men=unique(mbe, mOriginalEnd);
00096     m_monopoleIDs.erase(men, mOriginalEnd);
00097     
00098     if(m_lumi != 1 && m_lumi != 2){
00099       log << MSG::WARNING << "Luminosity set to unknown value: " << m_lumi << endreq; 
00100       log << MSG::WARNING << "Luminosity reset to Low-Lumi == 1" << endreq;
00101       m_lumi = 1;
00102     }
00103     log << MSG::DEBUG << "Making Header" << endreq; 
00104     HeaderPrinter hp("Atlfast GlobalEventData Maker:", log);
00105     hp.add("Invisibles (Neutrinos hardwired invisible): ", ibe, ien);
00106     hp.add("Luminosity:                                 ", m_lumi);
00107     hp.add("Initial Random Number Seed:                 ", m_randSeed);
00108     hp.add("B-field On:                                 ", m_fieldOn);
00109     hp.add("B-field Strength:                           ", m_fieldStrength);
00110     hp.add("Barrel Forward Eta:                         ", m_barrelForwardEta);
00111     hp.add("McLocation:                                 ", m_mcLocation);
00112     hp.add("Monopole IDs:                               ", mbe, men);
00113     hp.add("Just Hard Scatter?:                         ", m_justHardScatter);
00114     hp.print();
00115     log << MSG::DEBUG << "Calling ged instance" << endreq; 
00116 
00117     //set values of GlobalEventVariables
00118 
00119     GlobalEventData* ged;
00120 
00121     try{
00122       ged = GlobalEventData::Instance();
00123     }catch(std::string errMsg){
00124       log << MSG::DEBUG << "Error making a GlobalEventData"<< errMsg <<endreq; 
00125       return StatusCode::FAILURE;
00126     }catch(...){
00127       log << MSG::DEBUG << "Unknown Error making a GlobalEventData"<<endreq; 
00128       return StatusCode::FAILURE;
00129     }
00130 
00131     log << MSG::DEBUG << "Calling ged setValues" << endreq; 
00132     ged->setValues(m_lumi,
00133                    m_fieldOn,
00134                    m_barrelForwardEta,
00135                    m_randSeed,
00136                    m_invisibles,
00137                    m_mcLocation,
00138                    m_monopoleIDs,
00139                    m_justHardScatter) ;
00140 
00141     
00142     log << MSG::DEBUG << "Creating MagField singleton" << endreq; 
00143     if ( m_fieldStrength == -999.9 ){
00144       if ( m_fieldOn )
00145         MagField::Instance(2.0);
00146       else
00147         MagField::Instance();
00148     } else {
00149       MagField::Instance(m_fieldStrength);
00150     }
00151 
00152     log << MSG::DEBUG << "Everything Completed" << endreq;
00153     return StatusCode::SUCCESS ;
00154   }

StatusCode Atlfast::GlobalEventDataMaker::execute (  ) 

standard Athena-Algorithm method

Definition at line 173 of file GlobalEventDataMaker.cxx.

00173                                            {
00174     // do nothing in execute
00175     return StatusCode::SUCCESS;
00176   }

StatusCode Atlfast::GlobalEventDataMaker::finalize (  ) 

standard Athena-Algorithm method

Definition at line 160 of file GlobalEventDataMaker.cxx.

00161   {
00162     
00163     MsgStream log( messageService(), name() ) ;
00164     log << MSG::INFO << "Finalizing" << endreq;  
00165     return StatusCode::SUCCESS ;
00166   }


Member Data Documentation

int Atlfast::GlobalEventDataMaker::m_lumi [private]

Lumonosity low=1 high=2

Definition at line 37 of file GlobalEventDataMaker.h.

bool Atlfast::GlobalEventDataMaker::m_fieldOn [private]

Magnetic field on/off

Definition at line 39 of file GlobalEventDataMaker.h.

double Atlfast::GlobalEventDataMaker::m_fieldStrength [private]

Magnetic field strength (Tesla)

Definition at line 41 of file GlobalEventDataMaker.h.

std::vector<int> Atlfast::GlobalEventDataMaker::m_invisibles [private]

Invisible partices neutrinos etc.

Definition at line 43 of file GlobalEventDataMaker.h.

int Atlfast::GlobalEventDataMaker::m_randSeed [private]

Random seed

Definition at line 45 of file GlobalEventDataMaker.h.

double Atlfast::GlobalEventDataMaker::m_barrelForwardEta [private]

eta transition between barrel and forward detectors

Definition at line 47 of file GlobalEventDataMaker.h.

std::string Atlfast::GlobalEventDataMaker::m_mcLocation [private]

StoreGate key for MC data (default = "")

Definition at line 49 of file GlobalEventDataMaker.h.

bool Atlfast::GlobalEventDataMaker::m_justHardScatter [private]

Whether to just consider the hard scatter GenEvent or all of them

Definition at line 51 of file GlobalEventDataMaker.h.

std::vector<int> Atlfast::GlobalEventDataMaker::m_monopoleIDs [private]

PDG ID numbers for magnetic monopoles

Definition at line 53 of file GlobalEventDataMaker.h.

const int Atlfast::GlobalEventDataMaker::DEFAULT_lumi [static, private]

Definition at line 58 of file GlobalEventDataMaker.h.

const int Atlfast::GlobalEventDataMaker::DEFAULT_randSeed [static, private]

Definition at line 58 of file GlobalEventDataMaker.h.

const bool Atlfast::GlobalEventDataMaker::DEFAULT_fieldOn [static, private]

Definition at line 62 of file GlobalEventDataMaker.h.

const double Atlfast::GlobalEventDataMaker::DEFAULT_barrelForwardEta [static, private]

Definition at line 64 of file GlobalEventDataMaker.h.


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