ATLAS Offline Software
Reconstruction
egamma
egammaUtils
egammaUtils
egAmbLinkHelper.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "GaudiKernel/EventContext.h"
6
7
#include "
AthContainers/Accessor.h
"
8
#include "
xAODCaloEvent/CaloClusterContainer.h
"
9
#include "
xAODEgamma/EgammaContainer.h
"
10
#include "AthLinks/ElementLink.h"
11
12
13
namespace
egAmbLinkHelper
{
14
template
<
typename
SrcT,
typename
DestT>
15
void
doAmbiguityLinks
(
16
const
EventContext& ctx,
17
DataVector<SrcT>
*srcContainer,
18
DataVector<DestT>
*destContainer
19
) {
22
static
const
SG::AuxElement::Accessor
<
23
std::vector<ElementLink<xAOD::CaloClusterContainer>>>
24
caloClusterLinks(
"constituentClusterLinks"
);
25
26
static
const
SG::AuxElement::Accessor<ElementLink<xAOD::EgammaContainer>
>
27
ELink(
"ambiguityLink"
);
28
29
ElementLink<xAOD::EgammaContainer>
dummylink;
30
for
(SrcT *
src
: *srcContainer) {
31
ELink(*
src
) = dummylink;
32
if
(
src
->author() !=
xAOD::EgammaParameters::AuthorAmbiguous
) {
33
continue
;
34
}
35
36
for
(
37
size_t
destIndex = 0;
38
destIndex < destContainer->
size
();
39
++destIndex
40
) {
41
DestT *
dest
= destContainer->
at
(destIndex);
42
if
(
dest
->author() !=
xAOD::EgammaParameters::AuthorAmbiguous
) {
43
continue
;
44
}
45
46
if
(caloClusterLinks(*(
dest
->caloCluster())).at(0) ==
47
caloClusterLinks(*(
src
->caloCluster())).at(0)) {
48
ElementLink<xAOD::EgammaContainer>
link(
49
*destContainer, destIndex, ctx);
50
ELink(*
src
) = link;
51
break
;
52
}
53
}
54
}
55
}
56
}
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition:
Control/AthContainers/AthContainers/Accessor.h:68
WriteCellNoiseToCool.src
src
Definition:
WriteCellNoiseToCool.py:513
egAmbLinkHelper
Definition:
egAmbLinkHelper.h:13
perfmonmt-printer.dest
dest
Definition:
perfmonmt-printer.py:189
EgammaContainer.h
xAOD::EgammaParameters::AuthorAmbiguous
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition:
EgammaDefs.h:32
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:794
ElementLink
ElementLink implementation for ROOT usage.
Definition:
AthLinks/ElementLink.h:123
Accessor.h
Helper class to provide type-safe access to aux data.
CaloClusterContainer.h
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
egAmbLinkHelper::doAmbiguityLinks
void doAmbiguityLinks(const EventContext &ctx, DataVector< SrcT > *srcContainer, DataVector< DestT > *destContainer)
Definition:
egAmbLinkHelper.h:15
Generated on Mon Sep 1 2025 21:09:32 for ATLAS Offline Software by
1.8.18