ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwTime.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6
7NAME: CaloSwTime.cxx
8PACKAGE: offline/Calorimeter/CaloSwTime
9
10AUTHORS: G.Unal
11CREATED: December 2008
12
13PURPOSE: Refined time estimate from SW EM clusters
14
15********************************************************************/
16
17#include "CaloSwTime.h"
18#include "CaloEvent/CaloCell.h"
19
20
21void CaloSwTime::makeCorrection (const Context& /*myctx*/,
22 xAOD::CaloCluster* cluster) const
23{
24
25
26 double emax=-9999.;
27 double time=0.;
28
29 xAOD::CaloCluster::cell_iterator cellIter = cluster->cell_begin();
30 xAOD::CaloCluster::cell_iterator cellIterEnd = cluster->cell_end();
31 for (;cellIter!=cellIterEnd;cellIter++) {
32 const CaloCell* cell = (*cellIter);
33 CaloCell_ID::CaloSample sampling = cell->caloDDE()->getSampling();
34 if (sampling== CaloCell_ID::EMB2 || sampling== CaloCell_ID::EME2) {
35 if ( (cell->provenance() & 0x2000) ) {
36 if (cell->e() > emax) {
37 emax=cell->e();
38 time = cell->time();
39 }
40 }
41 }
42 }
43
44 ATH_MSG_DEBUG( " Cluster: emax,time " << emax << " " << time << endmsg);
45
46 if (emax>0.) cluster->setTime(time);
47
48}
49
#define endmsg
#define ATH_MSG_DEBUG(x)
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
void setTime(flt_t)
Set cluster time.
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
const_cell_iterator cell_end() const
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.