73 {
74
75 MsgStream log(
msgSvc(), name() );
76 log << MSG::INFO << "in execute()" << endmsg;
77
79 {
80
82 << endmsg;
83
84 }
85 else
86 {
87
89 << endmsg;
90
91 }
92 SmartDataPtr<HltInf> hlt( eventSvc(), "/Event/Hlt/HltInf" );
93 bool dstFlag = false;
94 if ( !hlt )
95 {
96 log << MSG::WARNING << "Could not find Event HltInf (try DstHltInf now)" << endmsg;
97 SmartDataPtr<DstHltInf> hltDst( eventSvc(), "/Event/Hlt/DstHltInf" );
98 if ( !hltDst )
99 {
100 log << MSG::FATAL << "Could not find Event DstHltInf too ( please re-generate data)"
101 << endmsg;
102 return ( StatusCode::FAILURE );
103 }
104 else
105 {
106 hlt = hltDst;
107 dstFlag = true;
108 }
109 }
110
111 uint32_t type = hlt->getEventType();
112 for ( int i = 0; i < 32; i++ )
113 {
114 if ( ( 1 << i ) & type ) m_type = i;
115 }
116 m_alg = hlt->getAlgProcess();
117 m_endEE = hlt->getCriteriaTable();
118 m_version = hlt->getVersion();
119 m_etot = hlt->getTotalEnergy();
120 m_nmdc0 = hlt->getNMDC();
121 m_ntof0 = hlt->getNTOF();
122 m_nemc0 = hlt->getNEMC();
123 m_nmuc0 = hlt->getNMUC();
124 m_ncon0 = hlt->getNCON();
125 m_nmdc = 0;
126 m_ntof = 0;
127 m_nemc = 0;
128 m_nmuc = 0;
129 m_ncon = 0;
130 if ( !dstFlag )
131 {
132 vector<uint32_t>::iterator it;
133
134 vector<uint32_t> mdcData = hlt->getDataVec(
HltID::MDC );
135 it = mdcData.begin();
136 for ( ; it != mdcData.end(); it++, m_nmdc++ )
137 {
138 if ( m_nmdc > 1 ) m_mdcData[m_nmdc] = *( (float*)&( *it ) );
139 else m_mdcData[m_nmdc] = *it;
140 }
141
142 vector<uint32_t> tofData = hlt->getDataVec(
HltID::TOF );
143 it = tofData.begin();
144 for ( ; it != tofData.end(); it++, m_ntof++ )
145 {
146 if ( m_ntof > 0 ) m_tofData[m_ntof] = *( (float*)&( *it ) );
147 else m_tofData[m_ntof] = *it;
148 }
149
150 vector<uint32_t> emcData = hlt->getDataVec(
HltID::EMC );
151 it = emcData.begin();
152 for ( ; it != emcData.end(); it++, m_nemc++ )
153 {
154 if ( !( m_nemc == 0 || m_nemc == 7 || m_nemc == 8 ) )
155 m_emcData[m_nemc] = *( (float*)&( *it ) );
156 else m_emcData[m_nemc] = *it;
157 }
158
159 vector<uint32_t> mucData = hlt->getDataVec(
HltID::MUC );
160 it = mucData.begin();
161 for ( ; it != mucData.end(); it++, m_nmuc++ )
162 {
163 if ( m_nmuc > 1 ) m_mucData[m_nmuc] = *( (float*)&( *it ) );
164 else m_mucData[m_nmuc] = *it;
165 }
166
167 vector<uint32_t> conData = hlt->getDataVec(
HltID::CON );
168 it = conData.begin();
169 for ( ; it != conData.end(); it++, m_ncon++ )
170 {
171 m_conData[m_ncon] = *it;
172 }
173 }
174
175 m_tuple->write();
176
177 return StatusCode::SUCCESS;
178}
static const std::string & getName()