{ ////////////////////////////////////////////////////////// // This file has been automatically generated // (Fri Jul 25 11:24:39 2008 by ROOT version5.18/00d) // from TChain PreselectedTightElectronTree/ ////////////////////////////////////////////////////////// //Reset ROOT and connect tree file gROOT->Reset(); #ifdef SINGLE_TREE // The following code should be used if you want this code to access // a single tree instead of a chain TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("TestNtupleOutput_130GeV.root"); if (!f) { f = new TFile("TestNtupleOutput_130GeV.root"); } TTree *PreselectedTightElectronTree = (TTree*)gDirectory->Get("PreselectedTightElectronTree"); #else // SINGLE_TREE // The following code should be used if you want this code to access a chain // of trees. TChain *PreselectedTightElectronTree = new TChain("PreselectedTightElectronTree",""); PreselectedTightElectronTree->Add("TestNtupleOutput_130GeV.root/PreselectedTightElectronTree"); #endif // SINGLE_TREE //Declaration of leaves types Int_t RunNumber; Int_t EventNumber; Char_t Token[153]; vector electron_pt; vector electron_eta; vector electron_phi; vector electron_mass; vector > electron_incrack; vector electron_cluster_pt; vector electron_cluster_eta; vector electron_cluster_phi; vector electron_cluster_mass; vector > electron_cluster_incrack; vector electron_track_pt; vector electron_track_eta; vector electron_track_phi; vector electron_track_mass; vector > electron_track_incrack; vector > electron_isloose; vector > electron_ismedium; vector > electron_istight; vector > electron_charge; vector > electron_author_electron; vector > electron_author_softe; vector electron_trackmatch_etacorrmag; vector electron_trackmatch_eoverp; vector electron_trackmatch_deta1; vector electron_trackmatch_deta2; vector electron_trackmatch_dphi2; vector electron_shower_ethad1; vector electron_shower_etcone20; vector electron_shower_e233; vector electron_shower_e237; vector electron_shower_e277; vector electron_shower_f1; vector electron_shower_f1core; vector electron_shower_f3core; vector electron_shower_e2tsts1; vector electron_shower_emins1; vector electron_shower_weta1; vector electron_shower_wtots1; vector electron_shower_fracs1; vector electron_shower_weta2; vector electron_shower_widths2; vector electron_shower_pos7; vector electron_shower_iso; vector > electron_truth_Unknown; vector > electron_truth_ElectronUnk; vector > electron_truth_ElectronIso; vector > electron_truth_ElectronNIso; vector > electron_truth_ElectronBkg; vector > electron_truth_Hadron; vector > electron_truth_Muon; vector > electron_truth_Tau; // Set branch addresses. PreselectedTightElectronTree->SetBranchAddress("RunNumber",&RunNumber); PreselectedTightElectronTree->SetBranchAddress("EventNumber",&EventNumber); PreselectedTightElectronTree->SetBranchAddress("Token",Token); PreselectedTightElectronTree->SetBranchAddress("electron_pt",&electron_pt); PreselectedTightElectronTree->SetBranchAddress("electron_eta",&electron_eta); PreselectedTightElectronTree->SetBranchAddress("electron_phi",&electron_phi); PreselectedTightElectronTree->SetBranchAddress("electron_mass",&electron_mass); PreselectedTightElectronTree->SetBranchAddress("electron_incrack",&electron_incrack); PreselectedTightElectronTree->SetBranchAddress("electron_cluster_pt",&electron_cluster_pt); PreselectedTightElectronTree->SetBranchAddress("electron_cluster_eta",&electron_cluster_eta); PreselectedTightElectronTree->SetBranchAddress("electron_cluster_phi",&electron_cluster_phi); PreselectedTightElectronTree->SetBranchAddress("electron_cluster_mass",&electron_cluster_mass); PreselectedTightElectronTree->SetBranchAddress("electron_cluster_incrack",&electron_cluster_incrack); PreselectedTightElectronTree->SetBranchAddress("electron_track_pt",&electron_track_pt); PreselectedTightElectronTree->SetBranchAddress("electron_track_eta",&electron_track_eta); PreselectedTightElectronTree->SetBranchAddress("electron_track_phi",&electron_track_phi); PreselectedTightElectronTree->SetBranchAddress("electron_track_mass",&electron_track_mass); PreselectedTightElectronTree->SetBranchAddress("electron_track_incrack",&electron_track_incrack); PreselectedTightElectronTree->SetBranchAddress("electron_isloose",&electron_isloose); PreselectedTightElectronTree->SetBranchAddress("electron_ismedium",&electron_ismedium); PreselectedTightElectronTree->SetBranchAddress("electron_istight",&electron_istight); PreselectedTightElectronTree->SetBranchAddress("electron_charge",&electron_charge); PreselectedTightElectronTree->SetBranchAddress("electron_author_electron",&electron_author_electron); PreselectedTightElectronTree->SetBranchAddress("electron_author_softe",&electron_author_softe); PreselectedTightElectronTree->SetBranchAddress("electron_trackmatch_etacorrmag",&electron_trackmatch_etacorrmag); PreselectedTightElectronTree->SetBranchAddress("electron_trackmatch_eoverp",&electron_trackmatch_eoverp); PreselectedTightElectronTree->SetBranchAddress("electron_trackmatch_deta1",&electron_trackmatch_deta1); PreselectedTightElectronTree->SetBranchAddress("electron_trackmatch_deta2",&electron_trackmatch_deta2); PreselectedTightElectronTree->SetBranchAddress("electron_trackmatch_dphi2",&electron_trackmatch_dphi2); PreselectedTightElectronTree->SetBranchAddress("electron_shower_ethad1",&electron_shower_ethad1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_etcone20",&electron_shower_etcone20); PreselectedTightElectronTree->SetBranchAddress("electron_shower_e233",&electron_shower_e233); PreselectedTightElectronTree->SetBranchAddress("electron_shower_e237",&electron_shower_e237); PreselectedTightElectronTree->SetBranchAddress("electron_shower_e277",&electron_shower_e277); PreselectedTightElectronTree->SetBranchAddress("electron_shower_f1",&electron_shower_f1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_f1core",&electron_shower_f1core); PreselectedTightElectronTree->SetBranchAddress("electron_shower_f3core",&electron_shower_f3core); PreselectedTightElectronTree->SetBranchAddress("electron_shower_e2tsts1",&electron_shower_e2tsts1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_emins1",&electron_shower_emins1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_weta1",&electron_shower_weta1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_wtots1",&electron_shower_wtots1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_fracs1",&electron_shower_fracs1); PreselectedTightElectronTree->SetBranchAddress("electron_shower_weta2",&electron_shower_weta2); PreselectedTightElectronTree->SetBranchAddress("electron_shower_widths2",&electron_shower_widths2); PreselectedTightElectronTree->SetBranchAddress("electron_shower_pos7",&electron_shower_pos7); PreselectedTightElectronTree->SetBranchAddress("electron_shower_iso",&electron_shower_iso); PreselectedTightElectronTree->SetBranchAddress("electron_truth_Unknown",&electron_truth_Unknown); PreselectedTightElectronTree->SetBranchAddress("electron_truth_ElectronUnk",&electron_truth_ElectronUnk); PreselectedTightElectronTree->SetBranchAddress("electron_truth_ElectronIso",&electron_truth_ElectronIso); PreselectedTightElectronTree->SetBranchAddress("electron_truth_ElectronNIso",&electron_truth_ElectronNIso); PreselectedTightElectronTree->SetBranchAddress("electron_truth_ElectronBkg",&electron_truth_ElectronBkg); PreselectedTightElectronTree->SetBranchAddress("electron_truth_Hadron",&electron_truth_Hadron); PreselectedTightElectronTree->SetBranchAddress("electron_truth_Muon",&electron_truth_Muon); PreselectedTightElectronTree->SetBranchAddress("electron_truth_Tau",&electron_truth_Tau); // This is the loop skeleton // To read only selected branches, Insert statements like: // PreselectedTightElectronTree->SetBranchStatus("*",0); // disable all branches // TTreePlayer->SetBranchStatus("branchname",1); // activate branchname Long64_t nentries = PreselectedTightElectronTree->GetEntries(); Long64_t nbytes = 0; // for (Long64_t i=0; iGetEntry(i); // } }