|
| 1 | +////////////////////////////////////////////////////////// |
| 2 | +// This class has been automatically generated on |
| 3 | +// Fri Aug 9 14:57:01 2013 by ROOT version 5.34/09 |
| 4 | +// from TTree outTree/outTree |
| 5 | +// found on file: /media/data/cmorgoth/scope_data/NoCrystalData/NoCrystalData.root |
| 6 | +////////////////////////////////////////////////////////// |
| 7 | + |
| 8 | +#ifndef outTree_h |
| 9 | +#define outTree_h |
| 10 | + |
| 11 | +#include <TROOT.h> |
| 12 | +#include <TChain.h> |
| 13 | +#include <TFile.h> |
| 14 | + |
| 15 | +// Header file for the classes stored in the TTree if any. |
| 16 | +#include <vector> |
| 17 | + |
| 18 | +// Fixed size dimensions of array or collections stored in the TTree if any. |
| 19 | + |
| 20 | +class outTree { |
| 21 | +public : |
| 22 | + TTree *fChain; //!pointer to the analyzed TTree or TChain |
| 23 | + Int_t fCurrent; //!current Tree number in a TChain |
| 24 | + |
| 25 | + // Declaration of leaf types |
| 26 | + Double_t ptime; |
| 27 | + std::vector<float> *Amp; |
| 28 | + std::vector<float> *Time; |
| 29 | + |
| 30 | + // List of branches |
| 31 | + TBranch *b_ptime; //! |
| 32 | + TBranch *b_Amp; //! |
| 33 | + TBranch *b_Time; //! |
| 34 | + |
| 35 | + outTree(TTree *tree=0); |
| 36 | + virtual ~outTree(); |
| 37 | + virtual Int_t Cut(Long64_t entry); |
| 38 | + virtual Int_t GetEntry(Long64_t entry); |
| 39 | + virtual Long64_t LoadTree(Long64_t entry); |
| 40 | + virtual void Init(TTree *tree); |
| 41 | + virtual void Loop(); |
| 42 | + virtual Bool_t Notify(); |
| 43 | + virtual void Show(Long64_t entry = -1); |
| 44 | +}; |
| 45 | + |
| 46 | +#endif |
| 47 | + |
| 48 | +#ifdef outTree_cxx |
| 49 | +outTree::outTree(TTree *tree) : fChain(0) |
| 50 | +{ |
| 51 | + // if parameter tree is not specified (or zero), connect the file |
| 52 | + // used to generate this class and read the Tree. |
| 53 | + if (tree == 0) { |
| 54 | + TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/media/data/cmorgoth/scope_data/NoCrystalData/NoCrystalData.root"); |
| 55 | + if (!f || !f->IsOpen()) { |
| 56 | + f = new TFile("/media/data/cmorgoth/scope_data/NoCrystalData/NoCrystalData.root"); |
| 57 | + } |
| 58 | + f->GetObject("outTree",tree); |
| 59 | + |
| 60 | + } |
| 61 | + Init(tree); |
| 62 | +} |
| 63 | + |
| 64 | +outTree::~outTree() |
| 65 | +{ |
| 66 | + if (!fChain) return; |
| 67 | + delete fChain->GetCurrentFile(); |
| 68 | +} |
| 69 | + |
| 70 | +Int_t outTree::GetEntry(Long64_t entry) |
| 71 | +{ |
| 72 | + // Read contents of entry. |
| 73 | + if (!fChain) return 0; |
| 74 | + return fChain->GetEntry(entry); |
| 75 | +} |
| 76 | +Long64_t outTree::LoadTree(Long64_t entry) |
| 77 | +{ |
| 78 | + // Set the environment to read one entry |
| 79 | + if (!fChain) return -5; |
| 80 | + Long64_t centry = fChain->LoadTree(entry); |
| 81 | + if (centry < 0) return centry; |
| 82 | + if (fChain->GetTreeNumber() != fCurrent) { |
| 83 | + fCurrent = fChain->GetTreeNumber(); |
| 84 | + Notify(); |
| 85 | + } |
| 86 | + return centry; |
| 87 | +} |
| 88 | + |
| 89 | +void outTree::Init(TTree *tree) |
| 90 | +{ |
| 91 | + // The Init() function is called when the selector needs to initialize |
| 92 | + // a new tree or chain. Typically here the branch addresses and branch |
| 93 | + // pointers of the tree will be set. |
| 94 | + // It is normally not necessary to make changes to the generated |
| 95 | + // code, but the routine can be extended by the user if needed. |
| 96 | + // Init() will be called many times when running on PROOF |
| 97 | + // (once per file to be processed). |
| 98 | + |
| 99 | + // Set object pointer |
| 100 | + Amp = 0; |
| 101 | + Time = 0; |
| 102 | + // Set branch addresses and branch pointers |
| 103 | + if (!tree) return; |
| 104 | + fChain = tree; |
| 105 | + fCurrent = -1; |
| 106 | + fChain->SetMakeClass(1); |
| 107 | + |
| 108 | + fChain->SetBranchAddress("ptime", &ptime, &b_ptime); |
| 109 | + fChain->SetBranchAddress("Amp", &Amp, &b_Amp); |
| 110 | + fChain->SetBranchAddress("Time", &Time, &b_Time); |
| 111 | + Notify(); |
| 112 | +} |
| 113 | + |
| 114 | +Bool_t outTree::Notify() |
| 115 | +{ |
| 116 | + // The Notify() function is called when a new file is opened. This |
| 117 | + // can be either for a new TTree in a TChain or when when a new TTree |
| 118 | + // is started when using PROOF. It is normally not necessary to make changes |
| 119 | + // to the generated code, but the routine can be extended by the |
| 120 | + // user if needed. The return value is currently not used. |
| 121 | + |
| 122 | + return kTRUE; |
| 123 | +} |
| 124 | + |
| 125 | +void outTree::Show(Long64_t entry) |
| 126 | +{ |
| 127 | +// Print contents of entry. |
| 128 | +// If entry is not specified, print current entry |
| 129 | + if (!fChain) return; |
| 130 | + fChain->Show(entry); |
| 131 | +} |
| 132 | +Int_t outTree::Cut(Long64_t entry) |
| 133 | +{ |
| 134 | + // This function may be called from Loop. |
| 135 | + // returns 1 if entry is accepted. |
| 136 | + // returns -1 otherwise. |
| 137 | + return 1; |
| 138 | +} |
| 139 | +#endif // #ifdef outTree_cxx |
0 commit comments