ATLAS Offline Software
Loading...
Searching...
No Matches
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
10class TrigEMCluster;
11class TrigElectron;
12class CaloCluster;
13class EmTau_ROI;
14
19// What is the type of cluster returned by a given object?
20namespace 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
42template<class T, class U>
44
45 public:
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
Principal data class for CaloCell clusters.
virtual float calculateDistance(const T *t, const U *u) const
static float deltaR(const T *t, const U *u)
Em/Tau RoI class for analysis.
Definition EmTau_ROI.h:34
Class with calibrated variables for egamma clustering.
float deltaR(const T *t, const U *u)
const TrigMatch::clusterTraits< T >::type * getCluster(const T *t)
helper namespace for calculating deltaR for unknown object types