 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef EGAMMAMVACALIB_EGAMMAMVAFUNCTIONS
6 #define EGAMMAMVACALIB_EGAMMAMVAFUNCTIONS
17 #include "TLorentzVector.h"
21 #include <unordered_map>
54 throw std::runtime_error(
"etaCalo not found in CaloCluster object");
61 throw std::runtime_error(
"phiCalo not found in CaloCluster object");
137 const float e =
cl.e();
138 const float eta =
cl.eta();
139 const float c = std::cosh(
eta);
140 return (
c != 0.
f) ? (
e /
c) : 0.
f;
147 if (!
cl.retrieveMoment(
m,
tmp)) {
148 throw std::runtime_error(std::string(
"Forward-electron missing moment: ") +
name);
150 return static_cast<float>(
tmp);
186 return std::fmod(std::abs(
cl.eta()),0.1);
189 return std::floor(std::abs(
cl.eta())/0.1);
193 float phi_mod = std::fmod(
cl.phi(), cz);
194 if (phi_mod < 0) phi_mod += cz;
215 if (original == 3)
return 2;
216 else if (original != 0)
return 1;
217 else return original;
224 for (
unsigned int i = 0;
i <
tp->numberOfParameters(); ++
i) {
226 return hypot(
tp->parameterPX(
i),
tp->parameterPY(
i));
241 return vx ? std::hypot(accPx(*vx), accPy(*vx)) : 0.0;
251 if (vx->trackParticle(0))
sum += vx->trackParticle(0)->p4();
252 if (vx->trackParticle(1))
sum += vx->trackParticle(1)->p4();
284 template<
int itrack, xAOD::SummaryType summary>
286 const auto vx = ph->
vertex();
289 if (vx->trackParticle(0)) {
291 if (vx->trackParticle(itrack)->summaryValue(
hits,
summary)) {
346 ATH_MSG_WARNING(
"pt1/pt2 not available, will approximate from first measurements");
358 if (!
m_tp0) {
return 0; }
367 if (!
m_tp1)
return 0;
376 if (!
m_tp0) {
return 0; }
385 if (!
m_tp1) {
return 0; }
@ SECOND_R
Second Moment in .
float compute_el_trackz0(const xAOD::Electron &el)
float compute_cl_secondR_fudge(const xAOD::Egamma &eg)
float compute_rawcl_Eacc(const xAOD::CaloCluster &cl)
float compute_cl_phiCalo(const xAOD::CaloCluster &cluster)
virtual double phi() const
The azimuthal angle ( ) of the particle.
float compute_cl_centerLambda(const xAOD::CaloCluster &cl)
std::unordered_map< std::string, std::function< float(const xAOD::Egamma *, const xAOD::CaloCluster *)> > funcMap_t
Define the map type since it's long.
float compute_cl_secondLambda(const xAOD::CaloCluster &cl)
int compute_ph_convFlag(const xAOD::Photon &ph)
int ph_convtrk2nSCTHits() const
float compute_cl_z(const xAOD::CaloCluster &cl)
float compute_phiMod_EMEC(const xAOD::CaloCluster &cl)
These functions are for calculating variables used by the MVA calibration.
@ CENTER_X
Cluster Centroid ( )
Helper class to provide type-safe access to aux data.
Scalar eta() const
pseudorapidity method
float compute_cl_fracMax(const xAOD::CaloCluster &cl)
float compute_cl_e(const xAOD::CaloCluster &cluster)
float compute_correctedcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
float compute_ptconv(const xAOD::Photon *ph)
This ptconv is the old one used by MVACalib.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Scalar theta() const
theta method
float compute_cl_secondR(const xAOD::CaloCluster &cl)
int compute_convtrk1nSCTHits(const xAOD::Photon *ph)
float compute_cl_longitudinal(const xAOD::CaloCluster &cl)
int compute_convtrk1nPixHits(const xAOD::Photon *ph)
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
AsgMessaging(const std::string &name)
Constructor with a name.
float compute_el_trackpt(const xAOD::Electron &el)
float compute_eta_FCAL(const xAOD::CaloCluster &cl)
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
const Amg::Vector3D & position() const
Returns the 3-pos.
float compute_cl_eta(const xAOD::CaloCluster &cluster)
float cl_getMoment(const xAOD::CaloCluster &cl, xAOD::CaloCluster::MomentType m, const char *name)
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
float compute_cellIndex_FCAL(const xAOD::CaloCluster &cl)
float getPtAtFirstMeasurement(const xAOD::TrackParticle *tp)
float compute_cl_x(const xAOD::CaloCluster &cl)
float compute_cl_secondDensity(const xAOD::CaloCluster &cl)
float compute_correctedcl_Es0(const xAOD::CaloCluster &cl)
@ SECOND_LAMBDA
Second Moment in .
MomentType
Enums to identify different moments.
float compute_et(const xAOD::CaloCluster &cl)
@ CENTER_Z
Cluster Centroid ( )
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
@ SECOND_ENG_DENS
Second Moment in E/V.
Description of a calorimeter cluster.
std::unique_ptr< funcMap_t > initializeConvertedPhotonFuncs(bool useLayerCorrected)
A function to build the map for converted photons.
float compute_pt2conv(const xAOD::Photon *ph)
int compute_convtrk2nSCTHits(const xAOD::Photon *ph)
float compute_calibHitsShowerDepth(const std::array< float, 4 > &cl, float eta)
float compute_el_tracketa(const xAOD::Electron &el)
float compute_correctedcl_Es2(const xAOD::CaloCluster &cl)
virtual double eta() const
The pseudorapidity ( ) of the particle.
std::unique_ptr< funcMap_t > initializeForwardElectronFuncs(bool useLayerCorrected)
NEW: A function to build the map for forward electrons.
float compute_correctedcl_f0(const xAOD::CaloCluster &cl)
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
float compute_cl_y(const xAOD::CaloCluster &cl)
ConversionHelper(const xAOD::Photon *ph)
std::unique_ptr< funcMap_t > initializeUnconvertedPhotonFuncs(bool useLayerCorrected)
A function to build the map for uncoverted photons.
float compute_el_refittedTrack_qoverp(const xAOD::Electron &el)
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
float compute_rawcl_Es1(const xAOD::CaloCluster &cl)
float compute_rawcl_f0(const xAOD::CaloCluster &cl)
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float compute_cl_etaCalo(const xAOD::CaloCluster &cluster)
int compute_el_author(const xAOD::Electron &el)
std::array< float, 4 > get_MVAradius(float eta)
helper function to compute shower depth
float compute_cl_significance(const xAOD::CaloCluster &cl)
float compute_correctedcl_Eacc(const xAOD::CaloCluster &cl)
int compute_convtrk2nPixHits(const xAOD::Photon *ph)
float compute_etaMod_FCAL(const xAOD::CaloCluster &cl)
float compute_rawcl_calibHitsShowerDepth(const xAOD::CaloCluster &cl)
const xAOD::Vertex * m_vertex
int ph_convtrk1nPixHits() const
int ph_convtrk1nSCTHits() const
Class mimicking the AthMessaging class from the offline software.
const xAOD::TrackParticle * m_tp0
The ConversionHelper struct is stll used by egammaMVATree in PhysicsAnalysis but not the functions in...
std::unique_ptr< funcMap_t > initializeElectronFuncs(bool useLayerCorrected)
A function to build the map for electrons.
@ PHICALOFRAME
Phi in the calo frame (for egamma)
float compute_R12_EMEC(const xAOD::CaloCluster &cl)
float compute_cellIndex_EMEC(const xAOD::CaloCluster &cl)
float compute_cl_etas2(const xAOD::CaloCluster &cluster)
float compute_cl_phi(const xAOD::CaloCluster &cluster)
Class describing a Vertex.
@ SIGNIFICANCE
Cluster significance.
#define ATH_MSG_WARNING(x)
float compute_cl_etas1(const xAOD::CaloCluster &cluster)
float compute_pt1conv(const xAOD::Photon *ph)
float compute_etaMod_EMEC(const xAOD::CaloCluster &cl)
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
float compute_ptconv_decor(const xAOD::Photon *ph)
This ptconv function uses the vertex decorations.
float compute_correctedcl_Es3(const xAOD::CaloCluster &cl)
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ LATERAL
Normalized lateral moment.
int compute_convtrkXhits(const xAOD::Photon *ph)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float compute_correctedcl_Es1(const xAOD::CaloCluster &cl)
float compute_cl_lateral(const xAOD::CaloCluster &cl)
Class describing a TrackParticle.
float compute_rawcl_Es2(const xAOD::CaloCluster &cl)
Helper class to provide constant type-safe access to aux data.
ConversionHelper(const xAOD::Photon &ph)
float compute_rawcl_Es3(const xAOD::CaloCluster &cl)
@ ETACALOFRAME
Eta in the calo frame (for egamma)
@ LONGITUDINAL
Normalized longitudinal moment.
const xAOD::TrackParticle * m_tp1
float compute_rawcl_Es0(const xAOD::CaloCluster &cl)
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
virtual double e() const
The total energy of the particle.
@ CENTER_Y
Cluster Centroid ( )
float compute_el_charge(const xAOD::Electron &el)
int ph_convtrk2nPixHits() const