Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:36

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Sun Jul 16 10:53:19 2006 by ROOT version 5.11/06a
0004 // from TTree RecJet/RecJet Tree
0005 // found on file: analysis.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef MinBias_h
0009 #define MinBias_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 
0015 class MinBias {
0016 public :
0017    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0018    Int_t           fCurrent; //!current Tree number in a TChain
0019 
0020    // Declaration of leave types
0021    Int_t           mydet;
0022    Int_t           mysubd;
0023    Int_t           depth;
0024    Int_t           ieta;
0025    Int_t           iphi;
0026    Float_t         eta;
0027    Float_t         phi;
0028    Float_t         mom1;
0029    Float_t         mom2;
0030    Float_t         mom3;
0031    Float_t         mom4;
0032 
0033    // List of branches
0034    TBranch        *b_mydet;   //!
0035    TBranch        *b_mysubd;   //!
0036    TBranch        *b_depth;   //!
0037    TBranch        *b_ieta;   //!
0038    TBranch        *b_iphi;   //!
0039    TBranch        *b_eta;   //!
0040    TBranch        *b_phi;   //!
0041    TBranch        *b_mom1;   //!
0042    TBranch        *b_mom2;   //!
0043    TBranch        *b_mom3;   //!
0044    TBranch        *b_mom4;   //!
0045 
0046    MinBias(TTree *tree=0);
0047    virtual ~MinBias();
0048    virtual Int_t    Cut(Long64_t entry);
0049    virtual Int_t    GetEntry(Long64_t entry);
0050    virtual Long64_t LoadTree(Long64_t entry);
0051    virtual void     Init(TTree *tree);
0052    virtual void     Loop();
0053    virtual Bool_t   Notify();
0054    virtual void     Show(Long64_t entry = -1);
0055 };
0056 
0057 #endif
0058 
0059 #ifdef MinBias_cxx
0060 MinBias::MinBias(TTree *tree)
0061 {
0062 // if parameter tree is not specified (or zero), connect the file
0063 // used to generate this class and read the Tree.
0064    if (tree == 0) {
0065       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("analysis.root");
0066       if (!f) {
0067          f = new TFile("analysis.root");
0068       }
0069       tree = (TTree*)gDirectory->Get("RecJet");
0070 
0071    }
0072    Init(tree);
0073 }
0074 
0075 MinBias::~MinBias()
0076 {
0077    if (!fChain) return;
0078    delete fChain->GetCurrentFile();
0079 }
0080 
0081 Int_t MinBias::GetEntry(Long64_t entry)
0082 {
0083 // Read contents of entry.
0084    if (!fChain) return 0;
0085    return fChain->GetEntry(entry);
0086 }
0087 Long64_t MinBias::LoadTree(Long64_t entry)
0088 {
0089 // Set the environment to read one entry
0090    if (!fChain) return -5;
0091    Long64_t centry = fChain->LoadTree(entry);
0092    if (centry < 0) return centry;
0093    if (fChain->IsA() != TChain::Class()) return centry;
0094    TChain *chain = (TChain*)fChain;
0095    if (chain->GetTreeNumber() != fCurrent) {
0096       fCurrent = chain->GetTreeNumber();
0097       Notify();
0098    }
0099    return centry;
0100 }
0101 
0102 void MinBias::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 of the tree
0106    // will be set. It is normaly not necessary to make changes to the
0107    // generated code, but the routine can be extended by the user if needed.
0108    // Init() will be called many times when running with PROOF.
0109 
0110    // Set branch addresses
0111    if (tree == 0) return;
0112    fChain = tree;
0113    fCurrent = -1;
0114    fChain->SetMakeClass(1);
0115 
0116    fChain->SetBranchAddress("mydet",&mydet);
0117    fChain->SetBranchAddress("mysubd",&mysubd);
0118    fChain->SetBranchAddress("depth",&depth);
0119    fChain->SetBranchAddress("ieta",&ieta);
0120    fChain->SetBranchAddress("iphi",&iphi);
0121    fChain->SetBranchAddress("eta",&eta);
0122    fChain->SetBranchAddress("phi",&phi);
0123    fChain->SetBranchAddress("mom1",&mom1);
0124    fChain->SetBranchAddress("mom2",&mom2);
0125    fChain->SetBranchAddress("mom3",&mom3);
0126    fChain->SetBranchAddress("mom4",&mom4);
0127    Notify();
0128 }
0129 
0130 Bool_t MinBias::Notify()
0131 {
0132    // The Notify() function is called when a new file is opened. This
0133    // can be either for a new TTree in a TChain or when when a new TTree
0134    // is started when using PROOF. Typically here the branch pointers
0135    // will be retrieved. It is normaly not necessary to make changes
0136    // to the generated code, but the routine can be extended by the
0137    // user if needed.
0138 
0139    // Get branch pointers
0140    b_mydet = fChain->GetBranch("mydet");
0141    b_mysubd = fChain->GetBranch("mysubd");
0142    b_depth = fChain->GetBranch("depth");
0143    b_ieta = fChain->GetBranch("ieta");
0144    b_iphi = fChain->GetBranch("iphi");
0145    b_eta = fChain->GetBranch("eta");
0146    b_phi = fChain->GetBranch("phi");
0147    b_mom1 = fChain->GetBranch("mom1");
0148    b_mom2 = fChain->GetBranch("mom2");
0149    b_mom3 = fChain->GetBranch("mom3");
0150    b_mom4 = fChain->GetBranch("mom4");
0151 
0152    return kTRUE;
0153 }
0154 
0155 void MinBias::Show(Long64_t entry)
0156 {
0157 // Print contents of entry.
0158 // If entry is not specified, print current entry
0159    if (!fChain) return;
0160    fChain->Show(entry);
0161 }
0162 Int_t MinBias::Cut(Long64_t entry)
0163 {
0164 // This function may be called from Loop.
0165 // returns  1 if entry is accepted.
0166 // returns -1 otherwise.
0167    return 1;
0168 }
0169 #endif // #ifdef MinBias_cxx