ATLAS Offline Software
Loading...
Searching...
No Matches
egammaForwardBuilder Class Reference

Algorithm which makes a egammaObjectCollection for forward electrons. More...

#include <egammaForwardBuilder.h>

Inheritance diagram for egammaForwardBuilder:

Public Member Functions

 egammaForwardBuilder (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
 ~egammaForwardBuilder ()=default
 Destructor.
virtual StatusCode initialize () override final
 Initialize method.
virtual StatusCode finalize () override final
 Finalize method.
virtual StatusCode execute (const EventContext &ctx) const override final
 Execute method.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

ToolHandleArray< IAsgForwardElectronIsEMSelectorm_forwardElectronIsEMSelectors
 Handle to the selectors.
Gaudi::Property< std::vector< std::string > > m_forwardElectronIsEMSelectorResultNames

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode RetrieveEMTrackMatchBuilder ()
StatusCode ExecObjectQualityTool (const EventContext &ctx, xAOD::Egamma *eg) const
std::pair< unsigned int, float > getnPVmu (const EventContext &ctx) const
void setAllTrackCaloMatchValues (xAOD::Electron *el, const std::array< xAOD::EgammaParameters::TrackCaloMatchType, 4 > &match_parameters, const std::array< double, 4 > &match_values) const
 Convinience wrapper to set track match values in all samplings.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IegammaOQFlagsBuilderm_objectQualityTool
 Tool to perform object quality.
ToolHandle< IEMTrackMatchBuilderm_trackMatchBuilder
 Tool to perform track-cluster matching.
Gaudi::Property< bool > m_doEnergyCal
 Private member flag to do energy calibration.
SG::ReadHandleKey< xAOD::VertexContainerm_pVtxKey
 Input primary vertices for fwd energy calibration.
SG::ReadHandleKey< xAOD::EventInfom_eiKey
 Input EventInfo for fwd energy calibration.
ServiceHandle< IegammaMVASvcm_MVACalibSvc
 Handle to the MVA calibration service.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_topoClusterKey
 Input topo cluster type.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloDetDescrMgrKey
 Calorimeter description.
SG::WriteHandleKey< xAOD::ElectronContainerm_electronOutputKey
 Output electron container.
SG::WriteHandleKey< xAOD::CaloClusterContainerm_outClusterContainerKey
 Output cluster container.
SG::WriteHandleKey< CaloClusterCellLinkContainerm_outClusterContainerCellLinkKey
 Output cluster container cell links: name taken from containter name.
Gaudi::Property< bool > m_doTrackMatching
 Private member flag to do the track matching.
Gaudi::Property< bool > m_doCookieCutting
 Private member flag to do cookie cutting.
Gaudi::Property< int > m_maxDelEtaCells
 Size of maximum search window in eta.
Gaudi::Property< int > m_maxDelPhiCells
 Size of maximum search window in phi.
Gaudi::Property< float > m_maxDelR
 Size of cone to cookie cut on FCal.
Gaudi::Accumulators::Counter m_AllClusters {}
Gaudi::Accumulators::Counter m_MatchedClusters {}
egammaClusterCookieCut::CookieCutPars m_CookieCutPars {}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm which makes a egammaObjectCollection for forward electrons.

egammaForwardBuilder, is dedicated to the reconstruction and identification of electrons in the forward region of ATLAS (2.5<|eta|<4.9). In contrast to the softe and egamma builders the algorithm can use only the information from the calorimeters, as the tracking system is limited to |eta|<2.5, and the topological clusters (instead of SW clusters). The pre-selection and ID are done in the same algorithm. The variables used to discriminant between electron and hadrons are defined as the topo cluster moments or combination of them. This is done separately in two eta bins: the EMEC IW and the FCal using a cut based technic. The forward electron AUTHOR is 8.

Definition at line 59 of file egammaForwardBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ egammaForwardBuilder()

egammaForwardBuilder::egammaForwardBuilder ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Definition at line 28 of file egammaForwardBuilder.cxx.

30 : AthReentrantAlgorithm(name, pSvcLocator)
31{}

◆ ~egammaForwardBuilder()

egammaForwardBuilder::~egammaForwardBuilder ( )
default

Destructor.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ ExecObjectQualityTool()

StatusCode egammaForwardBuilder::ExecObjectQualityTool ( const EventContext & ctx,
xAOD::Egamma * eg ) const
private

Definition at line 286 of file egammaForwardBuilder.cxx.

289 {
290 // Protection in case tool is not available return success as algorithm can run without it.
291 if (!m_objectQualityTool.isEnabled()) { return StatusCode::SUCCESS; }
292
293 return m_objectQualityTool->execute(ctx,*eg);
294}
ToolHandle< IegammaOQFlagsBuilder > m_objectQualityTool
Tool to perform object quality.

◆ execute()

StatusCode egammaForwardBuilder::execute ( const EventContext & ctx) const
finaloverridevirtual

Execute method.

Definition at line 97 of file egammaForwardBuilder.cxx.

98{
99 // Create an egamma container and register it.
100 SG::WriteHandle<xAOD::ElectronContainer> xaodFrwd(m_electronOutputKey, ctx);
101 ATH_CHECK(xaodFrwd.record(
102 std::make_unique<xAOD::ElectronContainer>(),
103 std::make_unique<xAOD::ElectronAuxContainer>())
104 );
105
106 // Create the relevant cluster output and register it.
107 SG::WriteHandle<xAOD::CaloClusterContainer> outClusterContainer(
109 ctx
110 );
111
113 SG::WriteHandle<CaloClusterCellLinkContainer> outClusterContainerCellLink(
115 ctx
116 );
117
118 ATH_CHECK(outClusterContainerCellLink.record(
119 std::make_unique<CaloClusterCellLinkContainer>())
120 );
121
122 // Topo cluster container.
123 SG::ReadHandle<xAOD::CaloClusterContainer> inputClusters(m_topoClusterKey, ctx);
124
125 // Check is only used for serial running, remove when MT scheduler used.
126 ATH_CHECK(inputClusters.isValid());
127
128 // Calorimeter description.
129 SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{
131 };
132 ATH_CHECK(caloDetDescrMgrHandle.isValid());
133 const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
134
135 static const SG::AuxElement::Accessor<
136 std::vector<ElementLink<xAOD::CaloClusterContainer>>
137 > caloClusterLinks("constituentClusterLinks");
138
139 // Prepare to create clusters.
140 EgammaRecContainer egammaRecsFwd;
141 size_t origClusterIndex = 0;
142
143 egammaMVACalib::GlobalEventInfo gei;
144 if (m_doEnergyCal) {
145 std::pair<float,float> nPVmu = this->getnPVmu(ctx);
146 gei.nPV = nPVmu.first;
147 gei.acmu = nPVmu.second;
148 ATH_MSG_DEBUG("Retrieved nPV = " << gei.nPV << " and mu = " << gei.acmu);
149 }
150
151 // Loop over input cluster container and create egRecs to store the electrons.
152 ATH_MSG_VERBOSE("Will run on " << inputClusters->size() << " input clusters, doing cookie cut ? " << m_doCookieCutting);
153 for (const xAOD::CaloCluster* cluster : *inputClusters) {
154
155 // Create links back to the original clusters.
156 std::vector<ElementLink<xAOD::CaloClusterContainer>> constituentLinks;
157
158 // The constituent links should contain a CaloCal cluster. When not running
159 // in ITk mode this is the default for the forward clusters used by egamma
160 // so no sister link is needed to get the CaloCal. When running in ITk mode
161 // the clusters used are CaloTopoClusters so need to access the sister
162 // cluster to maintain consistency.
163 if (m_doTrackMatching) {
164 ElementLink<xAOD::CaloClusterContainer> sisterCluster =
165 cluster->getSisterClusterLink();
166
167 if (sisterCluster) {
168 constituentLinks.push_back(sisterCluster);
169 } else {
170 ATH_MSG_WARNING("No sister Link available");
171 }
172 } else {
173 constituentLinks.emplace_back(*inputClusters, origClusterIndex, ctx);
174 }
175
176 const DataLink<CaloCellContainer>& cellCont =
177 cluster->getCellLinks()->getCellContainerLink();
178
179 // Create the new cluster.
180 std::unique_ptr<xAOD::CaloCluster> newCluster =
182 egammaClusterCookieCut::cookieCut(*cluster, *calodetdescrmgr,
183 cellCont, m_CookieCutPars) :
184 std::make_unique<xAOD::CaloCluster>(*cluster);
185
186 if (!newCluster || newCluster->size() == 0) {
187 ATH_MSG_DEBUG("Could not build a new cluster, or has 0 cell");
188 continue;
189 }
190
191 if (m_doEnergyCal &&
192 m_MVACalibSvc->execute(*newCluster, xAOD::EgammaParameters::forwardelectron, gei).isFailure())
193 { ATH_MSG_ERROR("Problem executing MVA cluster tool for fwd electron"); }
194
195 caloClusterLinks(*newCluster) = constituentLinks;
196 outClusterContainer->push_back(std::move(newCluster));
197
198 size_t index = outClusterContainer->size() - 1;
199 const ElementLink<xAOD::CaloClusterContainer> clusterLink(*outClusterContainer, index, ctx);
200 const std::vector<ElementLink<xAOD::CaloClusterContainer>> clusterLinkVector{clusterLink};
201
202 // Now create the egamma Rec
203 egammaRecsFwd.push_back(std::make_unique<egammaRec>(clusterLinkVector));
204
205 ++origClusterIndex;
206 }
207
208 // Add track-cluster matching information if requested.
209 if (m_doTrackMatching) {
210 ATH_CHECK(m_trackMatchBuilder->executeRec(ctx, &egammaRecsFwd));
211 }
212
213 auto buff_AllClusters = m_AllClusters.buffer();
214 auto buff_MatchedClusters = m_MatchedClusters.buffer();
215
216 //Loop over the egamma Rec creating electrons
217 for (const egammaRec* egRec : egammaRecsFwd) {
218 if (!egRec) {
219 return StatusCode::FAILURE;
220 }
221
222 ++buff_AllClusters;
223
224 if (m_doTrackMatching && egRec->getNumberOfTrackParticles() == 0) {
225 // Later we may want to use these for so called forward photons.
226 ATH_MSG_DEBUG("EgammaRec without track particle");
227 continue;
228 }
229
230 //common part
231 xAOD::Electron* el = xaodFrwd->push_back(std::make_unique<xAOD::Electron>());
233 el->setCaloClusterLinks(egRec->caloClusterElementLinks());
234
235 // from here one, we need both track matching and
236 // having tracks .
237 if (m_doTrackMatching) {
238
239 ++buff_MatchedClusters;
240 el->setTrackParticleLinks(egRec->trackParticleElementLinks());
241
242 const xAOD::TrackParticle* trackParticle = el->trackParticle();
243 if (trackParticle) {
244 el->setCharge(trackParticle->charge());
245 } else {
246 ATH_MSG_WARNING("Forward electron without track particle, whereas"
247 " corresponding egammaRec has at least one");
248 }
249
250 // Set DeltaEta, DeltaPhi, DeltaPhiRescaled.
251 el->setTrackCaloMatchValues(
252 egRec->deltaEta(),
253 egRec->deltaPhi(),
254 egRec->deltaPhiRescaled(),
255 egRec->deltaPhiLast()
256 );
257 }
258
261
262 // Apply the Forward Electron selectors.
263 for (size_t i = 0; i < m_forwardElectronIsEMSelectors.size(); ++i) {
266
267 // Save the bool result.
268 const asg::AcceptData accept = selector->accept(ctx, el);
269 el->setPassSelection(static_cast<bool>(accept), name);
270
271 // Save the isem.
272 el->setSelectionisEM(accept.getCutResultInverted(), "isEM" + name);
273 }
274
275 }//end of loop over egammaRecs
276
278 ctx,
279 outClusterContainer,
280 outClusterContainerCellLink);
281
282 return StatusCode::SUCCESS;
283}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
if(febId1==febId2)
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
ToolHandleArray< IAsgForwardElectronIsEMSelector > m_forwardElectronIsEMSelectors
Handle to the selectors.
std::pair< unsigned int, float > getnPVmu(const EventContext &ctx) const
Gaudi::Property< bool > m_doCookieCutting
Private member flag to do cookie cutting.
Gaudi::Accumulators::Counter m_AllClusters
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_topoClusterKey
Input topo cluster type.
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
Gaudi::Property< bool > m_doEnergyCal
Private member flag to do energy calibration.
egammaClusterCookieCut::CookieCutPars m_CookieCutPars
StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg) const
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Output electron container.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outClusterContainerKey
Output cluster container.
ToolHandle< IEMTrackMatchBuilder > m_trackMatchBuilder
Tool to perform track-cluster matching.
Gaudi::Property< bool > m_doTrackMatching
Private member flag to do the track matching.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Calorimeter description.
Gaudi::Accumulators::Counter m_MatchedClusters
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_outClusterContainerCellLinkKey
Output cluster container cell links: name taken from containter name.
Gaudi::Property< std::vector< std::string > > m_forwardElectronIsEMSelectorResultNames
float charge() const
Returns the charge.
DataVector< egammaRec > EgammaRecContainer
The container is a simple typedef for now.
StatusCode accept(const xAOD::Muon *mu)
str index
Definition DeMoScan.py:362
void calculate(xAOD::Electron &electron)
std::unique_ptr< xAOD::CaloCluster > cookieCut(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &mgr, const DataLink< CaloCellContainer > &cellCont, const egammaClusterCookieCut::CookieCutPars &pars)
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
Definition EgammaDefs.h:30
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Electron_v1 Electron
Definition of the current "egamma version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode egammaForwardBuilder::finalize ( )
finaloverridevirtual

Finalize method.

Definition at line 86 of file egammaForwardBuilder.cxx.

87{
88
89 ATH_MSG_INFO("====> Forward Egamma Statistics =============");
90 ATH_MSG_INFO(" All Clusters " << m_AllClusters);
91 ATH_MSG_INFO(" Matched Clusters " << m_MatchedClusters);
92 ATH_MSG_INFO("=============================================");
93
94 return StatusCode::SUCCESS;
95}
#define ATH_MSG_INFO(x)

◆ getnPVmu()

std::pair< unsigned int, float > egammaForwardBuilder::getnPVmu ( const EventContext & ctx) const
private

Definition at line 317 of file egammaForwardBuilder.cxx.

318 {
319 unsigned int npv(0);
320 float mu(0);
321
322 SG::ReadHandle<xAOD::VertexContainer> vtxCont(m_pVtxKey, ctx);
323 if (!vtxCont.isValid()) {
324 ATH_MSG_WARNING("Cannot find " << m_pVtxKey.key()
325 << " container, returning nPV = 0");
326 } else {
327 for (const auto *vtx : *vtxCont) {
328 if (vtx->vertexType() == xAOD::VxType::PriVtx ||
329 vtx->vertexType() == xAOD::VxType::PileUp) { ++npv; }
330 }
331 }
332
333 SG::ReadHandle<xAOD::EventInfo> eiCont(m_eiKey, ctx);
334 if (!eiCont.isValid()) {
335 ATH_MSG_WARNING("Cannot find " << m_eiKey.key() << " returning mu = 0");
336 } else {
337 mu = eiCont.get()->actualInteractionsPerCrossing();
338 }
339
340 return std::make_pair(npv,mu);
341}
SG::ReadHandleKey< xAOD::EventInfo > m_eiKey
Input EventInfo for fwd energy calibration.
SG::ReadHandleKey< xAOD::VertexContainer > m_pVtxKey
Input primary vertices for fwd energy calibration.
@ PileUp
Pile-up vertex.
@ PriVtx
Primary vertex.

◆ initialize()

StatusCode egammaForwardBuilder::initialize ( )
finaloverridevirtual

Initialize method.

Definition at line 33 of file egammaForwardBuilder.cxx.

34{
35 m_CookieCutPars.maxDelEta = m_maxDelEtaCells * cellEtaSize * 0.5;
36 m_CookieCutPars.maxDelPhi = m_maxDelPhiCells * cellPhiSize * 0.5;
37 m_CookieCutPars.maxDelR2 = m_maxDelR * m_maxDelR; // Square now to avoid a slow sqrt later.
38
39 // The data handle keys.
40 ATH_CHECK(m_topoClusterKey.initialize());
41 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
42 ATH_CHECK(m_electronOutputKey.initialize());
44 if (m_outClusterContainerCellLinkKey.key().empty()) {
46 }
48
49 // Retrieve object quality tool.
50 if (!m_objectQualityTool.empty()) {
52 }
53
54 else {
55 m_objectQualityTool.disable();
56 }
57
59
60 if (
63 ) {
65 "Number of selectors doesn't match number of given fwd-electron selector names"
66 );
67
68 return StatusCode::FAILURE;
69 }
70
71 // Retrieve track match builder.
73
74 // Retrive MVA energy calibration
75 if (m_doEnergyCal) {
76 ATH_CHECK(m_pVtxKey.initialize());
77 ATH_CHECK(m_eiKey.initialize());
78 ATH_CHECK(m_MVACalibSvc.retrieve());
79 }
80
81 ATH_MSG_DEBUG("Initialization completed successfully");
82
83 return StatusCode::SUCCESS;
84}
#define ATH_MSG_ERROR(x)
Gaudi::Property< float > m_maxDelR
Size of cone to cookie cut on FCal.
Gaudi::Property< int > m_maxDelEtaCells
Size of maximum search window in eta.
Gaudi::Property< int > m_maxDelPhiCells
Size of maximum search window in phi.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ RetrieveEMTrackMatchBuilder()

StatusCode egammaForwardBuilder::RetrieveEMTrackMatchBuilder ( )
private

Definition at line 297 of file egammaForwardBuilder.cxx.

298{
299 if (!m_doTrackMatching) {
300 m_trackMatchBuilder.disable();
301 return StatusCode::SUCCESS;
302 }
303
304 if (m_trackMatchBuilder.empty()) {
305 ATH_MSG_ERROR("EMTrackMatchBuilder is empty, but track matching is enabled");
306 return StatusCode::FAILURE;
307 }
308
309 if (m_trackMatchBuilder.retrieve().isFailure()) {
310 ATH_MSG_ERROR("Unable to retrieve " << m_trackMatchBuilder);
311 return StatusCode::FAILURE;
312 }
313
314 return StatusCode::SUCCESS;
315}

◆ setAllTrackCaloMatchValues()

void egammaForwardBuilder::setAllTrackCaloMatchValues ( xAOD::Electron * el,
const std::array< xAOD::EgammaParameters::TrackCaloMatchType, 4 > & match_parameters,
const std::array< double, 4 > & match_values ) const
private

Convinience wrapper to set track match values in all samplings.

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_AllClusters

Gaudi::Accumulators::Counter egammaForwardBuilder::m_AllClusters {}
mutableprivate

Definition at line 213 of file egammaForwardBuilder.h.

213{};

◆ m_caloDetDescrMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> egammaForwardBuilder::m_caloDetDescrMgrKey
private
Initial value:
{
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
}

Calorimeter description.

Definition at line 144 of file egammaForwardBuilder.h.

144 {
145 this,
146 "CaloDetDescrManager",
147 "CaloDetDescrManager",
148 "SG Key for CaloDetDescrManager in the Condition Store"
149 };

◆ m_CookieCutPars

egammaClusterCookieCut::CookieCutPars egammaForwardBuilder::m_CookieCutPars {}
private

Definition at line 216 of file egammaForwardBuilder.h.

216{};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doCookieCutting

Gaudi::Property<bool> egammaForwardBuilder::m_doCookieCutting
private
Initial value:
{
this,
"doCookieCutting",
false,
"Boolean to do cookie cutting"
}

Private member flag to do cookie cutting.

Definition at line 182 of file egammaForwardBuilder.h.

182 {
183 this,
184 "doCookieCutting",
185 false,
186 "Boolean to do cookie cutting"
187 };

◆ m_doEnergyCal

Gaudi::Property<bool> egammaForwardBuilder::m_doEnergyCal
private
Initial value:
{
this,
"doEnergyCal",
false,
"Boolean to do energy calibration"
}

Private member flag to do energy calibration.

Definition at line 107 of file egammaForwardBuilder.h.

107 {
108 this,
109 "doEnergyCal",
110 false,
111 "Boolean to do energy calibration"
112 };

◆ m_doTrackMatching

Gaudi::Property<bool> egammaForwardBuilder::m_doTrackMatching
private
Initial value:
{
this,
"doTrackMatching",
false,
"Boolean to do track matching"
}

Private member flag to do the track matching.

Definition at line 174 of file egammaForwardBuilder.h.

174 {
175 this,
176 "doTrackMatching",
177 false,
178 "Boolean to do track matching"
179 };

◆ m_eiKey

SG::ReadHandleKey<xAOD::EventInfo> egammaForwardBuilder::m_eiKey
private
Initial value:
{
this,
"EventInfoKey",
"",
"Name of the EventInfo object" }

Input EventInfo for fwd energy calibration.

Definition at line 122 of file egammaForwardBuilder.h.

122 {
123 this,
124 "EventInfoKey",
125 "",
126 "Name of the EventInfo object" };

◆ m_electronOutputKey

SG::WriteHandleKey<xAOD::ElectronContainer> egammaForwardBuilder::m_electronOutputKey
private
Initial value:
{
this,
"ElectronOutputName",
"",
"Name of Electron Container to be created"
}

Output electron container.

Definition at line 152 of file egammaForwardBuilder.h.

152 {
153 this,
154 "ElectronOutputName",
155 "",
156 "Name of Electron Container to be created"
157 };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_forwardElectronIsEMSelectorResultNames

Gaudi::Property<std::vector<std::string> > egammaForwardBuilder::m_forwardElectronIsEMSelectorResultNames
protected
Initial value:
{
this,
"forwardelectronIsEMselectorResultNames",
{},
"The selector result names"
}

Definition at line 227 of file egammaForwardBuilder.h.

227 {
228 this,
229 "forwardelectronIsEMselectorResultNames",
230 {},
231 "The selector result names"
232 };

◆ m_forwardElectronIsEMSelectors

ToolHandleArray<IAsgForwardElectronIsEMSelector> egammaForwardBuilder::m_forwardElectronIsEMSelectors
protected
Initial value:
{
this,
"forwardelectronIsEMselectors",
{},
"The selectors that we need to apply to the FwdElectron object"
}

Handle to the selectors.

Definition at line 220 of file egammaForwardBuilder.h.

220 {
221 this,
222 "forwardelectronIsEMselectors",
223 {},
224 "The selectors that we need to apply to the FwdElectron object"
225 };

◆ m_MatchedClusters

Gaudi::Accumulators::Counter egammaForwardBuilder::m_MatchedClusters {}
mutableprivate

Definition at line 214 of file egammaForwardBuilder.h.

214{};

◆ m_maxDelEtaCells

Gaudi::Property<int> egammaForwardBuilder::m_maxDelEtaCells
private
Initial value:
{
this,
"MaxWindowDelEtaCells",
3,
"Size of maximum search window in eta"
}

Size of maximum search window in eta.

Definition at line 190 of file egammaForwardBuilder.h.

190 {
191 this,
192 "MaxWindowDelEtaCells",
193 3,
194 "Size of maximum search window in eta"
195 };

◆ m_maxDelPhiCells

Gaudi::Property<int> egammaForwardBuilder::m_maxDelPhiCells
private
Initial value:
{
this,
"MaxWindowDelPhiCells",
3,
"Size of maximum search window in phi"
}

Size of maximum search window in phi.

Definition at line 198 of file egammaForwardBuilder.h.

198 {
199 this,
200 "MaxWindowDelPhiCells",
201 3,
202 "Size of maximum search window in phi"
203 };

◆ m_maxDelR

Gaudi::Property<float> egammaForwardBuilder::m_maxDelR
private
Initial value:
{
this,
"MaxWindowDelR",
0.3,
"Cone size to collect cells around hottest-cell FCAL"
}

Size of cone to cookie cut on FCal.

Definition at line 206 of file egammaForwardBuilder.h.

206 {
207 this,
208 "MaxWindowDelR",
209 0.3,
210 "Cone size to collect cells around hottest-cell FCAL"
211 };

◆ m_MVACalibSvc

ServiceHandle<IegammaMVASvc> egammaForwardBuilder::m_MVACalibSvc
private
Initial value:
{
this,
"MVACalibSvc",
"egammaMVASvc",
"calibration service" }

Handle to the MVA calibration service.

Definition at line 129 of file egammaForwardBuilder.h.

129 {
130 this,
131 "MVACalibSvc",
132 "egammaMVASvc",
133 "calibration service" };

◆ m_objectQualityTool

ToolHandle<IegammaOQFlagsBuilder> egammaForwardBuilder::m_objectQualityTool
private
Initial value:
{
this,
"ObjectQualityTool",
"",
"Name of the object quality tool (empty tool name ignored)"
}

Tool to perform object quality.

Definition at line 91 of file egammaForwardBuilder.h.

91 {
92 this,
93 "ObjectQualityTool",
94 "",
95 "Name of the object quality tool (empty tool name ignored)"
96 };

◆ m_outClusterContainerCellLinkKey

SG::WriteHandleKey<CaloClusterCellLinkContainer> egammaForwardBuilder::m_outClusterContainerCellLinkKey
private
Initial value:
{
this,
"ClusterContainerLinks", "",
"Key of the output cluster container cell links; Taken from associated container"}

Output cluster container cell links: name taken from containter name.

Definition at line 168 of file egammaForwardBuilder.h.

168 {
169 this,
170 "ClusterContainerLinks", "",
171 "Key of the output cluster container cell links; Taken from associated container"};

◆ m_outClusterContainerKey

SG::WriteHandleKey<xAOD::CaloClusterContainer> egammaForwardBuilder::m_outClusterContainerKey
private
Initial value:
{
this,
"ClusterContainerName",
""
"Name of the output EM cluster container"
}

Output cluster container.

Definition at line 160 of file egammaForwardBuilder.h.

160 {
161 this,
162 "ClusterContainerName",
163 ""
164 "Name of the output EM cluster container"
165 };

◆ m_pVtxKey

SG::ReadHandleKey<xAOD::VertexContainer> egammaForwardBuilder::m_pVtxKey
private
Initial value:
{
this,
"PrimaryVerticesContainerKey",
"",
"Name of the primary vertex container" }

Input primary vertices for fwd energy calibration.

Definition at line 115 of file egammaForwardBuilder.h.

115 {
116 this,
117 "PrimaryVerticesContainerKey",
118 "",
119 "Name of the primary vertex container" };

◆ m_topoClusterKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> egammaForwardBuilder::m_topoClusterKey
private
Initial value:
{
this,
"TopoClusterName",
"",
"Name of the input cluster collection"
}

Input topo cluster type.

Definition at line 136 of file egammaForwardBuilder.h.

136 {
137 this,
138 "TopoClusterName",
139 "",
140 "Name of the input cluster collection"
141 };

◆ m_trackMatchBuilder

ToolHandle<IEMTrackMatchBuilder> egammaForwardBuilder::m_trackMatchBuilder
private
Initial value:
{
this,
"TrackMatchBuilderTool",
"EMTrackMatchBuilder",
"Tool that matches tracks to egammaRecs (Fwd)"
}

Tool to perform track-cluster matching.

Definition at line 99 of file egammaForwardBuilder.h.

99 {
100 this,
101 "TrackMatchBuilderTool",
102 "EMTrackMatchBuilder",
103 "Tool that matches tracks to egammaRecs (Fwd)"
104 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: