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 // Tue Oct 24 09:50:41 2023 by ROOT version 6.26/06
0004 // from TTree T/RhoFluct Tree
0005 // found on file: hadd_RhoFluct.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef RhoFluct_h
0009 #define RhoFluct_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 
0017 class RhoFluct {
0018 public :
0019    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0020    Int_t           fCurrent; //!current Tree number in a TChain
0021 
0022 // Fixed size dimensions of array or collections stored in the TTree if any.
0023 
0024    // Declaration of leaf types
0025    Float_t         rho;
0026    Float_t         rho_sigma;
0027    Float_t         cent;
0028    Float_t         cent_mdb;
0029    Float_t         cent_epd;
0030    Float_t         impactparam;
0031    Float_t         emb_1TeV_phi;
0032    Float_t         emb_1TeV_eta;
0033    Bool_t          sub1_ismatched;
0034    Float_t         sub1JetPhi;
0035    Float_t         sub1JetEta;
0036    Float_t         sub1JetPt;
0037    Float_t         sub1Jet_delPt;
0038    Bool_t          rhoA_ismatched;
0039    Float_t         rhoAJetPhi;
0040    Float_t         rhoAJetEta;
0041    Float_t         rhoAJetPt;
0042    Float_t         rhoAJetArea;
0043    Float_t         rhoAJetPtLessRhoA;
0044    Float_t         rhoAJet_delPt;
0045 
0046    // List of branches
0047    TBranch        *b_rho;   //!
0048    TBranch        *b_rho_sigma;   //!
0049    TBranch        *b_cent;   //!
0050    TBranch        *b_cent_mdb;   //!
0051    TBranch        *b_cent_epd;   //!
0052    TBranch        *b_impactparam;   //!
0053    TBranch        *b_emb_1TeV_phi;   //!
0054    TBranch        *b_emb_1TeV_eta;   //!
0055    TBranch        *b_sub1_ismatched;   //!
0056    TBranch        *b_sub1JetPhi;   //!
0057    TBranch        *b_sub1JetEta;   //!
0058    TBranch        *b_sub1JetPt;   //!
0059    TBranch        *b_sub1Jet_delPt;   //!
0060    TBranch        *b_rhoA_ismatched;   //!
0061    TBranch        *b_rhoAJetPhi;   //!
0062    TBranch        *b_rhoAJetEta;   //!
0063    TBranch        *b_rhoAJetPt;   //!
0064    TBranch        *b_rhoAJetArea;   //!
0065    TBranch        *b_rhoAJetPtLessRhoA;   //!
0066    TBranch        *b_rhoAJet_delPt;   //!
0067 
0068    RhoFluct(TTree *tree=0);
0069    virtual ~RhoFluct();
0070    virtual Int_t    Cut(Long64_t entry);
0071    virtual Int_t    GetEntry(Long64_t entry);
0072    virtual Long64_t LoadTree(Long64_t entry);
0073    virtual void     Init(TTree *tree);
0074    virtual void     Loop(string);
0075    virtual Bool_t   Notify();
0076    virtual void     Show(Long64_t entry = -1);
0077 
0078    const std::array<float,11> IP_DEC{{
0079          0.,
0080          4.86409,
0081          6.84237,
0082          8.34927,
0083          9.61087,
0084          10.722 ,
0085          11.7247,
0086          12.6486,
0087          13.5242,
0088          14.4868,
0089          22.
0090    }};
0091    int get_ip_decile(float ip) {
0092          if (ip < 4.86409) { return 0; }
0093          else if (ip < 6.84237) { return 1; }
0094          else if (ip < 8.34927) { return 2; }
0095          else if (ip < 9.61087) { return 3; }
0096          else if (ip < 10.722)  { return 4; }
0097          else if (ip < 11.7247) { return 5; }
0098          else if (ip < 12.6486) { return 6; }
0099          else if (ip < 13.5242) { return 7; }
0100          else if (ip < 14.4868) { return 8; }
0101          else                   { return 9; }
0102    };
0103 
0104 };
0105 
0106 #endif
0107 
0108 #ifdef RhoFluct_cxx
0109 RhoFluct::RhoFluct(TTree *tree) : fChain(0) 
0110 {
0111 // if parameter tree is not specified (or zero), connect the file
0112 // used to generate this class and read the Tree.
0113    if (tree == 0) {
0114       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("hadd_RhoFluct.root");
0115       if (!f || !f->IsOpen()) {
0116          f = new TFile("hadd_RhoFluct.root");
0117       }
0118       f->GetObject("T",tree);
0119 
0120    }
0121    Init(tree);
0122 }
0123 
0124 RhoFluct::~RhoFluct()
0125 {
0126    if (!fChain) return;
0127    delete fChain->GetCurrentFile();
0128 }
0129 
0130 Int_t RhoFluct::GetEntry(Long64_t entry)
0131 {
0132 // Read contents of entry.
0133    if (!fChain) return 0;
0134    return fChain->GetEntry(entry);
0135 }
0136 Long64_t RhoFluct::LoadTree(Long64_t entry)
0137 {
0138 // Set the environment to read one entry
0139    if (!fChain) return -5;
0140    Long64_t centry = fChain->LoadTree(entry);
0141    if (centry < 0) return centry;
0142    if (fChain->GetTreeNumber() != fCurrent) {
0143       fCurrent = fChain->GetTreeNumber();
0144       Notify();
0145    }
0146    return centry;
0147 }
0148 
0149 void RhoFluct::Init(TTree *tree)
0150 {
0151    // The Init() function is called when the selector needs to initialize
0152    // a new tree or chain. Typically here the branch addresses and branch
0153    // pointers of the tree will be set.
0154    // It is normally not necessary to make changes to the generated
0155    // code, but the routine can be extended by the user if needed.
0156    // Init() will be called many times when running on PROOF
0157    // (once per file to be processed).
0158 
0159    // Set branch addresses and branch pointers
0160    if (!tree) return;
0161    fChain = tree;
0162    fCurrent = -1;
0163    fChain->SetMakeClass(1);
0164 
0165    fChain->SetBranchAddress("rho", &rho, &b_rho);
0166    fChain->SetBranchAddress("rho_sigma", &rho_sigma, &b_rho_sigma);
0167    fChain->SetBranchAddress("cent", &cent, &b_cent);
0168    fChain->SetBranchAddress("cent_mdb", &cent_mdb, &b_cent_mdb);
0169    fChain->SetBranchAddress("cent_epd", &cent_epd, &b_cent_epd);
0170    fChain->SetBranchAddress("impactparam", &impactparam, &b_impactparam);
0171    fChain->SetBranchAddress("emb_1TeV_phi", &emb_1TeV_phi, &b_emb_1TeV_phi);
0172    fChain->SetBranchAddress("emb_1TeV_eta", &emb_1TeV_eta, &b_emb_1TeV_eta);
0173    fChain->SetBranchAddress("sub1_ismatched", &sub1_ismatched, &b_sub1_ismatched);
0174    fChain->SetBranchAddress("sub1JetPhi", &sub1JetPhi, &b_sub1JetPhi);
0175    fChain->SetBranchAddress("sub1JetEta", &sub1JetEta, &b_sub1JetEta);
0176    fChain->SetBranchAddress("sub1JetPt", &sub1JetPt, &b_sub1JetPt);
0177    fChain->SetBranchAddress("sub1Jet_delPt", &sub1Jet_delPt, &b_sub1Jet_delPt);
0178    fChain->SetBranchAddress("rhoA_ismatched", &rhoA_ismatched, &b_rhoA_ismatched);
0179    fChain->SetBranchAddress("rhoAJetPhi", &rhoAJetPhi, &b_rhoAJetPhi);
0180    fChain->SetBranchAddress("rhoAJetEta", &rhoAJetEta, &b_rhoAJetEta);
0181    fChain->SetBranchAddress("rhoAJetPt", &rhoAJetPt, &b_rhoAJetPt);
0182    fChain->SetBranchAddress("rhoAJetArea", &rhoAJetArea, &b_rhoAJetArea);
0183    fChain->SetBranchAddress("rhoAJetPtLessRhoA", &rhoAJetPtLessRhoA, &b_rhoAJetPtLessRhoA);
0184    fChain->SetBranchAddress("rhoAJet_delPt", &rhoAJet_delPt, &b_rhoAJet_delPt);
0185    Notify();
0186 }
0187 
0188 Bool_t RhoFluct::Notify()
0189 {
0190    // The Notify() function is called when a new file is opened. This
0191    // can be either for a new TTree in a TChain or when when a new TTree
0192    // is started when using PROOF. It is normally not necessary to make changes
0193    // to the generated code, but the routine can be extended by the
0194    // user if needed. The return value is currently not used.
0195 
0196    return kTRUE;
0197 }
0198 
0199 void RhoFluct::Show(Long64_t entry)
0200 {
0201 // Print contents of entry.
0202 // If entry is not specified, print current entry
0203    if (!fChain) return;
0204    fChain->Show(entry);
0205 }
0206 Int_t RhoFluct::Cut(Long64_t entry)
0207 {
0208 // This function may be called from Loop.
0209 // returns  1 if entry is accepted.
0210 // returns -1 otherwise.
0211    return 1;
0212 }
0213 #endif // #ifdef RhoFluct_cxx