139{
140
141 std::vector<double> eCells_EM;
142 std::vector<double> eCells_HEC;
143 std::vector<double> eCells_FCAL;
144
145 unsigned int ncells_em =
m_larem_id->channel_hash_max();
146 unsigned int ncells_hec =
m_larhec_id->channel_hash_max();
147 unsigned int ncells_fcal =
m_larfcal_id->channel_hash_max();
148
149 ATH_MSG_INFO(
" ncells " << ncells_em <<
" " << ncells_hec <<
" " << ncells_fcal);
150
152 eCells_EM.resize(ncells_em,0.);
154 eCells_HEC.resize(ncells_hec,0.);
156 eCells_FCAL.resize(ncells_fcal,0.);
157
158
159
160
165
167
171 if (
sc.isFailure()) {
174 }
175 }
179 if (
sc.isFailure()) {
182 }
183 }
184
188 if (
sc.isFailure()) {
191 }
192 }
196 if (
sc.isFailure()) {
199 }
200 }
201
202
203
204
205 int nhit_tot=0;
206
207 for (
unsigned int iHitContainer=0;iHitContainer<
m_HitContainer.size();iHitContainer++)
208 {
209
211
212 int ical=0;
215 {
216 ical=1;
217 }
219 {
220 ical=2;
221 }
223 {
224 ical=3;
225 }
226 else
227 {
229 return StatusCode::FAILURE;
230 }
231
233 TimedHitContList hitContList;
234
235
236
238 ,hitContList).isSuccess()) && hitContList.empty()) {
240 return StatusCode::FAILURE;
241 }
242
243
244 TimedHitContList::iterator iFirstCont(hitContList.begin());
245 TimedHitContList::iterator iEndCont(hitContList.end());
246 while (iFirstCont != iEndCont) {
247
249
252
253 while (f_cell != l_cell) {
254 double energy = (*f_cell)->energy();
255 Identifier cellId = (*f_cell)->cellID();
256 ++f_cell;
257 nhit_tot++;
258 IdentifierHash idHash;
259 if (ical==1) {
261 if (idHash<ncells_em) eCells_EM[idHash] +=
energy;
262 }
263 else if(ical==2) {
265 if (idHash<ncells_hec) eCells_HEC[idHash] +=
energy;
266 }
267 else if(ical==3) {
269 if (idHash<ncells_fcal) eCells_FCAL[idHash] +=
energy;
270 }
271 }
272 ++iFirstCont;
273 }
274
275 }
276
277 ATH_MSG_INFO(
" total number of hits found " << nhit_tot);
278
279
281
283 int nhit=0;
284 for (
unsigned int i=0;
i<ncells_em;
i++) {
285 IdentifierHash idHash =
i;
286 Identifier cellId =
m_larem_id->channel_id(idHash);
288 if (energy>1e-6) {
290 LArHit* hit = new LArHit(cellId,energy,time);
293 nhit++;
294 }
296 LArHit* hit = new LArHit(cellId,energy,time);
299 nhit++;
300 }
301 }
302 }
303 ATH_MSG_INFO(
" Number of hits filled in LArHitEM containers " << nhit);
304 }
305
307 int nhit=0;
308 for (
unsigned int i=0;
i<ncells_hec;
i++) {
309 IdentifierHash idHash =
i;
310 Identifier cellId =
m_larhec_id->channel_id(idHash);
312 if (energy>1e-6) {
313 LArHit* hit = new LArHit(cellId,energy,time);
316 nhit++;
317 }
318 }
319 ATH_MSG_INFO(
" Number of hits filled in LArHitHEC container " << nhit);
320 }
321
323 int nhit=0;
324 for (
unsigned int i=0;
i<ncells_fcal;
i++) {
325 IdentifierHash idHash =
i;
327 double energy = eCells_FCAL[
i];
328 if (energy>1e-6) {
329 LArHit* hit = new LArHit(cellId,energy,time);
332 nhit++;
333 }
334 }
335 ATH_MSG_INFO(
" Number of hits filled in LArHitFCAL container " << nhit);
336 }
337
338
339
340
341 if (larhit_emb) {
343 if (
sc.isFailure()) {
345 return(StatusCode::FAILURE);
346 }
347 }
348
349 if (larhit_emec) {
351 if (
sc.isFailure()) {
353 return(StatusCode::FAILURE);
354 }
355 }
356
357 if (larhit_hec) {
359 if (
sc.isFailure()) {
361 return(StatusCode::FAILURE);
362 }
363 }
364
365 if (larhit_fcal) {
367 if (
sc.isFailure()) {
369 return(StatusCode::FAILURE);
370 }
371 }
372
373
374 return StatusCode::SUCCESS;
375
376}
ServiceHandle< StoreGateSvc > & evtStore()
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
const_iterator end() const
const_iterator begin() const
std::vector< std::string > m_HitContainer
StringProperty m_ForWardHitContainerName
StringProperty m_EmEndCapHitContainerName
StringProperty m_EmBarrelHitContainerName
const LArEM_ID * m_larem_id
std::vector< bool > m_SubDetFlag
const LArFCAL_ID * m_larfcal_id
StringProperty m_HecHitContainerName
ServiceHandle< PileUpMergeSvc > m_mergeSvc
const LArHEC_ID * m_larhec_id
std::vector< int > m_CaloType
void finalize()
The method to be called at the end of event by SD.
time(flags, cells_name, *args, **kw)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::list< value_t > type
type of the collection of timed data object