Atlfast::AtlfastDumper Class Reference

Dumps information about ReconstructedParticle collections from the TES. More...

#include <AtlfastDumper.h>

Collaboration diagram for Atlfast::AtlfastDumper:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Private Member Functions

template<class Iter>
void sortAndDump (Iter, Iter, const std::string &) const
void dumpEH (const EventHeader *) const

Private Attributes

std::string m_clusterLocation
std::string m_jetLocation
std::string m_jetBLocation
std::string m_cellLocation
std::string m_imuonLocation
std::string m_nimuonLocation
std::string m_ielectronLocation
std::string m_nielectronLocation
std::string m_iphotonLocation
std::string m_niphotonLocation
std::string m_coordinates
TesIOm_tesIO
int m_eventNo
std::string m_mcLocation

Detailed Description

Dumps information about ReconstructedParticle collections from the TES.

Collection names to be dumped are specified by job options. Dumping is performed via the AtlfastDumperObject class.

Definition at line 60 of file AtlfastDumper.h.


Constructor & Destructor Documentation

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

Standard Athena-Algorithm Constructor

Definition at line 31 of file AtlfastDumper.cxx.

00032     : Algorithm( name, pSvcLocator ){
00033     
00034     
00035     // Default paths for entities in the TES
00036     m_clusterLocation         = "/Event/AtlfastClusters";
00037     m_jetLocation             = "/Event/AtlfastJets";
00038     m_jetBLocation            = "/Event/AtlfastBJets";
00039     m_cellLocation            = "/Event/AtlfastCells";
00040     m_imuonLocation           = "/Event/AtlfastIsolatedMuons";
00041     m_nimuonLocation          = "/Event/AtlfastNonIsolatedMuons";
00042     m_ielectronLocation       = "/Event/AtlfastIsolatedElectrons";
00043     m_nielectronLocation      = "/Event/AtlfastNonIsolatedElectrons";
00044     m_iphotonLocation         = "/Event/AtlfastIsolatedPhotons";
00045     m_niphotonLocation        = "/Event/AtlfastNonIsolatedPhotons";
00046     m_coordinates             = "PxPyPzE";
00047 
00048     declareProperty( "clusterLocation",     m_clusterLocation ) ;
00049     declareProperty( "jetLocation",         m_jetLocation ) ;
00050     declareProperty( "jetBLocation",        m_jetBLocation ) ;
00051     declareProperty( "cellLocation",        m_cellLocation ) ;
00052     declareProperty( "imuonLocation",       m_imuonLocation ) ;
00053     declareProperty( "nimuonLocation",      m_nimuonLocation ) ;
00054     declareProperty( "ielectronLocation",   m_ielectronLocation ) ;
00055     declareProperty( "nielectronLocation",  m_nielectronLocation ) ;    
00056     declareProperty( "iphotonLocation",     m_iphotonLocation ) ;
00057     declareProperty( "niphotonLocation",    m_niphotonLocation ) ;
00058     declareProperty( "coordinates",         m_coordinates ) ;
00059     
00060     m_eventNo = 0;
00061   }

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

Default Destructor

Definition at line 64 of file AtlfastDumper.cxx.

00064 {} 


Member Function Documentation

StatusCode Atlfast::AtlfastDumper::initialize (  )  [virtual]

Standard Athena-Algorithm method

Definition at line 73 of file AtlfastDumper.cxx.

00074   {
00075     //get the Global Event Data using singleton pattern
00076     GlobalEventData* ged = GlobalEventData::Instance();
00077     // load the location of the MC in StoreGate
00078     m_mcLocation       = ged -> mcLocation();
00079 
00080 
00081     MsgStream log( messageService(), name() ) ;
00082     log<<MSG::DEBUG<<"Initialising "<<endreq;
00083     //Helper class: IO from Transient store
00084     m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter()); 
00085   
00086     return StatusCode::SUCCESS ;
00087   }

StatusCode Atlfast::AtlfastDumper::execute (  )  [virtual]

Standard Athena-Algorithm method

Definition at line 106 of file AtlfastDumper.cxx.

00107   {
00108     //................................
00109     // make a message logging stream
00110     
00111     MsgStream log( messageService(), name() ) ;
00112     log<<MSG::DEBUG<<"Executing "<<endreq;
00113     
00114     ++m_eventNo;
00115 
00116 
00117     std::cout<<"------------ New Event "
00118              <<std::setw(8)<<m_eventNo<<" -----------"
00119              <<std::endl<<std::endl;
00120 
00121     //IsolatedPhotons: read from TES and dump
00122     std::vector<ReconstructedParticle*> iphotons;
00123     m_tesIO->copy<ReconstructedParticleCollection>(
00124                                                    iphotons, 
00125                                                    m_iphotonLocation
00126                                                    );
00127 
00128     this->sortAndDump(iphotons.begin(), iphotons.end(), m_iphotonLocation);
00130     //
00131     // NonIsolatedPhotons: read, sort and dump
00132     //
00134     std::vector<ReconstructedParticle*> niphotons;
00135     m_tesIO->copy<ReconstructedParticleCollection> (niphotons, 
00136                                                     m_niphotonLocation
00137                                                     );
00138     this->sortAndDump(niphotons.begin(), niphotons.end(), m_niphotonLocation);
00139     
00141     //
00142     // IsolatedElectrons: read, sort and dump
00143     //
00145 
00146     std::vector<ReconstructedParticle*> ielectrons;
00147     m_tesIO->copy<ReconstructedParticleCollection>(ielectrons, 
00148                                                    m_ielectronLocation
00149                                                    );
00150     this->sortAndDump(ielectrons.begin(), 
00151                       ielectrons.end(),
00152                       m_ielectronLocation 
00153                       );
00154 
00155     
00157     //
00158     // NonIsolatedElectrons: read, sort and dump
00159     //
00161 
00162     std::vector<ReconstructedParticle*> nielectrons;
00163     m_tesIO->copy<ReconstructedParticleCollection>(nielectrons, 
00164                                                    m_nielectronLocation
00165                                                    );
00166     this->sortAndDump(nielectrons.begin(), 
00167                       nielectrons.end(),
00168                       m_nielectronLocation );
00169 
00170     
00172     //
00173     // IsolatedMuons: read, sort and dump
00174     //
00176 
00177     std::vector<ReconstructedParticle*> imuons;
00178     m_tesIO->copy<ReconstructedParticleCollection>(imuons, 
00179                                                    m_imuonLocation
00180                                                    );
00181 
00182     this->sortAndDump(imuons.begin(), imuons.end(), m_imuonLocation );
00183 
00184     
00186     //
00187     // NonIsolatedMuons: read, sort and dump
00188     //
00190 
00191     std::vector<ReconstructedParticle*> nimuons;
00192     m_tesIO->copy<ReconstructedParticleCollection>(nimuons, 
00193                                                    m_nimuonLocation
00194                                                    );
00195     this->sortAndDump(nimuons.begin(), nimuons.end(), m_nimuonLocation );
00196     
00198     //
00199     // Clusters: read, sort and dump
00200     //
00202 
00203     std::vector<ICluster*> clusters;
00204     m_tesIO->copy<IClusterCollection>(clusters, m_clusterLocation);
00205     this->sortAndDump(clusters.begin(), clusters.end(), m_clusterLocation );
00206 
00208     //
00209     // Jets: read, sort and dump
00210     //
00212 
00213     std::vector<Jet*> jets;
00214     m_tesIO->copy<JetCollection>(jets, m_jetLocation);
00215     this->sortAndDump(jets.begin(), jets.end(), m_jetLocation );
00216 
00218     //
00219     // AtlfastB Jets: read, sort and dump
00220     //
00222 
00223     std::vector<Jet*> bjets;
00224     m_tesIO->copy<JetCollection>(bjets, m_jetBLocation);
00225     this->sortAndDump(bjets.begin(), bjets.end(), m_jetBLocation );
00226 
00228     //
00229     // ITwoCptCells: read, sort and dump
00230     //
00232 
00233     std::vector<ITwoCptCell*> cells;
00234     m_tesIO->copy<ITwoCptCellCollection>(cells, m_cellLocation);
00235     this->sortAndDump(cells.begin(), cells.end(), m_cellLocation );
00236 
00238     //
00239     // EventHeader: read  and dump
00240     //
00242 
00243     const EventHeader* eventHeader(0);
00244     m_tesIO->getDH(eventHeader);
00245     this->dumpEH(eventHeader);
00246   
00247     log<<MSG::INFO<<"End of execute "<<std::endl;    
00248 
00249     return StatusCode::SUCCESS;
00250 
00251   }

StatusCode Atlfast::AtlfastDumper::finalize (  )  [virtual]

Standard Athena-Algorithm method

Definition at line 93 of file AtlfastDumper.cxx.

00094   {
00095     // .. put any finalisation in here...
00096     
00097     return StatusCode::SUCCESS ;
00098   }

template<class Iter>
void Atlfast::AtlfastDumper::sortAndDump ( Iter  ,
Iter  ,
const std::string &   
) const [inline, private]

extracts particles from the TES

Definition at line 109 of file AtlfastDumper.h.

00111                                                                      {
00112     
00113     std::sort(start, end, SortAttribute::AscendingEta());
00114     std::for_each(start, end, AtlfastDumperObject(location, m_coordinates) );
00115 
00116   }

void Atlfast::AtlfastDumper::dumpEH ( const EventHeader  )  const [private]

Definition at line 252 of file AtlfastDumper.cxx.

00252                                                                {
00253     
00254     if(!eventHeader){
00255       std::cout<<"\n\n"<<std::string(73,' ')<<"EventHeader"<<std::endl;
00256     }else{
00257       std::cout<<"\n\n"
00258                <<"b, c tau Jets:     "  
00259                <<std::setw(6)<<eventHeader->nBJets()
00260                <<std::setw(6)<<eventHeader->nCJets()
00261                <<std::setw(6)<<eventHeader->nTauJets()
00262                <<std::string(36,' ')<<"EventHeader"<<std::endl;
00263 
00264       std::cout<<std::setprecision(3);
00265       std::cout
00266         <<"px, py Miss:       "  
00267         <<std::setw(12)<<eventHeader->pMiss().x()       
00268         <<std::setw(12)<<eventHeader->pMiss().y()
00269         <<std::string(30,' ')<<"EventHeader"<<std::endl;
00270 
00271       std::cout
00272         <<"px, py Escaped:    "  
00273         <<std::setw(12)<<eventHeader->pEscaped().x()    
00274         <<std::setw(12)<<eventHeader->pEscaped().y()
00275         <<std::string(30,' ')<<"EventHeader"<<std::endl;
00276 
00277 
00278       HepMC::WeightContainer weights = eventHeader->firstFewWeights(3);
00279       std::cout
00280         <<"weight1, 2, 3:     "  
00281         <<std::setw(12)<<weights[0]
00282         <<std::setw(12)<<weights[1]
00283         <<std::setw(12)<<weights[2]
00284         <<std::string(18,' ')<<"EventHeader"<<std::endl;
00285     }
00286   }


Member Data Documentation

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

TES input location

Definition at line 81 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_jetLocation [private]

Definition at line 82 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_jetBLocation [private]

Definition at line 83 of file AtlfastDumper.h.

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

Definition at line 84 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_imuonLocation [private]

Definition at line 85 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_nimuonLocation [private]

Definition at line 86 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_ielectronLocation [private]

Definition at line 87 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_nielectronLocation [private]

Definition at line 88 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_iphotonLocation [private]

Definition at line 89 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_niphotonLocation [private]

Definition at line 90 of file AtlfastDumper.h.

std::string Atlfast::AtlfastDumper::m_coordinates [private]

Definition at line 91 of file AtlfastDumper.h.

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

Definition at line 92 of file AtlfastDumper.h.

int Atlfast::AtlfastDumper::m_eventNo [private]

Definition at line 93 of file AtlfastDumper.h.

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

Definition at line 100 of file AtlfastDumper.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