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

HecRunHeader2001v0.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////
00002 //   This class has been automatically generated 
00003 //     (Thu May  9 16:43:14 2002 by ROOT version3.01/06)
00004 //   from TTree h100/standard
00005 //   found on file: hec_adc_11555_nov8_20k.root
00006 //////////////////////////////////////////////////////////
00007 
00008 
00009 #ifndef HecRunHeader2001v0_h
00010 #define HecRunHeader2001v0_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 HecRunHeader2001v0 {
00023    public :
00024    TTree          *fChain;   //pointer to the analyzed TTree or TChain
00025    Int_t           fCurrent; //current Tree number in a TChain
00026 //Declaration of leaves types
00027 private:
00028    UInt_t          hec_run;
00029    UInt_t          hec_runpd;
00030    Float_t         hec_beame;
00031    Float_t         hec_cryox;
00032    Float_t         hec_tabley;
00033    Float_t         hec_zbeam;
00034    UInt_t          hec_parttype;
00035    Int_t           hec_peakf;
00036    UInt_t          hec_cal_version;
00037    UInt_t          hec_dig_version;
00038    UInt_t          hec_shower;
00039    UInt_t          hec_eunit;
00040    Int_t           hec_adc_max;
00041    Int_t           hec_cells_used;
00042  public:
00043    UInt_t          hec_index[320];
00044    Float_t         hec_ped_rms[320];
00045    UInt_t          hec_ieta[320];
00046    UInt_t          hec_iphi[320];
00047    UInt_t          hec_iz[320];
00048    UInt_t          hec_ic[320];
00049 
00050 //List of branches
00051    TBranch        *b_hec_run;
00052    TBranch        *b_hec_runpd;
00053    TBranch        *b_hec_beame;
00054    TBranch        *b_hec_cryox;
00055    TBranch        *b_hec_tabley;
00056    TBranch        *b_hec_zbeam;
00057    TBranch        *b_hec_parttype;
00058    TBranch        *b_hec_peakf;
00059    TBranch        *b_hec_cal_version;
00060    TBranch        *b_hec_dig_version;
00061    TBranch        *b_hec_shower;
00062    TBranch        *b_hec_eunit;
00063    TBranch        *b_hec_adc_max;
00064    TBranch        *b_hec_index;
00065    TBranch        *b_hec_cells_used;
00066    TBranch        *b_hec_ped_rms;
00067    TBranch        *b_hec_ieta;
00068    TBranch        *b_hec_iphi;
00069    TBranch        *b_hec_iz;
00070    TBranch        *b_hec_ic;
00071 
00072 
00073 
00074 
00075 
00076    HecRunHeader2001v0(TTree *tree=0,string fileName=0);
00077    ~HecRunHeader2001v0();
00078    Int_t  Cut(Int_t entry);
00079    Int_t  GetEntry(Int_t entry);
00080    Int_t  LoadTree(Int_t entry);
00081    void   Init(TTree *tree);
00082    void   Loop();
00083    Bool_t Notify();
00084    void   Show(Int_t entry = -1);
00085 
00086    //get methods
00087    int     getHec_run()        {return hec_run;};
00088    int     getHec_runpd()      { return hec_runpd;};
00089    float   getHec_beame()      { return hec_beame;};
00090    float   getHec_cryox()      {return hec_cryox;};
00091    float   getHec_tabley()     { return hec_tabley; };
00092    float   getHec_zbeam()    { return hec_zbeam;};
00093    int     getHec_parttype()   { return hec_parttype;};
00094    int     getHec_peakf()      { return hec_peakf; };
00095    int     getHec_cal_version(){ return hec_cal_version;};
00096    int     getHec_gid_version(){ return hec_dig_version;};
00097    int     getHec_shower()     { return hec_shower;};
00098    int     getHec_eunit()      { return hec_eunit;};
00099    int     getHec_adc_max()    { return hec_adc_max;};
00100    int     getHec_cells_used(){ hec_cells_used;};
00101    //these are as of yet unimplemented
00102    //   UInt_t          hec_index[320];
00103    //   Float_t         hec_ped_rms[320];
00104    //   UInt_t          hec_ieta[320];
00105    //   UInt_t          hec_iphi[320];
00106    //   UInt_t          hec_iz[320];
00107    //   UInt_t          hec_ic[320];
00108 
00109    int numEvents();
00110 };
00111 
00112 #endif
00113 
00114 #ifdef HecRunHeader2001v0_cxx
00115 
00116 
00117 HecRunHeader2001v0::HecRunHeader2001v0(TTree *tree,string fileName)
00118 {
00119 // if parameter tree is not specified (or zero), connect the file
00120 // used to generate this class and read the Tree.
00121    TFile *f ;
00122    if (tree == 0) {
00123          f = new TFile(fileName.c_str());
00124 
00125       tree = (TTree*)f->Get("h100");
00126 
00127    }
00128    Init(tree);
00129 }
00130 
00131 HecRunHeader2001v0::~HecRunHeader2001v0()
00132 {
00133    if (!fChain) return;
00134    //delete fChain->GetCurrentFile(); //commented out because of core dump
00135 }
00136 
00137 Int_t HecRunHeader2001v0::GetEntry(Int_t entry)
00138 {
00139 // Read contents of entry.
00140    if (!fChain) return 0;
00141    return fChain->GetEntry(entry);
00142 }
00143 Int_t HecRunHeader2001v0::LoadTree(Int_t entry)
00144 {
00145 // Set the environment to read one entry
00146    if (!fChain) return -5;
00147    Int_t centry = fChain->LoadTree(entry);
00148    if (centry < 0) return centry;
00149    if (fChain->IsA() != TChain::Class()) return centry;
00150    TChain *chain = (TChain*)fChain;
00151    if (chain->GetTreeNumber() != fCurrent) {
00152       fCurrent = chain->GetTreeNumber();
00153       Notify();
00154    }
00155    return centry;
00156 }
00157 
00158 void HecRunHeader2001v0::Init(TTree *tree)
00159 {
00160 //   Set branch addresses
00161    if (tree == 0) return;
00162    fChain    = tree;
00163    fCurrent = -1;
00164    fChain->SetMakeClass(1);
00165 
00166    fChain->SetBranchAddress("hec_run",&hec_run);
00167    fChain->SetBranchAddress("hec_runpd",&hec_runpd);
00168    fChain->SetBranchAddress("hec_beame",&hec_beame);
00169    fChain->SetBranchAddress("hec_cryox",&hec_cryox);
00170    fChain->SetBranchAddress("hec_tabley",&hec_tabley);
00171    fChain->SetBranchAddress("hec_zbeam",&hec_zbeam);
00172    fChain->SetBranchAddress("hec_parttype",&hec_parttype);
00173    fChain->SetBranchAddress("hec_peakf",&hec_peakf);
00174    fChain->SetBranchAddress("hec_cal_version",&hec_cal_version);
00175    fChain->SetBranchAddress("hec_dig_version",&hec_dig_version);
00176    fChain->SetBranchAddress("hec_shower",&hec_shower);
00177    fChain->SetBranchAddress("hec_eunit",&hec_eunit);
00178    fChain->SetBranchAddress("hec_adc_max",&hec_adc_max);
00179    fChain->SetBranchAddress("hec_index",hec_index);
00180    fChain->SetBranchAddress("hec_cells_used",&hec_cells_used);
00181    fChain->SetBranchAddress("hec_ped_rms",hec_ped_rms);
00182    fChain->SetBranchAddress("hec_ieta",hec_ieta);
00183    fChain->SetBranchAddress("hec_iphi",hec_iphi);
00184    fChain->SetBranchAddress("hec_iz",hec_iz);
00185    fChain->SetBranchAddress("hec_ic",hec_ic);
00186    Notify();
00187 }
00188 
00189 Bool_t HecRunHeader2001v0::Notify()
00190 {
00191 //   called when loading a new file
00192 //   get branch pointers
00193    b_hec_run = fChain->GetBranch("hec_run");
00194    b_hec_runpd = fChain->GetBranch("hec_runpd");
00195    b_hec_beame = fChain->GetBranch("hec_beame");
00196    b_hec_cryox = fChain->GetBranch("hec_cryox");
00197    b_hec_tabley = fChain->GetBranch("hec_tabley");
00198    b_hec_zbeam = fChain->GetBranch("hec_zbeam");
00199    b_hec_parttype = fChain->GetBranch("hec_parttype");
00200    b_hec_peakf = fChain->GetBranch("hec_peakf");
00201    b_hec_cal_version = fChain->GetBranch("hec_cal_version");
00202    b_hec_dig_version = fChain->GetBranch("hec_dig_version");
00203    b_hec_shower = fChain->GetBranch("hec_shower");
00204    b_hec_eunit = fChain->GetBranch("hec_eunit");
00205    b_hec_adc_max = fChain->GetBranch("hec_adc_max");
00206    b_hec_index = fChain->GetBranch("hec_index");
00207    b_hec_cells_used = fChain->GetBranch("hec_cells_used");
00208    b_hec_ped_rms = fChain->GetBranch("hec_ped_rms");
00209    b_hec_ieta = fChain->GetBranch("hec_ieta");
00210    b_hec_iphi = fChain->GetBranch("hec_iphi");
00211    b_hec_iz = fChain->GetBranch("hec_iz");
00212    b_hec_ic = fChain->GetBranch("hec_ic");
00213    return kTRUE;
00214 }
00215 
00216 void HecRunHeader2001v0::Show(Int_t entry)
00217 {
00218 // Print contents of entry.
00219 // If entry is not specified, print current entry
00220    if (!fChain) return;
00221    fChain->Show(entry);
00222 }
00223 Int_t HecRunHeader2001v0::Cut(Int_t entry)
00224 {
00225 // This function may be called from Loop.
00226 // returns  1 if entry is accepted.
00227 // returns -1 otherwise.
00228    return 1;
00229 }
00230 
00231 int HecRunHeader2001v0::numEvents(){
00232   return int(fChain->GetEntries());
00233 }
00234 #endif // #ifdef HecRunHeader2001v0_cxx
00235 

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