10#include "CaloGeoHelpers/CaloSampling.h"
14 const std::string& name, ISvcLocator* pSvcLocator)
27 return StatusCode::SUCCESS;
30static double deltaR(
double eta1,
double phi1,
double eta2,
double phi2) {
31 double deta = eta1 - eta2;
32 double dphi = phi1 - phi2;
35 return std::sqrt(deta*deta + dphi*dphi);
43 if (!electrons.isValid())
return StatusCode::SUCCESS;
49 std::vector<const xAOD::Electron*> fwd_electrons;
52 if (cl && std::abs(cl->eta()) > 2.5 && std::abs(cl->eta()) <= 4.0)
54 fwd_electrons.push_back(el);
57 if (fwd_electrons.size() == 0)
return StatusCode::SUCCESS;
67 const double calibPt =
m_calibTool->calibrate(ctx, el);
69 const bool isLoose =
static_cast<bool>(
m_looseTool->accept(ctx, el));
70 const bool isMedium =
static_cast<bool>(
m_mediumTool->accept(ctx, el));
71 const bool isTight =
static_cast<bool>(
m_tightTool->accept(ctx, el));
81 if (!tp || std::abs(tp->pdgId()) != 11 || tp->status() != 1)
continue;
82 double dr =
deltaR(cluster->
eta(), cluster->
phi(), tp->eta(), tp->phi());
83 if (dr < bestDR) { bestDR = dr; truthPt = tp->pt() / 1000.; }
92 double calo_eta = cluster->
eta();
93 double calo_phi = cluster->
phi();
96 double track_eta = track->eta();
97 double track_phi = track->phi();
100 double hgtd_time = track->time();
123 el->trackCaloMatchValue(val,
type);
132 const double caloE = cluster->
e();
133 const double inv_E = (caloE != 0.) ? 1. / caloE : 0.;
136 double frac_EM_1 = cluster->
energyBE(1) * inv_E;
137 double frac_EM_2 = cluster->
energyBE(2) * inv_E;
138 double frac_EM_3 = cluster->
energyBE(3) * inv_E;
139 double frac_HAD_0 = cluster->
eSample(
static_cast<CS
>(CaloSampling::HEC0)) * inv_E;
140 double frac_HAD_1 = (cluster->
eSample(
static_cast<CS
>(CaloSampling::HEC1)) +
141 cluster->
eSample(
static_cast<CS
>(CaloSampling::FCAL0))) * inv_E;
142 double frac_HAD_2 = (cluster->
eSample(
static_cast<CS
>(CaloSampling::HEC2)) +
143 cluster->
eSample(
static_cast<CS
>(CaloSampling::FCAL1))) * inv_E;
144 double frac_HAD_3 = (cluster->
eSample(
static_cast<CS
>(CaloSampling::HEC3)) +
145 cluster->
eSample(
static_cast<CS
>(CaloSampling::FCAL2))) * inv_E;
147 double calo_pt = el->pt();
156 <<
" calib_pT=" << calibPt/1000.
157 <<
" truth_pT=" << truthPt
158 <<
" score_cpp=" << score
159 <<
" L=" << isLoose <<
" M=" << isMedium <<
" T=" << isTight);
161 <<
" calo_phi=" << calo_phi
162 <<
" track_eta=" << track_eta
163 <<
" track_phi=" << track_phi
164 <<
" time=" << hgtd_time
165 <<
" pixels=" << pixels
166 <<
" strips=" << strips);
168 <<
" LONGITUDINAL=" << LONGITUDINAL
169 <<
" SECOND_LAMBDA=" << SECOND_LAMBDA
170 <<
" LATERAL=" << LATERAL
171 <<
" SECOND_R=" << SECOND_R
172 <<
" CENTER_LAMBDA=" << CENTER_LAMBDA
173 <<
" SECOND_ENG_DENS=" << SECOND_ENG_DENS);
175 <<
" delta_phi2=" << delta_phi2
176 <<
" delta_phi_rescaled2=" << delta_phi_rescaled2
177 <<
" delta_phi_last=" << delta_phi_last);
179 <<
" calo_frac_EM_2=" << frac_EM_2
180 <<
" calo_frac_EM_3=" << frac_EM_3
181 <<
" calo_frac_HAD_0=" << frac_HAD_0
182 <<
" calo_frac_HAD_1=" << frac_HAD_1
183 <<
" calo_frac_HAD_2=" << frac_HAD_2
184 <<
" calo_frac_HAD_3=" << frac_HAD_3);
189 return StatusCode::SUCCESS;
195 ATH_MSG_INFO(
"========================================");
201 ATH_MSG_INFO(
"========================================");
202 return StatusCode::SUCCESS;
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define ATH_CHECK
Evaluate an expression and check for errors.
bool msgLvl(const MSG::Level lvl) const
AnaReentrantAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
float eSample(const CaloSample sampling) const
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
virtual double phi() const
The azimuthal angle ( ) of the particle.
MomentType
Enums to identify different moments.
@ SECOND_ENG_DENS
Second Moment in E/V.
@ SECOND_LAMBDA
Second Moment in .
@ LATERAL
Normalized lateral moment.
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ deltaPhiFromLastMeasurement
difference between the cluster phi (sampling 2) and the eta of the track extrapolated from the last m...
@ deltaEta2
difference between the cluster eta (second sampling) and the eta of the track extrapolated to the sec...
@ deltaPhiRescaled2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Electron_v1 Electron
Definition of the current "egamma version".