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

Atlfast::StandardHistogramMaker Class Reference

Algorithm which makes some standard Atlfast debug histograms. More...

#include <StandardHistogramMaker.h>

Collaboration diagram for Atlfast::StandardHistogramMaker:

Collaboration graph
[legend]
List of all members.

Public Methods

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

Private Methods

void bookElectronHistograms ()
void bookPhotonHistograms ()
void bookIsolatedElectronHistograms ()
void bookIsolatedPhotonHistograms ()
void bookCellHistograms ()
void bookClusterHistograms ()
void fillElectronHistograms ()
void fillPhotonHistograms ()
void fillIsolatedElectronHistograms ()
void fillIsolatedPhotonHistograms ()
void fillCellHistograms ()
void fillClusterHistograms ()

Private Attributes

TesIO * m_tesIO
std::string m_electronLocation
std::string m_isolatedElectronLocation
std::string m_photonLocation
std::string m_isolatedPhotonLocation
std::string m_cellLocation
std::string m_clusterLocation
std::string m_mcTruthLocation
bool m_doElectronHistograms
bool m_doIsolatedElectronHistograms
bool m_doPhotonHistograms
bool m_doIsolatedPhotonHistograms
bool m_doCellHistograms
bool m_doClusterHistograms
IHistogram1D * m_h_electronMultiplicity
IHistogram1D * m_h_electronPt
IHistogram1D * m_h_isolatedElectronMultiplicity
IHistogram1D * m_h_isolatedElectronPt
IHistogram1D * m_h_photonMultiplicity
IHistogram1D * m_h_photonPt
IHistogram1D * m_h_isolatedPhotonMultiplicity
IHistogram1D * m_h_isolatedPhotonPt
IHistogram1D * m_h_cellMultiplicity
IHistogram1D * m_h_cellPt
IHistogram1D * m_h_clusterMultiplicity
IHistogram1D * m_h_clusterPt
int m_histStart
int m_nHist

Detailed Description

Algorithm which makes some standard Atlfast debug histograms.

Definition at line 64 of file StandardHistogramMaker.h.


Constructor & Destructor Documentation

Atlfast::StandardHistogramMaker::StandardHistogramMaker const std::string &    name,
ISvcLocator *    pSvcLocator
 

Definition at line 32 of file StandardHistogramMaker.cxx.

00033     : Algorithm( name, pSvcLocator )
00034 {
00035 
00036 
00037 
00038 
00039   // Default paths for entities in the TES
00040   m_electronLocation         = "/Event/Electrons";
00041   m_photonLocation           = "/Event/Photons";
00042   m_isolatedElectronLocation = "/Event/IsolatedElectrons";
00043   m_isolatedPhotonLocation   = "/Event/IsolatedPhotons";
00044   m_cellLocation             = "/Event/AtlfastCells";
00045   m_clusterLocation          = "/Event/Clusters";
00046   m_mcTruthLocation          = "/Event/McEventCollection";
00047 
00048 
00049   // Defaults for which sets of histograms to do
00050   m_doElectronHistograms         = true;
00051   m_doPhotonHistograms           = true;
00052   m_doIsolatedElectronHistograms = true;
00053   m_doIsolatedPhotonHistograms   = true;
00054   m_doCellHistograms             = true;
00055   m_doClusterHistograms          = true;
00056 
00057 
00058   // Default number at which to start the histograms
00059   m_histStart                    = 0;
00060 
00061   declareProperty( "ElectronLocation", m_electronLocation ) ;
00062   declareProperty( "PhotonLocation",   m_photonLocation );
00063   declareProperty( "IsolatedElectronLocation", m_isolatedElectronLocation );
00064   declareProperty( "IsolatedPhotonLocation", m_isolatedPhotonLocation );
00065   declareProperty( "CellLocation", m_cellLocation );
00066   declareProperty( "ClusterLocation", m_clusterLocation );
00067   declareProperty( "McTruthLocation", m_mcTruthLocation );
00068 
00069   declareProperty( "DoElectronHistograms",m_doElectronHistograms );
00070   declareProperty( "DoPhotonHistograms", m_doPhotonHistograms );
00071   declareProperty( "DoIsolatedElectronHistograms",m_doIsolatedElectronHistograms );
00072   declareProperty( "DoIsolatedPhotonHistograms",m_doIsolatedPhotonHistograms );
00073   declareProperty( "DoCellHistograms",m_doCellHistograms );
00074   declareProperty( "DoClusterHistograms",m_doClusterHistograms );
00075 
00076   declareProperty( "HistogramStart", m_histStart );
00077 
00078 
00079 }

Atlfast::StandardHistogramMaker::~StandardHistogramMaker  
 

Definition at line 80 of file StandardHistogramMaker.cxx.

00080 {}

Member Function Documentation

StatusCode Atlfast::StandardHistogramMaker::initialize  
 

Definition at line 86 of file StandardHistogramMaker.cxx.

References bookCellHistograms(), bookClusterHistograms(), bookElectronHistograms(), bookIsolatedElectronHistograms(), bookIsolatedPhotonHistograms(), bookPhotonHistograms(), m_histStart, m_nHist, and m_tesIO.

00087 {
00088   // .. put any initialisation in here...
00089   MsgStream log(messageService(), name());
00090   log << MSG::DEBUG << "in initialize()" << endreq;
00091   
00092   m_nHist = m_histStart;
00093   if ( m_doElectronHistograms ) bookElectronHistograms();
00094   if ( m_doPhotonHistograms ) bookPhotonHistograms();
00095   if ( m_doIsolatedElectronHistograms ) bookIsolatedElectronHistograms();
00096   if ( m_doIsolatedPhotonHistograms ) bookIsolatedPhotonHistograms();
00097   if ( m_doCellHistograms ) bookCellHistograms();
00098   if ( m_doClusterHistograms ) bookClusterHistograms();
00099 
00100   log << MSG::DEBUG << "Booked histograms OK" << endreq;
00101   //  m_tesIO = new TesIO(eventDataService());
00102   m_tesIO = new TesIO();
00103   return StatusCode::SUCCESS ;
00104 }

StatusCode Atlfast::StandardHistogramMaker::execute  
 

Definition at line 125 of file StandardHistogramMaker.cxx.

References fillCellHistograms(), fillClusterHistograms(), fillElectronHistograms(), fillIsolatedElectronHistograms(), fillIsolatedPhotonHistograms(), and fillPhotonHistograms().

00126 {
00127 
00128   //................................
00129   // make a message logging stream
00130 
00131   MsgStream log( messageService(), name() ) ;
00132   log << MSG::DEBUG << "Executing " << endreq;
00133 
00134   if ( m_doElectronHistograms ) fillElectronHistograms();
00135   if ( m_doPhotonHistograms ) fillPhotonHistograms();
00136   if ( m_doIsolatedElectronHistograms ) fillIsolatedElectronHistograms();
00137   if ( m_doIsolatedPhotonHistograms ) fillIsolatedPhotonHistograms();
00138   if ( m_doCellHistograms ) fillCellHistograms();
00139   if ( m_doClusterHistograms ) fillClusterHistograms();
00140     
00141   return StatusCode::SUCCESS ;
00142 }

StatusCode Atlfast::StandardHistogramMaker::finalize  
 

Definition at line 112 of file StandardHistogramMaker.cxx.

00113 {
00114   // .. put any finalisation in here...
00115   return StatusCode::SUCCESS ;
00116 }

void Atlfast::StandardHistogramMaker::bookElectronHistograms   [private]
 

Definition at line 147 of file StandardHistogramMaker.cxx.

References m_h_electronMultiplicity, m_h_electronPt, and m_nHist.

Referenced by initialize().

00147                                                      {
00148   MsgStream log( messageService(), name() );
00149   log << MSG::DEBUG << "Booking electron histograms" << endreq;
00150 
00151   // first increment the histogram count
00152   m_nHist++;
00153   // then book the histogram
00154   m_h_electronMultiplicity = 
00155     histoSvc()->book("/stat/simple/",m_nHist,"Electron Multiplicity",20,0.0,20.0);
00156   // or be a C++ guru and do both at once
00157   m_h_electronPt = 
00158     histoSvc()->book("/stat/simple/",++m_nHist,"Electron Pt",100,0.0,1000.0);
00159 
00160   //MC truth electrons
00161   
00162 
00163   return;
00164 }

void Atlfast::StandardHistogramMaker::bookPhotonHistograms   [private]
 

Definition at line 168 of file StandardHistogramMaker.cxx.

References m_h_photonMultiplicity, m_h_photonPt, and m_nHist.

Referenced by initialize().

00168                                                    {
00169   MsgStream log( messageService(), name() );
00170   log << MSG::DEBUG << "Booking photon histograms" << endreq;
00171 
00172   m_h_photonMultiplicity = 
00173     histoSvc()->book("/stat/simple/",++m_nHist,"Photon Multiplicity",100,0.0,100.0);
00174   // or be a C++ guru and do both at once
00175   m_h_photonPt = 
00176     histoSvc()->book("/stat/simple/",++m_nHist,"Photon Pt",100,0.0,1000.0);
00177   return;
00178 }

void Atlfast::StandardHistogramMaker::bookIsolatedElectronHistograms   [private]
 

Definition at line 182 of file StandardHistogramMaker.cxx.

References m_h_isolatedElectronMultiplicity, m_h_isolatedElectronPt, and m_nHist.

Referenced by initialize().

00182                                                              {
00183   MsgStream log( messageService(), name() );
00184   log << MSG::DEBUG << "Booking isolated electron histograms" << endreq;
00185 
00186   m_h_isolatedElectronMultiplicity = 
00187     histoSvc()->book("/stat/simple/",++m_nHist,"Isolated Electron Multiplicity",10,0.0,10.0);
00188   // or be a C++ guru and do both at once
00189   m_h_isolatedElectronPt = 
00190     histoSvc()->book("/stat/simple/",++m_nHist,"Isolated Electron Pt",100,0.0,1000.0);
00191   return;
00192 }

void Atlfast::StandardHistogramMaker::bookIsolatedPhotonHistograms   [private]
 

Definition at line 196 of file StandardHistogramMaker.cxx.

References m_h_isolatedPhotonMultiplicity, m_h_isolatedPhotonPt, and m_nHist.

Referenced by initialize().

00196                                                            {
00197   MsgStream log( messageService(), name() );
00198   log << MSG::DEBUG << "Booking isolated photon histograms" << endreq;
00199 
00200   m_h_isolatedPhotonMultiplicity = 
00201     histoSvc()->book("/stat/simple/",++m_nHist,"Isolated Photon Multiplicity",20,0.0,20.0);
00202   // or be a C++ guru and do both at once
00203   m_h_isolatedPhotonPt = 
00204     histoSvc()->book("/stat/simple/",++m_nHist,"Isolated Photon Pt",100,0.0,1000.0);
00205   return;
00206 }

void Atlfast::StandardHistogramMaker::bookCellHistograms   [private]
 

Definition at line 210 of file StandardHistogramMaker.cxx.

References m_h_cellMultiplicity, m_h_cellPt, and m_nHist.

Referenced by initialize().

00210                                                  {
00211   MsgStream log( messageService(), name() );
00212   log << MSG::DEBUG << "Booking Cell histograms" << endreq;
00213 
00214   m_h_cellMultiplicity = 
00215     histoSvc()->book("/stat/simple/",++m_nHist,"Cell Multiplicity",200,0.0,4000.0);
00216   // or be a C++ guru and do both at once
00217   m_h_cellPt = 
00218     histoSvc()->book("/stat/simple/",++m_nHist,"Cell Pt",100,0.0,1000.0);
00219   return;
00220 }

void Atlfast::StandardHistogramMaker::bookClusterHistograms   [private]
 

Definition at line 224 of file StandardHistogramMaker.cxx.

References m_h_clusterMultiplicity, m_h_clusterPt, and m_nHist.

Referenced by initialize().

00224                                                     {
00225   MsgStream log( messageService(), name() );
00226   log << MSG::DEBUG << "Booking Cluster histograms" << endreq;
00227 
00228   m_h_clusterMultiplicity = 
00229     histoSvc()->book("/stat/simple/",++m_nHist,"Cluster Multiplicity",10,0.0,10.0);
00230   // or be a C++ guru and do both at once
00231   m_h_clusterPt = 
00232     histoSvc()->book("/stat/simple/",++m_nHist,"Cluster Pt",100,0.0,1000.0);
00233   return;
00234 }

void Atlfast::StandardHistogramMaker::fillElectronHistograms   [private]
 

Definition at line 240 of file StandardHistogramMaker.cxx.

References m_electronLocation, m_h_electronMultiplicity, m_h_electronPt, and m_tesIO.

Referenced by execute().

00240                                                     {
00241 
00242   MsgStream log( messageService(), name() ) ;
00243   log << MSG::DEBUG << "Fillin Electron Histograms " << endreq;
00244   std::vector<ReconstructedParticle*> amyElectrons;
00245   if(!m_tesIO->
00246      copy<ReconstructedParticleCollection >(amyElectrons, m_electronLocation)){
00247     log << MSG::DEBUG << "no electrons found in the TES. This is probably normal" << endreq; 
00248     // fill any histograms that have meaning in the absence of electrons
00249     m_h_electronMultiplicity->fill(0.0,1.0);
00250   } else {
00251     // fill all electron histograms
00252     m_h_electronMultiplicity->fill(float(amyElectrons.size()),1.0);
00253     std::vector<ReconstructedParticle*>::const_iterator iter  = amyElectrons.begin();
00254     for (; iter != amyElectrons.end(); ++iter) {
00255       m_h_electronPt->fill(float( (*iter)->pT()), 1.0);
00256     }
00257   }
00258   return;
00259 }

void Atlfast::StandardHistogramMaker::fillPhotonHistograms   [private]
 

Definition at line 264 of file StandardHistogramMaker.cxx.

References m_h_photonMultiplicity, m_h_photonPt, m_photonLocation, and m_tesIO.

Referenced by execute().

00264                                                   {
00265 
00266   MsgStream log( messageService(), name() ) ;
00267   log << MSG::DEBUG << "Fillins Photon Histograms " << endreq;
00268   std::vector<ReconstructedParticle*> amyPhotons;
00269   if(!m_tesIO->copy<ReconstructedParticleCollection >
00270      (amyPhotons, m_photonLocation)){
00271     log << MSG::DEBUG << "no photons found in the TES. This is probably normal" << endreq; 
00272     // fill any histograms that have meaning in the absence of photons
00273     m_h_photonMultiplicity->fill(0.0,1.0);
00274   } else {
00275     // fill all photon histograms
00276     m_h_photonMultiplicity->fill(float(amyPhotons.size()),1.0);
00277     std::vector<ReconstructedParticle*>::const_iterator iter  = amyPhotons.begin();
00278     for (; iter != amyPhotons.end(); ++iter) {
00279       m_h_photonPt->fill(float( (*iter)->pT()), 1.0);
00280     }
00281   }
00282   return;
00283 }

void Atlfast::StandardHistogramMaker::fillIsolatedElectronHistograms   [private]
 

Definition at line 285 of file StandardHistogramMaker.cxx.

References m_h_isolatedElectronMultiplicity, m_h_isolatedElectronPt, m_isolatedElectronLocation, and m_tesIO.

Referenced by execute().

00285                                                             {
00286 
00287   MsgStream log( messageService(), name() ) ;
00288   log << MSG::DEBUG << "Filling Isolated Electron Histograms " << endreq;
00289   std::vector<ReconstructedParticle*> amyElectrons;
00290   if(!m_tesIO->copy<ReconstructedParticleCollection >
00291      (amyElectrons, m_isolatedElectronLocation)){
00292     log << MSG::DEBUG << "no electrons found in the TES. This is probably normal" << endreq; 
00293     // fill any histograms that have meaning in the absence of electrons
00294     m_h_isolatedElectronMultiplicity->fill(0.0,1.0);
00295   } else {
00296     // fill all electron histograms
00297     m_h_isolatedElectronMultiplicity->fill(float(amyElectrons.size()),1.0);
00298     std::vector<ReconstructedParticle*>::const_iterator iter  = amyElectrons.begin();
00299     for (; iter != amyElectrons.end(); ++iter) {
00300       m_h_isolatedElectronPt->fill(float( (*iter)->pT()), 1.0);
00301     }
00302   }
00303   return;
00304 }

void Atlfast::StandardHistogramMaker::fillIsolatedPhotonHistograms   [private]
 

Definition at line 308 of file StandardHistogramMaker.cxx.

References m_h_isolatedPhotonMultiplicity, m_h_isolatedPhotonPt, m_isolatedPhotonLocation, and m_tesIO.

Referenced by execute().

00308                                                           {
00309 
00310   MsgStream log( messageService(), name() ) ;
00311   log << MSG::DEBUG << "Filling isolated Photon Histograms " << endreq;
00312   std::vector<ReconstructedParticle*> amyPhotons;
00313   if(!m_tesIO->copy<ReconstructedParticleCollection >
00314      (amyPhotons, m_isolatedPhotonLocation)){
00315     log << MSG::DEBUG << "no photons found in the TES. This is probably normal" << endreq; 
00316     // fill any histograms that have meaning in the absence of photons
00317     m_h_isolatedPhotonMultiplicity->fill(0.0,1.0);
00318   } else {
00319     // fill all photon histograms
00320     m_h_isolatedPhotonMultiplicity->fill(float(amyPhotons.size()),1.0);
00321     std::vector<ReconstructedParticle*>::const_iterator iter  = amyPhotons.begin();
00322     for (; iter != amyPhotons.end(); ++iter) {
00323       m_h_isolatedPhotonPt->fill(float( (*iter)->pT()), 1.0);
00324     }
00325   }
00326   return;
00327 }

void Atlfast::StandardHistogramMaker::fillCellHistograms   [private]
 

Definition at line 331 of file StandardHistogramMaker.cxx.

Referenced by execute().

00331                                                 {
00332 
00333   MsgStream log( messageService(), name() ) ;
00334   log << MSG::DEBUG << "Filling Cell Histograms, currently empty " << endreq;
00335 
00336   return;
00337 }

void Atlfast::StandardHistogramMaker::fillClusterHistograms   [private]
 

Definition at line 340 of file StandardHistogramMaker.cxx.

Referenced by execute().

00340                                                    {
00341 
00342   MsgStream log( messageService(), name() ) ;
00343   log << MSG::DEBUG << "Filling Cluster Histograms, currently empty " << endreq;
00344 
00345   return;
00346 }

Member Data Documentation

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

Definition at line 111 of file StandardHistogramMaker.h.

Referenced by fillElectronHistograms(), fillIsolatedElectronHistograms(), fillIsolatedPhotonHistograms(), fillPhotonHistograms(), and initialize().

std::string Atlfast::StandardHistogramMaker::m_electronLocation [private]
 

Definition at line 118 of file StandardHistogramMaker.h.

Referenced by fillElectronHistograms().

std::string Atlfast::StandardHistogramMaker::m_isolatedElectronLocation [private]
 

Definition at line 119 of file StandardHistogramMaker.h.

Referenced by fillIsolatedElectronHistograms().

std::string Atlfast::StandardHistogramMaker::m_photonLocation [private]
 

Definition at line 120 of file StandardHistogramMaker.h.

Referenced by fillPhotonHistograms().

std::string Atlfast::StandardHistogramMaker::m_isolatedPhotonLocation [private]
 

Definition at line 121 of file StandardHistogramMaker.h.

Referenced by fillIsolatedPhotonHistograms().

std::string Atlfast::StandardHistogramMaker::m_cellLocation [private]
 

Definition at line 122 of file StandardHistogramMaker.h.

std::string Atlfast::StandardHistogramMaker::m_clusterLocation [private]
 

Definition at line 123 of file StandardHistogramMaker.h.

std::string Atlfast::StandardHistogramMaker::m_mcTruthLocation [private]
 

Definition at line 124 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doElectronHistograms [private]
 

Definition at line 131 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doIsolatedElectronHistograms [private]
 

Definition at line 132 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doPhotonHistograms [private]
 

Definition at line 133 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doIsolatedPhotonHistograms [private]
 

Definition at line 134 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doCellHistograms [private]
 

Definition at line 135 of file StandardHistogramMaker.h.

bool Atlfast::StandardHistogramMaker::m_doClusterHistograms [private]
 

Definition at line 136 of file StandardHistogramMaker.h.

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_electronMultiplicity [private]
 

Definition at line 143 of file StandardHistogramMaker.h.

Referenced by bookElectronHistograms(), and fillElectronHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_electronPt [private]
 

Definition at line 144 of file StandardHistogramMaker.h.

Referenced by bookElectronHistograms(), and fillElectronHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_isolatedElectronMultiplicity [private]
 

Definition at line 147 of file StandardHistogramMaker.h.

Referenced by bookIsolatedElectronHistograms(), and fillIsolatedElectronHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_isolatedElectronPt [private]
 

Definition at line 148 of file StandardHistogramMaker.h.

Referenced by bookIsolatedElectronHistograms(), and fillIsolatedElectronHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_photonMultiplicity [private]
 

Definition at line 151 of file StandardHistogramMaker.h.

Referenced by bookPhotonHistograms(), and fillPhotonHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_photonPt [private]
 

Definition at line 152 of file StandardHistogramMaker.h.

Referenced by bookPhotonHistograms(), and fillPhotonHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_isolatedPhotonMultiplicity [private]
 

Definition at line 155 of file StandardHistogramMaker.h.

Referenced by bookIsolatedPhotonHistograms(), and fillIsolatedPhotonHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_isolatedPhotonPt [private]
 

Definition at line 156 of file StandardHistogramMaker.h.

Referenced by bookIsolatedPhotonHistograms(), and fillIsolatedPhotonHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_cellMultiplicity [private]
 

Definition at line 159 of file StandardHistogramMaker.h.

Referenced by bookCellHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_cellPt [private]
 

Definition at line 160 of file StandardHistogramMaker.h.

Referenced by bookCellHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_clusterMultiplicity [private]
 

Definition at line 163 of file StandardHistogramMaker.h.

Referenced by bookClusterHistograms().

IHistogram1D* Atlfast::StandardHistogramMaker::m_h_clusterPt [private]
 

Definition at line 164 of file StandardHistogramMaker.h.

Referenced by bookClusterHistograms().

int Atlfast::StandardHistogramMaker::m_histStart [private]
 

Definition at line 168 of file StandardHistogramMaker.h.

Referenced by initialize().

int Atlfast::StandardHistogramMaker::m_nHist [private]
 

Definition at line 170 of file StandardHistogramMaker.h.

Referenced by bookCellHistograms(), bookClusterHistograms(), bookElectronHistograms(), bookIsolatedElectronHistograms(), bookIsolatedPhotonHistograms(), bookPhotonHistograms(), and initialize().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:18:59 2003 for AtlfastAlgs by doxygen1.3-rc1