Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawClusterUtility.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawClusterUtility.h
1 // $Id: $
2 
11 #ifndef CALOBASE_RAWCLUSTERUTILITY_H
12 #define CALOBASE_RAWCLUSTERUTILITY_H
13 
14 #include "RawCluster.h"
15 
16 #include <CLHEP/Vector/ThreeVector.h>
17 
22 {
23  public:
24  virtual ~RawClusterUtility() {}
25 
26  //
28  static inline float
29  GetPolarAngle(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).getTheta(); }
30  //
32  static inline float
33  GetAzimuthAngle(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).getPhi(); }
34  //
36  static inline float
37  GetPseudorapidity(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).pseudoRapidity(); }
38  //
40  static inline float
41  GetET(const RawCluster& cluster, const CLHEP::Hep3Vector vertex)
42  {
43  const CLHEP::Hep3Vector cluster_vec(cluster.get_position() - vertex);
44  const double mag = cluster_vec.mag();
45 
46  return mag > 0 ? cluster_vec.perp() / cluster_vec.mag() * cluster.get_energy() : 0;
47  }
48  //
50  static inline float
51  GetETCore(const RawCluster& cluster, const CLHEP::Hep3Vector vertex)
52  {
53  const CLHEP::Hep3Vector cluster_vec(cluster.get_position() - vertex);
54 
55  return cluster_vec.perp() / cluster_vec.mag() * cluster.get_ecore();
56  }
57  //
59  static inline CLHEP::Hep3Vector GetEVec(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).unit() * cluster.get_energy(); }
61  static inline CLHEP::Hep3Vector GetECoreVec(const RawCluster& cluster, const CLHEP::Hep3Vector vertex) { return (cluster.get_position() - vertex).unit() * cluster.get_ecore(); }
62 
63  private:
66 };
67 
68 #endif