Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:18:06

0001 #ifndef QA_QAG4SIMULATIONCALORIMETER_H
0002 #define QA_QAG4SIMULATIONCALORIMETER_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <cstdint>
0007 #include <memory>
0008 #include <string>
0009 
0010 class CaloEvalStack;
0011 class PHCompositeNode;
0012 class PHG4HitContainer;
0013 class PHG4TruthInfoContainer;
0014 
0015 /// \class QAG4SimulationCalorimeter
0016 class QAG4SimulationCalorimeter : public SubsysReco
0017 {
0018  public:
0019   enum enu_flags
0020   {
0021     kProcessG4Hit = 1 << 1,
0022     kProcessTower = 1 << 2,
0023     kProcessCluster = 1 << 3,
0024     kProcessTowerinfo = 1 << 4,
0025 
0026     kDefaultFlag = kProcessG4Hit | kProcessTower | kProcessCluster
0027   };
0028 
0029   QAG4SimulationCalorimeter(const std::string &calo_name, enu_flags flags =
0030                                                               kDefaultFlag);
0031   virtual ~QAG4SimulationCalorimeter() {}
0032 
0033   int Init(PHCompositeNode *topNode);
0034   int InitRun(PHCompositeNode *topNode);
0035   int process_event(PHCompositeNode *topNode);
0036 
0037   uint32_t
0038   get_flags() const
0039   {
0040     return _flags;
0041   }
0042 
0043   void
0044   set_flags(enu_flags flags)
0045   {
0046     _flags = (uint32_t) flags;
0047   }
0048 
0049   void
0050   set_flag(enu_flags flag)
0051   {
0052     _flags |= (uint32_t) flag;
0053   }
0054 
0055   bool
0056   flag(enu_flags flag)
0057   {
0058     return _flags & flag;
0059   }
0060 
0061   void
0062   reset_flag(enu_flags flag)
0063   {
0064     _flags &= ~(uint32_t) flag;
0065   }
0066 
0067   //! common prefix for QA histograms
0068   std::string
0069   get_histo_prefix();
0070 
0071  private:
0072   int Init_G4Hit(PHCompositeNode *topNode);
0073   int process_event_G4Hit(PHCompositeNode *topNode);
0074 
0075   int Init_Tower(PHCompositeNode *topNode);
0076   int process_event_Tower(PHCompositeNode *topNode);
0077 
0078   int Init_Cluster(PHCompositeNode *topNode);
0079   int process_event_Cluster(PHCompositeNode *topNode);
0080 
0081   std::shared_ptr<CaloEvalStack> _caloevalstack;
0082 
0083   std::string _calo_name;
0084   uint32_t _flags;
0085 
0086   PHG4HitContainer *_calo_hit_container;
0087   PHG4HitContainer *_calo_abs_hit_container;
0088   PHG4TruthInfoContainer *_truth_container;
0089 };
0090 
0091 #endif  // QA_QAG4SIMULATIONCALORIMETER_H