Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SEnergyCorrelator.sys.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SEnergyCorrelator.sys.h
1 // ----------------------------------------------------------------------------
2 // 'SEnergyCorrelator.sys.h'
3 // Derek Anderson
4 // 01.27.2023
5 //
6 // A module to implement Peter Komiske's EEC library
7 // in the sPHENIX software stack for the Cold QCD
8 // Energy-Energy Correlator analysis.
9 // ----------------------------------------------------------------------------
10 
11 #pragma once
12 
13 using namespace std;
14 using namespace fastjet;
15 
16 
17 
18 namespace SColdQcdCorrelatorAnalysis {
19 
20  // system methods -----------------------------------------------------------
21 
22  void SEnergyCorrelator::InitializeMembers() {
23 
24  // print debug statement
25  if (m_inDebugMode) PrintDebug(0);
26 
27  m_ptJetBins.clear();
28  m_inFileNames.clear();
29  m_eecLongSide.clear();
30  m_subEvtsToUse.clear();
31  m_jetCstVector.clear();
32  m_outHistVarDrAxis.clear();
33  m_outHistErrDrAxis.clear();
34  m_outHistVarLnDrAxis.clear();
35  m_outHistErrLnDrAxis.clear();
36  return;
37 
38  } // end 'InitializeMembers()'
39 
40 
41 
42  void SEnergyCorrelator::InitializeTree() {
43 
44  // print debug statement
45  if (m_inDebugMode) PrintDebug(4);
46 
47  // check for tree
48  if (!m_inChain) {
49  PrintError(10);
50  assert(m_inChain);
51  }
52  m_fCurrent = -1;
53  m_inChain -> SetMakeClass(1);
54 
55  // set truth vs. reco branch addresses
56  if (m_isInputTreeTruth) {
57  m_inChain -> SetBranchAddress("Parton3_ID", &m_partonID[0], &m_brPartonID[0]);
58  m_inChain -> SetBranchAddress("Parton4_ID", &m_partonID[1], &m_brPartonID[1]);
59  m_inChain -> SetBranchAddress("Parton3_MomX", &m_partonMomX[0], &m_brPartonMomX[0]);
60  m_inChain -> SetBranchAddress("Parton3_MomY", &m_partonMomY[0], &m_brPartonMomY[0]);
61  m_inChain -> SetBranchAddress("Parton3_MomZ", &m_partonMomZ[0], &m_brPartonMomZ[0]);
62  m_inChain -> SetBranchAddress("Parton4_MomX", &m_partonMomX[1], &m_brPartonMomX[1]);
63  m_inChain -> SetBranchAddress("Parton4_MomY", &m_partonMomY[1], &m_brPartonMomY[1]);
64  m_inChain -> SetBranchAddress("Parton4_MomZ", &m_partonMomZ[1], &m_brPartonMomZ[1]);
65  m_inChain -> SetBranchAddress("EvtSumParEne", &m_evtSumPar, &m_brEvtSumPar);
66  m_inChain -> SetBranchAddress("CstID", &m_cstID, &m_brCstID);
67  m_inChain -> SetBranchAddress("CstEmbedID", &m_cstEmbedID, &m_brCstEmbedID);
68  } else {
69  m_inChain -> SetBranchAddress("EvtNumTrks", &m_evtNumTrks, &m_brEvtNumTrks);
70  m_inChain -> SetBranchAddress("EvtSumECalEne", &m_evtSumECal, &m_brEvtSumECal);
71  m_inChain -> SetBranchAddress("EvtSumHCalEne", &m_evtSumHCal, &m_brEvtSumHCal);
72  m_inChain -> SetBranchAddress("CstMatchID", &m_cstMatchID, &m_brCstMatchID);
73  }
74 
75  // set generic branch addresses
76  m_inChain -> SetBranchAddress("EvtVtxX", &m_evtVtxX, &m_brEvtVtxX);
77  m_inChain -> SetBranchAddress("EvtVtxY", &m_evtVtxY, &m_brEvtVtxY);
78  m_inChain -> SetBranchAddress("EvtVtxZ", &m_evtVtxZ, &m_brEvtVtxZ);
79  m_inChain -> SetBranchAddress("EvtNumJets", &m_evtNumJets, &m_brEvtNumJets);
80  m_inChain -> SetBranchAddress("JetNumCst", &m_jetNumCst, &m_brJetNumCst);
81  m_inChain -> SetBranchAddress("JetID", &m_jetID, &m_brJetID);
82  m_inChain -> SetBranchAddress("JetEnergy", &m_jetEnergy, &m_brJetEnergy);
83  m_inChain -> SetBranchAddress("JetPt", &m_jetPt, &m_brJetPt);
84  m_inChain -> SetBranchAddress("JetEta", &m_jetEta, &m_brJetEta);
85  m_inChain -> SetBranchAddress("JetPhi", &m_jetPhi, &m_brJetPhi);
86  m_inChain -> SetBranchAddress("JetArea", &m_jetArea, &m_brJetArea);
87  m_inChain -> SetBranchAddress("CstZ", &m_cstZ, &m_brCstZ);
88  m_inChain -> SetBranchAddress("CstDr", &m_cstDr, &m_brCstDr);
89  m_inChain -> SetBranchAddress("CstEnergy", &m_cstEnergy, &m_brCstEnergy);
90  m_inChain -> SetBranchAddress("CstJt", &m_cstPt, &m_brCstPt);
91  m_inChain -> SetBranchAddress("CstEta", &m_cstEta, &m_brCstEta);
92  m_inChain -> SetBranchAddress("CstPhi", &m_cstPhi, &m_brCstPhi);
93 
94  // announce tree setting
95  if (m_inStandaloneMode) PrintMessage(2);
96  return;
97 
98  } // end 'InitializeTree()'
99 
100 
101 
102  void SEnergyCorrelator::InitializeHists() {
103 
104  // print debug statement
105  if (m_inDebugMode) PrintDebug(5);
106 
107  for (size_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
108  TH1D* hInitialVarDrAxis = NULL;
109  TH1D* hInitialErrDrAxis = NULL;
110  TH1D* hInitialVarLnDrAxis = NULL;
111  TH1D* hInitialErrLnDrAxis = NULL;
112  m_outHistVarDrAxis.push_back(hInitialVarDrAxis);
113  m_outHistVarLnDrAxis.push_back(hInitialVarLnDrAxis);
114  m_outHistErrDrAxis.push_back(hInitialErrDrAxis);
115  m_outHistErrLnDrAxis.push_back(hInitialErrLnDrAxis);
116  }
117 
118  // for weird cst check
119  if (m_doSecondCstLoop) {
120  vector<double> drBinEdges = m_eecLongSide[0] -> bin_edges();
121  size_t nDrBinEdges = drBinEdges.size();
122 
123  double drBinEdgeArray[nDrBinEdges];
124  for (size_t iDrEdge = 0; iDrEdge < nDrBinEdges; iDrEdge++) {
125  drBinEdgeArray[iDrEdge] = drBinEdges.at(iDrEdge);
126  }
127  hCstPtOneVsDr = new TH2D("hCstPtOneVsDr", "", m_nBinsDr, drBinEdgeArray, 200, 0., 100.);
128  hCstPtTwoVsDr = new TH2D("hCstPtTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 200, 0., 100.);
129  hCstPtFracVsDr = new TH2D("hCstPtFracVsDr", "", m_nBinsDr, drBinEdgeArray, 500, 0., 5.);
130  hCstPhiOneVsDr = new TH2D("hCstPhiOneVsDr", "", m_nBinsDr, drBinEdgeArray, 360, -3.15, 3.15);;
131  hCstPhiTwoVsDr = new TH2D("hCstPhiTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 360, -3.15, 3.15);
132  hCstEtaOneVsDr = new TH2D("hCstEtaOneVsDr", "", m_nBinsDr, drBinEdgeArray, 400, -2., 2.);
133  hCstEtaTwoVsDr = new TH2D("hCstEtaTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 400, -2., 2.);
134  hDeltaPhiOneVsDr = new TH2D("hDeltaPhiOneVsDr", "", m_nBinsDr, drBinEdgeArray, 720, -6.30, 6.30);
135  hDeltaPhiTwoVsDr = new TH2D("hDeltaPhiTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 720, -6.30, 6.30);
136  hDeltaEtaOneVsDr = new TH2D("hDeltaEtaOneVsDr", "", m_nBinsDr, drBinEdgeArray, 800, -4., 4.);
137  hDeltaEtaTwoVsDr = new TH2D("hDeltaEtaTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 800, -4., 4.);
138  hJetPtFracOneVsDr = new TH2D("hJetPtFracOneVsDr", "", m_nBinsDr, drBinEdgeArray, 500, 0., 5.);
139  hJetPtFracTwoVsDr = new TH2D("hJetPtFracTwoVsDr", "", m_nBinsDr, drBinEdgeArray, 500, 0., 5.);
140  hCstPairWeightVsDr = new TH2D("hCstPairWeightVsDr", "", m_nBinsDr, drBinEdgeArray, 100, 0., 1.);
141  }
142 
143  // announce histogram initialization
144  if (m_inStandaloneMode) PrintMessage(3);
145  return;
146 
147  } // end 'InitializeHists()'
148 
149 
150 
151  void SEnergyCorrelator::InitializeCorrs() {
152 
153  // print debug statement
154  if (m_inDebugMode) PrintDebug(6);
155 
156  // initialize correlator for each jet pt bin
157  for (size_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
158  m_eecLongSide.push_back(new contrib::eec::EECLongestSide<contrib::eec::hist::axis::log>(m_nPointCorr, m_nBinsDr, {m_drBinRange.first, m_drBinRange.second}));
159  }
160 
161  // announce correlator initialization
162  if (m_inStandaloneMode) PrintMessage(4);
163  return;
164 
165  } // end 'InitializeCorrs()'
166 
167 
168 
169  void SEnergyCorrelator::PrintMessage(const uint32_t code, const uint64_t nEvts, const uint64_t event) {
170 
171  // print debug statement
172  if (m_inDebugMode && (m_verbosity > 5)) PrintDebug(22);
173 
174  switch (code) {
175  case 0:
176  cout << "\n Running standalone correlator calculation...\n"
177  << " Set name & modes:\n"
178  << " module name = " << m_moduleName.data() << "\n"
179  << " complex mode? = " << m_inComplexMode << "\n"
180  << " standalone mode? = " << m_inStandaloneMode << "\n"
181  << " debug mode? = " << m_inDebugMode << "\n"
182  << " batch mode? = " << m_inBatchMode
183  << endl;
184  break;
185  case 1:
186  cout << " Opened files:\n"
187  << " output = " << m_outFileName.data() << "\n"
188  << " inputs = {"
189  << endl;
190  for (const string& inFileName : m_inFileNames) {
191  cout << " " << inFileName.data() << endl;
192  }
193  cout << " }" << endl;
194  break;
195  case 2:
196  cout << " Initialized input chain:\n"
197  << " tree name = " << m_inTreeName.data()
198  << endl;
199  break;
200  case 3:
201  cout << " Initialized output histograms." << endl;
202  break;
203  case 4:
204  cout << " Initialized correlators." << endl;
205  break;
206  case 5:
207  cout << " Set correlator parameters:\n"
208  << " n-point = " << m_nPointCorr << ", number of dR bins = " << m_nBinsDr << "\n"
209  << " dR bin range = (" << m_drBinRange.first << ", " << m_drBinRange.second << ")"
210  << endl;
211  break;
212  case 6:
213  cout << " Set jet parameters:\n"
214  << " eta range = (" << m_etaJetRange.first << ", " << m_etaJetRange.second << ")\n"
215  << " pt range = (" << m_ptJetRange.first << ", " << m_ptJetRange.second << ")\n"
216  << " Set pTjet bins:"
217  << endl;
218  for (uint32_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
219  cout << " bin[" << iPtBin << "] = (" << m_ptJetBins.at(iPtBin).first << ", " << m_ptJetBins.at(iPtBin).second << ")" << endl;
220  }
221  break;
222  case 7:
223  cout << " Beginning event loop: " << nEvts << " events to process..." << endl;
224  break;
225  case 8:
226  if (m_inBatchMode) {
227  cout << " processing event " << (event + 1) << "/" << nEvts << "..." << endl;
228  } else {
229  cout << " processing event " << (event + 1) << "/" << nEvts << "...\r" << flush;
230  if ((event + 1) == nEvts) cout << endl;
231  }
232  break;
233  case 9:
234  cout << " Analysis finished!" << endl;
235  break;
236  case 10:
237  cout << " Saved output histograms." << endl;
238  break;
239  case 11:
240  cout << " Finished correlator calculation!\n" << endl;
241  break;
242  case 12:
243  cout << " Set constituent parameters:\n"
244  << " apply constituent cuts? = " << m_applyCstCuts << "\n"
245  << " momentum range = (" << m_momCstRange.first << ", " << m_momCstRange.second << ")\n"
246  << " dr range = (" << m_drCstRange.first << ", " << m_drCstRange.second << ")"
247  << endl;
248  break;
249  case 13:
250  cout << " Finished event loop!" << endl;
251  break;
252  case 14:
253  cout << " Extracted output histograms from correlators." << endl;
254  break;
255  case 15:
256  cout << " Set which sub-events to use:" << endl;
257  switch (m_subEvtOpt) {
258  case 1:
259  cout << " Option " << m_subEvtOpt << ": use only signal event" << endl;
260  break;
261  case 2:
262  cout << " Option " << m_subEvtOpt << ": use only background events" << endl;
263  break;
264  case 3:
265  cout << " Option " << m_subEvtOpt << ": use only primary background event" << endl;
266  break;
267  case 4:
268  cout << " Option " << m_subEvtOpt << ": use only pileup events" << endl;
269  break;
270  case 5:
271  cout << " Option " << m_subEvtOpt << ": use events only with these embedding IDs: ";
272  for (size_t iEvtToUse = 0; iEvtToUse < m_subEvtsToUse.size(); iEvtToUse++) {
273  cout << m_subEvtsToUse[iEvtToUse];
274  if ((iEvtToUse + 1) < m_subEvtsToUse.size()) {
275  cout << ", ";
276  } else {
277  cout << endl;
278  }
279  } // end sub-event id loop
280  break;
281  default:
282  cout << " Option " << m_subEvtOpt << ": use everything (check what you entered)" << endl;
283  break;
284  }
285  break;
286  }
287  return;
288 
289  } // end 'PrintMessage(uint32_t)'
290 
291 
292  void SEnergyCorrelator::PrintDebug(const uint32_t code) {
293 
294  // print debug statement
295  if (m_inDebugMode && (m_verbosity > 7)) {
296  cout << "SEnergyCorrelator::PrintDebug(uint32_t) printing a debugging statement..." << endl;
297  }
298 
299  switch (code) {
300  case 0:
301  cout << "SEnergyCorrelator::InitializeMembers() initializing internal variables..." << endl;
302  break;
303  case 1:
304  cout << "SEnergyCorrelator::SEnergyCorrelator(string, bool, bool) calling ctor..." << endl;
305  break;
306  case 2:
307  cout << "SEnergyCorrelator::Init(PHCompositeNode*) initializing..." << endl;
308  break;
309  case 3:
310  cout << "SEnergyCorrelator::GrabInputNode() grabbing input node..." << endl;
311  break;
312  case 4:
313  cout << "SEnergyCorrelator::InitializeTree() initializing input tree..." << endl;
314  break;
315  case 5:
316  cout << "SEnergyCorrelator::InitializeHists() initializing histograms..." << endl;
317  break;
318  case 6:
319  cout << "SEnergyCorrelator::InitializeCorrs() initializing correlators" << endl;
320  break;
321  case 7:
322  cout << "SEnergyCorrelator::process_event(PHCompositeNode*) processing event..." << endl;
323  break;
324  case 8:
325  cout << "SEnergyCorrelator::End(PHCompositeNode*) this is the end..." << endl;
326  break;
327  case 9:
328  cout << "SEnergyCorrelator::SaveOutput() saving output..." << endl;
329  break;
330  case 10:
331  cout << "SEnergyCorrelator::Init() initializing..." << endl;
332  break;
333  case 11:
334  cout << "SenergyCorrelator::OpenInputFile() opening input file..." << endl;
335  break;
336  case 12:
337  cout << "SEnergyCorrelator::Analyze() analyzing input..." << endl;
338  break;
339  case 13:
340  cout << "SEnergyCorrelator::End() this is the end..." << endl;
341  break;
342  case 14:
343  cout << "SEnergyCorrelator::~SEnergyCorrelator() calling dtor..." << endl;
344  break;
345  case 15:
346  cout << "SEnergyCorrelator::OpenOutputFile() opening output file..." << endl;
347  break;
348  case 16:
349  cout << "SEnergyCorrelator::GetEntry(uint64_t) getting tree entry..." << endl;
350  break;
351  case 17:
352  cout << "SEnergyCorrelator::LoadTree(uint64_t) loading tree..." << endl;
353  break;
354  case 18:
355  cout << "SEnergyCorrelator::SetInputTree(string, bool) setting input tree name..." << endl;
356  break;
357  case 19:
358  cout << "SEnergyCorrelator::SetCorrelatorParameters(uint32_t, uint64_t, pair<double, double>) setting correlator parameters..." << endl;
359  break;
360  case 20:
361  cout << "SEnergyCorrelator::SetJetParameters(vector<pair<double, double>>, pair<double, double>) setting jet parameters..." << endl;
362  break;
363  case 21:
364  cout << "SEnergyCorrelators:CheckCriticalParameters() checking critical parameters..." << endl;
365  break;
366  case 22:
367  cout << "SEnergyCorrelator::PrintMessage(uint32_t, uint64_t, uint64_t) printing a message..." << endl;
368  break;
369  case 23:
370  cout << "SEnergyCorrelator::PrintError(uint32_t) printing an error..." << endl;
371  break;
372  case 24:
373  cout << "SEnergyCorrelator::SetConstituentParameters(pair<double, double>, pair<double, double>) setting constituent parameters..." << endl;
374  break;
375  case 25:
376  cout << "SEnergyCorrelator::ExtractHistsFromCorr() extracting output histograms..." << endl;
377  break;
378  case 26:
379  cout << "SEnergyCorrelator::ApplyJetCuts(double, double) applying jet cuts..." << endl;
380  break;
381  case 27:
382  cout << "SEnergyCorrelator::ApplyCstCuts(double, double) applying constituent cuts..." << endl;
383  break;
384  case 28:
385  cout << "SEnergyCorrelator::GetJetPtBin(double) getting jet pT bin..." << endl;
386  break;
387  case 29:
388  cout << "SEnergyCorrelator::CloseInputFile() closing input file..." << endl;
389  break;
390  case 30:
391  cout << "SEnergyCorrelator::CloseOutputFile() closing output file..." << endl;
392  break;
393  case 31:
394  cout << "SEnergyCorrelator::DoCorrelatorCalculation() looping over events and calculating correlators..." << endl;
395  break;
396  case 32:
397  cout << "SEnergyCorrelator::SetSubEventsToUse(uint16_t, vector<int>) setting sub-events to use..." << endl;
398  break;
399  case 33:
400  cout << "SEnergyCorrelator::CheckIfSubEvtGood(int) checking if sub-event is good..." << endl;
401  break;
402  }
403  return;
404 
405  } // end 'PrintDebug(uint32_t)'
406 
407 
408 
409  void SEnergyCorrelator::PrintError(const uint32_t code, const size_t nDrBinEdges, const size_t iDrBin, const string sInFileName) {
410 
411  // print debug statement
412  if (m_inDebugMode && (m_verbosity > 5)) PrintDebug(23);
413 
414  switch (code) {
415  case 0:
416  if (m_inComplexMode) {
417  cerr << "SEnergyCorrelator::Init(PHCompositeNode*) PANIC: calling complex method in standalone mode! Aborting!" << endl;
418  } else {
419  cerr << "PANIC: calling complex method in standalone mode! Aborting!" << endl;
420  }
421  break;
422  case 1:
423  if (m_inComplexMode) {
424  cerr << "SEnergyCorrelator::GrabInputNode() PANIC: couldn't grab node \"" << m_inNodeName << "\"! Aborting!" << endl;
425  } else {
426  cerr << "PANIC: couldn't grab node \"" << m_inNodeName << "\"! Aborting!" << endl;
427  }
428  break;
429  case 2:
430  if (m_inComplexMode) {
431  cerr << "SEnergyCorrelator::GrabInputNode() PANIC: couldn't grab tree \"" << m_inTreeName << "\" from node \"" << m_inNodeName << "\"! Aborting!" << endl;
432  } else {
433  cerr << "PANIC: couldn't grab tree \"" << m_inTreeName << "\" from node \"" << m_inNodeName << "\"! Aborting!" << endl;
434  }
435  break;
436  case 3:
437  if (m_inComplexMode) {
438  cerr << "SEnergyCorrelator::process_event(PHCompositeNode*) PANIC: calling complex method in standalone mode! Aborting!" << endl;
439  } else {
440  cerr << "PANIC: calling complex method in standalone mode! Aborting!" << endl;
441  }
442  break;
443  case 4:
444  if (m_inComplexMode) {
445  cerr << "SEnergyCorrelator::End(PHCompositeNode*) PANIC: calling complex method in standalone mode! Aborting!" << endl;
446  } else {
447  cerr << "PANIC: calling complex method in standalone mode! Aborting!" << endl;
448  }
449  break;
450  case 5:
451  if (m_inComplexMode) {
452  cerr << "SEnergyCorrelator::Init() PANIC: calling standalone method in complex mode! Aborting!" << endl;
453  } else {
454  cerr << "PANIC: calling standalone method in complex mode! Aborting!" << endl;
455  }
456  break;
457  case 6:
458  if (m_inComplexMode) {
459  cerr << "SEnergyCorrelator::OpenInputFiles() PANIC: couldn't create input TChain! Aborting" << endl;
460  } else {
461  cerr << "PANIC: couldn't create input TChain! Aborting!" << endl;
462  }
463  break;
464  case 7:
465  if (m_inComplexMode) {
466  cerr << "SEnergyCorrelator::OpenInputFiles() PANIC: couldn't grab tree \"" << m_inTreeName << "\" from file \"" << sInFileName << "\"! Aborting!" << endl;
467  } else {
468  cerr << "PANIC: couldn't grab tree \"" << m_inTreeName << "\" from file \"" << sInFileName << "\"! Aborting!" << endl;
469  }
470  break;
471  case 8:
472  if (m_inComplexMode) {
473  cerr << "SEnergyCorrelator::Analyze() PANIC: calling standalone method in complex mode! Aborting!" << endl;
474  } else {
475  cerr << "PANIC: calling standalone method in complex mode! Aborting!" << endl;
476  }
477  break;
478  case 9:
479  if (m_inComplexMode) {
480  cerr << "SEnergyCorrelator::End() PANIC: calling standalone method in complex mode! Aborting!" << endl;
481  } else {
482  cerr << "PANIC: calling standalone method in complex mode! Aborting!" << endl;
483  }
484  break;
485  case 10:
486  if (m_inComplexMode) {
487  cerr << "SEnergyCorrelator::InitializeTree() PANIC: no TTree! Aborting!" << endl;
488  } else {
489  cerr << "PANIC: no TTree! Aborting!" << endl;
490  }
491  break;
492  case 11:
493  if (m_inComplexMode) {
494  cerr << "SEnergyCorrelator::OpenOutputFile() PANIC: couldn't open output file! Aborting!" << endl;
495  } else {
496  cerr << "PANIC: couldn't open output file! Aborting!" << endl;
497  }
498  break;
499  case 12:
500  if (m_inComplexMode) {
501  cerr << "SEnergyCorrelator::ExtraHistsFromCorr() PANIC: number of dR bin edges is no good! Aborting!" << endl;
502  } else {
503  cerr << "PANIC: number of dR bin edges is no good! Aborting!\n"
504  << " nDrBinEdges = " << nDrBinEdges << ", nDrBins = " << m_nBinsDr
505  << endl;
506  }
507  break;
508  case 13:
509  if (m_inStandaloneMode) {
510  cerr << "WARNING: dR bin #" << iDrBin << " with variance has a NAN as content or error..." << endl;
511  }
512  break;
513  case 14:
514  if (m_inStandaloneMode) {
515  cerr << "WARNING: dR bin #" << iDrBin << " with statistical error has a NAN as content or error..." << endl;
516  }
517  break;
518  case 15:
519  if (m_inComplexMode) {
520  cerr << "SEnergyCorrelatorFile::End() PANIC: calling standalone method in complex mode! Aborting!" << endl;
521  } else {
522  cerr << "PANIC: calling standalone method in complex mode! Aborting!" << endl;
523  }
524  break;
525  }
526  return;
527 
528  } // end 'PrintError(unint32_t)'
529 
530 
531 
532  bool SEnergyCorrelator::CheckCriticalParameters() {
533 
534  // print debugging statement
535  if (m_inDebugMode) PrintDebug(21);
536 
537  /* TODO checking goes here */
538  return true;
539 
540  } // end 'CheckCriticalParameters()'
541 
542 
543 
544  int64_t SEnergyCorrelator::GetEntry(const uint64_t entry) {
545 
546  // print debugging statemet
547  if (m_inDebugMode && (m_verbosity > 5)) PrintDebug(16);
548 
549  int64_t entryStatus(-1);
550  if (!m_inChain) {
551  entryStatus = 0;
552  } else {
553  entryStatus = m_inChain -> GetEntry(entry);
554  }
555  return entryStatus;
556 
557  } // end 'GetEntry(uint64_t)'
558 
559 
560 
561  int64_t SEnergyCorrelator::LoadTree(const uint64_t entry) {
562 
563  // print debugging statemet
564  if (m_inDebugMode && (m_verbosity > 5)) PrintDebug(17);
565 
566  // check for tree & load
567  int treeNumber(-1);
568  int64_t treeStatus(-1);
569  if (!m_inChain) {
570  treeStatus = -5;
571  } else {
572  treeNumber = m_inChain -> GetTreeNumber();
573  treeStatus = m_inChain -> LoadTree(entry);
574  }
575 
576  // update current tree number if need be
577  const bool isTreeStatusGood = (treeStatus >= 0);
578  const bool isNotCurrentTree = (treeNumber != m_fCurrent);
579  if (isTreeStatusGood && isNotCurrentTree) {
580  m_fCurrent = m_inChain -> GetTreeNumber();
581  }
582  return treeStatus;
583 
584  } // end 'LoadTree(uint64_t)'
585 
586 } // end SColdQcdCorrelatorAnalysis namespace
587 
588 // end ------------------------------------------------------------------------