#include <EventTagExample.h>
Public Member Functions | |
EventTagExample (const std::string &name, ISvcLocator *pSvcLocator) | |
EventTagExample (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | execute () |
StatusCode | execute () |
StatusCode | finalize () |
StatusCode | finalize () |
StatusCode | initialize () |
StatusCode | initialize () |
Private Attributes | |
IEventTagSvc * | m_EventTagSvc |
IEventTagSvc * | m_EventTagSvc |
|
00015 : 00016 Algorithm(name, pSvcLocator) 00017 { 00018 }
|
|
|
|
|
|
00040 { 00041 // Part 1: Get the messaging service, print where you are 00042 MsgStream log(msgSvc(), name()); 00043 SmartDataPtr<Event::McParticleCol> mcParticles(eventSvc(),"/Event/MC/McParticleCol"); 00044 if( ! mcParticles ){ 00045 log<<MSG::ERROR<<" Unable to retrieve McParticleCol"<<endreq; 00046 return StatusCode::StatusCode::SUCCESS ; 00047 }; 00048 00049 SmartDataPtr<Event::EventHeader> evHead( eventSvc(), EventModel::EventHeader); 00050 if(!evHead){ 00051 log<<MSG::ERROR<< " Can not to retreave EventHeader" << endreq; 00052 return StatusCode::SUCCESS; 00053 } 00054 unsigned int evTag=evHead->eventTag(); 00055 00056 // select radiation decay of J/psi or transition to eta_c 00057 // if(((evTag&0xFF)!=0x54)&&((evTag&0xFF)!=0x34))return StatusCode::SUCCESS; 00058 00059 cout<<endl; 00060 cout<<"%%%%%%%%%%%%"<<endl; 00061 printf(" eventTag:%8X GeneralType:%2X DecayClass:%2X Decay chain:%4X %10X %10X\n",evTag,evTag&0xF 00062 ,(evTag&0xF0)>>4,(evTag&0xFF00)>>8,(evTag&0xFF0000)>>16,(evTag&0xFF000000)>>24); 00063 for(Event::McParticleCol::iterator it=mcParticles->begin();it!=mcParticles->end();it++){ 00064 int pdg=(*it)->particleProperty(); 00065 if((((abs(pdg))%1000)/100) == 4)cout<<"***"; 00066 printf(" Particle: %9i %10s Decay Type:%2X DecayCode:%2X ChainCode:%8X\n" 00067 ,pdg 00068 ,m_EventTagSvc->pdg2name(pdg).c_str() 00069 ,m_EventTagSvc->getCharmDecayType(*it) 00070 ,m_EventTagSvc->getDecayCode(*it) 00071 ,m_EventTagSvc->getChainCode(*it) 00072 ); 00073 } 00074 00075 00076 return StatusCode::SUCCESS; 00077 }
|
|
|
|
00081 { 00082 00083 // Part 1: Get the messaging service, print where you are 00084 return StatusCode::SUCCESS; 00085 }
|
|
|
|
00022 { 00023 00024 // Part 1: Get the messaging service, print where you are 00025 MsgStream log(msgSvc(), name()); 00026 log << MSG::INFO << " EventTagExample initialize()" << endreq; 00027 static const bool CREATEIFNOTTHERE(true); 00028 StatusCode EventTagSvcStatus = service("EventTagSvc", m_EventTagSvc, CREATEIFNOTTHERE); 00029 if (!EventTagSvcStatus.isSuccess() || 0 ==m_EventTagSvc ) { 00030 log << MSG::ERROR << " Could not initialize Decay code service" << endreq; 00031 return EventTagSvcStatus; 00032 } 00033 00034 00035 return StatusCode::SUCCESS; 00036 }
|
|
|
|
|