EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusterIso.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ClusterIso.h
1 // This file is really -*- C++ -*-.
2 #ifndef CLUSTERISO_CLUSTERISO_H
3 #define CLUSTERISO_CLUSTERISO_H
4 
5 #include <fun4all/SubsysReco.h>
6 
7 #include <CLHEP/Vector/ThreeVector.h>
8 
9 #include <cmath>
10 #include <string>
11 
12 class PHCompositeNode;
13 class RawTowerGeom;
14 
22 class ClusterIso : public SubsysReco
23 {
24  public:
29  ClusterIso(const std::string&, float eTCut, int coneSize, bool do_subtracted, bool do_unsubtracted);
30 
31  int Init(PHCompositeNode*) override;
32  int process_event(PHCompositeNode*) override;
33  int End(PHCompositeNode*) override;
34 
35  void seteTCut(float x);
36  void setConeSize(int x);
37  /*const*/ float geteTCut();
39  /*const*/ int getConeSize();
40  /*const*/ CLHEP::Hep3Vector getVertex();
41 
42  private:
43  double getTowerEta(RawTowerGeom* tower_geom, double vx, double vy, double vz);
44  float m_eTCut;
45  float m_coneSize;
46  float m_vx;
47  float m_vy;
48  float m_vz;
51 };
52 
59 inline /*const*/ float deltaR(float eta1, float eta2, float phi1, float phi2)
60 {
61  float deta = eta1 - eta2;
62  float dphi = phi1 - phi2;
63  if (dphi > M_PI) dphi -= 2 * M_PI; //corrects to keep range -pi to pi
64  if (dphi < -1 * M_PI) dphi += 2 * M_PI; //corrects to keep range -pi to pi
65  return sqrt(deta * deta + dphi * dphi);
66 }
67 
68 #endif