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

SlowControl2002v0.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////
00002 //   This class has been automatically generated 
00003 //     (Tue May 13 16:51:55 2003 by ROOT version3.05/05)
00004 //   from TTree h102/standard
00005 //   found on file: hec_12369.root
00006 //////////////////////////////////////////////////////////
00007 
00008 
00009 #ifndef SlowControl2002v0_h
00010 #define SlowControl2002v0_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 SlowControl2002v0
00023   * - Author: Ian Gable (igable@uvic.ca)
00024   * - Date:  05/27/2003
00025   * - Description: This class was created by root 3.05/05. Use it to access the information
00026   *      contained in the SlowControl Header.
00027   */
00028 
00029 class SlowControl2002v0 {
00030    public :
00031    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
00032    Int_t           fCurrent; //!current Tree number in a TChain
00033 
00034 
00035    SlowControl2002v0(TTree *tree=0,string fileName=0);
00036    ~SlowControl2002v0();
00037    Int_t  Cut(Int_t entry);
00038    Int_t  GetEntry(Int_t entry);
00039    Int_t  LoadTree(Int_t entry);
00040    void   Init(TTree *tree);
00041    void   Loop();
00042    Bool_t Notify();
00043    void   Show(Int_t entry = -1);
00044 
00045    //! run start time (UNIX binary time)
00046    int getTime(){ return time;};
00047 
00048    //! The number of adc channels
00049    int getAdcUsed(){ return adc_used;};
00050 
00051    //! Cryostat pressure (mbar)
00052    float getPress(){return press;};
00053 
00054 private:
00055 
00056 //Declaration of leaves types
00057    UInt_t          time;
00058    Int_t           adc_used;
00059    Float_t         lartemp[8];
00060    Float_t         press;
00061    Float_t         hvcor[1152];   //[adc_used]
00062 
00063 //List of branches
00064    TBranch        *b_time;   //!
00065    TBranch        *b_adc_used;   //!
00066    TBranch        *b_lartemp;   //!
00067    TBranch        *b_press;   //!
00068    TBranch        *b_hvcor;   //!
00069 
00070 };
00071 
00072 #endif
00073 
00074 #ifdef SlowControl2002v0_cxx
00075 SlowControl2002v0::SlowControl2002v0(TTree *tree,string fileName)
00076 {
00077 // if parameter tree is not specified (or zero), connect the file
00078 // used to generate this class and read the Tree.
00079    TFile *f ;
00080    if (tree == 0) {
00081          f = new TFile(fileName.c_str());
00082 
00083       tree = (TTree*)f->Get("h102");
00084 
00085    }
00086    Init(tree);
00087 }
00088 
00089 
00090 SlowControl2002v0::~SlowControl2002v0()
00091 {
00092    if (!fChain) return;
00093    delete fChain->GetCurrentFile();
00094 }
00095 
00096 Int_t SlowControl2002v0::GetEntry(Int_t entry)
00097 {
00098 // Read contents of entry.
00099    if (!fChain) return 0;
00100    return fChain->GetEntry(entry);
00101 }
00102 Int_t SlowControl2002v0::LoadTree(Int_t entry)
00103 {
00104 // Set the environment to read one entry
00105    if (!fChain) return -5;
00106    Int_t centry = fChain->LoadTree(entry);
00107    if (centry < 0) return centry;
00108    if (fChain->IsA() != TChain::Class()) return centry;
00109    TChain *chain = (TChain*)fChain;
00110    if (chain->GetTreeNumber() != fCurrent) {
00111       fCurrent = chain->GetTreeNumber();
00112       Notify();
00113    }
00114    return centry;
00115 }
00116 
00117 void SlowControl2002v0::Init(TTree *tree)
00118 {
00119 //   Set branch addresses
00120    if (tree == 0) return;
00121    fChain    = tree;
00122    fCurrent = -1;
00123    fChain->SetMakeClass(1);
00124 
00125    fChain->SetBranchAddress("time",&time);
00126    fChain->SetBranchAddress("adc_used",&adc_used);
00127    fChain->SetBranchAddress("lartemp",lartemp);
00128    fChain->SetBranchAddress("press",&press);
00129    fChain->SetBranchAddress("hvcor",hvcor);
00130    Notify();
00131 }
00132 
00133 Bool_t SlowControl2002v0::Notify()
00134 {
00135    // Called when loading a new file.
00136    // Get branch pointers.
00137    b_time = fChain->GetBranch("time");
00138    b_adc_used = fChain->GetBranch("adc_used");
00139    b_lartemp = fChain->GetBranch("lartemp");
00140    b_press = fChain->GetBranch("press");
00141    b_hvcor = fChain->GetBranch("hvcor");
00142    return kTRUE;
00143 }
00144 
00145 void SlowControl2002v0::Show(Int_t entry)
00146 {
00147 // Print contents of entry.
00148 // If entry is not specified, print current entry
00149    if (!fChain) return;
00150    fChain->Show(entry);
00151 }
00152 Int_t SlowControl2002v0::Cut(Int_t entry)
00153 {
00154 // This function may be called from Loop.
00155 // returns  1 if entry is accepted.
00156 // returns -1 otherwise.
00157    return 1;
00158 }
00159 #endif // #ifdef SlowControl2002v0_cxx
00160 

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