43{
44
45 auto timer = Monitored::Timer(
"TIME_exec");
46 auto clET = Monitored::Scalar("TrigEMCluster_eT",-999.0);
47 auto clHET = Monitored::Scalar("TrigEMCluster_had1",-999.0);
48 auto clEta = Monitored::Scalar("TrigEMCluster_eta",-999.0);
49 auto clPhi = Monitored::Scalar("TrigEMCluster_phi",-999.0);
50 auto clReta = Monitored::Scalar("TrigEMCluster_rEta",-999.0);
51 auto clETrings = Monitored::Scalar("TrigEMCluster_et_rings",-999.0);
52 auto res_et = Monitored::Scalar("Resolution_et",-999.0);
53 auto monitoring = Monitored::Group(
m_monTool, timer, clET, clHET, clEta, clPhi, clReta,clETrings,res_et);
54
55
56 SG::WriteHandle<xAOD::TrigEMClusterContainer> trigEmClusterCollection(
m_clusterContainerKey, context);
57 ATH_CHECK( trigEmClusterCollection.record(std::make_unique<xAOD::TrigEMClusterContainer>(),
58 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
59
60
62 if (!roisHandle.isValid()) {
64 return StatusCode::SUCCESS;
65 }
66
67
68 trigEmClusterCollection->reserve(roisHandle->size());
69
70 ATH_MSG_DEBUG(
"RoI descriptor size is " << roisHandle->size() );
71
73 float etaL1, phiL1;
74 double etamin, etamax, phimin, phimax;
75
76 ATH_MSG_DEBUG(
"RoI eta = " << roiDescriptor->eta() <<
" RoI phi = " << roiDescriptor->phi());
77
79
81 etamax = std::min( 2.5, roiDescriptor->eta() +
m_etaWidth);
82
85
86 etaL1 = roiDescriptor->eta();
87 phiL1 = roiDescriptor->phi();
88 }
89 else {
92
95
98 }
99
101 roiDescriptor->phi(), phimin, phimax);
102
103
104 ATH_MSG_DEBUG(
" etamin = " << etamin <<
" etamax = " << etamax <<
105 " phimin = " << phimin << " phimax = " << phimax);
106
108 trigEmClusterCollection->push_back(ptrigEmCluster);
110 ptrigEmCluster->
setEt(0.0);
126
127
128 for (
int i = 0;
i < CaloSampling::CaloSample::MINIFCAL0;
i++) {
131 }
132
133 ptrigEmCluster->
setEta(etaL1);
134 ptrigEmCluster->
setPhi(phiL1);
135
136
137
138
139
140
141 ptrigEmCluster->
setRoIword(roiDescriptor->roiWord());
142 const CaloDetDescrElement* caloDDE = nullptr;
143
146 ATH_CHECK(
tool->execute(*ptrigEmCluster, newroi, caloDDE, context) );
147 }
148
149
150
152 if ((error & 0xC0000000) || ptrigEmCluster->
phi() < -
M_PI || ptrigEmCluster->
phi() > +
M_PI ||
153 std::abs(ptrigEmCluster->
eta()) > 10.0) {
154
155 ptrigEmCluster->
setEta(etaL1);
156 ptrigEmCluster->
setPhi(phiL1);
158 ptrigEmCluster->
setEt(0.0);
159 }
160
161
162 if ( caloDDE != nullptr ){
164 for( ToolHandleArray<IEgammaCalibration>::const_iterator
167 (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
168 }else{
169 for( ToolHandleArray<IEgammaCalibration>::const_iterator
172 (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
173 }
174 }
175
176 float et_calib = -999.0;
177 float et_uncalib = ptrigEmCluster->
et();
181 ptrigEmCluster->
setEt(et_calib);
182 }
183 }
184
185
186 float calZ0 = 0;
187
188
205 << std::dec);
206 }
207
208 clET = et_uncalib*1
e-3;
209 clHET = ptrigEmCluster->
ehad1()*1
e-3;
210 clEta = ptrigEmCluster->
eta();
211 clPhi = ptrigEmCluster->
phi();
212 clETrings = et_calib*1
e-3;
213
214 if (et_uncalib != 0.) {
215 res_et = (et_calib - et_uncalib)/et_uncalib;
216 }
217
218 if ( ptrigEmCluster->
e277() > 0.01 ) clReta = ptrigEmCluster->
e237()/ptrigEmCluster->
e277();
219
220 }
221
222 return StatusCode::SUCCESS;
223}
#define ATH_CHECK
Evaluate an expression and check for errors.
Athena::TPCnvVers::Current TrigRoiDescriptor
bool msgLvl(const MSG::Level lvl) const
bool is_lar_em_barrel() const
cell belongs to EM barrel
Gaudi::Property< double > m_phiWidth
ToolHandleArray< IReAlgToolCalo > m_emAlgTools
Gaudi::Property< double > m_etaWidth
ToolHandle< TrigFastCalibWithRings > m_calibWRingsTool
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
SG::WriteHandleKey< xAOD::TrigEMClusterContainer > m_clusterContainerKey
ToolHandleArray< IEgammaCalibration > m_calibsBarrel
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandleArray< IEgammaCalibration > m_calibsEndcap
Gaudi::Property< float > m_l1eta
Gaudi::Property< bool > m_doCalibWithRings
Gaudi::Property< float > m_l1phi
unsigned int clusterQuality() const
get quality of cluster built (to be defined)
void setClusterQuality(unsigned int)
set quality of cluster built (to be defined)
void setNCells(int)
set number of cells used from RoI
void setRoIword(long)
set RoI Word
long RoIword() const
get RoI Word
void setRawPhi(float)
set Raw Phi (no calibration)
void setRawEnergy(float)
set Raw Energy (no calibration)
void setRawEta(float)
set Raw Eta (no calibration)
void setRawEt(float)
set Raw Et (no calibration)
void setPhi(float)
set Phi (calibrated)
float wstot() const
get width in first layer
void setEta(float)
set Eta (calibrated)
void setEt(float)
set Et (calibrated)
void setEhad1(float)
set hadronic Energy (first hadronic layer)
float et() const
get Et (calibrated)
float eta() const
get Eta (calibrated)
void setWeta2(float)
set cluster width (based on a 3x5 cluster - 2nd layer)
void setEnergy(float energy)
set Energy (calibrated)
void setE2tsts1(float)
set second maximum energy in sampling 1 (strip layer)
float phi() const
get Phi (calibrated)
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell
float e233() const
get Energy in a 3x3 cluster (no calibration) around hottest cell
void setE237(float)
set Energy in a 3x7 cluster (no calibration) around hottest cell
void setE277(float)
set Energy in a 7x7 cluster (no calibration) around hottest cell
void setEmaxs1(float)
set maximum energy in sampling 1 (strip layer)
float eta1() const
get Eta sampling 1 (strip layer)
void setFracs1(float)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
float ehad1() const
get hadronic Energy (first hadronic layer)
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
void setWstot(float)
set width in first layer
float energy() const
get Energy (calibrated)
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
void setE233(float)
set Energy in a 3x3 cluster (no calibration) around hottest cell
void setEta1(float)
set Eta sampling 1 (strip layer)
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
timer(name, disabled=False)
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.