Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Atlfast::CellMaker Class Reference

Maker class which reads Monte Carlo information form the TES and causes a calorimeter simulation of their energy deposits.
This results in a collection of hit Cell entities to be written to the TES. More...

#include <CellMaker.h>

Collaboration diagram for Atlfast::CellMaker:

Collaboration graph
[legend]
List of all members.

Public Methods

 CellMaker (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.

 ~CellMaker ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

Calorimeterm_calorimeter
ICellSelectorm_cellSelector
HepMC_helper::IMCselector * m_mcSelector
EPileupMapm_epileupMap
 EPileupMap contains the pileup energy distribution to be put into calorimeter.

ISmearerm_smearer
 CellSmearer, smears cells pt before put into CellCollection.

double m_etaCoverage
double m_minETCell
double m_barrelForwardEta
bool m_fieldOn
bool m_doSmearing
 switch on cell smearing

double m_granBarrelEta
double m_granBarrelPhi
double m_granForwardEta
double m_granForwardPhi
std::string m_inputLocation
std::string m_outputLocation
TesIO * m_tesIO
MagFieldm_magField

Detailed Description

Maker class which reads Monte Carlo information form the TES and causes a calorimeter simulation of their energy deposits.
This results in a collection of hit Cell entities to be written to the TES.

Definition at line 39 of file CellMaker.h.


Constructor & Destructor Documentation

Atlfast::CellMaker::CellMaker 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 41 of file CellMaker.cxx.

References m_doSmearing, m_etaCoverage, m_granBarrelEta, m_granBarrelPhi, m_granForwardEta, m_granForwardPhi, m_inputLocation, m_minETCell, and m_outputLocation.

00041                                                                       :
00042     Algorithm(name,pSvcLocator){
00043     
00044     //default paths for entities in the TES
00045     m_inputLocation       = "/Event/McEventCollection";
00046     m_outputLocation      = "/Event/AtlfastCells" ;
00047     
00048     // default parameters to build the calorimeter
00049     m_etaCoverage        = 5.0;
00050     m_minETCell          = 0.0;
00051     m_granBarrelEta      = 0.1;
00052     m_granBarrelPhi      = 0.1;
00053     m_granForwardEta     = 0.2;
00054     m_granForwardPhi     = 0.2;
00057     m_doSmearing         = false;
00058     
00059     declareProperty("InputLocation",      m_inputLocation);
00060     declareProperty("OutputLocation",     m_outputLocation);
00061     declareProperty("EtaCoverage",        m_etaCoverage);
00062     declareProperty("MinETCell",          m_minETCell);
00063     declareProperty("GranBarrelEta",      m_granBarrelEta);
00064     declareProperty("GranBarrelPhi",      m_granBarrelPhi);
00065     declareProperty("GranForwardEta",     m_granForwardEta);
00066     declareProperty("GranForwardPhi",     m_granForwardPhi);
00068     declareProperty("DoSmearing",     m_doSmearing);
00069     
00070   }
  

Atlfast::CellMaker::~CellMaker  
 

Definition at line 73 of file CellMaker.cxx.

References m_calorimeter, m_cellSelector, m_magField, and m_tesIO.

00074   {
00075     if (m_calorimeter) {
00076       delete m_calorimeter;
00077     }
00078     if (m_tesIO) {
00079       delete m_tesIO;
00080     }
00081     if (m_cellSelector) {
00082       delete m_cellSelector;
00083     }
00084     if (m_magField) {
00085       delete m_magField;
00086     }
00087   }

Member Function Documentation

StatusCode Atlfast::CellMaker::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 89 of file CellMaker.cxx.

References Atlfast::GlobalEventData::fieldOn(), Atlfast::GlobalEventData::lumi(), m_barrelForwardEta, m_calorimeter, m_cellSelector, m_doSmearing, m_epileupMap, m_etaCoverage, m_fieldOn, m_granBarrelEta, m_granBarrelPhi, m_granForwardEta, m_granForwardPhi, m_inputLocation, m_magField, m_mcSelector, m_minETCell, m_outputLocation, m_smearer, m_tesIO, and Atlfast::GlobalEventData::randSeed().

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

StatusCode Atlfast::CellMaker::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 CellCollection is filled

Definition at line 165 of file CellMaker.cxx.

References Atlfast::TransportedParticleCollection::begin(), Atlfast::Calorimeter::deposit(), Atlfast::TransportedParticleCollection::end(), Atlfast::EPileupMap::fillMap(), Atlfast::EPileupMap::getEMMap(), Atlfast::EPileupMap::getHadMap(), Atlfast::Calorimeter::giveHitCells(), m_calorimeter, m_cellSelector, m_epileupMap, m_mcSelector, m_outputLocation, m_smearer, m_tesIO, Atlfast::Calorimeter::reset(), Atlfast::Calorimeter::smearCells(), and Atlfast::TransportedParticleCollectionIter.

00166   {
00167     //.............................................
00168     
00169     MsgStream log( messageService(), name() );
00170     log << MSG::DEBUG << "CellMaker execute()" << endreq;
00171 
00172     std::string mess;
00173     
00174 
00175     // read MC particles from TES
00176     MCparticleCollection  mcParticles ;
00177     TesIoStat stat = m_tesIO->getMC( mcParticles, m_mcSelector ) ;
00178     mess = stat? "Retrieved MC from TES ":"Failed MC retrieve from TES";
00179     log << MSG::DEBUG << mess << endreq;
00180     
00181     // calculate phi after the bending in the magnetic field, 
00182     TransportedParticleCollection particlesAtCal;
00183     (*m_magField)(mcParticles, particlesAtCal);
00184     log << MSG::DEBUG << "bend" << endreq;
00185     
00186     //    return stat;
00187     // give to calorimeter (iseq gives the interval [begin,end)
00188     TransportedParticleCollectionIter fpart = particlesAtCal.begin();
00189     TransportedParticleCollectionIter lpart = particlesAtCal.end();
00190     m_calorimeter->deposit(fpart, lpart);
00191 
00192 
00193     // Add in the energy pileup 
00194     if(m_doSmearing){
00195       //Smear the cells resolution first
00196       m_calorimeter->smearCells(m_smearer);
00197       log << MSG::DEBUG << "Doing Smearing" << endreq;
00199       m_epileupMap->fillMap();
00200       log << MSG::DEBUG << "Size of EM EPileup vector: " << m_epileupMap->getEMMap()->size() << endreq;
00201       std::vector<Atlfast::EPileupDeposit*>::iterator fdep = m_epileupMap->getEMMap()->begin();
00202       std::vector<Atlfast::EPileupDeposit*>::iterator ldep = m_epileupMap->getEMMap()->end();
00204       m_calorimeter->deposit(fdep, ldep);
00205       log << MSG::DEBUG << "ECAL pileup deposited" << endreq;
00206       log << MSG::DEBUG << "Size of HAD EPileup vector: " << m_epileupMap->getHadMap()->size() << endreq;
00207       fdep = m_epileupMap->getHadMap()->begin();
00208       ldep = m_epileupMap->getHadMap()->end();
00210       m_calorimeter->deposit(fdep, ldep);
00211       log << MSG::DEBUG << "HCAL pileup deposited" << endreq;
00212     }
00213 
00214     log << MSG::DEBUG << "deposit" << endreq;
00215     
00216     // ask for Cells passing selection criteria of m_cellSelector (=Et).
00217     //************************
00218     //this worked 23/12 PS
00219     CellCollection* cells = new CellCollection;
00220     //************************
00223     m_calorimeter->giveHitCells(m_cellSelector, cells);
00224     log << MSG::DEBUG << "hit cells retrieved, " << cells->size() 
00225         << " cells were hit this event " << endreq;
00226 
00227     //    return stat;
00228 
00229     // finished with the calorimeter
00230     m_calorimeter->reset();
00231     log << MSG::DEBUG << "calorimeter reset" << endreq;
00232     //    return stat;
00233     //    return stat;
00234     
00235     // then store and return
00236     stat = m_tesIO->store(cells, m_outputLocation );  
00237     mess = stat? " Stored cells to TES":" Failed store cells to TES";
00238     log << MSG::DEBUG << mess << endreq;
00239 
00240     return stat;
00241   }

StatusCode Atlfast::CellMaker::finalize  
 

Definition at line 156 of file CellMaker.cxx.

00157   {
00158     
00159     MsgStream log( messageService(), name() );
00160     
00161     return StatusCode::SUCCESS; 
00162   }

Member Data Documentation

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

Definition at line 51 of file CellMaker.h.

Referenced by execute(), initialize(), and ~CellMaker().

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

Definition at line 52 of file CellMaker.h.

Referenced by execute(), initialize(), and ~CellMaker().

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

Definition at line 53 of file CellMaker.h.

Referenced by execute(), and initialize().

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

EPileupMap contains the pileup energy distribution to be put into calorimeter.

Definition at line 55 of file CellMaker.h.

Referenced by execute(), and initialize().

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

CellSmearer, smears cells pt before put into CellCollection.

Definition at line 57 of file CellMaker.h.

Referenced by execute(), and initialize().

double Atlfast::CellMaker::m_etaCoverage [private]
 

Definition at line 60 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_minETCell [private]
 

Definition at line 61 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_barrelForwardEta [private]
 

Definition at line 62 of file CellMaker.h.

Referenced by initialize().

bool Atlfast::CellMaker::m_fieldOn [private]
 

Definition at line 63 of file CellMaker.h.

Referenced by initialize().

bool Atlfast::CellMaker::m_doSmearing [private]
 

switch on cell smearing

Definition at line 65 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_granBarrelEta [private]
 

Definition at line 69 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_granBarrelPhi [private]
 

Definition at line 70 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_granForwardEta [private]
 

Definition at line 71 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

double Atlfast::CellMaker::m_granForwardPhi [private]
 

Definition at line 72 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

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

Definition at line 75 of file CellMaker.h.

Referenced by CellMaker(), and initialize().

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

Definition at line 76 of file CellMaker.h.

Referenced by CellMaker(), execute(), and initialize().

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

Definition at line 78 of file CellMaker.h.

Referenced by execute(), initialize(), and ~CellMaker().

MagField* Atlfast::CellMaker::m_magField [private]
 

Definition at line 79 of file CellMaker.h.

Referenced by initialize(), and ~CellMaker().


The documentation for this class was generated from the following files:
Generated on Tue Jan 28 09:57:34 2003 for AtlfastAlgs by doxygen1.3-rc1