Atlfast::AtlfastPoolTest Class Reference

Direct copy of CellMaker class, for purposes of testing Pool. More...

#include <AtlfastPoolTest.h>

Collaboration diagram for Atlfast::AtlfastPoolTest:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Private Attributes

Calorimeterm_calorimeter
ICellSelectorm_cellSelector
HepMC_helper::IMCselectorm_mcSelector
EPileupMapm_epileupMap
ISmearerm_smearer
double m_etaCoverage
double m_minETCell
double m_barrelForwardEta
bool m_fieldOn
bool m_doSmearing
 warning! not fully tested. Should not be used if JetSmearing == true
bool m_fastShower
 flag to control if FastShower is to run
double m_granBarrelEta
double m_granBarrelPhi
double m_granForwardEta
double m_granForwardPhi
std::string m_inputLocation
std::string m_outputLocation
TesIOm_tesIO
MsgStream m_log
std::string m_mcLocation
std::vector< int > m_monopoleIDs

Detailed Description

Direct copy of CellMaker class, for purposes of testing Pool.

Definition at line 38 of file AtlfastPoolTest.h.


Constructor & Destructor Documentation

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

Standard Athena-Algorithm Constructor

This doSmearing is still in experimental phase and should NOT be set to true by any user

WARNING!! DoSmearing should not be changed from default of false

Definition at line 36 of file AtlfastPoolTest.cxx.

00036                                                                                   :
00037     Algorithm(name,pSvcLocator), 
00038     m_calorimeter(0),
00039     m_cellSelector(0),
00040     m_mcSelector(0),
00041     m_epileupMap(0),
00042     m_smearer(0),
00043     m_tesIO(0),
00044     m_log( messageService(), name )
00045   {
00046     
00047     //default paths for entities in the TES
00048     m_inputLocation       = "/Event/McEventCollection";
00049     m_outputLocation      = "/Event/AtlfastCells" ;
00050     
00051     // default parameters to build the calorimeter
00052     m_etaCoverage        = 5.0;
00053     m_minETCell          = 0.0;
00054     m_granBarrelEta      = 0.1;
00055     m_granBarrelPhi      = 0.1;
00056     m_granForwardEta     = 0.2;
00057     m_granForwardPhi     = 0.2;
00060     m_doSmearing         = false;
00061     m_fastShower         = false;
00062     
00063     declareProperty("InputLocation",      m_inputLocation);
00064     declareProperty("OutputLocation",     m_outputLocation);
00065     declareProperty("EtaCoverage",        m_etaCoverage);
00066     declareProperty("MinETCell",          m_minETCell);
00067     declareProperty("GranBarrelEta",      m_granBarrelEta);
00068     declareProperty("GranBarrelPhi",      m_granBarrelPhi);
00069     declareProperty("GranForwardEta",     m_granForwardEta);
00070     declareProperty("GranForwardPhi",     m_granForwardPhi);
00072     declareProperty("DoSmearing",     m_doSmearing);
00073     declareProperty("FastShower",     m_fastShower);
00074     
00075   }
  

Atlfast::AtlfastPoolTest::~AtlfastPoolTest (  ) 

Default destructor

Definition at line 78 of file AtlfastPoolTest.cxx.

00078                                    {
00079 
00080     m_log << MSG::DEBUG << "AtlfastPoolTest destructor starts " << endreq;
00081 
00082     if ( m_calorimeter ) delete m_calorimeter;
00083     if ( m_cellSelector ) delete m_cellSelector;
00084     if ( m_epileupMap ) delete m_epileupMap;
00085     if ( m_tesIO ) delete m_tesIO;
00086     if ( m_smearer ) delete m_smearer;
00087     
00088     m_log << MSG::DEBUG << "AtlfastPoolTest destructor ends " << endreq;
00089   }


Member Function Documentation

StatusCode Atlfast::AtlfastPoolTest::initialize (  ) 

Standard Athena-Algorithm initialize

NOTE!! Smearing should not be switched on

if we want to perform cell level smearing, must make a CellSmearer and a Energy Pileup map

Definition at line 91 of file AtlfastPoolTest.cxx.

00092   {
00093     
00094 
00095     //set up objects used to determine particle charge,
00096     // and to select input MC 4-vectors.
00097     m_cellSelector  = new CellsAboveThreshold(m_minETCell);
00098     
00099 
00100     //get the Global Event Data using singleton pattern
00101     GlobalEventData* ged = GlobalEventData::Instance();
00102     m_fieldOn          = ged->fieldOn();
00103     m_mcSelector       = ged -> visibleToCal();
00104     m_barrelForwardEta = ged -> barrelForwardEta();
00105     m_mcLocation       = ged -> mcLocation();
00106     m_monopoleIDs      = ged -> monopoleIDs();
00107 
00108     if (fabs(m_etaCoverage) < fabs(m_barrelForwardEta) ) {
00109       m_log << MSG::ERROR 
00110           << "asked to makecalo with max extent " 
00111           << m_etaCoverage 
00112           << "but barrel-forward boundary at " 
00113           << m_barrelForwardEta << endreq;
00114       return StatusCode::FAILURE;
00115 
00116     //    m_tesIO = new TesIO(eventDataService());
00117     m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter());
00118 
00119     }
00120     m_calorimeter = new Calorimeter(
00121                                     m_log,
00122                                     m_fastShower,
00123                                     m_etaCoverage, 
00124                                     m_barrelForwardEta,
00125                                     m_granBarrelEta, 
00126                                     m_granBarrelPhi, 
00127                                     m_granForwardEta, 
00128                                     m_granForwardPhi
00129                                     );
00133     if(m_doSmearing == true){
00134       m_epileupMap = new EPileupMap(ged->lumi());
00135       m_smearer = new CellSmearer(ged->randSeed(),m_barrelForwardEta);
00136     }else{
00137       m_epileupMap = NULL;
00138       m_smearer = NULL;
00139     }
00140 
00141     HeaderPrinter hp("Atlfast Cell Maker:", m_log);
00142     
00143     hp.add("min Cell ET             ", m_minETCell);  
00144     hp.add("Magnetic Field is on?   ", m_fieldOn);
00145     hp.add("Input Location          ", m_inputLocation);    
00146     hp.add("Output Location         ", m_outputLocation);
00147     hp.add(" DoSmearing             ", m_doSmearing);    
00148     hp.add(" Run FastShower         ", m_fastShower);    
00149     hp.add("Calorimeter Geometry:   ");
00150     hp.add(" Total Eta Range        ", m_etaCoverage);
00151     hp.add(" Barrel Eta Range       ", m_barrelForwardEta);
00152     hp.add(" Barrel Eta Granularity ", m_granBarrelEta);
00153     hp.add(" Barrel Phi Granularity ", m_granBarrelPhi);
00154     hp.add(" Forward Eta Granularity", m_granForwardEta);
00155     hp.add(" Forward Phi Granularity", m_granForwardPhi);
00156     hp.print();
00157 
00158 
00159       
00160     return StatusCode::SUCCESS; 
00161   }

StatusCode Atlfast::AtlfastPoolTest::execute (  ) 

Standard Athena-Algorithm execute

randomly fill the map from a text file

deposit energy pileup into EM calorimeter

deposit energy pileup into EM calorimeter

pass pointer to smearer as well, if not NULL, then cells pT is smeared before the ITwoCellCollection is filled

Definition at line 171 of file AtlfastPoolTest.cxx.

00172   {
00173     //.............................................
00174     
00175     m_log << MSG::DEBUG << "AtlfastPoolTest execute()" << endreq;
00176     
00177     
00178     // read MC particles from TES
00179     MCparticleCollection p;
00180     TesIoStat stat = m_tesIO->getMC( p, m_mcSelector ) ;
00181     std::string mess;
00182     mess = stat? "Retrieved MC from TES ":"Failed MC retrieve from TES ";
00183     m_log << MSG::DEBUG << mess << p.size()<<endreq;
00184     
00185     ITransportedParticleCollection particlesAtCal;
00186     
00187     MCparticleCollectionCIter ip= p.begin();
00188     for(; ip<p.end(); ++ip){
00189       
00190       // Factory comes back with the relevant TransportedParticle
00191       ITransportedParticle *itp = ITransportedParticleFactory::create(*ip,m_monopoleIDs);
00192       itp->deflect();
00193       particlesAtCal.push_back(itp);
00194       
00195     }   
00196     
00197     
00198     //    return stat;
00199     // give to calorimeter (iseq gives the interval [begin,end)
00200     ITransportedParticleCollectionIter fpart = particlesAtCal.begin();
00201     ITransportedParticleCollectionIter lpart = particlesAtCal.end();
00202     m_calorimeter->deposit(fpart, lpart);
00203     
00204     //Delete the the container of transported particles and its pointers
00205 
00206     containerDelete(particlesAtCal.begin(), particlesAtCal.end());
00207 
00208 
00209     // Add in the energy pileup 
00210     if(m_doSmearing){
00211       //Smear the cells resolution first
00212       m_calorimeter->smearCells(m_smearer);
00213       m_log << MSG::DEBUG << "Doing Smearing" << endreq;
00215       m_epileupMap->fillMap();
00216       m_log << MSG::DEBUG 
00217           << "Size of EM EPileup vector: " 
00218           << m_epileupMap->getEMMap()->size() 
00219           << endreq;
00220       std::vector<Atlfast::EPileupDeposit*>::iterator fdep = 
00221         m_epileupMap->getEMMap()->begin();
00222       std::vector<Atlfast::EPileupDeposit*>::iterator ldep = 
00223         m_epileupMap->getEMMap()->end();
00225       m_calorimeter->deposit(fdep, ldep);
00226       m_log << MSG::DEBUG << "ECAL pileup deposited" << endreq;
00227       m_log << MSG::DEBUG << "Size of HAD EPileup vector: " 
00228           << m_epileupMap->getHadMap()->size() 
00229           << endreq;
00230       fdep = m_epileupMap->getHadMap()->begin();
00231       ldep = m_epileupMap->getHadMap()->end();
00233       m_calorimeter->deposit(fdep, ldep);
00234       m_log << MSG::DEBUG << "HCAL pileup deposited" << endreq;
00235     }
00236 
00237     m_log << MSG::DEBUG << "deposit" << endreq;
00238     
00239     // ask for Cells passing selection criteria of m_cellSelector (=Et).
00240     //************************
00241     //this worked 23/12 PS
00242     ITwoCptCellCollection* cells = new ITwoCptCellCollection;
00243     //************************
00246     m_calorimeter->giveHitCells(m_cellSelector, cells);
00247     m_log << MSG::DEBUG << "hit cells retrieved, " << cells->size() 
00248         << " cells were hit this event " << endreq;
00249 
00250     //    return stat;
00251 
00252     // finished with the calorimeter
00253     m_calorimeter->reset();
00254     m_log << MSG::DEBUG << "calorimeter reset" << endreq;
00255     //    return stat;
00256     //    return stat;
00257     
00258     // then store and return
00259     stat = m_tesIO->store(cells, m_outputLocation );  
00260     mess = stat? " Stored cells to TES":" Failed store cells to TES";
00261     m_log << MSG::DEBUG << mess << endreq;
00262 
00263     return stat;
00264   }

StatusCode Atlfast::AtlfastPoolTest::finalize (  ) 

Standard Athena-Algorithm finalize

Definition at line 163 of file AtlfastPoolTest.cxx.

00164   {
00165     
00166     m_log<<MSG::INFO<<"Finalizing"<<endreq;
00167     return StatusCode::SUCCESS; 
00168   }


Member Data Documentation

Calorimeter* Atlfast::AtlfastPoolTest::m_calorimeter [private]

Definition at line 56 of file AtlfastPoolTest.h.

ICellSelector* Atlfast::AtlfastPoolTest::m_cellSelector [private]

Definition at line 57 of file AtlfastPoolTest.h.

HepMC_helper::IMCselector* Atlfast::AtlfastPoolTest::m_mcSelector [private]

Definition at line 58 of file AtlfastPoolTest.h.

EPileupMap* Atlfast::AtlfastPoolTest::m_epileupMap [private]

EPileupMap contains the pileup energy distribution to be put into calorimeter

Definition at line 60 of file AtlfastPoolTest.h.

ISmearer* Atlfast::AtlfastPoolTest::m_smearer [private]

CellSmearer, smears cells pt before put into CellCollection

Definition at line 62 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_etaCoverage [private]

Definition at line 65 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_minETCell [private]

Definition at line 66 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_barrelForwardEta [private]

Definition at line 67 of file AtlfastPoolTest.h.

bool Atlfast::AtlfastPoolTest::m_fieldOn [private]

Definition at line 68 of file AtlfastPoolTest.h.

bool Atlfast::AtlfastPoolTest::m_doSmearing [private]

warning! not fully tested. Should not be used if JetSmearing == true

switch on cell smearing

Definition at line 71 of file AtlfastPoolTest.h.

bool Atlfast::AtlfastPoolTest::m_fastShower [private]

flag to control if FastShower is to run

Definition at line 73 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_granBarrelEta [private]

Definition at line 77 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_granBarrelPhi [private]

Definition at line 78 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_granForwardEta [private]

Definition at line 79 of file AtlfastPoolTest.h.

double Atlfast::AtlfastPoolTest::m_granForwardPhi [private]

Definition at line 80 of file AtlfastPoolTest.h.

std::string Atlfast::AtlfastPoolTest::m_inputLocation [private]

Definition at line 83 of file AtlfastPoolTest.h.

std::string Atlfast::AtlfastPoolTest::m_outputLocation [private]

Definition at line 84 of file AtlfastPoolTest.h.

TesIO* Atlfast::AtlfastPoolTest::m_tesIO [private]

Definition at line 86 of file AtlfastPoolTest.h.

MsgStream Atlfast::AtlfastPoolTest::m_log [private]

Definition at line 88 of file AtlfastPoolTest.h.

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

Definition at line 91 of file AtlfastPoolTest.h.

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

Definition at line 94 of file AtlfastPoolTest.h.


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