14#include "GaudiKernel/StatusCode.h"
16#include "AthLinks/ElementLink.h"
39 return StatusCode::SUCCESS;
57 ATH_CHECK( trigEmClusterCollection.
record(std::make_unique<xAOD::TrigEMClusterContainer>(),
58 std::make_unique<xAOD::TrigEMClusterAuxContainer>()) );
62 if (!roisHandle.isValid()) {
64 return StatusCode::SUCCESS;
68 trigEmClusterCollection->reserve(roisHandle->size());
70 ATH_MSG_DEBUG(
"RoI descriptor size is " << roisHandle->size() );
74 double etamin, etamax, phimin, phimax;
76 ATH_MSG_DEBUG(
"RoI eta = " << roiDescriptor->eta() <<
" RoI phi = " << roiDescriptor->phi());
80 etamin = std::max(-2.5, roiDescriptor->eta() -
m_etaWidth);
81 etamax = std::min( 2.5, roiDescriptor->eta() +
m_etaWidth);
86 etaL1 = roiDescriptor->eta();
87 phiL1 = roiDescriptor->phi();
101 roiDescriptor->phi(), phimin, phimax);
104 ATH_MSG_DEBUG(
" etamin = " << etamin <<
" etamax = " << etamax <<
105 " phimin = " << phimin <<
" phimax = " << phimax);
108 trigEmClusterCollection->push_back(ptrigEmCluster);
110 ptrigEmCluster->
setEt(0.0);
128 for (
int i = 0; i < CaloSampling::CaloSample::MINIFCAL0; i++) {
133 ptrigEmCluster->
setEta(etaL1);
134 ptrigEmCluster->
setPhi(phiL1);
141 ptrigEmCluster->
setRoIword(roiDescriptor->roiWord());
146 ATH_CHECK( tool->execute(*ptrigEmCluster, newroi, caloDDE, context) );
152 if ((
error & 0xC0000000) || ptrigEmCluster->
phi() < -
M_PI || ptrigEmCluster->
phi() > +
M_PI ||
153 std::abs(ptrigEmCluster->
eta()) > 10.0) {
155 ptrigEmCluster->
setEta(etaL1);
156 ptrigEmCluster->
setPhi(phiL1);
158 ptrigEmCluster->
setEt(0.0);
162 if ( caloDDE !=
nullptr ){
164 for( ToolHandleArray<IEgammaCalibration>::const_iterator
167 (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
169 for( ToolHandleArray<IEgammaCalibration>::const_iterator
172 (*ical)->makeCorrection(ptrigEmCluster,caloDDE);
176 float et_calib = -999.0;
177 float et_uncalib = ptrigEmCluster->
et();
181 ptrigEmCluster->
setEt(et_calib);
208 clET = et_uncalib*1e-3;
209 clHET = ptrigEmCluster->
ehad1()*1e-3;
210 clEta = ptrigEmCluster->
eta();
211 clPhi = ptrigEmCluster->
phi();
212 clETrings = et_calib*1e-3;
214 if (et_uncalib != 0.) {
215 res_et = (et_calib - et_uncalib)/et_uncalib;
218 if ( ptrigEmCluster->
e277() > 0.01 ) clReta = ptrigEmCluster->
e237()/ptrigEmCluster->
e277();
222 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
This class groups all DetDescr information related to a CaloCell.
bool is_lar_em_barrel() const
cell belongs to EM barrel
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Gaudi::Property< double > m_phiWidth
ToolHandleArray< IReAlgToolCalo > m_emAlgTools
virtual StatusCode execute(const EventContext &context) const override
Gaudi::Property< double > m_etaWidth
T2CaloEgammaReFastAlgo(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< TrigFastCalibWithRings > m_calibWRingsTool
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
SG::WriteHandleKey< xAOD::TrigEMClusterContainer > m_clusterContainerKey
ToolHandleArray< IEgammaCalibration > m_calibsBarrel
virtual StatusCode initialize() override
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandleArray< IEgammaCalibration > m_calibsEndcap
SG::ReadHandleKey< CaloBCIDAverage > m_bcidAvgKey
Gaudi::Property< float > m_l1eta
Gaudi::Property< bool > m_doCalibWithRings
Gaudi::Property< float > m_l1phi
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
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())
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
Helper for azimuthal angle calculations.