ATLAS Offline Software
CaloD3PDClass.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #define CaloD3PDClass_cxx
7 #include <TH2.h>
8 #include <TStyle.h>
9 #include <TCanvas.h>
10 
12 {
13 // In a ROOT session, you can do:
14 // Root > .L CaloD3PDClass.C
15 // Root > CaloD3PDClass t
16 // Root > t.GetEntry(12); // Fill t data members with entry number 12
17 // Root > t.Show(); // Show values of entry 12
18 // Root > t.Show(16); // Read and show values of entry 16
19 // Root > t.Loop(); // Loop on all entries
20 //
21 
22 // This is the loop skeleton where:
23 // jentry is the global entry number in the chain
24 // ientry is the entry number in the current Tree
25 // Note that the argument to GetEntry must be:
26 // jentry for TChain::GetEntry
27 // ientry for TTree::GetEntry and TBranch::GetEntry
28 //
29 // To read only selected branches, Insert statements like:
30 // METHOD1:
31 // fChain->SetBranchStatus("*",0); // disable all branches
32 // fChain->SetBranchStatus("branchname",1); // activate branchname
33 // METHOD2: replace line
34 // fChain->GetEntry(jentry); //read all branches
35 //by b_branchname->GetEntry(ientry); //read only this branch
36  if (fChain == nullptr) return;
37 
38  Long64_t nentries = fChain->GetEntriesFast();
39 
40  for (Long64_t jentry=0; jentry<nentries;jentry++) {
41  Long64_t ientry = LoadTree(jentry);
42  if (ientry < 0) break;
43  fChain->GetEntry(jentry);
44  // if (Cut(ientry) < 0) continue;
45  }
46 }
CaloD3PDClass::Loop
virtual void Loop()
Definition: CaloD3PDClass.cxx:11
CaloD3PDClass.h
CaloD3PDClass::fChain
TTree * fChain
Definition: CaloD3PDClass.h:30
CaloD3PDClass::LoadTree
virtual Long64_t LoadTree(Long64_t entry)
PlotCalibFromCool.nentries
nentries
Definition: PlotCalibFromCool.py:798