Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:12

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Thu Oct 19 12:42:52 2023 by ROOT version 6.26/06
0004 // from TTree T/JetRhoMedian Tree
0005 // found on file: hadd_Sub1rhoA.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef Sub1rhoA_h
0009 #define Sub1rhoA_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 
0015 // Header file for the classes stored in the TTree if any.
0016 #include "vector"
0017 
0018 class Sub1rhoA {
0019 public :
0020    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0021    Int_t           fCurrent; //!current Tree number in a TChain
0022 
0023 // Fixed size dimensions of array or collections stored in the TTree if any.
0024 
0025    // Declaration of leaf types
0026    Float_t         rho;
0027    Float_t         rho_sigma;
0028    Float_t         cent_mdb;
0029    Float_t         cent_epd;
0030    Float_t         impactparam;
0031    vector<float>   *TruthJetEta;
0032    vector<float>   *TruthJetPhi;
0033    vector<float>   *TruthJetPt;
0034    vector<float>   *sub1JetEta;
0035    vector<float>   *sub1JetPhi;
0036    vector<float>   *sub1JetPt;
0037    vector<float>   *rhoAJetEta;
0038    vector<float>   *rhoAJetPhi;
0039    vector<float>   *rhoAJetPt;
0040    vector<float>   *rhoAJetPtLessRhoA;
0041    vector<float>   *rhoAJetArea;
0042 
0043    // List of branches
0044    TBranch        *b_rho;   //!
0045    TBranch        *b_rho_sigma;   //!
0046    TBranch        *b_cent_mdb;   //!
0047    TBranch        *b_cent_epd;   //!
0048    TBranch        *b_impactparam;   //!
0049    TBranch        *b_TruthJetEta;   //!
0050    TBranch        *b_TruthJetPhi;   //!
0051    TBranch        *b_TruthJetPt;   //!
0052    TBranch        *b_sub1JetEta;   //!
0053    TBranch        *b_sub1JetPhi;   //!
0054    TBranch        *b_sub1JetPt;   //!
0055    TBranch        *b_rhoAJetEta;   //!
0056    TBranch        *b_rhoAJetPhi;   //!
0057    TBranch        *b_rhoAJetPt;   //!
0058    TBranch        *b_rhoAJetPtLessRhoA;   //!
0059    TBranch        *b_rhoAJetArea;   //!
0060 
0061    Sub1rhoA(TTree *tree=0);
0062    virtual ~Sub1rhoA();
0063    virtual Int_t    Cut(Long64_t entry);
0064    virtual Int_t    GetEntry(Long64_t entry);
0065    virtual Long64_t LoadTree(Long64_t entry);
0066    virtual void     Init(TTree *tree);
0067    virtual void     Loop(string inp="");
0068    virtual Bool_t   Notify();
0069    virtual void     Show(Long64_t entry = -1);
0070 };
0071 
0072 #endif
0073 
0074 #ifdef Sub1rhoA_cxx
0075 Sub1rhoA::Sub1rhoA(TTree *tree) : fChain(0) 
0076 {
0077 // if parameter tree is not specified (or zero), connect the file
0078 // used to generate this class and read the Tree.
0079    if (tree == 0) {
0080       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("hadd_Sub1rhoA.root");
0081       if (!f || !f->IsOpen()) {
0082          f = new TFile("hadd_Sub1rhoA.root");
0083       }
0084       f->GetObject("T",tree);
0085 
0086    }
0087    Init(tree);
0088 }
0089 
0090 Sub1rhoA::~Sub1rhoA()
0091 {
0092    if (!fChain) return;
0093    delete fChain->GetCurrentFile();
0094 }
0095 
0096 Int_t Sub1rhoA::GetEntry(Long64_t entry)
0097 {
0098 // Read contents of entry.
0099    if (!fChain) return 0;
0100    return fChain->GetEntry(entry);
0101 }
0102 Long64_t Sub1rhoA::LoadTree(Long64_t entry)
0103 {
0104 // Set the environment to read one entry
0105    if (!fChain) return -5;
0106    Long64_t centry = fChain->LoadTree(entry);
0107    if (centry < 0) return centry;
0108    if (fChain->GetTreeNumber() != fCurrent) {
0109       fCurrent = fChain->GetTreeNumber();
0110       Notify();
0111    }
0112    return centry;
0113 }
0114 
0115 void Sub1rhoA::Init(TTree *tree)
0116 {
0117    // The Init() function is called when the selector needs to initialize
0118    // a new tree or chain. Typically here the branch addresses and branch
0119    // pointers of the tree will be set.
0120    // It is normally not necessary to make changes to the generated
0121    // code, but the routine can be extended by the user if needed.
0122    // Init() will be called many times when running on PROOF
0123    // (once per file to be processed).
0124 
0125    // Set object pointer
0126    TruthJetEta = 0;
0127    TruthJetPhi = 0;
0128    TruthJetPt = 0;
0129    sub1JetEta = 0;
0130    sub1JetPhi = 0;
0131    sub1JetPt = 0;
0132    rhoAJetEta = 0;
0133    rhoAJetPhi = 0;
0134    rhoAJetPt = 0;
0135    rhoAJetPtLessRhoA = 0;
0136    rhoAJetArea = 0;
0137    // Set branch addresses and branch pointers
0138    if (!tree) return;
0139    fChain = tree;
0140    fCurrent = -1;
0141    fChain->SetMakeClass(1);
0142 
0143    fChain->SetBranchAddress("rho", &rho, &b_rho);
0144    fChain->SetBranchAddress("rho_sigma", &rho_sigma, &b_rho_sigma);
0145    fChain->SetBranchAddress("cent_mdb", &cent_mdb, &b_cent_mdb);
0146    fChain->SetBranchAddress("cent_epd", &cent_epd, &b_cent_epd);
0147    fChain->SetBranchAddress("impactparam", &impactparam, &b_impactparam);
0148    fChain->SetBranchAddress("TruthJetEta", &TruthJetEta, &b_TruthJetEta);
0149    fChain->SetBranchAddress("TruthJetPhi", &TruthJetPhi, &b_TruthJetPhi);
0150    fChain->SetBranchAddress("TruthJetPt", &TruthJetPt, &b_TruthJetPt);
0151    fChain->SetBranchAddress("sub1JetEta", &sub1JetEta, &b_sub1JetEta);
0152    fChain->SetBranchAddress("sub1JetPhi", &sub1JetPhi, &b_sub1JetPhi);
0153    fChain->SetBranchAddress("sub1JetPt", &sub1JetPt, &b_sub1JetPt);
0154    fChain->SetBranchAddress("rhoAJetEta", &rhoAJetEta, &b_rhoAJetEta);
0155    fChain->SetBranchAddress("rhoAJetPhi", &rhoAJetPhi, &b_rhoAJetPhi);
0156    fChain->SetBranchAddress("rhoAJetPt", &rhoAJetPt, &b_rhoAJetPt);
0157    fChain->SetBranchAddress("rhoAJetPtLessRhoA", &rhoAJetPtLessRhoA, &b_rhoAJetPtLessRhoA);
0158    fChain->SetBranchAddress("rhoAJetArea", &rhoAJetArea, &b_rhoAJetArea);
0159    Notify();
0160 }
0161 
0162 Bool_t Sub1rhoA::Notify()
0163 {
0164    // The Notify() function is called when a new file is opened. This
0165    // can be either for a new TTree in a TChain or when when a new TTree
0166    // is started when using PROOF. It is normally not necessary to make changes
0167    // to the generated code, but the routine can be extended by the
0168    // user if needed. The return value is currently not used.
0169 
0170    return kTRUE;
0171 }
0172 
0173 void Sub1rhoA::Show(Long64_t entry)
0174 {
0175 // Print contents of entry.
0176 // If entry is not specified, print current entry
0177    if (!fChain) return;
0178    fChain->Show(entry);
0179 }
0180 Int_t Sub1rhoA::Cut(Long64_t entry)
0181 {
0182 // This function may be called from Loop.
0183 // returns  1 if entry is accepted.
0184 // returns -1 otherwise.
0185    return 1;
0186 }
0187 #endif // #ifdef Sub1rhoA_cxx