ATLAS Offline Software
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 //
26 #include "xAODEgamma/EgammaEnums.h"
28 
29 #include <memory>
30 #include <vector>
31 
47 {
48 protected:
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 
200 private:
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 
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
CookieCutterHelpers::CentralPosition
Find the reference position (eta, phi) relative to which cells are restricted.
Definition: CookieCutterHelpers.h:19
egammaSuperClusterBuilderBase::m_addCellsWindowEtaCellsBarrel
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...
Definition: egammaSuperClusterBuilderBase.h:329
egammaSuperClusterBuilderBase::m_MVACalibSvc
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
Definition: egammaSuperClusterBuilderBase.h:369
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
egammaSuperClusterBuilderBase::m_searchWindowPhiEndcap
float m_searchWindowPhiEndcap
Definition: egammaSuperClusterBuilderBase.h:198
egammaSuperClusterBuilderBase::m_searchWindowEtaBarrel
float m_searchWindowEtaBarrel
Definition: egammaSuperClusterBuilderBase.h:195
egammaSuperClusterBuilderBase::egammaRecPassesSelection
virtual bool egammaRecPassesSelection(const egammaRec *egRec) const
Definition: egammaSuperClusterBuilderBase.cxx:396
egammaSuperClusterBuilderBase::m_clusterCorrectionTool
ToolHandle< IegammaSwTool > m_clusterCorrectionTool
Tool to handle cluster corrections.
Definition: egammaSuperClusterBuilderBase.h:375
IegammaSwTool.h
IegammaCellRecoveryTool.h
egammaSuperClusterBuilderBase::s_TG3Run3E3cellEtaMin
static constexpr float s_TG3Run3E3cellEtaMin
Definition: egammaSuperClusterBuilderBase.h:139
egammaSuperClusterBuilderBase::m_addCellsWindowEtaBarrel
float m_addCellsWindowEtaBarrel
Definition: egammaSuperClusterBuilderBase.h:271
egammaSuperClusterBuilderBase::initialize
virtual StatusCode initialize() override
should be called by the derived class in the initialize phase
Definition: egammaSuperClusterBuilderBase.cxx:211
M_PI
#define M_PI
Definition: ActiveFraction.h:11
egammaSuperClusterBuilderBase::createNewCluster
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.
Definition: egammaSuperClusterBuilderBase.cxx:477
egammaSuperClusterBuilderBase::s_cellPhiSize
static constexpr float s_cellPhiSize
Definition: egammaSuperClusterBuilderBase.h:137
egammaSuperClusterBuilderBase::s_TG3Run3E4cellEtaMax
static constexpr float s_TG3Run3E4cellEtaMax
Definition: egammaSuperClusterBuilderBase.h:138
egammaSuperClusterBuilderBase::m_outputSuperClusterCollectionName
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputSuperClusterCollectionName
Key for output clusters.
Definition: egammaSuperClusterBuilderBase.h:178
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IegammaCheckEnergyDepositTool.h
egammaSuperClusterBuilderBase::getEgammaRecType
virtual xAOD::EgammaParameters::EgammaType getEgammaRecType(const egammaRec *egRec) const =0
egammaSuperClusterBuilderBase::m_egammaCheckEnergyDepositTool
ToolHandle< IegammaCheckEnergyDepositTool > m_egammaCheckEnergyDepositTool
Pointer to the egammaCheckEnergyDepositTool.
Definition: egammaSuperClusterBuilderBase.h:383
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
egammaSuperClusterBuilderBase::m_addCellsWindowEtaCellsEndcap
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...
Definition: egammaSuperClusterBuilderBase.h:338
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
xAOD::EgammaParameters::EgammaType
EgammaType
Definition: EgammaEnums.h:17
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
egammaSuperClusterBuilderBase::execute
virtual StatusCode execute(const EventContext &ctx) const override
should be called by the derived class in the execute phase
Definition: egammaSuperClusterBuilderBase.cxx:274
egammaSuperClusterBuilderBase::addTileGap3CellsinWindow
StatusCode addTileGap3CellsinWindow(xAOD::CaloCluster &tofill, const CaloDetDescrManager &mgr) const
add all tile Gap 3 cells in a window.
Definition: egammaSuperClusterBuilderBase.cxx:785
egammaSuperClusterBuilderBase::m_linkToConstituents
Gaudi::Property< bool > m_linkToConstituents
Decorate the supercluster with links to the component topoclusters.
Definition: egammaSuperClusterBuilderBase.h:280
egammaSuperClusterBuilderBase::m_caloDetDescrMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Definition: egammaSuperClusterBuilderBase.h:162
egammaSuperClusterBuilderBase::matchesInWindow
bool matchesInWindow(const xAOD::CaloCluster *ref, const xAOD::CaloCluster *clus) const
Is clus in window center around ref?
Definition: egammaSuperClusterBuilderBase.cxx:409
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
egammaSuperClusterBuilderBase::m_egammaCellRecoveryTool
ToolHandle< IegammaCellRecoveryTool > m_egammaCellRecoveryTool
Pointer to the egammaCellRecoveryTool.
Definition: egammaSuperClusterBuilderBase.h:391
egammaSuperClusterBuilderBase::m_searchWindowPhiCellsEndcap
Gaudi::Property< int > m_searchWindowPhiCellsEndcap
Size of topocluster search window in phi for the end-cap.
Definition: egammaSuperClusterBuilderBase.h:320
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
CaloClusterFwd.h
IegammaMVASvc.h
egammaSuperClusterBuilderBase::redoMatching
virtual StatusCode redoMatching(const EventContext &ctx, SG::WriteHandle< EgammaRecContainer > &newEgammaRecs) const
Definition: egammaSuperClusterBuilderBase.cxx:401
egammaSuperClusterBuilderBase::egammaSuperClusterBuilderBase
egammaSuperClusterBuilderBase(const std::string &name, ISvcLocator *pSvcLocator)
Protected constructor since this class should not be instantiated by itself.
Definition: egammaSuperClusterBuilderBase.cxx:203
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
egammaSuperClusterBuilderBase::m_searchWindowPhiBarrel
float m_searchWindowPhiBarrel
Definition: egammaSuperClusterBuilderBase.h:196
CaloCellDetPos.h
egammaSuperClusterBuilderBase::m_searchWindowEtaCellsBarrel
Gaudi::Property< int > m_searchWindowEtaCellsBarrel
Size of topocluster search window in eta for the barrel.
Definition: egammaSuperClusterBuilderBase.h:296
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
egammaSuperClusterBuilderBase::s_TG3Run2E4cellEtaMin
static constexpr float s_TG3Run2E4cellEtaMin
Definition: egammaSuperClusterBuilderBase.h:141
egammaSuperClusterBuilderBase::m_precorrClustersKey
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_precorrClustersKey
Optional key for pre-correction clusters.
Definition: egammaSuperClusterBuilderBase.h:186
AthReentrantAlgorithm.h
egammaSuperClusterBuilderBase::m_addCellsWindowEtaEndcap
float m_addCellsWindowEtaEndcap
Definition: egammaSuperClusterBuilderBase.h:272
egammaSuperClusterBuilderBase::m_inputEgammaRecContainerKey
SG::ReadHandleKey< EgammaRecContainer > m_inputEgammaRecContainerKey
Key for input egammaRec container.
Definition: egammaSuperClusterBuilderBase.h:155
CookieCutterHelpers.h
egammaSuperClusterBuilderBase::m_extraL3EtaSize
float m_extraL3EtaSize
Definition: egammaSuperClusterBuilderBase.h:276
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
egammaSuperClusterBuilderBase::searchForSecondaryClusters
virtual std::vector< std::size_t > searchForSecondaryClusters(std::size_t egammaInd, const EgammaRecContainer *egammaRecs, std::vector< bool > &isUsed) const =0
SG::ReadCondHandleKey< CaloDetDescrManager >
EgammaEnums.h
egammaSuperClusterBuilderBase::s_TG3Run2E4cellEtaMax
static constexpr float s_TG3Run2E4cellEtaMax
Definition: egammaSuperClusterBuilderBase.h:140
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
egammaSuperClusterBuilderBase::s_cellEtaSize
static constexpr float s_cellEtaSize
Definition: egammaSuperClusterBuilderBase.h:136
egammaSuperClusterBuilderBase::m_EtThresholdCut
Gaudi::Property< float > m_EtThresholdCut
Seed selection requirements.
Definition: egammaSuperClusterBuilderBase.h:147
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
ref
const boost::regex ref(r_ef)
egammaSuperClusterBuilderBase::m_extraL0L1PhiSize
float m_extraL0L1PhiSize
Definition: egammaSuperClusterBuilderBase.h:274
egammaSuperClusterBuilderBase::calibrateCluster
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
Definition: egammaSuperClusterBuilderBase.cxx:844
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
egammaSuperClusterBuilderBase
Base class for electronSuperClusterBuilder photonSuperClusterBuilder egammaSuperClusterBuilder This c...
Definition: egammaSuperClusterBuilderBase.h:47
egammaSuperClusterBuilderBase::seedClusterSelection
bool seedClusterSelection(const xAOD::CaloCluster *clus) const
check if we pass the basic criteria for a seed cluster
Definition: egammaSuperClusterBuilderBase.cxx:585
egammaRec
Definition: egammaRec.h:31
egammaSuperClusterBuilderBase::m_extraL0L1PhiSizeCells
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...
Definition: egammaSuperClusterBuilderBase.h:348
egammaRecContainer.h
egammaSuperClusterBuilderBase::s_ClEtaMinForTG3cell
static constexpr float s_ClEtaMinForTG3cell
Definition: egammaSuperClusterBuilderBase.h:143
egammaSuperClusterBuilderBase::m_searchWindowPhiCellsBarrel
Gaudi::Property< int > m_searchWindowPhiCellsBarrel
Size of topocluster search window in phi for the barrel.
Definition: egammaSuperClusterBuilderBase.h:304
egammaSuperClusterBuilderBase::m_useExtendedTG3
Gaudi::Property< bool > m_useExtendedTG3
Use extended TG3 definition (only after Run 2)
Definition: egammaSuperClusterBuilderBase.h:288
egammaSuperClusterBuilderBase::fillClusterConstrained
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...
Definition: egammaSuperClusterBuilderBase.cxx:606
TrackParticleContainerFwd.h
egammaSuperClusterBuilderBase::m_searchWindowEtaEndcap
float m_searchWindowEtaEndcap
Definition: egammaSuperClusterBuilderBase.h:197
egammaSuperClusterBuilderBase::m_searchWindowEtaCellsEndcap
Gaudi::Property< int > m_searchWindowEtaCellsEndcap
Size of topocluster search window in eta for the end-cap.
Definition: egammaSuperClusterBuilderBase.h:312
egammaSuperClusterBuilderBase::m_extraL3EtaSizeCells
Gaudi::Property< int > m_extraL3EtaSizeCells
"When adding L3 cells, how much wider in eta than the L2
Definition: egammaSuperClusterBuilderBase.h:359
egammaSuperClusterBuilderBase::s_ClEtaMaxForTG3cell
static constexpr float s_ClEtaMaxForTG3cell
Definition: egammaSuperClusterBuilderBase.h:144
ServiceHandle< IegammaMVASvc >
egammaSuperClusterBuilderBase::m_outputEgammaRecContainerKey
SG::WriteHandleKey< EgammaRecContainer > m_outputEgammaRecContainerKey
Key for output egammaRec container.
Definition: egammaSuperClusterBuilderBase.h:170