Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:16

0001 #ifndef CALOVALID_CALOVALID_H
0002 #define CALOVALID_CALOVALID_H
0003 
0004 #include <calotrigger/TriggerAnalyzer.h>
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 // Forward declarations
0012 class PHCompositeNode;
0013 class TH1;
0014 class TH2;
0015 class TH3;
0016 class TProfile2D;
0017 class TProfile;
0018 
0019 class CaloValid : public SubsysReco
0020 {
0021  public:
0022   //! constructor
0023   CaloValid(const std::string& name = "CaloValid");  // const std::string &filename = "testQA.root"); //int nevents = 100);
0024 
0025   //! destructor
0026   ~CaloValid() override;
0027 
0028   //! full initialization
0029   int Init(PHCompositeNode*) override;
0030 
0031   int InitRun(PHCompositeNode*) override;
0032 
0033   //! event processing method
0034   int process_event(PHCompositeNode*) override;
0035 
0036   //! end of run method
0037   int End(PHCompositeNode*) override;
0038 
0039   int process_g4hits(PHCompositeNode*);
0040   int process_g4cells(PHCompositeNode*);
0041   int process_towers(PHCompositeNode*);
0042   int process_clusters(PHCompositeNode*);
0043 
0044   void set_timing_cut_width(const int& t) { _range = t; }
0045 
0046   void set_debug(bool debug) { m_debug = debug; }
0047   void SetSpecies(const std::string& species) { m_species = species; }
0048   static TH2* LogYHist2D(const std::string& name, const std::string& title, int, double, double, int, double, double);
0049 
0050  private:
0051   void createHistos();
0052   static void MirrorHistogram(TH1* histogram);
0053   std::string getHistoPrefix() const;
0054   std::string m_species = "pp";
0055 
0056   TriggerAnalyzer* trigAna{nullptr};
0057   TH3* h_pi0_trigIB_mass{nullptr};
0058   std::vector<int> triggerIndices{10, 28, 29, 30, 31};  // MBD NS>=1, Photon Triggers
0059 
0060   TH1* h_cemc_channel_pedestal[128 * 192]{nullptr};
0061   TH1* h_ihcal_channel_pedestal[32 * 48]{nullptr};
0062   TH1* h_ohcal_channel_pedestal[32 * 48]{nullptr};
0063 
0064   TH1* h_cemc_channel_energy[128 * 192]{nullptr};
0065   TH1* h_ihcal_channel_energy[32 * 48]{nullptr};
0066   TH1* h_ohcal_channel_energy[32 * 48]{nullptr};
0067   TH2* h_emcal_mbd_correlation{nullptr};
0068   TH1* h_mbd_hits{nullptr};
0069   TH2* h_ohcal_mbd_correlation{nullptr};
0070   TH2* h_ihcal_mbd_correlation{nullptr};
0071   TH2* h_emcal_hcal_correlation{nullptr};
0072   TH2* h_cemc_etaphi{nullptr};
0073   TH2* h_cemc_etaphi_highhit{nullptr};
0074   TH2* h_ihcal_etaphi{nullptr};
0075   TH2* h_ihcal_etaphi_highhit{nullptr};
0076   TH2* h_ohcal_etaphi{nullptr};
0077   TH2* h_ohcal_etaphi_highhit{nullptr};
0078   TH2* h_cemc_etaphi_wQA{nullptr};
0079   TH2* h_ihcal_etaphi_wQA{nullptr};
0080   TH2* h_ohcal_etaphi_wQA{nullptr};
0081   TH1* h_ihcal_status{nullptr};
0082   TH1* h_ohcal_status{nullptr};
0083   TH1* h_cemc_status{nullptr};
0084   TH2* h_cemc_e_chi2{nullptr};
0085   TH2* h_ihcal_e_chi2{nullptr};
0086   TH2* h_ohcal_e_chi2{nullptr};
0087   TProfile2D* h_cemc_etaphi_time{nullptr};
0088   TProfile2D* h_cemc_etaphi_time_highhit{nullptr};
0089   TProfile2D* h_ihcal_etaphi_time{nullptr};
0090   TProfile2D* h_ihcal_etaphi_time_highhit{nullptr};
0091   TProfile2D* h_ohcal_etaphi_time{nullptr};
0092   TProfile2D* h_ohcal_etaphi_time_highhit{nullptr};
0093   TProfile2D* h_cemc_etaphi_fracHitADC{nullptr};
0094   TProfile2D* h_cemc_etaphi_fracHit{nullptr};
0095   TProfile2D* h_ihcal_etaphi_fracHitADC{nullptr};
0096   TProfile2D* h_ohcal_etaphi_fracHitADC{nullptr};
0097   TProfile2D* h_cemc_etaphi_pedRMS{nullptr};
0098   TProfile2D* h_ihcal_etaphi_pedRMS{nullptr};
0099   TProfile2D* h_ohcal_etaphi_pedRMS{nullptr};
0100   TProfile2D* h_cemc_etaphi_ZSpedRMS{nullptr};
0101   TProfile2D* h_ohcal_etaphi_ZSpedRMS{nullptr};
0102   TProfile2D* h_ihcal_etaphi_ZSpedRMS{nullptr};
0103   TProfile2D* h_cemc_etaphi_badChi2{nullptr};
0104   TProfile2D* h_ohcal_etaphi_badChi2{nullptr};
0105   TProfile2D* h_ihcal_etaphi_badChi2{nullptr};
0106   TH1* h_InvMass{nullptr};
0107   TH1* h_channel_pedestal_0{nullptr};
0108   TH1* h_vtx_z_raw{nullptr};
0109   TH1* h_vtx_z_cut{nullptr};
0110   TH1* h_emcaltime_cut{nullptr};
0111   TH1* h_ihcaltime_cut{nullptr};
0112   TH1* h_ohcaltime_cut{nullptr};
0113   TH1* h_emcaltime{nullptr};
0114   TH1* h_ihcaltime{nullptr};
0115   TH1* h_ohcaltime{nullptr};
0116   TH1* h_emcal_tower_e{nullptr};
0117   TH1* h_emcal_tower_e_wide_range{nullptr};
0118   TH1* h_emcal_tower_e_saturated{nullptr};
0119   TH1* h_ihcal_tower_e{nullptr};
0120   TH1* h_ihcal_tower_e_wide_range{nullptr};
0121   TH1* h_ihcal_tower_e_saturated{nullptr};
0122   TH1* h_ohcal_tower_e{nullptr};
0123   TH1* h_ohcal_tower_e_wide_range{nullptr};
0124   TH1* h_ohcal_tower_e_saturated{nullptr};
0125   TH2* h_etaphi_clus{nullptr};
0126   TH1* h_clusE{nullptr};
0127 
0128   TProfile2D* h_cemc_etaphi_time_raw{nullptr};
0129   TProfile2D* h_ohcal_etaphi_time_raw{nullptr};
0130   TProfile2D* h_ihcal_etaphi_time_raw{nullptr};
0131 
0132   // Trigger histos
0133   TH1* h_triggerVec{nullptr};
0134   TH2* h_edist[64] = {nullptr};
0135   TH1* h_ldClus_trig[64] = {nullptr};
0136   TProfile* pr_evtNum_ldClus_trig[64] = {nullptr};
0137   TProfile* pr_rejection[64] = {nullptr};
0138   TProfile* pr_livetime[64] = {nullptr};
0139   TProfile* pr_ldClus_trig{nullptr};
0140   std::vector<int> trigOfInterest = {3, 10, 11, 21, 22, 23, 25, 26, 27};
0141 
0142   int _eventcounter{0};
0143   int _range{1};
0144 
0145   bool m_debug{false};
0146 
0147   std::string m_outputFileName;
0148   std::string OutputFileName;
0149 };
0150 
0151 #endif