Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef DIJETQA_H
0004 #define DIJETQA_H
0005 
0006 #include "JetQADefs.h"
0007 
0008 #include <fun4all/SubsysReco.h>
0009 
0010 #include <cmath>
0011 #include <cstdint>
0012 #include <string>
0013 #include <utility>
0014 
0015 class JetContainer;
0016 class Fun4AllHistoManager;
0017 class TriggerAnalyzer;
0018 class PHCompositeNode;
0019 class TH1;
0020 class TH2;
0021 
0022 class DijetQA : public SubsysReco
0023 {
0024  public:
0025   DijetQA(const std::string &name = "DijetQA", const std::string &recojetname = "AntiKt_Tower_r04");
0026 
0027   ~DijetQA() override = default;
0028 
0029   /** Called during initialization.
0030       Typically this is where you can book histograms, and e.g.
0031       register them to Fun4AllServer (so they can be output to file
0032       using Fun4AllServer::dumpHistos() method).
0033    */
0034   int Init(PHCompositeNode *topNode) override;
0035 
0036   /** Called for each event.
0037       This is where you do the real work.
0038    */
0039   int process_event(PHCompositeNode *topNode) override;
0040   void FindPairs(JetContainer *);
0041 
0042   /// Called at the end of all processing.
0043   int End(PHCompositeNode *topNode) override;
0044 
0045   /// Set the eta range for reco jets
0046   void setEtaRange(double low, double high)
0047   {
0048     m_etaRange.first = low;
0049     m_etaRange.second = high;
0050   }
0051 
0052   /// Set the leading pt range for the reco jets
0053   void setPtLeadRange(double low, double high)
0054   {
0055     m_ptLeadRange.first = low;
0056     m_ptLeadRange.second = high;
0057   }
0058 
0059   /// Set the sub-leading pt range for the reco jets
0060   void setPtSubRange(double low, double high)
0061   {
0062     m_ptSubRange.first = low;
0063     m_ptSubRange.second = high;
0064   }
0065 
0066   /// Specifies a trigger to require
0067   void setTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSJet1)
0068   {
0069     m_doTrgSelect = true;
0070     m_trgToSelect = trig;
0071   }
0072 
0073   //////////////////////////////////////////////////////////////
0074   //                                //
0075   //        X_j = (p_(T, 1))/(p_(T,2))              //
0076   //        A_j = (p_(T, 1) -p_(T,2))/P_T               //
0077   //                                //
0078   //////////////////////////////////////////////////////////////
0079 
0080  private:
0081   Fun4AllHistoManager *m_manager{nullptr};
0082   TriggerAnalyzer *m_analyzer{nullptr};
0083 
0084   TH1 *h_Ajj{nullptr};
0085   TH1 *h_xj{nullptr};
0086   TH1 *h_pt{nullptr};
0087   TH1 *h_dphi{nullptr};
0088   TH2 *h_Ajj_pt{nullptr};
0089   TH2 *h_xj_pt{nullptr};
0090   TH2 *h_dphi_pt{nullptr};
0091   TH2 *h_dphi_Ajj{nullptr};
0092   TH1 *h_Ajj_l{nullptr};
0093   TH1 *h_xj_l{nullptr};
0094   TH1 *h_pt_l{nullptr};
0095   TH1 *h_dphi_l{nullptr};
0096   TH2 *h_Ajj_pt_l{nullptr};
0097   TH2 *h_xj_pt_l{nullptr};
0098   TH2 *h_dphi_pt_l{nullptr};
0099   TH2 *h_dphi_Ajj_l{nullptr};
0100 
0101   int m_nJet{-1};
0102   int m_nJetPair{-1};
0103   uint32_t m_trgToSelect{false};
0104 
0105   float DeltaPhi{M_PI * 0.25};  // cut on the opening angle of phi for the identified jets
0106                                 // using same value as the dijet analysis
0107   float m_zvtx{-1};
0108   float m_Ajj{-1};
0109   float m_xj{-1};
0110   float m_ptl{-1};
0111   float m_ptsl{-1};
0112   float m_phil{-1};
0113   float m_phisl{-1};
0114   float m_dphil{-1};
0115   float m_etal{-1};
0116   float m_etasl{-1};
0117   float m_deltaeta{-1};
0118 
0119   bool m_doTrgSelect = (JetQADefs::GL1::MBDNSJet1);  // maps an int to a boolean, needs static cast if {} is used
0120 
0121   std::string m_moduleName;
0122   std::string m_recoJetName;
0123 
0124   std::pair<float, float> m_etaRange{-0.7, 0.7};
0125   std::pair<float, float> m_ptLeadRange{1, 100};
0126   std::pair<float, float> m_ptSubRange{1, 100};
0127 };
0128 
0129 #endif  // DIJETQA_H