26 MsgStream log(
msgSvc(), name() );
28 m_EventTag = initialEventTag;
30 if ( ( m_EventTag & 0xF ) == 1 )
return StatusCode::SUCCESS;
35 log << MSG::ERROR <<
"Can not open McParticleCollection" << endmsg;
36 return StatusCode::SUCCESS;
39 if ( m_EventTag == 0 )
41 for ( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end();
45 long int pdg =
abs( ( *it )->particleProperty() );
46 if ( ( ( pdg % 1000 ) / 10 ) == 44 )
48 m_EventTag = ( (int)( pdg == 443 ) ) * 4 + ( (
int)( pdg == 100443 ) ) * 5 +
49 ( (int)( pdg == 30443 ) ) * 6 + ( (
int)( pdg == 9000443 ) ) * 7 +
50 ( (int)( pdg == 9010443 ) ) * 8 + ( (
int)( pdg == 9020443 ) ) * 9;
56 if ( m_EventTag == 0 )
59 for ( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end();
62 if ( ( *it )->decayInFlight() || ( *it )->primaryParticle() )
continue;
63 long int pdg =
abs( ( *it )->particleProperty() );
79 else if ( ( pdg > 0 ) && ( pdg < 9 ) )
87 if ( ( ( m_EventTag & 0xf ) > 3 ) && ( ( m_EventTag & 0xf ) < 9 ) )
91 for ( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end();
94 long int pdg = ( *it )->particleProperty();
95 if ( ( ( pdg % 1000 ) / 10 ) != 44 )
continue;
97 m_EventTag |= ( m_EventTagSvc->getCharmDecayType( *it ) ) << 4;
98 m_EventTag |= ( m_EventTagSvc->getChainCode( *it ) ) << 8;
103 else if ( ( m_EventTag & 0xf ) == 0x2 )
108 for ( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end();
111 long int pdg =
abs( ( *it )->particleProperty() );
112 bool good = ( !( *it )->decayInFlight() ) && ( !( *it )->primaryParticle() );
113 ncha += ( (int)( good && ( ( pdg == 11 ) || ( pdg == 13 ) || ( pdg == 211 ) ||
114 ( pdg == 321 ) || ( pdg == 2212 ) || ( pdg == 1011 ) ) ) );
115 nneu += ( (int)( good && ( ( pdg == 111 ) || ( pdg == 310 ) || ( pdg == 130 ) ||
116 ( pdg == 2112 ) ) ) );
123 m_EventTag |= ( ( ncha & 0xF ) << 8 );
124 m_EventTag |= ( ( nneu & 0xF ) << 12 );
125 if ( ( m_EventTag & 0xf0 ) == 0x40 )
128 for ( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end();
131 long int pdg = ( *it )->particleProperty();
135 m_EventTag |= ( m_EventTagSvc->getDecayCode( *it ) ) << 16;
138 else if ( pdg == 15 )
140 m_EventTag |= ( m_EventTagSvc->getDecayCode( *it ) ) << 24;
147 SmartDataPtr<Event::EventHeader> evHead( eventSvc(), EventModel::EventHeader );
150 log << MSG::ERROR <<
" Can not to retreave EventHeader" << endmsg;
151 return StatusCode::SUCCESS;
153 evHead->setEventTag( m_EventTag );
155 return StatusCode::SUCCESS;