////////////////////////////////////////////////////////// // This class has been automatically generated on // Wed Jun 20 10:04:24 2018 by ROOT version 5.34/39 // from TTree eventTree/Event tree // found on file: L1Ntuple_EBTP_HGCalTP_L1_L1TTracklet_onMC_L1_FEVTHLTDEBUG_TRACK_GEN_TT_nevt_10.root ////////////////////////////////////////////////////////// #ifndef eventTree_h #define eventTree_h #include #include #include // Header file for the classes stored in the TTree if any. #include #include // Fixed size dimensions of array or collections stored in the TTree if any. class eventTree { public : TChain *fChain; //!pointer to the analyzed TTree or TChain TChain *fTracks; Int_t fCurrent; //!current Tree number in a TChain // Declaration of leaf types vector *trk_pt; UInt_t lumi; // List of branches TBranch *b_trk_pt; TBranch *b_lumi; eventTree(TChain *tree=0); virtual ~eventTree(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TChain *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); }; #endif #ifdef eventTree_cxx eventTree::eventTree(TChain *tree) : fChain(0) { // Define the TChains TChain* fMainTree = new TChain("l1EventTree/L1EventTree"); // Main Chain (other chains will be added as friends to it) fTracks = new TChain("l1TrackTree/eventTree"); // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("L1Ntuple_EBTP_HGCalTP_L1_L1TTracklet_onMC_L1_FEVTHLTDEBUG_TRACK_GEN_TT_nevt_10.root"); if (!f || !f->IsOpen()) { fMainTree->Add("L1Ntuple_EBTP_HGCalTP_L1_L1TTracklet_onMC_L1_FEVTHLTDEBUG_TRACK_GEN_TT_nevt_10.root"); fTracks ->Add("L1Ntuple_EBTP_HGCalTP_L1_L1TTracklet_onMC_L1_FEVTHLTDEBUG_TRACK_GEN_TT_nevt_10.root"); } fMainTree->AddFriend(fTracks); tree = fMainTree; } Init(tree); } eventTree::~eventTree() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t eventTree::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t eventTree::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->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); } return centry; } void eventTree::Init(TChain *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 normally 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 object pointer trk_pt = 0; lumi = 0; // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; // SetMakeClass(1) //--for the main chain fChain->SetMakeClass(1); //--for all the chains added as friends TFriendElement *friendTreeElement = (TFriendElement*)fChain->GetListOfFriends()->First(); //fChain->GetListOfFriends()->ls(); while (friendTreeElement){ friendTreeElement->GetTree()->SetMakeClass(1); friendTreeElement = (TFriendElement*)fChain->GetListOfFriends()->After(friendTreeElement); } // Set address of branches fChain->SetBranchAddress("lumi", &lumi, &b_lumi); fChain->SetBranchAddress("trk_pt", &trk_pt, &b_trk_pt); Notify(); } Bool_t eventTree::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 normally 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 eventTree::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t eventTree::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef eventTree_cxx