////////////////////////////////////////////////////////// // This class has been automatically generated on // Fri Jan 29 16:57:14 2010 by ROOT version 5.16/00 // from TTree PomoneDATA/BEAM_3106 // found on file: BEAM_3106.root ////////////////////////////////////////////////////////// #ifndef PomoneStruct_h #define PomoneStruct_h #include #include #include #include #include #include #include #include const Int_t Thrs[8] = { 19, 49, 79, 109, 139, 169, 199, 229 }; const UInt_t maxEvts = 10; const Int_t nCols = 16; const Int_t nRows = 8; const Int_t minStrip = 0; const Int_t maxStrip = 127; const Int_t maxChips = 3; class PomoneStruct { public : std::map planeIds; TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leave types UInt_t EventSize; Int_t Adc[maxEvts]; //[EventSize] Int_t Chipid[maxEvts]; //[EventSize] Int_t Col[maxEvts]; //[EventSize] Int_t Row[maxEvts]; //[EventSize] Int_t Planeid[maxEvts]; //[EventSize] UInt_t Timestamp[maxEvts]; //[EventSize] Int_t Finecnt[maxEvts]; //[EventSize] Int_t Chipbco[maxEvts]; //[EventSize] // new leaves Double_t strip[maxEvts]; Int_t nClusters; Double_t clustPH[maxEvts]; Int_t clustPlaneId[maxEvts]; Int_t clustMul[maxEvts]; // List of branches TBranch *b_EventSize; //! TBranch *b_Adc; //! TBranch *b_Chipid; //! TBranch *b_Col; //! TBranch *b_Row; //! TBranch *b_Planeid; //! TBranch *b_Timestamp; //! TBranch *b_Finecnt; //! TBranch *b_Chipbco; //! // new branches TBranch *b_strip; TBranch *b_nClusters; TBranch *b_clustPH; TBranch *b_clustPlaneId; TBranch *b_clustMul; PomoneStruct(const char* fileName, const char* treeName="PomoneDATA"); virtual ~PomoneStruct(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); struct stripcomp { bool operator() (const Double_t& lhs, const Double_t& rhs) const {return lhsIsZombie() ) { std::cerr << fileName << " is a non-valid root file.\n"; return; } TTree* tree = (TTree*)gDirectory->Get(treeName); Init(tree); } PomoneStruct::~PomoneStruct() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t PomoneStruct::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t PomoneStruct::LoadTree(Long64_t entry) { // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (!fChain->InheritsFrom(TChain::Class())) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void PomoneStruct::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers 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 on PROOF // (once per file to be processed). // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("EventSize", &EventSize, &b_EventSize); fChain->SetBranchAddress("Adc", Adc, &b_Adc); fChain->SetBranchAddress("Chipid", Chipid, &b_Chipid); fChain->SetBranchAddress("Col", Col, &b_Col); fChain->SetBranchAddress("Row", Row, &b_Row); fChain->SetBranchAddress("Planeid", Planeid, &b_Planeid); fChain->SetBranchAddress("Timestamp", Timestamp, &b_Timestamp); fChain->SetBranchAddress("Finecnt", Finecnt, &b_Finecnt); fChain->SetBranchAddress("Chipbco", Chipbco, &b_Chipbco); // addressing new branches b_strip = fChain->Branch("strip",&strip,"strip[EventSize]/D"); b_nClusters = fChain->Branch("nClusters",&nClusters,"nClusters/I"); b_clustPH = fChain->Branch("clustPH",clustPH,"clustPH[nClusters]/D"); b_clustPlaneId = fChain->Branch("clustPlaneId",clustPlaneId,"clustPlaneId[nClusters]/I"); b_clustMul = fChain->Branch("clustMul",clustMul,"clustMul[nClusters]/I"); Notify(); } Bool_t PomoneStruct::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. It is normaly not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. return kTRUE; } void PomoneStruct::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t PomoneStruct::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef PomoneStruct_cxx