Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:44

0001 
0002 // Tell emacs that this is a C++ source
0003 //  -*- C++ -*-.
0004 #ifndef QA_JET_STRUCTUREINJETS_H
0005 #define QA_JET_STRUCTUREINJETS_H
0006 
0007 #include "JetQADefs.h"
0008 
0009 #include <fun4all/SubsysReco.h>
0010 
0011 #include <string>
0012 #include <utility>
0013 
0014 class Fun4AllHistoManager;
0015 class PHCompositeNode;
0016 class TH1;
0017 class TH2;
0018 class TH3;
0019 class TriggerAnalyzer;
0020 
0021 class StructureinJets : public SubsysReco
0022 {
0023  public:
0024   StructureinJets(const std::string& moduleName = "StructureInJets",
0025                   const std::string& recojetname = "AntiKt_Tower_r04_Sub1",
0026                   const std::string& trkNodeName = "SvtxTrackMap",
0027                   const std::string& histTag = "AllTrig_AntiKt_Tower_r04",
0028                   const std::string& outputfilename = "tracksinjets.root");
0029 
0030   ~StructureinJets() override;
0031 
0032   /** Called during initialization.
0033       Typically this is where you can book histograms, and e.g.
0034       register them to Fun4AllServer (so they can be output to file
0035       using Fun4AllServer::dumpHistos() method).
0036   */
0037   int Init(PHCompositeNode *topNode) override;
0038 
0039   /** Called for first event when run number is known.
0040       Typically this is where you may want to fetch data from
0041       database, because you know the run number. A place
0042       to book histograms which have to know the run number.
0043   */
0044   int InitRun(PHCompositeNode *topNode) override;
0045 
0046   /** Called for each event.
0047       This is where you do the real work.
0048   */
0049   int process_event(PHCompositeNode *topNode) override;
0050 
0051   /// Clean up internals after each event.
0052   int ResetEvent(PHCompositeNode *topNode) override;
0053 
0054   /// Called at the end of each run.
0055   int EndRun(const int runnumber) override;
0056 
0057   /// Called at the end of all processing.
0058   int End(PHCompositeNode *topNode) override;
0059 
0060   /// Reset
0061   int Reset(PHCompositeNode * /*topNode*/) override;
0062 
0063   void Print(const std::string &what = "ALL") const override;
0064 
0065   bool isAA() const { return m_isAAFlag; }
0066   void isAA(bool b) { m_isAAFlag = b; }
0067 
0068   bool writeToOutputFile() const { return m_writeToOutputFileFlag; }
0069   void writeToOutputFile(bool b) { m_writeToOutputFileFlag = b; }
0070 
0071   /// set the name of the node containing the reco jets
0072   void setRecoJetNodeName(const std::string &name)
0073   {
0074     m_recoJetName = name;
0075   }
0076 
0077   /// set the name of the node containg the tracks
0078   void setTrkNodeName(const std::string &name)
0079   {
0080     m_trkNodeName = name;
0081   }
0082 
0083   /// set the name of the output file
0084   void setOutputFileName(const std::string &name)
0085   {
0086     m_outputFileName = name;
0087   }
0088 
0089   /// set the tag to be applied to the histogram names
0090   void setHistTag(const std::string &tag)
0091   {
0092     m_histTag = tag;
0093   }
0094 
0095   /// set trigger to require
0096   void setTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSJet1)
0097   {
0098     m_doTrgSelect = true;
0099     m_trgToSelect = trig;
0100   }
0101 
0102   /// set minimum track pt
0103   void setTrkPtCut(const float cut)
0104   {
0105     m_trk_pt_cut = cut;
0106   }
0107 
0108   /// set max track quality
0109   void setTrkQualityCut(const float cut)
0110   {
0111     m_trk_qual_cut = cut;
0112   }
0113 
0114   /// set min no. of silicon clusters
0115   void setTrkNSilCut(const int cut)
0116   {
0117     m_trk_nsil_cut = cut;
0118   }
0119 
0120   /// set min no. of tpc clusters
0121   void setTrkNTPCCut(const int cut)
0122   {
0123     m_trk_ntpc_cut = cut;
0124   }
0125 
0126   /// set jet radius
0127   void setJetRadius(const float radius)
0128   {
0129     m_jetRadius = radius;
0130   }
0131 
0132   /// set jet pt range
0133   void setJetPtRange(const double low, const double high)
0134   {
0135     m_ptJetRange.first = low;
0136     m_ptJetRange.second = high;
0137   }
0138 
0139   /// set jet eta range
0140   void setJetEtaRange(const double low, const double high)
0141   {
0142     m_etaJetRange.first = low;
0143     m_etaJetRange.second = high;
0144   }
0145 
0146  private:
0147 
0148   /// module name, input node strings, histogram tags, and output file name
0149   std::string m_moduleName;
0150   std::string m_recoJetName;
0151   std::string m_trkNodeName;
0152   std::string m_histTag;
0153   std::string m_outputFileName;
0154 
0155   /// track cuts
0156   float m_trk_pt_cut{0.1};
0157   float m_trk_qual_cut{6.0};
0158   int m_trk_nsil_cut{4};
0159   int m_trk_ntpc_cut{25};
0160   float m_jetRadius{0.4};
0161 
0162   /// jet kinematic cuts
0163   std::pair<double, double> m_etaJetRange{-1.1, 1.1};
0164   std::pair<double, double> m_ptJetRange{1.0, 1000.0};
0165 
0166   /// flags
0167   bool m_isAAFlag{false};
0168   bool m_writeToOutputFileFlag{false};
0169   bool m_doTrgSelect{false};
0170 
0171   /// trigger to select
0172   uint32_t m_trgToSelect{JetQADefs::GL1::MBDNSJet1};
0173 
0174   /// output histograms
0175   TH3 *m_hSumTrkVsJetPtVsCent{nullptr};
0176   TH2 *m_hSumTrkVsJetPt{nullptr};
0177   TH1 *m_hSumTrkOverJetPt{nullptr};
0178   TH1 *m_hSumTrkPt{nullptr};
0179 
0180   /// fun4all members
0181   Fun4AllHistoManager *m_manager{nullptr};
0182   TriggerAnalyzer *m_analyzer{nullptr};
0183 };
0184 
0185 #endif  // QA_JET_STRUCTUREINJETS_H