Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Thu Mar  7 07:29:22 2024 by ROOT version 6.26/06
0004 // from TTree tree_eta/Tracklet eta info.
0005 // found on file: INTT_final_hist_info.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef ReadEta_v1_h
0009 #define ReadEta_v1_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 #include "vector"
0018 
0019 class ReadEta_v1 {
0020 public :
0021    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0022    Int_t           fCurrent; //!current Tree number in a TChain
0023 
0024 // Fixed size dimensions of array or collections stored in the TTree if any.
0025 
0026    // Declaration of leaf types
0027    Int_t           eID;
0028    Int_t           Evt_centrality_bin;
0029    Double_t        Evt_zvtx;
0030    vector<double>  *Track_eta_d;
0031    vector<int>     *Track_eta_i;
0032    vector<double>  *Track_delta_phi_d;
0033    Int_t           N2Clu_track;
0034    Int_t           N3Clu_track;
0035    Int_t           N4Clu_track;
0036 
0037    // List of branches
0038    TBranch        *b_eID;   //!
0039    TBranch        *b_Evt_centrality_bin;   //!
0040    TBranch        *b_Evt_zvtx;   //!
0041    TBranch        *b_Track_eta_d;   //!
0042    TBranch        *b_Track_eta_i;   //!
0043    TBranch        *b_Track_delta_phi_d;   //!
0044    TBranch        *b_N2Clu_track;   //!
0045    TBranch        *b_N3Clu_track;   //!
0046    TBranch        *b_N4Clu_track;   //!
0047 
0048    ReadEta_v1(TTree *tree=0);
0049    virtual ~ReadEta_v1();
0050    virtual Int_t    Cut(Long64_t entry);
0051    virtual Int_t    GetEntry(Long64_t entry);
0052    virtual Long64_t LoadTree(Long64_t entry);
0053    virtual void     Init(TTree *tree);
0054    virtual void     Loop();
0055    virtual Bool_t   Notify();
0056    virtual void     Show(Long64_t entry = -1);
0057 };
0058 
0059 #endif
0060 
0061 #ifdef ReadEta_v1_cxx
0062 ReadEta_v1::ReadEta_v1(TTree *tree) : fChain(0) 
0063 {
0064 // if parameter tree is not specified (or zero), connect the file
0065 // used to generate this class and read the Tree.
0066    if (tree == 0) {
0067       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("INTT_final_hist_info.root");
0068       if (!f || !f->IsOpen()) {
0069          f = new TFile("INTT_final_hist_info.root");
0070       }
0071       f->GetObject("tree_eta",tree);
0072 
0073    }
0074    Init(tree);
0075 }
0076 
0077 ReadEta_v1::~ReadEta_v1()
0078 {
0079    if (!fChain) return;
0080    delete fChain->GetCurrentFile();
0081 }
0082 
0083 Int_t ReadEta_v1::GetEntry(Long64_t entry)
0084 {
0085 // Read contents of entry.
0086    if (!fChain) return 0;
0087    return fChain->GetEntry(entry);
0088 }
0089 Long64_t ReadEta_v1::LoadTree(Long64_t entry)
0090 {
0091 // Set the environment to read one entry
0092    if (!fChain) return -5;
0093    Long64_t centry = fChain->LoadTree(entry);
0094    if (centry < 0) return centry;
0095    if (fChain->GetTreeNumber() != fCurrent) {
0096       fCurrent = fChain->GetTreeNumber();
0097       Notify();
0098    }
0099    return centry;
0100 }
0101 
0102 void ReadEta_v1::Init(TTree *tree)
0103 {
0104    // The Init() function is called when the selector needs to initialize
0105    // a new tree or chain. Typically here the branch addresses and branch
0106    // pointers of the tree will be set.
0107    // It is normally not necessary to make changes to the generated
0108    // code, but the routine can be extended by the user if needed.
0109    // Init() will be called many times when running on PROOF
0110    // (once per file to be processed).
0111 
0112    // Set object pointer
0113    Track_eta_d = 0;
0114    Track_eta_i = 0;
0115    Track_delta_phi_d = 0;
0116    // Set branch addresses and branch pointers
0117    if (!tree) return;
0118    fChain = tree;
0119    fCurrent = -1;
0120    fChain->SetMakeClass(1);
0121 
0122    fChain->SetBranchAddress("eID", &eID, &b_eID);
0123    fChain->SetBranchAddress("Evt_centrality_bin", &Evt_centrality_bin, &b_Evt_centrality_bin);
0124    fChain->SetBranchAddress("Evt_zvtx", &Evt_zvtx, &b_Evt_zvtx);
0125    fChain->SetBranchAddress("Track_eta_d", &Track_eta_d, &b_Track_eta_d);
0126    fChain->SetBranchAddress("Track_eta_i", &Track_eta_i, &b_Track_eta_i);
0127    fChain->SetBranchAddress("Track_delta_phi_d", &Track_delta_phi_d, &b_Track_delta_phi_d);
0128    fChain->SetBranchAddress("N2Clu_track", &N2Clu_track, &b_N2Clu_track);
0129    fChain->SetBranchAddress("N3Clu_track", &N3Clu_track, &b_N3Clu_track);
0130    fChain->SetBranchAddress("N4Clu_track", &N4Clu_track, &b_N4Clu_track);
0131    Notify();
0132 }
0133 
0134 Bool_t ReadEta_v1::Notify()
0135 {
0136    // The Notify() function is called when a new file is opened. This
0137    // can be either for a new TTree in a TChain or when when a new TTree
0138    // is started when using PROOF. It is normally not necessary to make changes
0139    // to the generated code, but the routine can be extended by the
0140    // user if needed. The return value is currently not used.
0141 
0142    return kTRUE;
0143 }
0144 
0145 void ReadEta_v1::Show(Long64_t entry)
0146 {
0147 // Print contents of entry.
0148 // If entry is not specified, print current entry
0149    if (!fChain) return;
0150    fChain->Show(entry);
0151 }
0152 Int_t ReadEta_v1::Cut(Long64_t entry)
0153 {
0154 // This function may be called from Loop.
0155 // returns  1 if entry is accepted.
0156 // returns -1 otherwise.
0157    return 1;
0158 }
0159 #endif // #ifdef ReadEta_v1_cxx