Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:39:41

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Fri Jun  2 11:42:20 2006 by ROOT version 4.04/02g
0004 // from TTree theTree/Detector units positions
0005 // found on file: aligned.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef theTree_h
0009 #define theTree_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 
0015 class theTree {
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    Float_t         x;
0022    Float_t         y;
0023    Float_t         z;
0024    Float_t         phi;
0025    Float_t         theta;
0026    Float_t         length;
0027    Float_t         width;
0028    Float_t         thick;
0029 
0030    // List of branches
0031    TBranch        *b_x;   //!
0032    TBranch        *b_y;   //!
0033    TBranch        *b_z;   //!
0034    TBranch        *b_phi;   //!
0035    TBranch        *b_theta;   //!
0036    TBranch        *b_length;   //!
0037    TBranch        *b_width;   //!
0038    TBranch        *b_thick;   //!
0039 
0040    theTree(TTree *tree=0);
0041    virtual ~theTree();
0042    virtual Int_t    Cut(Long64_t entry);
0043    virtual Int_t    GetEntry(Long64_t entry);
0044    virtual Long64_t LoadTree(Long64_t entry);
0045    virtual void     Init(TTree *tree);
0046    virtual void     Loop();
0047    virtual Bool_t   Notify();
0048    virtual void     Show(Long64_t entry = -1);
0049 };
0050 
0051 #endif
0052 
0053 #ifdef theTree_cxx
0054 theTree::theTree(TTree *tree)
0055 {
0056 // if parameter tree is not specified (or zero), connect the file
0057 // used to generate this class and read the Tree.
0058    if (tree == 0) {
0059       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("aligned.root");
0060       if (!f) {
0061          f = new TFile("aligned.root");
0062       }
0063       tree = (TTree*)gDirectory->Get("theTree");
0064 
0065    }
0066    Init(tree);
0067 }
0068 
0069 theTree::~theTree()
0070 {
0071    if (!fChain) return;
0072    delete fChain->GetCurrentFile();
0073 }
0074 
0075 Int_t theTree::GetEntry(Long64_t entry)
0076 {
0077 // Read contents of entry.
0078    if (!fChain) return 0;
0079    return fChain->GetEntry(entry);
0080 }
0081 Long64_t theTree::LoadTree(Long64_t entry)
0082 {
0083 // Set the environment to read one entry
0084    if (!fChain) return -5;
0085    Long64_t centry = fChain->LoadTree(entry);
0086    if (centry < 0) return centry;
0087    if (fChain->IsA() != TChain::Class()) return centry;
0088    TChain *chain = (TChain*)fChain;
0089    if (chain->GetTreeNumber() != fCurrent) {
0090       fCurrent = chain->GetTreeNumber();
0091       Notify();
0092    }
0093    return centry;
0094 }
0095 
0096 void theTree::Init(TTree *tree)
0097 {
0098    // The Init() function is called when the selector needs to initialize
0099    // a new tree or chain. Typically here the branch addresses of the tree
0100    // will be set. It is normaly not necessary to make changes to the
0101    // generated code, but the routine can be extended by the user if needed.
0102    // Init() will be called many times when running with PROOF.
0103 
0104    // Set branch addresses
0105    if (tree == 0) return;
0106    fChain = tree;
0107    fCurrent = -1;
0108    fChain->SetMakeClass(1);
0109 
0110    fChain->SetBranchAddress("x",&x);
0111    fChain->SetBranchAddress("y",&y);
0112    fChain->SetBranchAddress("z",&z);
0113    fChain->SetBranchAddress("phi",&phi);
0114    fChain->SetBranchAddress("theta",&theta);
0115    fChain->SetBranchAddress("length",&length);
0116    fChain->SetBranchAddress("width",&width);
0117    fChain->SetBranchAddress("thick",&thick);
0118    Notify();
0119 }
0120 
0121 Bool_t theTree::Notify()
0122 {
0123    // The Notify() function is called when a new file is opened. This
0124    // can be either for a new TTree in a TChain or when when a new TTree
0125    // is started when using PROOF. Typically here the branch pointers
0126    // will be retrieved. It is normaly not necessary to make changes
0127    // to the generated code, but the routine can be extended by the
0128    // user if needed.
0129 
0130    // Get branch pointers
0131    b_x = fChain->GetBranch("x");
0132    b_y = fChain->GetBranch("y");
0133    b_z = fChain->GetBranch("z");
0134    b_phi = fChain->GetBranch("phi");
0135    b_theta = fChain->GetBranch("theta");
0136    b_length = fChain->GetBranch("length");
0137    b_width = fChain->GetBranch("width");
0138    b_thick = fChain->GetBranch("thick");
0139 
0140    return kTRUE;
0141 }
0142 
0143 void theTree::Show(Long64_t entry)
0144 {
0145 // Print contents of entry.
0146 // If entry is not specified, print current entry
0147    if (!fChain) return;
0148    fChain->Show(entry);
0149 }
0150 Int_t theTree::Cut(Long64_t entry)
0151 {
0152 // This function may be called from Loop.
0153 // returns  1 if entry is accepted.
0154 // returns -1 otherwise.
0155    return 1;
0156 }
0157 #endif // #ifdef theTree_cxx