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"
28 declareProperty(
"PrintLevel", m_OutputLevel=0);
29 declareProperty(
"FileName", m_FileName );
30 declareProperty(
"fstreamOption",m_fstreamOption=1);
38 if(m_fstreamOption==0)
40 os.open(m_FileName.c_str(),ios::app);
42 else os.open(m_FileName.c_str());
48 MsgStream log(
msgSvc(), name());
49 log<<MSG::INFO<<
"PrintMcInfo::initialize()"<<endreq;
52 return StatusCode::SUCCESS;
55 MsgStream log(
msgSvc(), name());
56 log<<MSG::INFO<<
"PrintMcInfo::beginRun()"<<endreq;
58 return StatusCode::SUCCESS;
67 MsgStream log(
msgSvc(), name());
68 log<<MSG::INFO<<
"PrintMcInfo::execute()"<<endreq;
77 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
78 int runNo=eventHeader->runNumber();
79 int event=eventHeader->eventNumber();
80 os<<
"run number:"<<
runNo<<endl
81 <<
"event number:"<<
event<<endl<<endl;
84 SmartDataPtr<Event::McParticleCol> mcPartCol(eventSvc(),
"/Event/MC/McParticleCol");
89 log << MSG::ERROR <<
"Could not retrieve McParticelCol" << endreq;
90 return StatusCode::FAILURE;
93 Event::McParticleCol::iterator iter_mc = mcPartCol->begin();
94 for (;iter_mc !=mcPartCol->end();iter_mc++)
96 bool primary = (*iter_mc)->primaryParticle();
97 bool gamma = ((*iter_mc)->particleProperty())==22?
true:
false;
105 os<<endl<<
"\n- - - - - - - - - - - - - - Information in this decay tree : particle level - - - - - - - - - - - - - -- - -- - -\n"<<endl;
111 os<<endl<<
"\n- - - - - - - - - - - - - - Information in this decay tree : hit level - - - - - - - - - - - - - - - - - - - -\n"<<endl;
118 os<<endl<<
"\n- - - - - - - - - - - - - - Digi Information in this EVENT - - - - - - - - - - - - - - - - - - -\n"<<endl;
122 os<<endl<<
"\n******************************** end of this event *********************************\n"<<endl;
126 return StatusCode::SUCCESS;
133 MsgStream log(
msgSvc(), name());
134 log<<MSG::INFO<<
"PrintMcInfo::endRun()"<<endreq;
135 return StatusCode::SUCCESS;
139 MsgStream log(
msgSvc(), name());
140 log<<MSG::INFO<<
"PrintMcInfo::finalize()"<<endreq;
141 return StatusCode::SUCCESS;
void printPartInf(ofstream &, Event::McParticle *, int, int)
void printTree(ofstream &, Event::McParticle *, int, int)
void printDigi(ofstream &)
void printTitle(ofstream &os, int)