////////////////////////////////////////////////////////// // This class has been automatically generated on // Sun Nov 14 17:03:12 2004 by ROOT version 4.00/08 // from TTree tree/ph184 data tree // found on file: root_file/run006.root ////////////////////////////////////////////////////////// #ifndef ph184example_h #define ph184example_h #include #include #include #include #include #include #define N_CH_ADC 8 /* LEDA CD SSB */ #define N_ADC1 16 /* 16 + 0 */ #define N_ADC2 9 /* 0 + 8 + 1 */ #define N_CH_LEDA (N_ADC1 * (N_CH_ADC + 1)) #define N_CH_CD (N_ADC2 * (N_CH_ADC + 1)) class ph184example { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leave types Int_t n_tdc; Int_t n_adc; Int_t TDC_channel[161]; //[n_tdc] Int_t TDC_data[161]; //[n_tdc] Int_t ADC_channel[83]; //[n_adc] Int_t ADC_data[83]; //[n_adc] // List of branches TBranch *b_n_tdc; //! TBranch *b_n_adc; //! TBranch *b_TDC_channel; //! TBranch *b_TDC_data; //! TBranch *b_ADC_channel; //! TBranch *b_ADC_data; //! //List of histos TH1I *hE[N_CH_LEDA+N_CH_CD]; TH1I *hTof[N_CH_LEDA+N_CH_CD]; TH2I *hBip[N_CH_LEDA+N_CH_CD]; //File TFile *store; ph184example(TTree *tree=0); ~ph184example(); Int_t Cut(Int_t entry); Int_t GetEntry(Int_t entry); Int_t LoadTree(Int_t entry); void Init(TTree *tree); void Loop(char*); Bool_t Notify(); void Show(Int_t entry = -1); }; #endif #ifdef ph184example_cxx ph184example::ph184example(TTree *tree) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { std::cout << "You need to specify a TTree or a TChain ..." << std::endl; } else{ Init(tree); for(int i=0;iGetCurrentFile(); } Int_t ph184example::GetEntry(Int_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Int_t ph184example::LoadTree(Int_t entry) { // Set the environment to read one entry if (!fChain) return -5; Int_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->IsA() != TChain::Class()) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void ph184example::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses of the tree // will be set. It is normaly not necessary to make changes to the // generated code, but the routine can be extended by the user if needed. // Init() will be called many times when running with PROOF. // Set branch addresses if (tree == 0) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("n_tdc",&n_tdc); fChain->SetBranchAddress("n_adc",&n_adc); fChain->SetBranchAddress("TDC_channel",TDC_channel); fChain->SetBranchAddress("TDC_data",TDC_data); fChain->SetBranchAddress("ADC_channel",ADC_channel); fChain->SetBranchAddress("ADC_data",ADC_data); Notify(); } Bool_t ph184example::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. Typically here the branch pointers // will be retrieved. It is normaly not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. // Get branch pointers b_n_tdc = fChain->GetBranch("n_tdc"); b_n_adc = fChain->GetBranch("n_adc"); b_TDC_channel = fChain->GetBranch("TDC_channel"); b_TDC_data = fChain->GetBranch("TDC_data"); b_ADC_channel = fChain->GetBranch("ADC_channel"); b_ADC_data = fChain->GetBranch("ADC_data"); return kTRUE; } void ph184example::Show(Int_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t ph184example::Cut(Int_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef ph184example_cxx