Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:31

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef QA_JET_CONSTITUENTSINJETS_H
0004 #define QA_JET_CONSTITUENTSINJETS_H
0005 
0006 #include "JetQADefs.h"
0007 
0008 #include <fun4all/SubsysReco.h>
0009 #include <jetbase/Jet.h>
0010 
0011 #include <string>
0012 #include <utility>  // std::pair, std::make_pair
0013 #include <vector>
0014 
0015 class Fun4AllHistoManager;
0016 class PHCompositeNode;
0017 class TH1;
0018 class TH2;
0019 class TriggerAnalyzer;
0020 
0021 class ConstituentsinJets : public SubsysReco
0022 {
0023  public:
0024   ConstituentsinJets(
0025       const std::string &moduleName = "ConstituentsInJets",
0026       const std::string &recojetname = "AntiKt_Tower_r04",
0027       const std::string &towBkgdName = "TowerInfoBackground_Sub2",
0028       const std::string &histTag = "AllTrig_AntiKt_Tower_R04",
0029       const std::string &towCEMCName = "TOWERINFO_CALIB_CEMC_RETOWER",
0030       const std::string &towIHCALName = "TOWERINFO_CALIB_HCALIN",      
0031       const std::string &towOHCALName = "TOWERINFO_CALIB_HCALOUT");
0032   ~ConstituentsinJets() override{};
0033 
0034   void setRecoJetNodeName(const std::string &name)
0035   {  // set the name of the node containing the reco jets
0036     m_recoJetName = name;
0037   }
0038   void setHistTag(const std::string &tag)
0039   {  // set the tag to be applied to histogram names
0040     m_histTag = tag;
0041   }
0042 
0043   void setEtaRange(double low, double high)
0044   {  // set the eta range for the reco jets
0045     m_etaRange.first = low;
0046     m_etaRange.second = high;
0047   }
0048   void setPtRange(double low, double high)
0049   {  // set the pt range for the reco jets
0050     m_ptRange.first = low;
0051     m_ptRange.second = high;
0052   }
0053   void setTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSJet1)
0054   {  // specifies a trigger to require
0055     m_doTrgSelect = true;
0056     m_trgToSelect = trig;
0057   }
0058   void setPPMode(const bool pp)
0059   {
0060     m_inPPMode = pp;
0061   }
0062 
0063   void setTowBkgdNodeName(const std::string &name)
0064   { // set the name of the node containing the subtracted background towers
0065     m_towBkgdName = name;
0066   }
0067 
0068   void setTowNodeNameCEMC(const std::string &name)
0069   {//set the name of the node containing raw towers from EMCAL
0070     m_towCEMCName = name;
0071   }
0072 
0073   void setTowNodeNameIHCAL(const std::string &name)
0074   {
0075     m_towIHCALName = name;  
0076   }
0077 
0078   void setTowNodeNameOHCAL(const std::string &name)
0079   {
0080     m_towOHCALName = name;
0081   }
0082 
0083 
0084   // standard Fun4All functions
0085   int Init(PHCompositeNode *topNode) override;
0086   int process_event(PHCompositeNode *topNode) override;
0087   int End(PHCompositeNode *topNode) override;
0088 
0089  private:
0090   //! Module name, input node strings, and histogram tags
0091   std::string m_moduleName;
0092   std::string m_recoJetName;
0093   std::string m_towBkgdName;
0094   std::string m_histTag;
0095   std::string m_towCEMCName;
0096   std::string m_towIHCALName;
0097   std::string m_towOHCALName;
0098   // std::string m_outputFileName{ "ConstituentsinJets.root"};
0099 
0100   //! Trigger selection
0101   bool m_doTrgSelect{false};
0102   bool m_inPPMode{false};
0103   uint32_t m_trgToSelect{JetQADefs::GL1::MBDNSJet1};
0104 
0105   // ! Kinematic cuts and reco jet node name
0106   std::pair<double, double> m_etaRange{-1.1, 1.1};
0107   std::pair<double, double> m_ptRange{1.0, 1000.0};
0108 
0109   // Jet N constituents
0110   Fun4AllHistoManager *m_manager{nullptr};
0111 
0112   TriggerAnalyzer* m_analyzer{nullptr};
0113 
0114   TH1 *h1_ConstituentsinJets_total{nullptr};
0115   // TH1 * h1_ConstituentsinJets_CaloTowers{nullptr};
0116   TH1 *h1_ConstituentsinJets_IHCAL{nullptr};
0117   TH1 *h1_ConstituentsinJets_OHCAL{nullptr};
0118   TH1 *h1_ConstituentsinJets_CEMC{nullptr};
0119   TH2 *h2_ConstituentsinJets_vs_caloLayer{nullptr};
0120 
0121   // Jet E fraction
0122   TH1 *h1_jetFracE_IHCAL{nullptr};
0123   TH1 *h1_jetFracE_OHCAL{nullptr};
0124   TH1 *h1_jetFracE_CEMC{nullptr};
0125   TH2 *h2_jetFracE_vs_caloLayer{nullptr};
0126 };
0127 
0128 #endif  // ConstituentsinJets_H