ATLAS Offline Software
Loading...
Searching...
No Matches
egammaSuperClusterBuilderBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EGAMMAALGS_EGAMMASUPERCLUSTERBUILDERBASE_H
6#define EGAMMAALGS_EGAMMASUPERCLUSTERBUILDERBASE_H
7
8//
9#include "AthLinks/DataLink.h"
11#include "GaudiKernel/EventContext.h"
12#include "GaudiKernel/SystemOfUnits.h"
13#include "GaudiKernel/ToolHandle.h"
14//
17//
24//
28
29#include <memory>
30#include <vector>
31
47{
48protected:
51 egammaSuperClusterBuilderBase(const std::string& name,
52 ISvcLocator* pSvcLocator);
53
55 virtual StatusCode initialize() override;
56
58 virtual StatusCode execute(const EventContext &ctx) const override;
60 virtual bool egammaRecPassesSelection(const egammaRec *egRec) const;
61 virtual StatusCode redoMatching(
62 const EventContext &ctx,
64 ) const;
65
66 virtual std::vector<std::size_t> searchForSecondaryClusters(
67 std::size_t egammaInd,
68 const EgammaRecContainer* egammaRecs,
69 std::vector<bool>& isUsed) const = 0;
89 const xAOD::CaloCluster* clus) const;
90
122 std::unique_ptr<xAOD::CaloCluster> createNewCluster(
123 const EventContext& ctx,
124 const std::vector<const xAOD::CaloCluster*>& clusters,
125 const DataLink<CaloCellContainer>& cellCont,
126 const CaloDetDescrManager& mgr,
128 xAOD::CaloClusterContainer* precorrClusters) const;
129
133 bool seedClusterSelection(const xAOD::CaloCluster* clus) const;
134
135 // some constants to use
136 static constexpr float s_cellEtaSize = 0.025;
137 static constexpr float s_cellPhiSize = M_PI / 128.;
138 static constexpr float s_TG3Run3E4cellEtaMax = 1.72;
139 static constexpr float s_TG3Run3E3cellEtaMin = 1.2;
140 static constexpr float s_TG3Run2E4cellEtaMax = 1.6;
141 static constexpr float s_TG3Run2E4cellEtaMin = 1.4;
142 // Run2 here
143 static constexpr float s_ClEtaMinForTG3cell = s_TG3Run2E4cellEtaMin - 0.03;
144 static constexpr float s_ClEtaMaxForTG3cell = s_TG3Run3E4cellEtaMax + 0.03;
145
147 Gaudi::Property<float> m_EtThresholdCut{
148 this,
149 "EtThresholdCut",
150 1.5 * Gaudi::Units::GeV,
151 "The minimum EM Et required of SEED clusters (not applied to secondaries)"
152 };
153
156 this,
157 "InputEgammaRecContainerName",
158 "egammaRecCollection",
159 "input egammaRec container"
160 };
161
163 this,
164 "CaloDetDescrManager",
165 "CaloDetDescrManager",
166 "SG Key for CaloDetDescrManager in the Condition Store"
167 };
168
171 this,
172 "OutputEgammaRecContainerKey",
173 "egammaSuperRecContainer",
174 "output egammaRec container"
175 };
176
179 this,
180 "SuperClusterCollectionName",
181 "egammaSuperClusters",
182 "output calo cluster container"
183 };
184
187 this,
188 "precorrClustersName",
189 "",
190 "optional pre-correction clusters"
191 };
192
193 // these are calculated search window values
194 // half of search window size, converted to units of eta,phi
199
200private:
237 StatusCode fillClusterConstrained(
238 xAOD::CaloCluster& tofill,
239 const std::vector<const xAOD::CaloCluster*>& clusters,
240 const CookieCutterHelpers::CentralPosition& cp0) const;
241
248 const CaloDetDescrManager& mgr) const;
249
261 StatusCode calibrateCluster(
262 const EventContext& ctx,
263 xAOD::CaloCluster* newCluster,
264 const CaloDetDescrManager& mgr,
266 xAOD::CaloClusterContainer* precorrClusters) const;
267
268 // window values for the windows
269 // in which cells of topoclusters are added
270 // half of addCells window size, converted in units of eta/phi
273 // Extra opening in phi for L0,L1
274 float m_extraL0L1PhiSize = 0.0F;
275 // Extra opening in eta for L3 cells
276 float m_extraL3EtaSize = 0.0F;
277
280 Gaudi::Property<bool> m_linkToConstituents{
281 this,
282 "LinkToConstituents",
283 true,
284 "Link sister clusters to new cluster"
285 };
286
288 Gaudi::Property<bool> m_useExtendedTG3{
289 this,
290 "UseExtendedTG3",
291 false,
292 "Extend TG3 definition from |eta| = 1.2 to |eta| = 1.72"
293 };
294
296 Gaudi::Property<int> m_searchWindowEtaCellsBarrel{
297 this,
298 "SearchWindowEtaCellsBarrel",
299 5,
300 "Number of cells in eta of window in which to search for topoclusters"
301 };
302
304 Gaudi::Property<int> m_searchWindowPhiCellsBarrel{
305 this,
306 "SearchWindowPhiCellsBarrel",
307 5,
308 "Number of cells in phi of window in which to search for topoclusters"
309 };
310
312 Gaudi::Property<int> m_searchWindowEtaCellsEndcap{
313 this,
314 "SearchWindowEtaCellsEndcap",
315 5,
316 "Number of cells in eta of window in which to search for topoclusters"
317 };
318
320 Gaudi::Property<int> m_searchWindowPhiCellsEndcap{
321 this,
322 "SearchWindowPhiCellsEndcap",
323 5,
324 "Number of cells in phi of window in which to search for topoclusters"
325 };
326
329 Gaudi::Property<int> m_addCellsWindowEtaCellsBarrel{
330 this,
331 "AddCellsWindowEtaCellsBarrel",
332 3,
333 "Number of cells in eta of window around topocluster center to add cells"
334 };
335
338 Gaudi::Property<int> m_addCellsWindowEtaCellsEndcap{
339 this,
340 "AddCellsWindowEtaCellsEndcap",
341 5,
342 "Number of cells in eta of window around topocluster center to add cells"
343 };
344
348 Gaudi::Property<int> m_extraL0L1PhiSizeCells{
349 this,
350 "ExtraL0L1PhiSize",
351 1,
352 "When adding L0 (PS) and L1 cells in phi, "
353 "how much wider (+/- of the value) than the L2 phi size of the "
354 "cluster (in L2 cells units) is the acceptance"
355 };
356
359 Gaudi::Property<int> m_extraL3EtaSizeCells{
360 this,
361 "ExtraL3EtaSizeCells",
362 0,
363 "When adding L3 cells how much wider (+/- 0.5 of the value) "
364 "than L2 (in L2 cells "
365 "units) is the acceptance in eta"
366 };
367
370 "MVACalibSvc",
371 "egammaMVASvc",
372 "calibration service" };
373
375 ToolHandle<IegammaSwTool> m_clusterCorrectionTool{
376 this,
377 "ClusterCorrectionTool",
378 "egammaSwTool/egammaswtool",
379 "tool that applies cluster corrections"
380 };
381
383 ToolHandle<IegammaCheckEnergyDepositTool> m_egammaCheckEnergyDepositTool{
384 this,
385 "egammaCheckEnergyDepositTool",
386 "",
387 "Optional tool that performs basic checks of viability of cluster"
388 };
389
391 ToolHandle<IegammaCellRecoveryTool> m_egammaCellRecoveryTool{
392 this,
393 "egammaCellRecoveryTool",
394 "",
395 "Optional tool that adds cells in L2 or L3 "
396 "that could have been rejected by timing cut"
397 };
398
399};
400
401#endif
const boost::regex ref(r_ef)
#define M_PI
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
This class provides the client interface for accessing the detector description information common to...
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Represent an egamma object for internal egamma usage during reconstruction.
Definition egammaRec.h:31
Gaudi::Property< int > m_addCellsWindowEtaCellsEndcap
Size of windows et eta in which cells of topoclusters are edded for the endcap (units of 2nd layer ce...
egammaSuperClusterBuilderBase(const std::string &name, ISvcLocator *pSvcLocator)
Protected constructor since this class should not be instantiated by itself.
SG::WriteHandleKey< EgammaRecContainer > m_outputEgammaRecContainerKey
Key for output egammaRec container.
SG::ReadHandleKey< EgammaRecContainer > m_inputEgammaRecContainerKey
Key for input egammaRec container.
Gaudi::Property< int > m_extraL3EtaSizeCells
"When adding L3 cells, how much wider in eta than the L2
Gaudi::Property< float > m_EtThresholdCut
Seed selection requirements.
StatusCode fillClusterConstrained(xAOD::CaloCluster &tofill, const std::vector< const xAOD::CaloCluster * > &clusters, const CookieCutterHelpers::CentralPosition &cp0) const
Fill super cluster constraining its size in eta,phi around the overall hottest cell and the its L2 si...
virtual StatusCode redoMatching(const EventContext &ctx, SG::WriteHandle< EgammaRecContainer > &newEgammaRecs) const
Gaudi::Property< int > m_searchWindowEtaCellsBarrel
Size of topocluster search window in eta for the barrel.
bool matchesInWindow(const xAOD::CaloCluster *ref, const xAOD::CaloCluster *clus) const
Is clus in window center around ref?
std::unique_ptr< xAOD::CaloCluster > createNewCluster(const EventContext &ctx, const std::vector< const xAOD::CaloCluster * > &clusters, const DataLink< CaloCellContainer > &cellCont, const CaloDetDescrManager &mgr, xAOD::EgammaParameters::EgammaType egType, xAOD::CaloClusterContainer *precorrClusters) const
Add new supercluster ,created out of the input clusters, to the newClusters collections.
Gaudi::Property< bool > m_linkToConstituents
Decorate the supercluster with links to the component topoclusters.
StatusCode calibrateCluster(const EventContext &ctx, xAOD::CaloCluster *newCluster, const CaloDetDescrManager &mgr, const xAOD::EgammaParameters::EgammaType egType, xAOD::CaloClusterContainer *precorrClusters) const
function to calibrate the new clusters energy
ToolHandle< IegammaCheckEnergyDepositTool > m_egammaCheckEnergyDepositTool
Pointer to the egammaCheckEnergyDepositTool.
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
Gaudi::Property< bool > m_useExtendedTG3
Use extended TG3 definition (only after Run 2)
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_precorrClustersKey
Optional key for pre-correction clusters.
virtual StatusCode execute(const EventContext &ctx) const override
should be called by the derived class in the execute phase
virtual bool egammaRecPassesSelection(const egammaRec *egRec) const
StatusCode addTileGap3CellsinWindow(xAOD::CaloCluster &tofill, const CaloDetDescrManager &mgr) const
add all tile Gap 3 cells in a window.
Gaudi::Property< int > m_searchWindowPhiCellsEndcap
Size of topocluster search window in phi for the end-cap.
virtual xAOD::EgammaParameters::EgammaType getEgammaRecType(const egammaRec *egRec) const =0
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
ToolHandle< IegammaSwTool > m_clusterCorrectionTool
Tool to handle cluster corrections.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputSuperClusterCollectionName
Key for output clusters.
Gaudi::Property< int > m_extraL0L1PhiSizeCells
"When adding L0 (PS) and L1 cells, how much wider than the L2 size of the cluster is the acceptance i...
Gaudi::Property< int > m_searchWindowEtaCellsEndcap
Size of topocluster search window in eta for the end-cap.
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
virtual std::vector< std::size_t > searchForSecondaryClusters(std::size_t egammaInd, const EgammaRecContainer *egammaRecs, std::vector< bool > &isUsed) const =0
Gaudi::Property< int > m_addCellsWindowEtaCellsBarrel
Size of windows et eta in which cells of topoclusters are added for the barrel (units of 2nd layer ce...
Gaudi::Property< int > m_searchWindowPhiCellsBarrel
Size of topocluster search window in phi for the barrel.
virtual StatusCode initialize() override
should be called by the derived class in the initialize phase
bool seedClusterSelection(const xAOD::CaloCluster *clus) const
check if we pass the basic criteria for a seed cluster
DataVector< egammaRec > EgammaRecContainer
The container is a simple typedef for now.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Find the reference position (eta, phi) relative to which cells are restricted.