Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:53

0001 #ifndef MICROMEGAS_MICROMEGASCLUSTERIZER_H
0002 #define MICROMEGAS_MICROMEGASCLUSTERIZER_H
0003 
0004 /*!
0005  * \file MicromegasClusterizer.h
0006  * \author Hugo Pereira Da Costa <hugo.pereira-da-costa@cea.fr>
0007  */
0008 
0009 #include "MicromegasCalibrationData.h"
0010 
0011 #include <fun4all/SubsysReco.h>
0012 
0013 #include <string>
0014 
0015 class PHCompositeNode;
0016 
0017 //! micromegas clusterizer
0018 class MicromegasClusterizer : public SubsysReco
0019 {
0020  public:
0021 
0022   //! constructor
0023   MicromegasClusterizer( const std::string &name = "MicromegasClusterizer" );
0024 
0025   /// global initialization
0026   int Init(PHCompositeNode*) override;
0027 
0028   //! run initialization
0029   int InitRun(PHCompositeNode*) override;
0030 
0031   //! event processing
0032   int process_event(PHCompositeNode*) override;
0033 
0034   /// end of processing
0035   int End(PHCompositeNode*) override;
0036 
0037   /// set default pedestal
0038   void set_default_pedestal( double value )
0039   { m_default_pedestal = value; }
0040 
0041   /// set whether default pedestal is used or not
0042   void set_use_default_pedestal( bool value )
0043   { m_use_default_pedestal = value; }
0044 
0045   void set_drop_single_strips(bool drop)
0046   { m_drop_single_strips = drop; }
0047 
0048   /// calibration file
0049   void set_calibration_file( const std::string& value )
0050   { m_calibration_filename = value; }
0051 
0052   private:
0053 
0054   //!@name calibration filename
0055   //@{
0056 
0057   // discard single strip clusters if true
0058   bool m_drop_single_strips = false;
0059 
0060   /// if true, use default pedestal to get hit charge. Relies on calibration data otherwise
0061   bool m_use_default_pedestal = true;
0062 
0063   /// default pedestal
0064   double m_default_pedestal = 74.6;
0065 
0066   /// calibration filename
0067   std::string m_calibration_filename;
0068 
0069   /// calibration data
0070   MicromegasCalibrationData m_calibration_data;
0071 
0072   //@}
0073 
0074 
0075   /// keep track of number of clusters per hitsetid
0076   using clustercountmap_t = std::map<TrkrDefs::hitsetkey, int>;
0077   clustercountmap_t m_clustercounts;
0078 
0079 };
0080 
0081 #endif