|
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");
150 if (original == 3)
return 2;
151 else if (original != 0)
return 1;
152 else return original;
159 for (
unsigned int i = 0;
i <
tp->numberOfParameters(); ++
i) {
161 return hypot(
tp->parameterPX(
i),
tp->parameterPY(
i));
176 return vx ? std::hypot(accPx(*vx), accPy(*vx)) : 0.0;
186 if (vx->trackParticle(0))
sum += vx->trackParticle(0)->p4();
187 if (vx->trackParticle(1))
sum += vx->trackParticle(1)->p4();
219 template<
int itrack, xAOD::SummaryType summary>
221 const auto vx = ph->
vertex();
224 if (vx->trackParticle(0)) {
226 if (vx->trackParticle(itrack)->summaryValue(
hits,
summary)) {
279 ATH_MSG_WARNING(
"pt1/pt2 not available, will approximate from first measurements");
291 if (!
m_tp0) {
return 0; }
300 if (!
m_tp1)
return 0;
309 if (!
m_tp0) {
return 0; }
318 if (!
m_tp1) {
return 0; }
float compute_el_trackz0(const xAOD::Electron &el)
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.
std::unordered_map< std::string, std::function< float(const xAOD::Egamma *, const xAOD::CaloCluster *)> > funcMap_t
Define the map type since it's long.
int compute_ph_convFlag(const xAOD::Photon &ph)
int ph_convtrk2nSCTHits() const
These functions are for calculating variables used by the MVA calibration.
Helper class to provide type-safe access to aux data.
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.
int compute_convtrk1nSCTHits(const xAOD::Photon *ph)
int compute_convtrk1nPixHits(const xAOD::Photon *ph)
AsgMessaging(const std::string &name)
Constructor with a name.
float compute_el_trackpt(const xAOD::Electron &el)
@ 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 getPtAtFirstMeasurement(const xAOD::TrackParticle *tp)
float compute_correctedcl_Es0(const xAOD::CaloCluster &cl)
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.
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.
float compute_correctedcl_f0(const xAOD::CaloCluster &cl)
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
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_correctedcl_Eacc(const xAOD::CaloCluster &cl)
int compute_convtrk2nPixHits(const xAOD::Photon *ph)
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_cl_etas2(const xAOD::CaloCluster &cluster)
float compute_cl_phi(const xAOD::CaloCluster &cluster)
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
float compute_cl_etas1(const xAOD::CaloCluster &cluster)
float compute_pt1conv(const xAOD::Photon *ph)
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].
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)
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)
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.
float compute_el_charge(const xAOD::Electron &el)
int ph_convtrk2nPixHits() const