File indexing completed on 2025-08-05 08:16:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef CALOBASE_RAWCLUSTERUTILITY_H
0012 #define CALOBASE_RAWCLUSTERUTILITY_H
0013
0014 #include "RawCluster.h"
0015
0016 #include <CLHEP/Vector/ThreeVector.h>
0017
0018
0019
0020
0021 class RawClusterUtility
0022 {
0023 public:
0024 virtual ~RawClusterUtility() {}
0025
0026
0027
0028 static inline float
0029 GetPolarAngle(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).getTheta(); }
0030
0031
0032 static inline float
0033 GetAzimuthAngle(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).getPhi(); }
0034
0035
0036 static inline float
0037 GetPseudorapidity(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).pseudoRapidity(); }
0038
0039
0040 static inline float
0041 GetET(const RawCluster& cluster, const CLHEP::Hep3Vector vertex)
0042 {
0043 const CLHEP::Hep3Vector cluster_vec(cluster.get_position() - vertex);
0044 const double mag = cluster_vec.mag();
0045
0046 return mag > 0 ? cluster_vec.perp() / cluster_vec.mag() * cluster.get_energy() : 0;
0047 }
0048
0049
0050 static inline float
0051 GetETCore(const RawCluster& cluster, const CLHEP::Hep3Vector vertex)
0052 {
0053 const CLHEP::Hep3Vector cluster_vec(cluster.get_position() - vertex);
0054
0055 return cluster_vec.perp() / cluster_vec.mag() * cluster.get_ecore();
0056 }
0057
0058
0059 static inline CLHEP::Hep3Vector GetEVec(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).unit() * cluster.get_energy(); }
0060
0061 static inline CLHEP::Hep3Vector GetECoreVec(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).unit() * cluster.get_ecore(); }
0062
0063 private:
0064
0065 RawClusterUtility() {}
0066 };
0067
0068 #endif