Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef QA_TRACKING_MICROMEGASCLUSTERQA_H_
0004 #define QA_TRACKING_MICROMEGASCLUSTERQA_H_
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <micromegas/MicromegasCalibrationData.h>
0008 #include <micromegas/MicromegasDefs.h>
0009 #include <micromegas/MicromegasMapping.h>
0010 
0011 #include <array>
0012 #include <map>
0013 #include <set>
0014 #include <string>
0015 
0016 class ActsGeometry;
0017 class TrkrHitSetContainer;
0018 class TrkrClusterContainer;
0019 class TrkrClusterHitAssoc;
0020 
0021 class TH1;
0022 class TH2;
0023 
0024 class PHCompositeNode;
0025 
0026 class MicromegasClusterQA : public SubsysReco
0027 {
0028  public:
0029   MicromegasClusterQA(const std::string& name = "MicromegasClusterQA");
0030 
0031   ~MicromegasClusterQA() override = default;
0032 
0033   int InitRun(PHCompositeNode* topNode) override;
0034   int process_event(PHCompositeNode* topNode) override;
0035 
0036   /// set default pedestal
0037   void set_default_pedestal(double value)
0038   {
0039     m_default_pedestal = value;
0040   }
0041 
0042   /// set whether default pedestal is used or not
0043   void set_use_default_pedestal(bool value)
0044   {
0045     m_use_default_pedestal = value;
0046   }
0047 
0048   /// calibration file
0049   void set_calibration_file(const std::string& value)
0050   {
0051     m_calibration_filename = value;
0052   }
0053 
0054  private:
0055   void create_histograms();
0056 
0057   std::string get_histogram_prefix() const;
0058 
0059   /// micromegas mapping
0060   MicromegasMapping m_mapping;
0061 
0062   /// per detector cluster multiplicity distribution
0063   TH2* m_h_cluster_multiplicity = nullptr;
0064 
0065   /// per detector cluster size distribution
0066   TH2* m_h_cluster_size = nullptr;
0067 
0068   /// per detector cluster charge distribution
0069   TH2* m_h_cluster_charge = nullptr;
0070 
0071   /// per detector reference cluster count histogram
0072   /*! used for standalone efficiency calculation */
0073   TH1* m_h_cluster_count_ref = nullptr;
0074 
0075   /// per detector found cluster count histogram
0076   /** used for standalone efficiency calculation */
0077   TH1* m_h_cluster_count_found = nullptr;
0078 
0079   /// Acts tracking geometry for surface lookup
0080   ActsGeometry* m_tGeometry = nullptr;
0081 
0082   //! hits
0083   TrkrHitSetContainer* m_hitsetcontainer = nullptr;
0084 
0085   //! clusters
0086   TrkrClusterContainer* m_cluster_map = nullptr;
0087 
0088   //! cluster to hit association
0089   TrkrClusterHitAssoc* m_cluster_hit_map = nullptr;
0090 
0091   /// first micromegas layer
0092   /* this is updated on the fly from geometry object */
0093   int m_firstlayer = 55;
0094 
0095   /// number of layers
0096   int m_nlayers = 2;
0097 
0098   /// keep track of detector names
0099   std::vector<std::string> m_detector_names;
0100 
0101   ///@name calibration filename
0102   //@{
0103 
0104   /// if true, use default pedestal to get hit charge. Relies on calibration data otherwise
0105   bool m_use_default_pedestal = true;
0106 
0107   /// default pedestal
0108   double m_default_pedestal = 74.6;
0109 
0110   /// calibration filename
0111   std::string m_calibration_filename;
0112 
0113   /// calibration data
0114   MicromegasCalibrationData m_calibration_data;
0115 
0116   //@}
0117 };
0118 
0119 #endif  // MicromegasClusterQA_H