Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:20:02

0001 // This file is really -*- C++ -*-.
0002 #ifndef CLUSTERISO_CLUSTERISO_H
0003 #define CLUSTERISO_CLUSTERISO_H
0004 
0005 #include <fun4all/SubsysReco.h>
0006 
0007 #include <CLHEP/Vector/ThreeVector.h>
0008 
0009 #include <cmath>
0010 #include <string>
0011 
0012 class PHCompositeNode;
0013 class RawTowerGeom;
0014 class TowerInfo;
0015 
0016 /** \Brief Tool to find isolation energy of each EMCal cluster.
0017  *
0018  * This tool finds isoET of clusters by summing towers energy
0019  * in a cone of radius R around the cluster and subtracting
0020  * the cluster from the sum
0021  */
0022 
0023 class ClusterIso : public SubsysReco
0024 {
0025  public:
0026   /**
0027    * Constructor for ClusterIso Class
0028    * the coneSize is taken in as an integer multiple of .1 ie if you want R=.2 pass 2
0029    */
0030   ClusterIso(const std::string&, float eTCut, int coneSize, bool do_subtracted, bool do_unsubtracted);
0031 
0032   int Init(PHCompositeNode*) override;
0033   int process_event(PHCompositeNode*) override;
0034   int End(PHCompositeNode*) override;
0035 
0036   void seteTCut(float eTCut);
0037   void setConeSize(int coneSize);
0038   float geteTCut() const;
0039   //! returns coneSize*10 as an int
0040   int getConeSize() const;
0041   CLHEP::Hep3Vector getVertex() const;
0042   void set_use_towerinfo(bool usetowerinfo)
0043   {
0044     m_use_towerinfo = usetowerinfo;
0045   };
0046 
0047   // Minimum tower energy (GeV) required for a tower to contribute to isolation sum
0048   void setMinTowerEnergy(float emin) { m_minTowerEnergy = emin; }
0049   float getMinTowerEnergy() const { return m_minTowerEnergy; }
0050 
0051   void set_cluster_node_name(const std::string& name)
0052   {
0053     m_cluster_node_name = name;
0054   }
0055 
0056  private:
0057   double getTowerEta(RawTowerGeom* tower_geom, double vx, double vy, double vz);
0058   bool IsAcceptableTower(TowerInfo* tower);
0059   float m_eTCut{};     ///< The minimum required transverse energy in a cluster for ClusterIso to be run
0060   float m_coneSize{};  ///< Size of the cone used to isolate a given cluster
0061   float m_vx;          ///< Correct vertex x coordinate
0062   float m_vy;          ///< Correct vertex y coordinate
0063   float m_vz;          ///< Correct vertex z coordinate
0064   bool m_do_subtracted;
0065   bool m_do_unsubtracted;
0066   bool m_use_towerinfo{true};
0067   std::string m_cluster_node_name{"CLUSTERINFO_CEMC"};
0068   float m_minTowerEnergy{-100};  ///< Minimum tower energy for inclusion in isolation calculation
0069 };
0070 
0071 #endif