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 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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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.
ToolHandleArray< IAsgElectronLikelihoodToolm_forwardElectronNNSelectors
ToolHandle< IForwardElectronCalibm_forwardElectronpTCalib
Gaudi::Property< std::vector< std::string > > m_forwardElectronIsEMSelectorResultNames
Gaudi::Property< std::vector< std::string > > m_forwardElectronNNSelectorResultNames

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.
Gaudi::Property< bool > m_dopTCal
 Private member flag to do pT calibration.
Gaudi::Property< bool > m_fwdDNN
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 65 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 29 of file egammaForwardBuilder.cxx.

31 : AthReentrantAlgorithm(name, pSvcLocator)
32{}

◆ ~egammaForwardBuilder()

egammaForwardBuilder::~egammaForwardBuilder ( )
default

Destructor.

Member Function Documentation

◆ 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 330 of file egammaForwardBuilder.cxx.

333 {
334 // Protection in case tool is not available return success as algorithm can run without it.
335 if (!m_objectQualityTool.isEnabled()) { return StatusCode::SUCCESS; }
336
337 return m_objectQualityTool->execute(ctx,*eg);
338}
ToolHandle< IegammaOQFlagsBuilder > m_objectQualityTool
Tool to perform object quality.

◆ execute()

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

Execute method.

Definition at line 116 of file egammaForwardBuilder.cxx.

117{
118 // Create an egamma container and register it.
119 SG::WriteHandle<xAOD::ElectronContainer> xaodFrwd(m_electronOutputKey, ctx);
120 ATH_CHECK(xaodFrwd.record(
121 std::make_unique<xAOD::ElectronContainer>(),
122 std::make_unique<xAOD::ElectronAuxContainer>())
123 );
124
125 // Create the relevant cluster output and register it.
126 SG::WriteHandle<xAOD::CaloClusterContainer> outClusterContainer(
128 ctx
129 );
130
132 SG::WriteHandle<CaloClusterCellLinkContainer> outClusterContainerCellLink(
134 ctx
135 );
136
137 ATH_CHECK(outClusterContainerCellLink.record(
138 std::make_unique<CaloClusterCellLinkContainer>())
139 );
140
141 // Topo cluster container.
142 SG::ReadHandle<xAOD::CaloClusterContainer> inputClusters(m_topoClusterKey, ctx);
143
144 // Check is only used for serial running, remove when MT scheduler used.
145 ATH_CHECK(inputClusters.isValid());
146
147 // Calorimeter description.
148 SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{
150 };
151 ATH_CHECK(caloDetDescrMgrHandle.isValid());
152 const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
153
154 static const SG::AuxElement::Accessor<
155 std::vector<ElementLink<xAOD::CaloClusterContainer>>
156 > caloClusterLinks("constituentClusterLinks");
157
158 // Prepare to create clusters.
159 EgammaRecContainer egammaRecsFwd;
160 size_t origClusterIndex = 0;
161
162 egammaMVACalib::GlobalEventInfo gei;
163 if (m_doEnergyCal) {
164 std::pair<float,float> nPVmu = this->getnPVmu(ctx);
165 gei.nPV = nPVmu.first;
166 gei.acmu = nPVmu.second;
167 ATH_MSG_DEBUG("Retrieved nPV = " << gei.nPV << " and mu = " << gei.acmu);
168 }
169
170 // Loop over input cluster container and create egRecs to store the electrons.
171 ATH_MSG_VERBOSE("Will run on " << inputClusters->size() << " input clusters, doing cookie cut ? " << m_doCookieCutting);
172 for (const xAOD::CaloCluster* cluster : *inputClusters) {
173
174 // Create links back to the original clusters.
175 std::vector<ElementLink<xAOD::CaloClusterContainer>> constituentLinks;
176
177 // The constituent links should contain a CaloCal cluster. When not running
178 // in ITk mode this is the default for the forward clusters used by egamma
179 // so no sister link is needed to get the CaloCal. When running in ITk mode
180 // the clusters used are CaloTopoClusters so need to access the sister
181 // cluster to maintain consistency.
182 if (m_doTrackMatching) {
183 ElementLink<xAOD::CaloClusterContainer> sisterCluster =
184 cluster->getSisterClusterLink();
185
186 if (sisterCluster) {
187 constituentLinks.push_back(sisterCluster);
188 } else {
189 ATH_MSG_WARNING("No sister Link available");
190 }
191 } else {
192 constituentLinks.emplace_back(*inputClusters, origClusterIndex, ctx);
193 }
194
195 const DataLink<CaloCellContainer>& cellCont =
196 cluster->getCellLinks()->getCellContainerLink();
197
198 // Create the new cluster.
199 std::unique_ptr<xAOD::CaloCluster> newCluster =
201 egammaClusterCookieCut::cookieCut(*cluster, *calodetdescrmgr,
202 cellCont, m_CookieCutPars) :
203 std::make_unique<xAOD::CaloCluster>(*cluster);
204
205 if (!newCluster || newCluster->size() == 0) {
206 ATH_MSG_DEBUG("Could not build a new cluster, or has 0 cell");
207 continue;
208 }
209
210 if (m_doEnergyCal &&
211 m_MVACalibSvc->execute(*newCluster, xAOD::EgammaParameters::forwardelectron, gei).isFailure())
212 { ATH_MSG_ERROR("Problem executing MVA cluster tool for fwd electron"); }
213
214 caloClusterLinks(*newCluster) = constituentLinks;
215 outClusterContainer->push_back(std::move(newCluster));
216
217 size_t index = outClusterContainer->size() - 1;
218 const ElementLink<xAOD::CaloClusterContainer> clusterLink(*outClusterContainer, index, ctx);
219 const std::vector<ElementLink<xAOD::CaloClusterContainer>> clusterLinkVector{clusterLink};
220
221 // Now create the egamma Rec
222 egammaRecsFwd.push_back(std::make_unique<egammaRec>(clusterLinkVector));
223
224 ++origClusterIndex;
225 }
226
227 // Add track-cluster matching information if requested.
228 if (m_doTrackMatching) {
229 ATH_CHECK(m_trackMatchBuilder->executeRec(ctx, &egammaRecsFwd));
230 }
231
232 auto buff_AllClusters = m_AllClusters.buffer();
233 auto buff_MatchedClusters = m_MatchedClusters.buffer();
234
235 //Loop over the egamma Rec creating electrons
236 for (const egammaRec* egRec : egammaRecsFwd) {
237 if (!egRec) {
238 return StatusCode::FAILURE;
239 }
240
241 ++buff_AllClusters;
242
243 if (m_doTrackMatching && egRec->getNumberOfTrackParticles() == 0) {
244 // Later we may want to use these for so called forward photons.
245 ATH_MSG_DEBUG("EgammaRec without track particle");
246 continue;
247 }
248
249 //common part
250 xAOD::Electron* el = xaodFrwd->push_back(std::make_unique<xAOD::Electron>());
252 el->setCaloClusterLinks(egRec->caloClusterElementLinks());
253
254 // from here one, we need both track matching and
255 // having tracks .
256 if (m_doTrackMatching) {
257
258 ++buff_MatchedClusters;
259 el->setTrackParticleLinks(egRec->trackParticleElementLinks());
260
261 const xAOD::TrackParticle* trackParticle = el->trackParticle();
262 if (trackParticle) {
263 el->setCharge(trackParticle->charge());
264 } else {
265 ATH_MSG_WARNING("Forward electron without track particle, whereas"
266 " corresponding egammaRec has at least one");
267 }
268
269 // Set DeltaEta, DeltaPhi, DeltaPhiRescaled.
270 el->setTrackCaloMatchValues(
271 egRec->deltaEta(),
272 egRec->deltaPhi(),
273 egRec->deltaPhiRescaled(),
274 egRec->deltaPhiLast()
275 );
276 }
277
280
281 if (m_dopTCal)
282 {
283 double DNN_pT=m_forwardElectronpTCalib->calibrate(ctx,el);
284 el->setPt(DNN_pT);
285 }
286
287 // Apply the Forward Electron selectors.
288 for (size_t i = 0; i < m_forwardElectronIsEMSelectors.size(); ++i) {
291
292 // Save the bool result.
293 const asg::AcceptData accept = selector->accept(ctx, el);
294 el->setPassSelection(static_cast<bool>(accept), name);
295
296 // Save the isem.
297 el->setSelectionisEM(accept.getCutResultInverted(), "isEM" + name);
298 }
299
300
301
302 if (m_fwdDNN) {
303 // Apply the Forward Electron selectors.
304 for (size_t i = 0; i < m_forwardElectronNNSelectors.size(); ++i) {
307
308
309 // Save the bool result.
310 const asg::AcceptData accept = selector->accept(ctx, el);
311 el->setPassSelection(static_cast<bool>(accept), "DNN"+name);
312 }
313 std::string LikeliHoodName = "DNN_Score";
315 float val=selector->calculate(ctx,el);
316 el->setLikelihoodValue(val,LikeliHoodName);
317 }
318
319 }//end of loop over egammaRecs
320
322 ctx,
323 outClusterContainer,
324 outClusterContainerCellLink);
325
326 return StatusCode::SUCCESS;
327}
#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(pathvar)
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.
ToolHandle< IForwardElectronCalib > m_forwardElectronpTCalib
ToolHandleArray< IAsgForwardElectronIsEMSelector > m_forwardElectronIsEMSelectors
Handle to the selectors.
Gaudi::Property< bool > m_dopTCal
Private member flag to do pT calibration.
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
ToolHandleArray< IAsgElectronLikelihoodTool > m_forwardElectronNNSelectors
Gaudi::Property< bool > m_fwdDNN
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_forwardElectronNNSelectorResultNames
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 & AthCommonAlgorithm< 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 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode egammaForwardBuilder::finalize ( )
finaloverridevirtual

Finalize method.

Definition at line 105 of file egammaForwardBuilder.cxx.

106{
107
108 ATH_MSG_INFO("====> Forward Egamma Statistics =============");
109 ATH_MSG_INFO(" All Clusters " << m_AllClusters);
110 ATH_MSG_INFO(" Matched Clusters " << m_MatchedClusters);
111 ATH_MSG_INFO("=============================================");
112
113 return StatusCode::SUCCESS;
114}
#define ATH_MSG_INFO(x)

◆ getnPVmu()

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

Definition at line 361 of file egammaForwardBuilder.cxx.

362 {
363 unsigned int npv(0);
364 float mu(0);
365
366 SG::ReadHandle<xAOD::VertexContainer> vtxCont(m_pVtxKey, ctx);
367 if (!vtxCont.isValid()) {
368 ATH_MSG_WARNING("Cannot find " << m_pVtxKey.key()
369 << " container, returning nPV = 0");
370 } else {
371 for (const auto *vtx : *vtxCont) {
372 if (vtx->vertexType() == xAOD::VxType::PriVtx ||
373 vtx->vertexType() == xAOD::VxType::PileUp) { ++npv; }
374 }
375 }
376
377 SG::ReadHandle<xAOD::EventInfo> eiCont(m_eiKey, ctx);
378 if (!eiCont.isValid()) {
379 ATH_MSG_WARNING("Cannot find " << m_eiKey.key() << " returning mu = 0");
380 } else {
381 mu = eiCont.get()->actualInteractionsPerCrossing();
382 }
383
384 return std::make_pair(npv,mu);
385}
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 34 of file egammaForwardBuilder.cxx.

35{
36 m_CookieCutPars.maxDelEta = m_maxDelEtaCells * cellEtaSize * 0.5;
37 m_CookieCutPars.maxDelPhi = m_maxDelPhiCells * cellPhiSize * 0.5;
38 m_CookieCutPars.maxDelR2 = m_maxDelR * m_maxDelR; // Square now to avoid a slow sqrt later.
39
40 // The data handle keys.
41 ATH_CHECK(m_topoClusterKey.initialize());
42 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
43 ATH_CHECK(m_electronOutputKey.initialize());
45 if (m_outClusterContainerCellLinkKey.key().empty()) {
47 }
49
50 // Retrieve object quality tool.
51 if (!m_objectQualityTool.empty()) {
53 }
54
55 else {
56 m_objectQualityTool.disable();
57 }
58
60
61 if (
64 ) {
66 "Number of selectors doesn't match number of given fwd-electron selector names"
67 );
68
69 return StatusCode::FAILURE;
70 }
71 if (m_fwdDNN) {
73
74 if (
77 ) {
79 "Number of selectors doesn't match number of given fwd-electron NN selector names"
80 );
81
82 return StatusCode::FAILURE;
83 }
84 }
85
86 // Retrieve track match builder.
88
89 // Retrive MVA energy calibration
90 if (m_doEnergyCal) {
91 ATH_CHECK(m_pVtxKey.initialize());
92 ATH_CHECK(m_eiKey.initialize());
93 ATH_CHECK(m_MVACalibSvc.retrieve());
94 }
95
96 if (m_dopTCal) {
98 }
99
100 ATH_MSG_DEBUG("Initialization completed successfully");
101
102 return StatusCode::SUCCESS;
103}
#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()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ 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 341 of file egammaForwardBuilder.cxx.

342{
343 if (!m_doTrackMatching) {
344 m_trackMatchBuilder.disable();
345 return StatusCode::SUCCESS;
346 }
347
348 if (m_trackMatchBuilder.empty()) {
349 ATH_MSG_ERROR("EMTrackMatchBuilder is empty, but track matching is enabled");
350 return StatusCode::FAILURE;
351 }
352
353 if (m_trackMatchBuilder.retrieve().isFailure()) {
354 ATH_MSG_ERROR("Unable to retrieve " << m_trackMatchBuilder);
355 return StatusCode::FAILURE;
356 }
357
358 return StatusCode::SUCCESS;
359}

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
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 236 of file egammaForwardBuilder.h.

236{};

◆ 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 167 of file egammaForwardBuilder.h.

167 {
168 this,
169 "CaloDetDescrManager",
170 "CaloDetDescrManager",
171 "SG Key for CaloDetDescrManager in the Condition Store"
172 };

◆ m_CookieCutPars

egammaClusterCookieCut::CookieCutPars egammaForwardBuilder::m_CookieCutPars {}
private

Definition at line 239 of file egammaForwardBuilder.h.

239{};

◆ 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 205 of file egammaForwardBuilder.h.

205 {
206 this,
207 "doCookieCutting",
208 false,
209 "Boolean to do cookie cutting"
210 };

◆ 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 113 of file egammaForwardBuilder.h.

113 {
114 this,
115 "doEnergyCal",
116 false,
117 "Boolean to do energy calibration"
118 };

◆ m_dopTCal

Gaudi::Property<bool> egammaForwardBuilder::m_dopTCal
private
Initial value:
{
this,
"dopTCal",
false,
"Boolean to do pT calibration"
}

Private member flag to do pT calibration.

Definition at line 122 of file egammaForwardBuilder.h.

122 {
123 this,
124 "dopTCal",
125 false,
126 "Boolean to do pT calibration"
127 };

◆ 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 197 of file egammaForwardBuilder.h.

197 {
198 this,
199 "doTrackMatching",
200 false,
201 "Boolean to do track matching"
202 };

◆ 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 145 of file egammaForwardBuilder.h.

145 {
146 this,
147 "EventInfoKey",
148 "",
149 "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 175 of file egammaForwardBuilder.h.

175 {
176 this,
177 "ElectronOutputName",
178 "",
179 "Name of Electron Container to be created"
180 };

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_forwardElectronIsEMSelectorResultNames

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

Definition at line 266 of file egammaForwardBuilder.h.

266 {
267 this,
268 "forwardelectronIsEMselectorResultNames",
269 {},
270 "The selector result names"
271 };

◆ 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 243 of file egammaForwardBuilder.h.

243 {
244 this,
245 "forwardelectronIsEMselectors",
246 {},
247 "The selectors that we need to apply to the FwdElectron object"
248 };

◆ m_forwardElectronNNSelectorResultNames

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

Definition at line 273 of file egammaForwardBuilder.h.

273 {
274 this,
275 "forwardelectronNNselectorResultNames",
276 {},
277 "The selector result names"
278 };

◆ m_forwardElectronNNSelectors

ToolHandleArray<IAsgElectronLikelihoodTool> egammaForwardBuilder::m_forwardElectronNNSelectors
protected
Initial value:
{
this,
"forwardelectronNNselectors",
{},
"The selectors that we need to apply to the FwdElectron object"
}

Definition at line 250 of file egammaForwardBuilder.h.

250 {
251 this,
252 "forwardelectronNNselectors",
253 {},
254 "The selectors that we need to apply to the FwdElectron object"
255 };

◆ m_forwardElectronpTCalib

ToolHandle<IForwardElectronCalib> egammaForwardBuilder::m_forwardElectronpTCalib
protected
Initial value:
{
this,
"forwardelectronNNCalib",
{},
"The tool that we need to calibrate the pT of the FwdElectron object"
}

Definition at line 258 of file egammaForwardBuilder.h.

258 {
259 this,
260 "forwardelectronNNCalib",
261 {},
262 "The tool that we need to calibrate the pT of the FwdElectron object"
263 };

◆ m_fwdDNN

Gaudi::Property<bool> egammaForwardBuilder::m_fwdDNN
private
Initial value:
{
this,
"dofwdDNN",
false,
"Boolean to do forward DNN identification"
}

Definition at line 129 of file egammaForwardBuilder.h.

129 {
130 this,
131 "dofwdDNN",
132 false,
133 "Boolean to do forward DNN identification"
134 };

◆ m_MatchedClusters

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

Definition at line 237 of file egammaForwardBuilder.h.

237{};

◆ 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 213 of file egammaForwardBuilder.h.

213 {
214 this,
215 "MaxWindowDelEtaCells",
216 3,
217 "Size of maximum search window in eta"
218 };

◆ 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 221 of file egammaForwardBuilder.h.

221 {
222 this,
223 "MaxWindowDelPhiCells",
224 3,
225 "Size of maximum search window in phi"
226 };

◆ 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 229 of file egammaForwardBuilder.h.

229 {
230 this,
231 "MaxWindowDelR",
232 0.3,
233 "Cone size to collect cells around hottest-cell FCAL"
234 };

◆ m_MVACalibSvc

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

Handle to the MVA calibration service.

Definition at line 152 of file egammaForwardBuilder.h.

152 {
153 this,
154 "MVACalibSvc",
155 "egammaMVASvc",
156 "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 97 of file egammaForwardBuilder.h.

97 {
98 this,
99 "ObjectQualityTool",
100 "",
101 "Name of the object quality tool (empty tool name ignored)"
102 };

◆ 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 191 of file egammaForwardBuilder.h.

191 {
192 this,
193 "ClusterContainerLinks", "",
194 "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 183 of file egammaForwardBuilder.h.

183 {
184 this,
185 "ClusterContainerName",
186 ""
187 "Name of the output EM cluster container"
188 };

◆ 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 138 of file egammaForwardBuilder.h.

138 {
139 this,
140 "PrimaryVerticesContainerKey",
141 "",
142 "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 159 of file egammaForwardBuilder.h.

159 {
160 this,
161 "TopoClusterName",
162 "",
163 "Name of the input cluster collection"
164 };

◆ 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 105 of file egammaForwardBuilder.h.

105 {
106 this,
107 "TrackMatchBuilderTool",
108 "EMTrackMatchBuilder",
109 "Tool that matches tracks to egammaRecs (Fwd)"
110 };

◆ 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: