Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

EmecEventNTup2002v0.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////
00002 //   This class has been automatically generated 
00003 //     (Tue May 13 16:23:09 2003 by ROOT version3.05/05)
00004 //   from TTree h201/event
00005 //   found on file: emec_12369.root
00006 //////////////////////////////////////////////////////////
00007 
00008 
00009 #ifndef EmecEventNTup2002v0_h
00010 #define EmecEventNTup2002v0_h
00011 
00012 #include <TROOT.h>
00013 #include <TChain.h>
00014 #include <TFile.h>
00015 #include <string>
00016 #include <iostream>
00017 
00018 using std::string;
00019 using std::cout;
00020 using std::endl;
00021 
00022 /*! - Class EmecEventNTup2002v0
00023   * - Author: Ian Gable (igable@uvic.ca)
00024   * - Date:  05/27/2003
00025   * - Description: This class should not be used to acess the information contained in the event.
00026   *      Use the Event class instead.
00027   */
00028 
00029 class EmecEventNTup2002v0 {
00030    public :
00031    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
00032    Int_t           fCurrent; //!current Tree number in a TChain
00033 //Declaration of leaves types
00034    UInt_t          evtno;
00035    UInt_t          trig[5];
00036    Int_t           nchan;
00037    Float_t         signal[1152];   //[nchan]
00038    Float_t         xbeam[5];
00039    Float_t         ybeam[5];
00040 
00041 //List of branches
00042    TBranch        *b_evtno;   //!
00043    TBranch        *b_trig;   //!
00044    TBranch        *b_nchan;   //!
00045    TBranch        *b_signal;   //!
00046    TBranch        *b_xbeam;   //!
00047    TBranch        *b_ybeam;   //!
00048 
00049    EmecEventNTup2002v0(TTree *tree=0,string fileName=0);
00050    ~EmecEventNTup2002v0();
00051    Int_t  Cut(Int_t entry);
00052    Int_t  GetEntry(Int_t entry);
00053    Int_t  LoadTree(Int_t entry);
00054    void   Init(TTree *tree);
00055    void   Loop();
00056    Bool_t Notify();
00057    void   Show(Int_t entry = -1);
00058 };
00059 
00060 #endif
00061 
00062 #ifdef EmecEventNTup2002v0_cxx
00063 EmecEventNTup2002v0::EmecEventNTup2002v0(TTree *tree,string fileName)
00064 {
00065 // if parameter tree is not specified (or zero), connect the file
00066 // used to generate this class and read the Tree.
00067    TFile *f ;
00068    if (tree == 0) {
00069          f = new TFile(fileName.c_str());
00070 
00071       tree = (TTree*)f->Get("h201");
00072 
00073    }
00074    Init(tree);
00075 }
00076 
00077 EmecEventNTup2002v0::~EmecEventNTup2002v0()
00078 {
00079    if (!fChain) return;
00080    delete fChain->GetCurrentFile();
00081 }
00082 
00083 Int_t EmecEventNTup2002v0::GetEntry(Int_t entry)
00084 {
00085 // Read contents of entry.
00086    if (!fChain) return 0;
00087    return fChain->GetEntry(entry);
00088 }
00089 Int_t EmecEventNTup2002v0::LoadTree(Int_t entry)
00090 {
00091 // Set the environment to read one entry
00092    if (!fChain) return -5;
00093    Int_t centry = fChain->LoadTree(entry);
00094    if (centry < 0) return centry;
00095    if (fChain->IsA() != TChain::Class()) return centry;
00096    TChain *chain = (TChain*)fChain;
00097    if (chain->GetTreeNumber() != fCurrent) {
00098       fCurrent = chain->GetTreeNumber();
00099       Notify();
00100    }
00101    return centry;
00102 }
00103 
00104 void EmecEventNTup2002v0::Init(TTree *tree)
00105 {
00106 //   Set branch addresses
00107    if (tree == 0) return;
00108    fChain    = tree;
00109    fCurrent = -1;
00110    fChain->SetMakeClass(1);
00111 
00112    fChain->SetBranchAddress("evtno",&evtno);
00113    fChain->SetBranchAddress("trig",trig);
00114    fChain->SetBranchAddress("nchan",&nchan);
00115    fChain->SetBranchAddress("signal",signal);
00116    fChain->SetBranchAddress("xbeam",xbeam);
00117    fChain->SetBranchAddress("ybeam",ybeam);
00118    Notify();
00119 }
00120 
00121 Bool_t EmecEventNTup2002v0::Notify()
00122 {
00123    // Called when loading a new file.
00124    // Get branch pointers.
00125    b_evtno = fChain->GetBranch("evtno");
00126    b_trig = fChain->GetBranch("trig");
00127    b_nchan = fChain->GetBranch("nchan");
00128    b_signal = fChain->GetBranch("signal");
00129    b_xbeam = fChain->GetBranch("xbeam");
00130    b_ybeam = fChain->GetBranch("ybeam");
00131    return kTRUE;
00132 }
00133 
00134 void EmecEventNTup2002v0::Show(Int_t entry)
00135 {
00136 // Print contents of entry.
00137 // If entry is not specified, print current entry
00138    if (!fChain) return;
00139    fChain->Show(entry);
00140 }
00141 Int_t EmecEventNTup2002v0::Cut(Int_t entry)
00142 {
00143 // This function may be called from Loop.
00144 // returns  1 if entry is accepted.
00145 // returns -1 otherwise.
00146    return 1;
00147 }
00148 #endif // #ifdef EmecEventNTup2002v0_cxx
00149 

Generated on Fri Aug 15 10:52:04 2003 for TBRootAna by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002