47 return StatusCode::SUCCESS;
76 for (
const auto*
egamma : *importedPhotons) {
80 decorationPh0(*
egamma) =
res.maxEcell_time;
81 decorationPh1(*
egamma) =
res.maxEcell_energy;
82 decorationPh2(*
egamma) =
res.maxEcell_gain;
83 decorationPh3(*
egamma) =
res.maxEcell_onlId;
96 std::optional<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> odecorationEl7;
101 egClContainer = egClContainerRH.
ptr();
122 for (
const auto*
egamma : *importedElectrons) {
127 for (
const auto *clus : *egClContainer) {
128 double dR = clus->p4().DeltaR(cluster->
p4());
131 matchedCluster = clus;
134 cluster = matchedCluster;
135 odecorationEl7.value()(*egamma) = dRMin;
139 decorationEl0(*
egamma) =
res.maxEcell_time;
140 decorationEl1(*
egamma) =
res.maxEcell_energy;
141 decorationEl2(*
egamma) =
res.maxEcell_gain;
142 decorationEl3(*
egamma) =
res.maxEcell_onlId;
169 for (
const auto* tau : *importedTaus) {
171 res.maxEcell_energy = -9999.;
172 for (
size_t i = 0;i<tau->nClusters();++i) {
193 decorationTau0(*tau) =
res.maxEcell_time;
194 decorationTau1(*tau) =
res.maxEcell_energy;
195 decorationTau2(*tau) =
res.maxEcell_gain;
196 decorationTau3(*tau) =
res.maxEcell_onlId;
197 decorationTau4(*tau) =
res.maxEcell_x;
198 decorationTau5(*tau) =
res.maxEcell_y;
199 decorationTau6(*tau) =
res.maxEcell_z;
223 for (
const auto*
jet : *importedJets) {
224 if (
jet->numConstituents() == 0)
continue;
227 res.maxEcell_energy = -9999.;
228 std::vector<const xAOD::CaloCluster*> clusterList;
235 for (
size_t i=0;i<
jet->numConstituents();++i) {
237 ATH_MSG_WARNING(
"Tried to call fillEperSamplingFE with a jet constituent that is not a FlowElement!");
244 auto originalFE =
dynamic_cast<const xAOD::FlowElement*
>(*originalObject(*constit));
245 if(originalFE && !originalFE->isCharged()){
248 clusterList.push_back(cluster);
255 for (
size_t i=0;i<
jet->numConstituents();++i) {
257 ATH_MSG_WARNING(
"Tried to call fillEperSamplingCluster with a jet constituent that is not a cluster!");
263 clusterList.push_back(cluster);
268 for (
size_t i=0;i<
jet->numConstituents();++i) {
274 for (
unsigned int cidx=0;cidx<iPFO->
nCaloCluster();++cidx) {
276 clusterList.push_back(iPFO->
cluster(cidx));
283 for (
auto cluster : clusterList) {
291 decorationJet0(*
jet) =
res.maxEcell_time;
292 decorationJet1(*
jet) =
res.maxEcell_energy;
293 decorationJet2(*
jet) =
res.maxEcell_gain;
294 decorationJet3(*
jet) =
res.maxEcell_onlId;
295 decorationJet4(*
jet) =
res.maxEcell_x;
296 decorationJet5(*
jet) =
res.maxEcell_y;
297 decorationJet6(*
jet) =
res.maxEcell_z;
301 return StatusCode::SUCCESS;
307 const EventContext& ctx)
const
327 const CaloCell* cell_maxE =
nullptr;
328 for (
const CaloCell* cell : *cluster) {
329 int sampling = cell->caloDDE()->getSampling();
330 if (sampling == CaloCell_ID::EMB2 || sampling == CaloCell_ID::EME2) {
331 if ((cell->provenance() & 0x2000)) {
332 if (cell->energy() > emax) {
333 emax = cell->energy();
344 result.maxEcell_gain = (int)cell_maxE->
gain();
346 (uint64_t)(cabling->createSignalChannelID(caloDDEl->
identify()))
348 result.maxEcell_x = caloDDEl->
x();
349 result.maxEcell_y = caloDDEl->
y();
350 result.maxEcell_z = caloDDEl->
z();
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::pair< std::vector< unsigned int >, bool > res
xAOD::ElectronContainer * electronContainer
xAOD::PhotonContainer * photonContainer
Data object for each calorimeter readout cell.
float time() const
get time (data member)
double energy() const
get energy (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
CaloGain::CaloGain gain() const
get gain (data member )
This class groups all DetDescr information related to a CaloCell.
Identifier identify() const override final
cell identifier
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_SGKey_jets_decorations
SG::ReadHandleKey< xAOD::TauJetContainer > m_SGKey_taus
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_photons
SG::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_SGKey_taus_decorations
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_electrons_decorations
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_SGKey_egammaClusters
This should be only for using run 2 reprocessing, which misses the cell link from LRT electron cluste...
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey_electrons
calculation decorateObject(const xAOD::CaloCluster *cluster, const EventContext &ctx) const
Gaudi::Property< double > m_dRLRTegClusegClusMax
matching cone size
virtual StatusCode initialize() override final
SG::WriteDecorHandleKeyArray< xAOD::EgammaContainer > m_SGKey_photons_decorations
SG::ReadHandleKey< xAOD::JetContainer > m_SGKey_jets
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ConstAccessor< T, ALLOC > ConstAccessor
const_pointer_type ptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Class providing the definition of the 4-vector interface.
unsigned int nCaloCluster() const
Find out how many CaloCluster are linked.
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ ParticleFlow
The object is a particle-flow object.
@ FlowElement
The object is a track-calo-cluster.
@ CaloCluster
The object is a calorimeter cluster.
PFO_v1 PFO
Definition of the current "pfo version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".