Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // include guard to prevent TpcNoiseQA.h from being preprocessed multiple times
0002 #ifndef QA_TPC_TPCCHANQA_H
0003 #define QA_TPC_TPCCHANQA_H
0004 //
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 // Call classes to be used in code
0012 class PHCompositeNode;
0013 class TH1;
0014 class TH2;
0015 //
0016 
0017 class TpcChanQA : public SubsysReco  // Inherit public parts of SubsysReco
0018 {
0019   // list of public methods
0020  public:
0021   // Function that sets file name and allocated memory to adcSamples
0022   explicit TpcChanQA(const std::string &name = "TpcChanQA.root");
0023 
0024   ~TpcChanQA() override = default;
0025 
0026   // Initialization of run: where you fetch data and place histograms that
0027   // care about run number
0028   int InitRun(PHCompositeNode *topNode) override;
0029 
0030   // Where you do the desired work associated with the run (analysis)
0031   int process_event(PHCompositeNode *topNode) override;
0032 
0033   // called at the end of the run when processing is over
0034   int End(PHCompositeNode *topNode) override;
0035 
0036   void set_filename(const std::string &fname) { m_fname = fname; }
0037   // Define function that stores packets to a vector
0038   void AddPacket(int packet)
0039   {
0040     m_packets.push_back(packet);
0041   }
0042 
0043   // List of private members
0044  private:
0045   TH1 *h_channel_hits{nullptr};  // Histogram of hits per channel
0046   TH2 *h_channel_ADCs{nullptr};  // Histogram of ADC counts per channel
0047 
0048   int side{0};                // Face of the TPC (0==North && 1==South)
0049   int m_packet{0};            // packet number
0050   int m_nWaveformInFrame{0};  // Number of waveforms in a frame
0051   int m_Channel{0};           // Channel number
0052   int m_nSamples{0};          // Number of samples in waveform
0053 
0054   void createHistos();
0055   std::string getHistoPrefix() const;
0056 
0057   std::string m_fname;    // Name of file given to program
0058   std::string sectorNum;  // Sector number associated with data file
0059 
0060   std::vector<int> m_packets;
0061   std::vector<unsigned short> m_adcSamples;  // ADC values in waveform
0062 };
0063 
0064 #endif  // ends preprocessing if TpcFFTQA.h has already been defined