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

EmecEventNTup2002v1.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 EmecEventNTup2002v1_h
00010 #define EmecEventNTup2002v1_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 EmecEventNTup2002v1
00023   * - Author: Ian Gable (igable@uvic.ca)
00024   * - Date:  07/04/2003
00025   * - Description: This class should not be used to acess the information contained in the event.
00026   *      Use the Event class instead. This version was updated from the v0 version to deal with the
00027   *      NTuple contain the parametrization of a line created from the beam chamber information and
00028   *      the associated covarience matrix. In addition timing information is included.  This version of
00029   *      the class works with LArTBCombinedNtup.cxx version 1.7, created by N. Kanaya,
00030   *      contained in the official atlas repository.
00031   */
00032 
00033 class EmecEventNTup2002v1 {
00034    public :
00035    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
00036    Int_t           fCurrent; //!current Tree number in a TChain
00037 //Declaration of leaves types
00038    UInt_t          evtno;
00039    UInt_t          trig[5];
00040    Int_t           nchan;
00041    Float_t         signal[1152];   //[nchan]
00042    Float_t         slop[2];
00043    Float_t         pos0[2];
00044    Float_t         xcov[3];
00045    Float_t         ycov[3];
00046    Float_t         tdc_ns;
00047    Float_t         Globalcubictime;
00048    Float_t         Globalcubictimesigma;
00049 
00050 //List of branches
00051    TBranch        *b_evtno;   //!
00052    TBranch        *b_trig;   //!
00053    TBranch        *b_nchan;   //!
00054    TBranch        *b_signal;   //!
00055    TBranch        *b_slop;   //!
00056    TBranch        *b_pos0;   //!
00057    TBranch        *b_xcov;   //!
00058    TBranch        *b_ycov;   //!
00059    TBranch        *b_tdc_ns;   //!
00060    TBranch        *b_Globalcubictime;   //!
00061    TBranch        *b_Globalcubictimesigma;   //!
00062 
00063    EmecEventNTup2002v1(TTree *tree=0,string fileName=0);
00064    ~EmecEventNTup2002v1();
00065    Int_t  Cut(Int_t entry);
00066    Int_t  GetEntry(Int_t entry);
00067    Int_t  LoadTree(Int_t entry);
00068    void   Init(TTree *tree);
00069    void   Loop();
00070    Bool_t Notify();
00071    void   Show(Int_t entry = -1);
00072    int numEvents();
00073 };
00074 
00075 #endif
00076 
00077 #ifdef EmecEventNTup2002v1_cxx
00078 EmecEventNTup2002v1::EmecEventNTup2002v1(TTree *tree,string fileName)
00079 {
00080 // if parameter tree is not specified (or zero), connect the file
00081 // used to generate this class and read the Tree.
00082    TFile *f ;
00083    if (tree == 0) {
00084          f = new TFile(fileName.c_str());
00085 
00086       tree = (TTree*)f->Get("h201");
00087 
00088    }
00089    Init(tree);
00090 }
00091 
00092 EmecEventNTup2002v1::~EmecEventNTup2002v1()
00093 {
00094    if (!fChain) return;
00095    delete fChain->GetCurrentFile();
00096 }
00097 
00098 Int_t EmecEventNTup2002v1::GetEntry(Int_t entry)
00099 {
00100 // Read contents of entry.
00101    if (!fChain) return 0;
00102    return fChain->GetEntry(entry);
00103 }
00104 Int_t EmecEventNTup2002v1::LoadTree(Int_t entry)
00105 {
00106 // Set the environment to read one entry
00107    if (!fChain) return -5;
00108    Int_t centry = fChain->LoadTree(entry);
00109    if (centry < 0) return centry;
00110    if (fChain->IsA() != TChain::Class()) return centry;
00111    TChain *chain = (TChain*)fChain;
00112    if (chain->GetTreeNumber() != fCurrent) {
00113       fCurrent = chain->GetTreeNumber();
00114       Notify();
00115    }
00116    return centry;
00117 }
00118 
00119 void EmecEventNTup2002v1::Init(TTree *tree)
00120 {
00121 //   Set branch addresses
00122    if (tree == 0) return;
00123    fChain    = tree;
00124    fCurrent = -1;
00125    fChain->SetMakeClass(1);
00126 
00127    fChain->SetBranchAddress("evtno",&evtno);
00128    fChain->SetBranchAddress("trig",trig);
00129    fChain->SetBranchAddress("nchan",&nchan);
00130    fChain->SetBranchAddress("signal",signal);
00131    fChain->SetBranchAddress("slop",slop);
00132    fChain->SetBranchAddress("pos0",pos0);
00133    fChain->SetBranchAddress("xcov",xcov);
00134    fChain->SetBranchAddress("ycov",ycov);
00135    fChain->SetBranchAddress("tdc_ns",&tdc_ns);
00136    fChain->SetBranchAddress("Globalcubictime",&Globalcubictime);
00137    fChain->SetBranchAddress("Globalcubictimesigma",&Globalcubictimesigma);
00138    Notify();
00139 }
00140 
00141 Bool_t EmecEventNTup2002v1::Notify()
00142 {
00143    // Called when loading a new file.
00144    // Get branch pointers.
00145    b_evtno = fChain->GetBranch("evtno");
00146    b_trig = fChain->GetBranch("trig");
00147    b_nchan = fChain->GetBranch("nchan");
00148    b_signal = fChain->GetBranch("signal");
00149    b_slop = fChain->GetBranch("slop");
00150    b_pos0 = fChain->GetBranch("pos0");
00151    b_xcov = fChain->GetBranch("xcov");
00152    b_ycov = fChain->GetBranch("ycov");
00153    b_tdc_ns = fChain->GetBranch("tdc_ns");
00154    b_Globalcubictime = fChain->GetBranch("Globalcubictime");
00155    b_Globalcubictimesigma = fChain->GetBranch("Globalcubictimesigma");
00156    return kTRUE;
00157 }
00158 
00159 void EmecEventNTup2002v1::Show(Int_t entry)
00160 {
00161 // Print contents of entry.
00162 // If entry is not specified, print current entry
00163    if (!fChain) return;
00164    fChain->Show(entry);
00165 }
00166 Int_t EmecEventNTup2002v1::Cut(Int_t entry)
00167 {
00168 // This function may be called from Loop.
00169 // returns  1 if entry is accepted.
00170 // returns -1 otherwise.
00171    return 1;
00172 }
00173 
00174 int EmecEventNTup2002v1::numEvents(){
00175   return  int(fChain->GetEntries());
00176 }
00177 #endif // #ifdef EmecEventNTup2002v1_cxx
00178 

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