Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-10-17 08:20:48

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef UEVSETACENTRALITY_H
0004 #define UEVSETACENTRALITY_H
0005 
0006 // jet qa
0007 #include "jetqa/JetQADefs.h"
0008 
0009 #include <fun4all/SubsysReco.h>
0010 #include <fun4all/Fun4AllHistoManager.h>
0011 
0012 // c++ utilities
0013 #include <cstdlib>
0014 #include <map>
0015 #include <string>
0016 #include <vector>
0017 
0018 class PHCompositeNode;
0019 class TH1F;
0020 class TH2F;
0021 class TriggerAnalyzer;
0022 
0023 class UEvsEtaCentrality : public SubsysReco
0024 {
0025  public:
0026 
0027   // set options
0028   struct Config
0029   {
0030     ///! turn debug messages on/off
0031     bool debug {true};
0032 
0033     ///! turn trigger selection on/off
0034     bool doTrgSelect {false};
0035 
0036     ///! trigger to select
0037     uint32_t trgToSelect {JetQADefs::GL1::MBDNSJet1};
0038 
0039     ///! histogram tag
0040     std::string histTag {""};
0041 
0042     ///! module name
0043     std::string moduleName {"UEvsEtaCentrality"};
0044   };
0045 
0046   UEvsEtaCentrality(const std::string &moduleName = "UEvsEtaCentrality");
0047   UEvsEtaCentrality(const Config& config);
0048   ~UEvsEtaCentrality() override;
0049 
0050   // setters
0051   void SetConfig(const Config& config) {m_config = config;}
0052 
0053   // getters
0054   const Config& GetConfig() {return m_config;}
0055 
0056   // f4a methods
0057 
0058   /** Called during initialization.
0059       Typically this is where you can book histograms, and e.g.
0060       register them to Fun4AllServer (so they can be output to file
0061       using Fun4AllServer::dumpHistos() method).
0062    */
0063   int Init(PHCompositeNode* /*topNode*/) override;
0064 
0065   /** Called for first event when run number is known.
0066       Typically this is where you may want to fetch data from
0067       database, because you know the run number. A place
0068       to book histograms which have to know the run number.
0069    */
0070   int InitRun(PHCompositeNode* /*topNode*/) override;
0071 
0072   /** Called for each event.
0073       This is where you do the real work.
0074    */
0075   int process_event(PHCompositeNode* topNode) override;
0076   
0077   /// Clean up internals after each event.
0078   int ResetEvent(PHCompositeNode* /*topNode*/) override;
0079 
0080   /// Called at the end of each run.
0081   int EndRun(const int runnumber) override;
0082 
0083   /// Called at the end of all processing.
0084   int End(PHCompositeNode* /*topNode*/) override;
0085 
0086   /// Reset
0087   int Reset(PHCompositeNode * /*topNode*/) override;
0088 
0089   void Print(const std::string &what = "ALL") const override;
0090 
0091  private:
0092 
0093   //std::string m_outputFileName;
0094   
0095   void InitHistManager();
0096 
0097   ///! module configuration
0098   Config m_config;
0099 
0100   std::string m_moduleName;
0101 
0102   ///! histogram manager
0103   Fun4AllHistoManager* m_manager {nullptr};
0104 
0105   TriggerAnalyzer* m_analyzer {nullptr};
0106 
0107   TH2F *hv2_cent = nullptr;
0108   TH2F *hPsi2_cent = nullptr;
0109   
0110   TH2F *hUEiHcalEta_Cent0_20 = nullptr;
0111   TH2F *hUEoHcalEta_Cent0_20 = nullptr;
0112   TH2F *hUEemcalEta_Cent0_20 = nullptr;
0113   
0114   TH2F *hUEiHcalEta_Cent20_50 = nullptr;
0115   TH2F *hUEoHcalEta_Cent20_50 = nullptr;
0116   TH2F *hUEemcalEta_Cent20_50 = nullptr;
0117   
0118   TH2F *hUEiHcalEta_Cent50_100 = nullptr;
0119   TH2F *hUEoHcalEta_Cent50_100 = nullptr;
0120   TH2F *hUEemcalEta_Cent50_100 = nullptr;
0121 
0122   TH2F *hUEiHcalEta = nullptr;
0123   TH2F *hUEoHcalEta = nullptr;
0124   TH2F *hUEemcalEta = nullptr;
0125 };
0126 
0127 #endif // UEVSETACENTRALITY_H