ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterMatchingTool.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7// CaloClusterMatchingTool.h
8// Header file for class CaloClusterMatchingTool
9// Author: T.J. Khoo<khoo@cern.ch>
11#ifndef CALOCLUSTERMATCHING_CALOCLUSTERMATCHINGTOOL_H
12#define CALOCLUSTERMATCHING_CALOCLUSTERMATCHINGTOOL_H 1
13
14// STL includes
15#include <string>
16
17// FrameWork includes
18#include "AsgTools/AsgTool.h"
20
21// CaloClusterMatching includes
24
25// xAOD includes
27
28// Forward declaration
29
30namespace ClusterMatching {
31
33 : virtual public asg::AsgTool,
34 virtual public ::ICaloClusterMatchingTool
35 {
37
38
39 // Public methods:
41 public:
42
45
48
49 // Athena algtool's Hooks
50 virtual StatusCode initialize() override;
51 virtual StatusCode finalize() override;
52
54 // Const methods:
56
57 StatusCode fillClusterMap(const EventContext& ctx, TopoClusterMap& tcmap) const override final;
58
59 // return shared fraction of clustered cell energy
60 float getClusterSharedEfrac(const xAOD::CaloCluster& refCluster,
61 const xAOD::CaloCluster& testCluster) const override final;
62
63 // return true if clusters share a given fraction of their cell energy
64 bool clustersAreMatched(const xAOD::CaloCluster& refCluster,
65 const xAOD::CaloCluster& testCluster) const override final;
66
67 // fill a list of clusters from the testClusters container that match the reference cluster
68 // match criteria determined by calling clustersAreMatched
69 // return true if matchedClusters list is non-empty.
70 bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
71 const std::vector<const xAOD::CaloCluster*>& testClusters,
72 std::vector<const xAOD::CaloCluster*>& matchedClusters) const override final;
73
74 // fill a list of clusters from the configured cluster container that match the reference cluster
75 // match criteria determined by calling clustersAreMatched
76 // return true if matchedClusters list is non-empty
77 bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
78 std::vector<const xAOD::CaloCluster*>& matchedClusters,
79 const TopoClusterMap& tcmap,
80 bool useLeadingCellEtaPhi) const override final;
81
82 // fill a list of clusters from the testClusters container that match the reference cluster
83 // match criteria determined by calling clustersAreMatched
84 // return true if matchedClusters list is non-empty.
85 bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
86 const std::vector<const xAOD::CaloCluster*>& testClusters,
87 std::vector<std::pair<const xAOD::CaloCluster*,float> >& matchedClusters) const override final;
88
89 // fill a list of clusters from the configured cluster container that match the reference cluster
90 // match criteria determined by calling clustersAreMatched
91 // return true if matchedClusters list is non-empty
92 bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
93 std::vector<std::pair<const xAOD::CaloCluster*, float> >& matchedClusters,
94 const TopoClusterMap& tcmap,
95 bool useLeadingCellEtaPhi) const override final;
96
97 // set ElementLinks to clusters from the configured cluster container that match the reference cluster
98 // works via getMatchedClusters
99 // return true if matchedClusters list is non-empty
100 StatusCode linkMatchedClusters(elementLinkDecorHandle_t& elementLinkDec,
101 const xAOD::CaloCluster& refCluster,
102 const std::vector<const xAOD::CaloCluster*>& testClusters,
103 bool (*gtrthan)(const std::pair<const xAOD::CaloCluster*,float>& pair1,
104 const std::pair<const xAOD::CaloCluster*,float>& pair2)) const override final;
105
106 // set ElementLinks to clusters from the configured cluster container that match the reference cluster
107 // works via getMatchedClusters
108 // return true if matchedClusters list is non-empty
109 StatusCode linkMatchedClusters(elementLinkDecorHandle_t& elementLinkDec,
110 const xAOD::CaloCluster& refCluster,
111 const TopoClusterMap& tcmap,
112 bool useLeadingCellEtaPhi,
113 bool (*gtrthan)(const std::pair<const xAOD::CaloCluster*,float>& pair1,
114 const std::pair<const xAOD::CaloCluster*,float>& pair2)) const override final;
115
117 // Private data:
119 private:
120 Gaudi::Property<bool> m_reqPosE{ this, "RequirePositiveE", true };
121 Gaudi::Property<float> m_minSharedEfrac{ this, "MinSharedEfrac", 0.2 };
123 this,
124 "InputClusterCollection",
125 "CaloCalTopoClusters",
126 "The CaloCluster collection to match to "
127 };
128 };
129}
130
131#endif //> !CALOCLUSTERMATCHING_CALOCLUSTERMATCHINGTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Handle class for adding a decoration to an object.
virtual ~CaloClusterMatchingTool()
Destructor:
StatusCode linkMatchedClusters(elementLinkDecorHandle_t &elementLinkDec, const xAOD::CaloCluster &refCluster, const std::vector< const xAOD::CaloCluster * > &testClusters, bool(*gtrthan)(const std::pair< const xAOD::CaloCluster *, float > &pair1, const std::pair< const xAOD::CaloCluster *, float > &pair2)) const override final
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
bool clustersAreMatched(const xAOD::CaloCluster &refCluster, const xAOD::CaloCluster &testCluster) const override final
bool getMatchedClusters(const xAOD::CaloCluster &refCluster, const std::vector< const xAOD::CaloCluster * > &testClusters, std::vector< const xAOD::CaloCluster * > &matchedClusters) const override final
float getClusterSharedEfrac(const xAOD::CaloCluster &refCluster, const xAOD::CaloCluster &testCluster) const override final
StatusCode fillClusterMap(const EventContext &ctx, TopoClusterMap &tcmap) const override final
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clustersIn
SG::WriteDecorHandle< xAOD::CaloClusterContainer, std::vector< ElementLink< xAOD::CaloClusterContainer > > > elementLinkDecorHandle_t
Property holding a SG store/key/clid from which a ReadHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.