ATLAS Offline Software
ClusterDistanceFunctor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef CLUSTER_DISTANCE_FUNCTOR_H
6 #define CLUSTER_DISTANCE_FUNCTOR_H
7 
9 
10 class TrigEMCluster;
11 class TrigElectron;
12 class CaloCluster;
13 class EmTau_ROI;
14 
19 // What is the type of cluster returned by a given object?
20 namespace TrigMatch {
21  template<class T> struct clusterTraits { typedef CaloCluster type; };
22  template<> struct clusterTraits<TrigElectron> { typedef TrigEMCluster type; };
23  template<> struct clusterTraits<EmTau_ROI> { typedef EmTau_ROI type; };
24 }
26  // what the deltaR is between two clusters
27  template<class T, class U>
28  float deltaR(const T* t, const U* u) {
30  }
31  // how to get the cluster for various types
32  template <class T>
33  const typename TrigMatch::clusterTraits<T>::type *getCluster(const T* t) { return t->cluster(); }
34  inline const EmTau_ROI *getCluster(const EmTau_ROI* t) { return t; }
35 }
36 
42 template<class T, class U>
44 
45  public:
47  virtual ~ClusterDistanceFunctor() { };
48  private:
49  virtual float calculateDistance(const T *t, const U *u) const {
50  if(!t || !u)
51  return -1.;
54  }
55 
56 };
57 
58 #endif
ClusterDistanceHelper::deltaR
float deltaR(const T *t, const U *u)
Definition: ClusterDistanceFunctor.h:28
ClusterDistanceFunctor
The ClusterDistanceFunctor is a templated distance functor used for matching two objects based upon t...
Definition: ClusterDistanceFunctor.h:43
TrigMatch::clusterTraits< TrigElectron >::type
TrigEMCluster type
Definition: ClusterDistanceFunctor.h:22
ClusterDistanceHelper
Definition: ClusterDistanceFunctor.h:25
TrigElectron
File: TrigElectron.h.
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigElectron.h:63
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ClusterDistanceFunctor::ClusterDistanceFunctor
ClusterDistanceFunctor()
Definition: ClusterDistanceFunctor.h:46
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
TrigMatch::clusterTraits
Definition: ClusterDistanceFunctor.h:21
TrigMatch::clusterTraits::type
CaloCluster type
Definition: ClusterDistanceFunctor.h:21
ClusterDistanceFunctor::~ClusterDistanceFunctor
virtual ~ClusterDistanceFunctor()
Definition: ClusterDistanceFunctor.h:47
DeltaRDistanceFunctor::deltaR
static float deltaR(const T *t, const U *u)
Definition: DistanceFunctor.h:36
ClusterDistanceHelper::getCluster
const TrigMatch::clusterTraits< T >::type * getCluster(const T *t)
Definition: ClusterDistanceFunctor.h:33
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
ClusterDistanceFunctor::calculateDistance
virtual float calculateDistance(const T *t, const U *u) const
Definition: ClusterDistanceFunctor.h:49
DistanceFunctor
Definition: DistanceFunctor.h:11
TrigMatch
helper namespace for calculating deltaR for unknown object types
Definition: ClusterDistanceFunctor.h:20
TrigMatch::clusterTraits< EmTau_ROI >::type
EmTau_ROI type
Definition: ClusterDistanceFunctor.h:23
DistanceFunctor.h
EmTau_ROI
Em/Tau RoI class for analysis.
Definition: EmTau_ROI.h:34
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35