Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EventTagExample Class Reference

#include <EventTagExample.h>

List of all members.

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

IEventTagSvcm_EventTagSvc
IEventTagSvcm_EventTagSvc


Constructor & Destructor Documentation

EventTagExample::EventTagExample const std::string &  name,
ISvcLocator *  pSvcLocator
 

00015                                                                                 :
00016   Algorithm(name, pSvcLocator)
00017 {
00018 }

EventTagExample::EventTagExample const std::string &  name,
ISvcLocator *  pSvcLocator
 


Member Function Documentation

StatusCode EventTagExample::execute  ) 
 

StatusCode EventTagExample::execute  ) 
 

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 }

StatusCode EventTagExample::finalize  ) 
 

StatusCode EventTagExample::finalize  ) 
 

00081                                      {
00082 
00083 // Part 1: Get the messaging service, print where you are
00084   return StatusCode::SUCCESS;
00085 }

StatusCode EventTagExample::initialize  ) 
 

StatusCode EventTagExample::initialize  ) 
 

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 }


Member Data Documentation

IEventTagSvc* EventTagExample::m_EventTagSvc [private]
 

IEventTagSvc* EventTagExample::m_EventTagSvc [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:02:54 2011 for BOSS6.5.5 by  doxygen 1.3.9.1