2#include "GaudiKernel/IHistogramSvc.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/ISvcLocator.h"
5#include "GaudiKernel/SmartDataPtr.h"
6#include "GaudiKernel/SmartDataLocator.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
27 declareProperty(
"PrintLevel", m_OutputLevel=0);
28 declareProperty(
"FileName", m_FileName );
29 declareProperty(
"fstreamOption",m_fstreamOption=1);
37 if(m_fstreamOption==0)
39 os.open(m_FileName.c_str(),ios::app);
41 else os.open(m_FileName.c_str());
47 MsgStream log(
msgSvc(), name());
48 log<<MSG::INFO<<
"PrintMcInfo::initialize()"<<endreq;
51 return StatusCode::SUCCESS;
54 MsgStream log(
msgSvc(), name());
55 log<<MSG::INFO<<
"PrintMcInfo::beginRun()"<<endreq;
57 return StatusCode::SUCCESS;
66 MsgStream log(
msgSvc(), name());
67 log<<MSG::INFO<<
"PrintMcInfo::execute()"<<endreq;
76 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
77 int runNo=eventHeader->runNumber();
78 int event=eventHeader->eventNumber();
79 os<<
"run number:"<<
runNo<<endl
80 <<
"event number:"<<
event<<endl<<endl;
83 SmartDataPtr<Event::McParticleCol> mcPartCol(eventSvc(),
"/Event/MC/McParticleCol");
88 log << MSG::ERROR <<
"Could not retrieve McParticelCol" << endreq;
89 return StatusCode::FAILURE;
92 Event::McParticleCol::iterator iter_mc = mcPartCol->begin();
93 for (;iter_mc !=mcPartCol->end();iter_mc++)
95 bool primary = (*iter_mc)->primaryParticle();
96 bool gamma = ((*iter_mc)->particleProperty())==22?
true:
false;
104 os<<endl<<
"\n- - - - - - - - - - - - - - Information in this decay tree : particle level - - - - - - - - - - - - - -- - -- - -\n"<<endl;
110 os<<endl<<
"\n- - - - - - - - - - - - - - Information in this decay tree : hit level - - - - - - - - - - - - - - - - - - - -\n"<<endl;
117 os<<endl<<
"\n- - - - - - - - - - - - - - Digi Information in this EVENT - - - - - - - - - - - - - - - - - - -\n"<<endl;
121 os<<endl<<
"\n******************************** end of this event *********************************\n"<<endl;
125 return StatusCode::SUCCESS;
132 MsgStream log(
msgSvc(), name());
133 log<<MSG::INFO<<
"PrintMcInfo::endRun()"<<endreq;
134 return StatusCode::SUCCESS;
138 MsgStream log(
msgSvc(), name());
139 log<<MSG::INFO<<
"PrintMcInfo::finalize()"<<endreq;
140 return StatusCode::SUCCESS;
void printPartInf(ofstream &, Event::McParticle *, int, int)
void printTree(ofstream &, Event::McParticle *, int, int)
PrintMcInfo(const std::string &name, ISvcLocator *pSvcLocator)
void printDigi(ofstream &)
void printTitle(ofstream &os, int)