5#ifndef EGAMMA_CALIB_TOOL_H_
6#define EGAMMA_CALIB_TOOL_H_
52 bool do_throw =
false) {
56 phi_calo = cluster.
phi();
60 phi_calo = phiCaloAcc(cluster);
63 msg.msg(MSG::ERROR) <<
"phiCalo not available as auxilliary variable"
66 throw std::runtime_error(
"phiCalo not available as auxilliary variable");
68 msg.msg(MSG::WARNING) <<
"using phi as phiCalo" <<
endmsg;
69 phi_calo = cluster.
phi();
75 bool do_throw =
false) {
79 eta_calo = cluster.
eta();
83 eta_calo = etaCaloAcc(cluster);
86 msg.msg(MSG::ERROR) <<
"etaCalo not available as auxilliary variable"
89 throw std::runtime_error(
"etaCalo not available as auxilliary variable");
91 msg.msg(MSG::WARNING) <<
"using eta as etaCalo" <<
endmsg;
103 template<ContainerIdConcept CI = ContainerId::cluster,
typename CM=ColumnarModeDefault>
113 :
m_phiCaloAcc (columnarTool,
"phiCalo", {.isOptional =
true}),
132 msg.msg(MSG::ERROR) <<
"phiCalo not available as auxilliary variable" <<
endmsg;
133 if (do_throw) {
throw std::runtime_error(
"phiCalo not available as auxilliary variable"); }
134 msg.msg(MSG::WARNING) <<
"using phi as phiCalo" <<
endmsg;
141 template<ContainerIdConcept CI = ContainerId::cluster,
typename CM=ColumnarModeDefault>
151 :
m_etaCaloAcc (columnarTool,
"etaCalo", {.isOptional =
true}),
170 msg.msg(MSG::ERROR) <<
"etaCalo not available as auxilliary variable" <<
endmsg;
171 if (do_throw) {
throw std::runtime_error(
"etaCalo not available as auxilliary variable"); }
172 msg.msg(MSG::WARNING) <<
"using eta as etaCalo" <<
endmsg;
192 enum class ScaleDecorrelation {
244 double energy,
double cl_eta,
double cl_etaCalo,
246 bool withCT =
false)
const override;
294 this,
"FixForMissingCells",
true,
295 "AOD fix for cell recovery in core egamma cluster"};
298 this,
"DoFwdElectronCalibration",
false,
299 "MVA calibration of the forward electron"};
302 this,
"PrimaryVerticesKey",
"PrimaryVertices",
303 "Name of the primary vertex container"};
313 const double eta =
acc.etaCaloAcc(
acc.caloClusterAcc(p)[0].value(),
acc.authorAcc (p));
333 std::abs(
acc.etaCaloAcc(
acc.caloClusterAcc(p)[0].value(),
acc.authorAcc (p)));
342 double eta_max)
const {
350 std::pair<double, double> edges)
const {
355 const std::vector<std::pair<double, double>>& edges)
const {
356 std::vector<EgammaPredicate>
result;
357 result.reserve(edges.size());
358 for (
const auto& it : edges) {
365 const std::vector<double>& edges)
const {
366 std::vector<EgammaPredicate>
result;
367 result.reserve(edges.size() - 1);
368 auto it2 = edges.begin();
370 for (; it2 != edges.end(); ++it, ++it2) {
378 double eta2_min,
double eta2_max)
387 std::abs(
acc.etaCaloAcc(
acc.caloClusterAcc(p)[0].value(),
acc.authorAcc (p)));
397 double eta1_min,
double eta1_max,
double eta2_min,
398 double eta2_max)
const {
409 bool withCT =
true)
const override;
415 "calibration service"};
423 std::unique_ptr<AtlasRoot::egammaEnergyCorrectionTool>
m_rootTool;
432 std::map<CP::SystematicVariation, egEnergyCorr::Resolution::Variation>
452 Gaudi::Property<bool>
m_onlyElectrons {
this,
"onlyElectrons",
false,
"the tool will only be applied to electrons"};
453 Gaudi::Property<bool>
m_onlyPhotons {
this,
"onlyPhotons",
false,
"the tool will only be applied to photons"};
Scalar eta() const
pseudorapidity method
Helper class to provide constant type-safe access to aux data.
Return value from object correction CP tools.
Class to wrap a set of SystematicVariations.
parameterization of correction for ADC non linearity
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class mimicking the AthMessaging class from the offline software.
ColumnAccessor< CI, float, CM > m_etaCaloAcc
ColumnAccessor< CI, float, CM > m_etacaloframeAcc
float operator()(ClusterId cluster, int author, bool do_throw=false) const
EtaCaloAccessor(ColumnarTool< CM > &columnarTool)
ColumnAccessor< CI, float, CM > m_etaAcc
PhiCaloAccessor(ColumnarTool< CM > &columnarTool)
ColumnAccessor< CI, float, CM > m_phicaloframeAcc
float operator()(ClusterId cluster, int author, bool do_throw=false) const
ColumnAccessor< CI, float, CM > m_phiAcc
ColumnAccessor< CI, float, CM > m_phiCaloAcc
a handle to hold a IMomentumAccessors object
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
@ ETACALOFRAME
Eta in the calo frame (for egamma)
@ PHICALOFRAME
Phi in the calo frame (for egamma)
Select isolated Photons, Electrons and Muons.
AccessorTemplate< CI, CT, ColumnAccessMode::input, CM > ColumnAccessor
AccessorTemplate< ContainerId::egamma, CT, ColumnAccessMode::output, CM > EgammaDecorator
ObjectId< ContainerId::cluster > ClusterId
AccessorTemplate< ContainerId::eventInfo, CT, ColumnAccessMode::input, CM > EventInfoAccessor
ObjectId< ContainerId::egamma > EgammaId
ObjectRange< ContainerId::eventContext > EventContextRange
AccessorTemplate< ContainerId::egamma, CT, ColumnAccessMode::input, CM > EgammaAccessor
AccessorTemplate< ContainerId::mutableEgamma, CT, ColumnAccessMode::input, CM > MutableEgammaAccessor
ObjectRange< ContainerId::mutableEgamma > MutableEgammaRange
ObjectId< ContainerId::mutableEgamma > MutableEgammaId
AccessorTemplate< ContainerId::cluster, CT, ColumnAccessMode::input, CM > ClusterAccessor
ObjectId< ContainerId::eventInfo > EventInfoId
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
float get_phi_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
EventInfo_v1 EventInfo
Definition of the latest event info version.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
float get_eta_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
Photon_v1 Photon
Definition of the current "egamma version".
setBGCode setTAP setLVL2ErrorBits bool
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
Electron_v1 Electron
Definition of the current "egamma version".