Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RhoFluct.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RhoFluct.h
1 
2 // This class has been automatically generated on
3 // Tue Oct 24 09:50:41 2023 by ROOT version 6.26/06
4 // from TTree T/RhoFluct Tree
5 // found on file: hadd_RhoFluct.root
7 
8 #ifndef RhoFluct_h
9 #define RhoFluct_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 
17 class RhoFluct {
18 public :
19  TTree *fChain;
20  Int_t fCurrent;
21 
22 // Fixed size dimensions of array or collections stored in the TTree if any.
23 
24  // Declaration of leaf types
25  Float_t rho;
26  Float_t rho_sigma;
27  Float_t cent;
28  Float_t cent_mdb;
29  Float_t cent_epd;
30  Float_t impactparam;
31  Float_t emb_1TeV_phi;
32  Float_t emb_1TeV_eta;
34  Float_t sub1JetPhi;
35  Float_t sub1JetEta;
36  Float_t sub1JetPt;
37  Float_t sub1Jet_delPt;
39  Float_t rhoAJetPhi;
40  Float_t rhoAJetEta;
41  Float_t rhoAJetPt;
42  Float_t rhoAJetArea;
44  Float_t rhoAJet_delPt;
45 
46  // List of branches
47  TBranch *b_rho;
48  TBranch *b_rho_sigma;
49  TBranch *b_cent;
50  TBranch *b_cent_mdb;
51  TBranch *b_cent_epd;
52  TBranch *b_impactparam;
53  TBranch *b_emb_1TeV_phi;
54  TBranch *b_emb_1TeV_eta;
55  TBranch *b_sub1_ismatched;
56  TBranch *b_sub1JetPhi;
57  TBranch *b_sub1JetEta;
58  TBranch *b_sub1JetPt;
59  TBranch *b_sub1Jet_delPt;
60  TBranch *b_rhoA_ismatched;
61  TBranch *b_rhoAJetPhi;
62  TBranch *b_rhoAJetEta;
63  TBranch *b_rhoAJetPt;
64  TBranch *b_rhoAJetArea;
66  TBranch *b_rhoAJet_delPt;
67 
68  RhoFluct(TTree *tree=0);
69  virtual ~RhoFluct();
70  virtual Int_t Cut(Long64_t entry);
71  virtual Int_t GetEntry(Long64_t entry);
72  virtual Long64_t LoadTree(Long64_t entry);
73  virtual void Init(TTree *tree);
74  virtual void Loop(string);
75  virtual Bool_t Notify();
76  virtual void Show(Long64_t entry = -1);
77 
78  const std::array<float,11> IP_DEC{{
79  0.,
80  4.86409,
81  6.84237,
82  8.34927,
83  9.61087,
84  10.722 ,
85  11.7247,
86  12.6486,
87  13.5242,
88  14.4868,
89  22.
90  }};
91  int get_ip_decile(float ip) {
92  if (ip < 4.86409) { return 0; }
93  else if (ip < 6.84237) { return 1; }
94  else if (ip < 8.34927) { return 2; }
95  else if (ip < 9.61087) { return 3; }
96  else if (ip < 10.722) { return 4; }
97  else if (ip < 11.7247) { return 5; }
98  else if (ip < 12.6486) { return 6; }
99  else if (ip < 13.5242) { return 7; }
100  else if (ip < 14.4868) { return 8; }
101  else { return 9; }
102  };
103 
104 };
105 
106 #endif
107 
108 #ifdef RhoFluct_cxx
109 RhoFluct::RhoFluct(TTree *tree) : fChain(0)
110 {
111 // if parameter tree is not specified (or zero), connect the file
112 // used to generate this class and read the Tree.
113  if (tree == 0) {
114  TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("hadd_RhoFluct.root");
115  if (!f || !f->IsOpen()) {
116  f = new TFile("hadd_RhoFluct.root");
117  }
118  f->GetObject("T",tree);
119 
120  }
121  Init(tree);
122 }
123 
125 {
126  if (!fChain) return;
127  delete fChain->GetCurrentFile();
128 }
129 
130 Int_t RhoFluct::GetEntry(Long64_t entry)
131 {
132 // Read contents of entry.
133  if (!fChain) return 0;
134  return fChain->GetEntry(entry);
135 }
136 Long64_t RhoFluct::LoadTree(Long64_t entry)
137 {
138 // Set the environment to read one entry
139  if (!fChain) return -5;
140  Long64_t centry = fChain->LoadTree(entry);
141  if (centry < 0) return centry;
142  if (fChain->GetTreeNumber() != fCurrent) {
143  fCurrent = fChain->GetTreeNumber();
144  Notify();
145  }
146  return centry;
147 }
148 
149 void RhoFluct::Init(TTree *tree)
150 {
151  // The Init() function is called when the selector needs to initialize
152  // a new tree or chain. Typically here the branch addresses and branch
153  // pointers of the tree will be set.
154  // It is normally not necessary to make changes to the generated
155  // code, but the routine can be extended by the user if needed.
156  // Init() will be called many times when running on PROOF
157  // (once per file to be processed).
158 
159  // Set branch addresses and branch pointers
160  if (!tree) return;
161  fChain = tree;
162  fCurrent = -1;
163  fChain->SetMakeClass(1);
164 
165  fChain->SetBranchAddress("rho", &rho, &b_rho);
166  fChain->SetBranchAddress("rho_sigma", &rho_sigma, &b_rho_sigma);
167  fChain->SetBranchAddress("cent", &cent, &b_cent);
168  fChain->SetBranchAddress("cent_mdb", &cent_mdb, &b_cent_mdb);
169  fChain->SetBranchAddress("cent_epd", &cent_epd, &b_cent_epd);
170  fChain->SetBranchAddress("impactparam", &impactparam, &b_impactparam);
171  fChain->SetBranchAddress("emb_1TeV_phi", &emb_1TeV_phi, &b_emb_1TeV_phi);
172  fChain->SetBranchAddress("emb_1TeV_eta", &emb_1TeV_eta, &b_emb_1TeV_eta);
173  fChain->SetBranchAddress("sub1_ismatched", &sub1_ismatched, &b_sub1_ismatched);
174  fChain->SetBranchAddress("sub1JetPhi", &sub1JetPhi, &b_sub1JetPhi);
175  fChain->SetBranchAddress("sub1JetEta", &sub1JetEta, &b_sub1JetEta);
176  fChain->SetBranchAddress("sub1JetPt", &sub1JetPt, &b_sub1JetPt);
177  fChain->SetBranchAddress("sub1Jet_delPt", &sub1Jet_delPt, &b_sub1Jet_delPt);
178  fChain->SetBranchAddress("rhoA_ismatched", &rhoA_ismatched, &b_rhoA_ismatched);
179  fChain->SetBranchAddress("rhoAJetPhi", &rhoAJetPhi, &b_rhoAJetPhi);
180  fChain->SetBranchAddress("rhoAJetEta", &rhoAJetEta, &b_rhoAJetEta);
181  fChain->SetBranchAddress("rhoAJetPt", &rhoAJetPt, &b_rhoAJetPt);
182  fChain->SetBranchAddress("rhoAJetArea", &rhoAJetArea, &b_rhoAJetArea);
183  fChain->SetBranchAddress("rhoAJetPtLessRhoA", &rhoAJetPtLessRhoA, &b_rhoAJetPtLessRhoA);
184  fChain->SetBranchAddress("rhoAJet_delPt", &rhoAJet_delPt, &b_rhoAJet_delPt);
185  Notify();
186 }
187 
188 Bool_t RhoFluct::Notify()
189 {
190  // The Notify() function is called when a new file is opened. This
191  // can be either for a new TTree in a TChain or when when a new TTree
192  // is started when using PROOF. It is normally not necessary to make changes
193  // to the generated code, but the routine can be extended by the
194  // user if needed. The return value is currently not used.
195 
196  return kTRUE;
197 }
198 
199 void RhoFluct::Show(Long64_t entry)
200 {
201 // Print contents of entry.
202 // If entry is not specified, print current entry
203  if (!fChain) return;
204  fChain->Show(entry);
205 }
206 Int_t RhoFluct::Cut(Long64_t entry)
207 {
208 // This function may be called from Loop.
209 // returns 1 if entry is accepted.
210 // returns -1 otherwise.
211  return 1;
212 }
213 #endif // #ifdef RhoFluct_cxx