Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:39

0001 #ifndef G4CALO_RAWTOWERBUILDERBYHITINDEX_H
0002 #define G4CALO_RAWTOWERBUILDERBYHITINDEX_H
0003 
0004 #include <calobase/RawTowerDefs.h>
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <map>
0009 #include <string>
0010 
0011 class PHCompositeNode;
0012 class RawTowerContainer;
0013 class RawTowerGeomContainer;
0014 
0015 /**
0016  * \brief SubsysReco module creating calorimeter tower objects (RawTowerv1) from hits
0017  * (PHG4Hit) using j,k indeces of these hits
0018  *
0019  */
0020 class RawTowerBuilderByHitIndex : public SubsysReco
0021 {
0022  public:
0023   RawTowerBuilderByHitIndex(const std::string &name = "RawTowerBuilderByHitIndex");
0024   ~RawTowerBuilderByHitIndex() override = default;
0025 
0026   int InitRun(PHCompositeNode *topNode) override;
0027 
0028   int process_event(PHCompositeNode *topNode) override;
0029 
0030   int End(PHCompositeNode *topNode) override;
0031 
0032   /** Name of the detector node the G4Hits should be taken from.
0033    */
0034   void Detector(const std::string &d);
0035 
0036   /** Specifiy text-file with table for tower mapping
0037    */
0038   void GeometryTableFile(const std::string &d)
0039   {
0040     m_MappingTowerFile = d;
0041   }
0042 
0043   /** Define minimum tower energy. After processing an event, towers with lower energy
0044    * are will be deleted.
0045    */
0046   void EminCut(const double e) { m_Emin = e; }
0047 
0048   /** Get prefix for tower collection to identify simulated towers
0049    * before digitization.
0050    */
0051   const std::string
0052   &get_sim_tower_node_prefix() const
0053   {
0054     return m_SimTowerNodePrefix;
0055   }
0056 
0057   /** Set prefix for tower collection to identify simulated towers
0058    * before digitization.
0059    */
0060   void
0061   set_sim_tower_node_prefix(const std::string &simTowerNodePrefix)
0062   {
0063     m_SimTowerNodePrefix = simTowerNodePrefix;
0064   }
0065 
0066  private:
0067   /** Create nodes for output.
0068    *
0069    * Name of output node for RawTowerContainer: "TOWER_" + detector;
0070    */
0071   void CreateNodes(PHCompositeNode *topNode);
0072 
0073   /** Read geometry information from table stored in text-file
0074    */
0075   bool ReadGeometryFromTable();
0076 
0077   RawTowerContainer *m_Towers = nullptr;
0078   RawTowerGeomContainer *m_Geoms = nullptr;
0079 
0080   std::string m_Detector = "NONE";
0081   std::string m_SimTowerNodePrefix;
0082 
0083   std::string m_MappingTowerFile = "default.txt";
0084 
0085   RawTowerDefs::CalorimeterId m_CaloId = RawTowerDefs::NONE;
0086 
0087   double m_GlobalPlaceInX = 0.;
0088   double m_GlobalPlaceInY = 0.;
0089   double m_GlobalPlaceInZ = 0.;
0090 
0091   double m_RotInX = 0.;
0092   double m_RotInY = 0.;
0093   double m_RotInZ = 0.;
0094 
0095   double m_Emin = 1e-6;
0096 
0097   std::map<std::string, double> m_GlobalParameterMap;
0098 };
0099 
0100 #endif