Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MICROMEGAS_MicromegasCombinedDataCalibration_H
0002 #define MICROMEGAS_MicromegasCombinedDataCalibration_H
0003 
0004 /*!
0005  * \file MicromegasCombinedDataCalibration.h
0006  * \author Hugo Pereira Da Costa <hugo.pereira-da-costa@cea.fr>
0007  */
0008 
0009 #include "MicromegasMapping.h"
0010 
0011 #include <fun4all/SubsysReco.h>
0012 
0013 #include <map>
0014 #include <memory>
0015 #include <string>
0016 
0017 class PHCompositeNode;
0018 class TFile;
0019 class TH1;
0020 class TH2;
0021 class TProfile;
0022 
0023 /// micromegas raw data decoder
0024 class MicromegasCombinedDataCalibration : public SubsysReco
0025 {
0026   public:
0027 
0028   /// constructor
0029   MicromegasCombinedDataCalibration( const std::string &name = "MicromegasCombinedDataCalibration" );
0030 
0031   /// global initialization
0032   int Init(PHCompositeNode*) override;
0033 
0034   /// run initialization
0035   int InitRun(PHCompositeNode*) override;
0036 
0037   /// event processing
0038   int process_event(PHCompositeNode*) override;
0039 
0040   /// end of processing
0041   int End(PHCompositeNode*) override;
0042 
0043   /// set min sample for noise estimation
0044   void set_sample_min( uint16_t value ) { m_sample_min = value; }
0045 
0046   /// set min sample for noise estimation
0047   void set_sample_max( uint16_t value ) { m_sample_max = value; }
0048 
0049   /// set to true to store evaluation histograms and ntuples
0050   void set_calibration_file( const std::string& value ) { m_calibration_filename = value; }
0051 
0052   private:
0053   //! raw node
0054   std::string m_rawhitnodename = "MICROMEGASRAWHIT";
0055 
0056   //! mapping
0057   MicromegasMapping m_mapping;
0058 
0059   /// min sample for noise estimation
0060   uint16_t m_sample_min = 0;
0061 
0062   /// max sample for noise estimation
0063   uint16_t m_sample_max = 100;
0064 
0065   /// calibration output file
0066   std::string m_calibration_filename = "TPOT_Pedestal_000.root";
0067 
0068   /// map fee id to Profile histogram
0069   using profile_map_t = std::map<int, TProfile*>;
0070   profile_map_t m_profile_map;
0071 
0072 };
0073 
0074 #endif