Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:16:06

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef OFFLINESMDTESTING_DST_H
0004 #define OFFLINESMDTESTING_DST_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <cmath>
0010 #include <map>
0011 #include <vector>
0012 
0013 class CaloWaveformFitting;
0014 class TowerInfoContainer;
0015 class PHCompositeNode;
0016 class Gl1Packet;
0017 class CaloPacketContainer;
0018 class CaloPacket;
0019 class TH1;
0020 class TH2;
0021 class TTree;
0022 
0023 class ZDCNeutronLocPol : public SubsysReco
0024 {
0025  public:
0026 
0027   ZDCNeutronLocPol(const std::string &name = "ZDCNeutronLocPol");
0028 
0029   ~ZDCNeutronLocPol() override;
0030 
0031   int Init(PHCompositeNode *topNode) override;
0032   int InitRun(PHCompositeNode *topNode) override;
0033   int process_event(PHCompositeNode *topNode) override;
0034   int End(PHCompositeNode *topNode) override;
0035 
0036   void setGainMatch(const std::string &fname);
0037   void setFileName(const std::string &fname); 
0038 
0039  protected:
0040   CaloWaveformFitting *WaveformProcessingFast = nullptr;
0041 
0042   TH1 *h_rawADC[32] = {nullptr};
0043   TH1 *h_pedADC[32] = {nullptr};
0044   TH1 *h_signalADC[32] = {nullptr};
0045 
0046   TH2 *h_waveformZDC = nullptr;
0047   TH2 *h_waveformSMD_North = nullptr;
0048   TH2 *h_waveformSMD_South = nullptr;
0049   TH2 *h_waveformVeto_North = nullptr;
0050   TH2 *h_waveformVeto_South = nullptr;
0051   TH2 *h_waveformAll = nullptr;
0052 
0053   TTree *smdHits;
0054 
0055   float gain[32] = {0.0f};
0056   float smd_south_rgain[16] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
0057   float smd_north_rgain[16] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
0058 
0059 
0060   float zdcS1_adc = 0.;
0061   float zdcS2_adc = 0.;
0062   float zdcS3_adc = 0.;
0063   float zdcN1_adc = 0.;
0064   float zdcN2_adc = 0.;
0065   float zdcN3_adc = 0.;
0066 
0067 
0068   float rawADC[32] = {0.0f};
0069   float pedADC[32] = {0.0f};
0070   float signalADC[32] = {0.0f};
0071 
0072   float veto_NF = 0.;
0073   float veto_NB = 0.;
0074   float veto_SF = 0.;
0075   float veto_SB = 0.;
0076 
0077   float smd_pos[4] = {0.0f};
0078 
0079   float n_x = 0;
0080   float n_y = 0;
0081   float s_x = 0;
0082   float s_y = 0;
0083 
0084   int bunchnumber = 0;
0085 
0086   float smdS1_adc = 0.;
0087   float smdS2_adc = 0.;
0088   float smdS6_adc = 0.;
0089   float smdS7_adc = 0.;
0090 
0091   float smdN1_adc = 0.;
0092   float smdN2_adc = 0.;
0093   float smdN6_adc = 0.;
0094   float smdN7_adc = 0.;
0095 
0096   float smdS1_v_adc = 0.;
0097   float smdS2_v_adc = 0.;
0098   float smdS7_v_adc = 0.;
0099   float smdS8_v_adc = 0.;
0100 
0101   float smdN1_v_adc = 0.;
0102   float smdN2_v_adc = 0.;
0103   float smdN7_v_adc = 0.;
0104   float smdN8_v_adc = 0.;
0105 
0106 
0107   // int evtseq_gl1 = 0;
0108 
0109   // int evtseq_zdc = 0;
0110   // uint64_t BCO_gl1 = 0;
0111   // uint64_t BCO_zdc = 0;
0112 
0113   int showerCutN = 0;
0114   int showerCutS = 0;
0115 
0116   void CompSmdAdc();
0117   void CompSmdPos();
0118 
0119   Gl1Packet *p_gl1;
0120   CaloPacketContainer *zdc_cont;
0121 
0122 
0123   std::vector<float> anaWaveformFast(CaloPacket *p, const int channel);
0124 
0125   
0126   std::string outfile  = "";
0127   
0128   int evtcnt;
0129 
0130 
0131 };
0132 
0133 #endif // OFFLINESMDTESTING_DST_H