Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:19

0001 //  -*- C++ -*-.
0002 #ifndef LEDTOWERBUILDER_H
0003 #define LEDTOWERBUILDER_H
0004 
0005 #include <fun4all/SubsysReco.h>
0006 #include <fun4all/Fun4AllReturnCodes.h>
0007 
0008 #include <caloreco/CaloWaveformProcessing.h>
0009 
0010 #include <phool/PHCompositeNode.h>
0011 #include <phool/getClass.h>
0012 
0013 #include <Event/Event.h>
0014 #include <Event/packet.h>
0015 
0016 #include <TTree.h>
0017 #include <TFile.h>
0018 
0019 #include <iostream>
0020 #include <string>
0021 
0022 class LEDTowerBuilder : public SubsysReco {
0023   public:
0024 
0025     LEDTowerBuilder(const std::string &name = "LEDTowerBuilder");
0026     ~LEDTowerBuilder() override;
0027 
0028     int InitRun(PHCompositeNode *topNode) override;
0029     int process_event(PHCompositeNode *topNode) override;
0030     int End(PHCompositeNode *topNode) override;
0031 
0032     enum DetectorSystem {
0033     CEMC = 0,
0034     HCALIN = 1,
0035     HCALOUT = 2,
0036     EPD = 3
0037   };
0038 
0039     void set_detector_type(LEDTowerBuilder::DetectorSystem dettype) {
0040       m_dettype = dettype;
0041       return;
0042     }
0043 
0044     void set_nsamples(int _nsamples) {
0045       m_nsamples = _nsamples;
0046       return;
0047     }
0048     void set_dataflag(bool flag) {
0049       m_isdata = flag;
0050       return;
0051     }
0052 
0053   private:
0054  
0055     CaloWaveformProcessing* WaveformProcessing = new CaloWaveformProcessing();
0056     LEDTowerBuilder::DetectorSystem m_dettype;
0057     std::string m_detector;
0058     int m_packet_low;
0059     int m_packet_high;
0060     int m_nsamples;
0061     int m_nchannels;
0062     bool m_isdata;
0063     int m_event;
0064 
0065     TTree *tOut;
0066     std::vector<float> m_adc;
0067     std::vector<float> m_ped;
0068     std::vector<float> m_time;
0069     std::vector<int> m_chan;
0070     std::vector<std::vector<float>> m_waveforms;
0071     std::string m_outputFilename;
0072 };
0073 
0074 #endif // LEDTOWERBUILDER_H