Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef HCALCALIBTREE_H
0004 #define HCALCALIBTREE_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <vector>
0008 #include <array>
0009 #include "TH2F.h"
0010 
0011 // Forward declarations
0012 class Fun4AllHistoManager;
0013 class PHCompositeNode;
0014 class TFile;
0015 class TH1F;
0016 
0017 class HCalCalibTree : public SubsysReco
0018 {
0019 public:
0020   //! constructor
0021   HCalCalibTree(const std::string &name = "HCalCalibTree", const std::string &fname = "HCalCalibtuple.root", const std::string &prefix = "TOWERSV2_");
0022   //! destructor
0023   virtual ~HCalCalibTree();
0024 
0025   //! Processing
0026   int Init(PHCompositeNode *) override;
0027   int process_event(PHCompositeNode *) override;
0028   int process_towers(PHCompositeNode *);
0029   int ResetEvent(PHCompositeNode *topNode) override;
0030   int End(PHCompositeNode *) override;
0031 
0032   void Detector(const std::string &name) { detector = name; }
0033   void TowerPrefix(const std::string &name) { prefix = name; }
0034 
0035 protected:
0036   std::string detector;
0037   std::string prefix;
0038   
0039   Fun4AllHistoManager *hm = nullptr;
0040 
0041   // HCal geometry
0042   static const int n_etabin = 24;
0043   static const int n_phibin = 64;
0044 
0045   // Cut threshold
0046   float tower_threshold, vert_threshold, veto_threshold;
0047 
0048   const float tower_threshold_data = 500;
0049   const float vert_threshold_data = 1500;
0050   const float veto_threshold_data = 350;
0051 
0052   const float tower_threshold_sim = 0.001767; //283 ADC/MeV
0053   const float vert_threshold_sim = 0.0053;
0054   const float veto_threshold_sim = 0.001237;
0055 
0056   TH1F* h_channel_hist[n_etabin][n_phibin] = {{nullptr}};
0057   TH2F* h_waveformchi2 = nullptr;
0058   TH1F* h_check = nullptr;
0059   TH1F* h_eventnumber_record;
0060 
0061   std::string outfilename;
0062 
0063   int event;
0064   int goodevent;
0065   int goodevent_check;
0066 
0067   float m_peak[n_etabin][n_phibin];
0068   float m_chi2[n_etabin][n_phibin];
0069 
0070   TFile *outfile;
0071 };
0072 
0073 #endif // HCALCALIBTREE_H