ATLAS Offline Software
Loading...
Searching...
No Matches
ICaloClusterMatchingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// ICaloClusterMatchingTool.h
8// Header file for class ICaloClusterMatchingTool
9// Author: S.Binet<binet@cern.ch>
11#ifndef CALOCLUSTERMATCHING_ICALOCLUSTERMATCHINGTOOL_H
12#define CALOCLUSTERMATCHING_ICALOCLUSTERMATCHINGTOOL_H 1
13
14// STL includes
15
16// FrameWork includes
17#include "AsgTools/IAsgTool.h"
19
20// Forward declaration
21
22// xAOD includes
25
26namespace ClusterMatching {
27 typedef std::pair<const xAOD::CaloCluster*,float> tcmatch_pair;
28
29 inline static bool gtrClusterE(const tcmatch_pair& a, const tcmatch_pair& b) {return a.first->e()>b.first->e();}
30 inline static bool gtrMatchedE(const tcmatch_pair& a, const tcmatch_pair& b) {return a.second*a.first->e()>b.second*b.first->e();}
31 inline static bool gtrMatchedEFrac(const tcmatch_pair& a, const tcmatch_pair& b) {return a.second>b.second;}
32
38}
39
41 : virtual public asg::IAsgTool
42{
44
45
46public:
48
49
50 // Prime the map before starting to match
51 virtual StatusCode fillClusterMap(const EventContext& ctx, TopoClusterMap& tcmap) const = 0;
52
53 // return shared fraction of clustered cell energy (wrt testCluster)
54 virtual float getClusterSharedEfrac(const xAOD::CaloCluster& refCluster,
55 const xAOD::CaloCluster& testCluster) const = 0;
56
57 // return true if clusters share a given fraction of their cell energy
58 virtual bool clustersAreMatched(const xAOD::CaloCluster& refCluster,
59 const xAOD::CaloCluster& testCluster) const = 0;
60
61 // fill a list of clusters from the testClusters container that match the reference cluster
62 // match criteria determined by calling clustersAreMatched
63 // return true if matchedClusters list is non-empty
64 virtual bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
65 const std::vector<const xAOD::CaloCluster*>& testClusters,
66 std::vector<const xAOD::CaloCluster*>& matchedClusters) const = 0;
67
68 // fill a list of clusters from the configured cluster container that match the reference cluster
69 // match criteria determined by calling clustersAreMatched
70 // return true if matchedClusters list is non-empty
71 virtual bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
72 std::vector<const xAOD::CaloCluster*>& matchedClusters,
73 const TopoClusterMap& tcmap,
74 bool useLeadingCellEtaPhi=false) const = 0;
75
76 // fill a list of clusters from the testClusters container that match the reference cluster
77 // match criteria determined by calling clustersAreMatched
78 // return true if matchedClusters list is non-empty
79 virtual bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
80 const std::vector<const xAOD::CaloCluster*>& testClusters,
81 std::vector<std::pair<const xAOD::CaloCluster*, float> >& matchedClustersAndE) const = 0;
82
83 // fill a list of clusters from the configured cluster container that match the reference cluster
84 // match criteria determined by calling clustersAreMatched
85 // return true if matchedClusters list is non-empty
86 virtual bool getMatchedClusters(const xAOD::CaloCluster& refCluster,
87 std::vector<std::pair<const xAOD::CaloCluster*, float> >& matchedClustersAndE,
88 const TopoClusterMap& tcmap,
89 bool useLeadingCellEtaPhi=false) const = 0;
90
91 // set ElementLinks to clusters from the configured cluster container that match the reference cluster
92 // works via getMatchedClusters
93 // return true if matchedClusters list is non-empty
94 virtual StatusCode linkMatchedClusters(elementLinkDecorHandle_t& elementLinkDec,
95 const xAOD::CaloCluster& refCluster,
96 const std::vector<const xAOD::CaloCluster*>& testClusters,
97 bool (*gtrthan)(const std::pair<const xAOD::CaloCluster*,float>& pair1,
98 const std::pair<const xAOD::CaloCluster*,float>& pair2) = ClusterMatching::gtrMatchedE) const = 0;
99
100 // set ElementLinks to clusters from the configured cluster container that match the reference cluster
101 // works via getMatchedClusters
102 // return true if matchedClusters list is non-empty
103 virtual StatusCode linkMatchedClusters(elementLinkDecorHandle_t& elementLinkDec,
104 const xAOD::CaloCluster& refCluster,
105 const TopoClusterMap& tcmap,
106 bool useLeadingCellEtaPhi=false,
107 bool (*gtrthan)(const std::pair<const xAOD::CaloCluster*,float>& pair1,
108 const std::pair<const xAOD::CaloCluster*,float>& pair2) = ClusterMatching::gtrMatchedE) const = 0;
109};
110
111#endif //> !CALOCLUSTERMATCHING_ICALOCLUSTERMATCHINGTOOL_H
#define ASG_TOOL_INTERFACE(CLASSNAME)
static Double_t a
Handle class for adding a decoration to an object.
virtual 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)=ClusterMatching::gtrMatchedE) const =0
virtual StatusCode linkMatchedClusters(elementLinkDecorHandle_t &elementLinkDec, const xAOD::CaloCluster &refCluster, const TopoClusterMap &tcmap, bool useLeadingCellEtaPhi=false, bool(*gtrthan)(const std::pair< const xAOD::CaloCluster *, float > &pair1, const std::pair< const xAOD::CaloCluster *, float > &pair2)=ClusterMatching::gtrMatchedE) const =0
virtual float getClusterSharedEfrac(const xAOD::CaloCluster &refCluster, const xAOD::CaloCluster &testCluster) const =0
virtual bool clustersAreMatched(const xAOD::CaloCluster &refCluster, const xAOD::CaloCluster &testCluster) const =0
virtual bool getMatchedClusters(const xAOD::CaloCluster &refCluster, std::vector< std::pair< const xAOD::CaloCluster *, float > > &matchedClustersAndE, const TopoClusterMap &tcmap, bool useLeadingCellEtaPhi=false) const =0
virtual StatusCode fillClusterMap(const EventContext &ctx, TopoClusterMap &tcmap) const =0
virtual bool getMatchedClusters(const xAOD::CaloCluster &refCluster, std::vector< const xAOD::CaloCluster * > &matchedClusters, const TopoClusterMap &tcmap, bool useLeadingCellEtaPhi=false) const =0
virtual bool getMatchedClusters(const xAOD::CaloCluster &refCluster, const std::vector< const xAOD::CaloCluster * > &testClusters, std::vector< std::pair< const xAOD::CaloCluster *, float > > &matchedClustersAndE) const =0
SG::WriteDecorHandle< xAOD::CaloClusterContainer, std::vector< ElementLink< xAOD::CaloClusterContainer > > > elementLinkDecorHandle_t
virtual bool getMatchedClusters(const xAOD::CaloCluster &refCluster, const std::vector< const xAOD::CaloCluster * > &testClusters, std::vector< const xAOD::CaloCluster * > &matchedClusters) const =0
Handle class for adding a decoration to an object.
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
static bool gtrMatchedEFrac(const tcmatch_pair &a, const tcmatch_pair &b)
static bool gtrClusterE(const tcmatch_pair &a, const tcmatch_pair &b)
std::pair< const xAOD::CaloCluster *, float > tcmatch_pair
static bool gtrMatchedE(const tcmatch_pair &a, const tcmatch_pair &b)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.