Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // ----------------------------------------------------------------------------
0002 // 'SCheckCstPairs.h'
0003 // Derek Anderson
0004 // 01.19.2024
0005 //
0006 // SCorrelatorQAMaker plugin to iterate through all pairs of constituents in
0007 // an event and fill tuples/histograms comparing them.
0008 //
0009 // This is similar to the `SCheckTrackPairs` plugin, which specifically looks
0010 // at pairs of tracks off the node tree. This plugin compares constituents
0011 // of any type off the correlator jet tree.
0012 // ----------------------------------------------------------------------------
0013 
0014 #ifndef SCORRELATORQAMAKER_SCHECKCSTPAIRS_H
0015 #define SCORRELATORQAMAKER_SCHECKCSTPAIRS_H
0016 
0017 // c++ utilities
0018 #include <string>
0019 #include <vector>
0020 #include <utility>
0021 // root libraries
0022 #include <TH1.h>
0023 #include <TH2.h>
0024 #include <TFile.h>
0025 #include <TChain.h>
0026 #include <TBranch.h>
0027 // analysis utilities
0028 #include <scorrelatorutilities/Types.h>
0029 #include <scorrelatorutilities/Constants.h>
0030 #include <scorrelatorutilities/Interfaces.h>
0031 // plugin definitions
0032 #include "SBaseQAPlugin.h"
0033 #include "SCheckCstPairsConfig.h"
0034 
0035 // make common namespaces implicit
0036 using namespace std;
0037 
0038 
0039 
0040 namespace SColdQcdCorrelatorAnalysis {
0041 
0042   // SCheckCstPairs definition ------------------------------------------------
0043 
0044   class SCheckCstPairs : public SBaseQAPlugin<SCheckCstPairsConfig> {
0045 
0046     public:
0047 
0048       // ctor/dtor
0049       SCheckCstPairs() {};
0050       ~SCheckCstPairs() {};
0051 
0052       // analysis methods
0053       void Init();
0054       void Analyze();
0055       void End();
0056 
0057     private:
0058 
0059       // internal methods
0060       void InitInput();
0061       void InitHists();
0062       void SaveOutput();
0063       void CloseInput();
0064       void DoDoubleCstLoop();
0065       bool IsGoodJet();
0066       bool IsGoodCst();
0067 
0068       // io members
0069       TFile*  m_fInput = NULL;
0070       TChain* m_cInput = NULL;
0071 
0072       // output histograms
0073       TH2D* hCstPtOneVsDr;
0074       TH2D* hCstPtTwoVsDr;
0075       TH2D* hCstPtFracVsDr;
0076       TH2D* hCstPhiOneVsDr;
0077       TH2D* hCstPhiTwoVsDr;
0078       TH2D* hCstEtaOneVsDr;
0079       TH2D* hCstEtaTwoVsDr;
0080       TH2D* hDeltaPhiOneVsDr;
0081       TH2D* hDeltaPhiTwoVsDr;
0082       TH2D* hDeltaEtaOneVsDr;
0083       TH2D* hDeltaEtaTwoVsDr;
0084       TH2D* hJetPtFracOneVsDr;
0085       TH2D* hJetPtFracTwoVsDr;
0086       TH2D* hCstPairWeightVsDr;
0087 
0088       // input truth tree addresses
0089       //   - FIXME swap out for utlity types when ready
0090       int                  m_evtNumChrgPars = -999;
0091       double               m_evtSumPar      = -999.;
0092       pair<int, int>       m_partonID       = {-999,  -999};
0093       pair<double, double> m_partonMomX     = {-999., -999.};
0094       pair<double, double> m_partonMomY     = {-999., -999.};
0095       pair<double, double> m_partonMomZ     = {-999., -999.};
0096       vector<vector<int>>* m_cstID          = NULL;
0097       vector<vector<int>>* m_cstEmbedID     = NULL;
0098       // input reco. tree addresses
0099       int                  m_evtNumTrks = -999;
0100       double               m_evtSumECal = -999.;
0101       double               m_evtSumHCal = -999.;
0102       vector<vector<int>>* m_cstMatchID = NULL;
0103 
0104       // generic input tree address members
0105       //   - FIXME swap out for utlity types when ready
0106       int                     m_evtNumJets = -999;
0107       double                  m_evtVtxX    = -999.;
0108       double                  m_evtVtxY    = -999.;
0109       double                  m_evtVtxZ    = -999.;
0110       vector<unsigned long>*  m_jetNumCst  = NULL;
0111       vector<unsigned int>*   m_jetID      = NULL;
0112       vector<unsigned int>*   m_jetTruthID = NULL;
0113       vector<double>*         m_jetEnergy  = NULL;
0114       vector<double>*         m_jetPt      = NULL;
0115       vector<double>*         m_jetEta     = NULL;
0116       vector<double>*         m_jetPhi     = NULL;
0117       vector<double>*         m_jetArea    = NULL;
0118       vector<vector<double>>* m_cstZ       = NULL;
0119       vector<vector<double>>* m_cstDr      = NULL;
0120       vector<vector<double>>* m_cstEnergy  = NULL;
0121       vector<vector<double>>* m_cstPt      = NULL;
0122       vector<vector<double>>* m_cstEta     = NULL;
0123       vector<vector<double>>* m_cstPhi     = NULL;
0124 
0125       // input truth tree branch members
0126       //   - FIXME swap out for utlity types when ready
0127       TBranch*                 m_brEvtSumPar  = NULL;
0128       TBranch*                 m_brCstID      = NULL;
0129       TBranch*                 m_brCstEmbedID = NULL;
0130       pair<TBranch*, TBranch*> m_brPartonID   = {NULL, NULL};
0131       pair<TBranch*, TBranch*> m_brPartonMomX = {NULL, NULL};
0132       pair<TBranch*, TBranch*> m_brPartonMomY = {NULL, NULL};
0133       pair<TBranch*, TBranch*> m_brPartonMomZ = {NULL, NULL};
0134       // input reco. tree branch members
0135       TBranch* m_brEvtNumTrks = NULL;
0136       TBranch* m_brEvtSumECal = NULL;
0137       TBranch* m_brEvtSumHCal = NULL;
0138       TBranch* m_brCstMatchID = NULL;
0139 
0140       // generic input tree branch members
0141       //   - FIXME swap out for utlity types when ready
0142       TBranch* m_brEvtNumJets = NULL;
0143       TBranch* m_brEvtVtxX    = NULL;
0144       TBranch* m_brEvtVtxY    = NULL;
0145       TBranch* m_brEvtVtxZ    = NULL;
0146       TBranch* m_brJetNumCst  = NULL;
0147       TBranch* m_brJetID      = NULL;
0148       TBranch* m_brJetEnergy  = NULL;
0149       TBranch* m_brJetPt      = NULL;
0150       TBranch* m_brJetEta     = NULL;
0151       TBranch* m_brJetPhi     = NULL;
0152       TBranch* m_brJetArea    = NULL;
0153       TBranch* m_brCstZ       = NULL;
0154       TBranch* m_brCstDr      = NULL;
0155       TBranch* m_brCstPt      = NULL;
0156       TBranch* m_brCstEnergy  = NULL;
0157       TBranch* m_brCstEta     = NULL;
0158       TBranch* m_brCstPhi     = NULL;
0159 
0160   };  // end SCheckCstPairs
0161 
0162 }  // end SColdQcdCorrelatorAnalysis namespace
0163 
0164 #endif
0165 
0166 // end ------------------------------------------------------------------------