Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SEnergyCorrelator.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SEnergyCorrelator.cc
1 // ----------------------------------------------------------------------------
2 // 'SEnergyCorrelator.cc'
3 // Derek Anderson
4 // 01.20.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 #define SENERGYCORRELATOR_CC
12 
13 // user includes
14 #include "SEnergyCorrelator.h"
15 #include "SEnergyCorrelator.io.h"
16 #include "SEnergyCorrelator.sys.h"
17 #include "SEnergyCorrelator.ana.h"
18 
19 using namespace std;
20 using namespace fastjet;
21 
22 
23 
24 namespace SColdQcdCorrelatorAnalysis {
25 
26  // ctor/dtor ----------------------------------------------------------------
27 
28  SEnergyCorrelator::SEnergyCorrelator(const string &name, const bool isComplex, const bool doDebug, const bool inBatch) : SubsysReco(name) {
29 
30  // initialize internal variables
32 
33  // set standalone/complex mode
34  if (isComplex) {
35  m_inComplexMode = true;
36  m_inStandaloneMode = false;
37  } else {
38  m_inComplexMode = false;
39  m_inStandaloneMode = true;
40  }
41 
42  // set verbosity in complex mode
43  if (m_inComplexMode) {
45  }
46 
47  // set debug/batch mode & print debug statement
48  m_inDebugMode = doDebug;
49  m_inBatchMode = inBatch;
50  if (m_inDebugMode) PrintDebug(1);
51 
52  // set module name & announce start of calculation
55 
56  } // end ctor(string, bool, bool)
57 
58 
59 
61 
62  // print debug statement
63  if (m_inDebugMode) PrintDebug(14);
64 
65  // delete pointers to files
66  if (!m_inChain) {
67  delete m_outFile;
68  }
69  m_inFileNames.clear();
70 
71  // delete pointers to correlators/histograms
72  for (size_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
73  delete m_eecLongSide.at(iPtBin);
74  delete m_outHistVarDrAxis.at(iPtBin);
75  delete m_outHistErrDrAxis.at(iPtBin);
76  delete m_outHistVarLnDrAxis.at(iPtBin);
77  delete m_outHistErrLnDrAxis.at(iPtBin);
78  }
79  m_ptJetBins.clear();
80  m_eecLongSide.clear();
81  m_outHistVarDrAxis.clear();
82  m_outHistErrDrAxis.clear();
83  m_outHistVarLnDrAxis.clear();
84  m_outHistErrLnDrAxis.clear();
85 
86  } // end dtor
87 
88 
89 
90  // F4A methods --------------------------------------------------------------
91 
93 
94  /* TODO init will go here */
96 
97  } // end 'Init(PHCompositeNode*)'
98 
99 
100 
101 
103 
104  /* TODO event processing will go here */
106 
107  } // end 'process_event(PHCompositeNode*)'
108 
109 
110 
112 
113  /* TODO end will go here */
115 
116  } // end 'End(PHCompositeNode*)'
117 
118 
119 
120  // standalone-only methods --------------------------------------------------
121 
123 
124  // print debug statement
125  if (m_inDebugMode) PrintDebug(10);
126 
127  // make sure standalone mode is on & open files
128  if (m_inComplexMode) {
129  PrintError(5);
131  } else {
132  OpenInputFiles();
133  }
134  OpenOutputFile();
135 
136  // announce files
137  PrintMessage(1);
138 
139  // initialize input, output, & correlators
140  InitializeTree();
141  InitializeCorrs();
142  InitializeHists();
143  return;
144 
145  } // end 'StandaloneInit()'
146 
147 
148 
150 
151  // print debug statement
152  if (m_inDebugMode) PrintDebug(12);
153 
154  // make sure standalone mode is on
155  if (m_inComplexMode) {
156  PrintError(8);
158  }
159 
160  // loop over events and calculate correlators
162 
163  // translate correlators into root hists
165  PrintMessage(9);
166  return;
167 
168  } // end 'StandaloneAnalyze()'
169 
170 
171 
173 
174  // print debug statement
175  if (m_inDebugMode) PrintDebug(13);
176 
177  // make sure standalone mode is on & save output
178  if (m_inComplexMode) {
179  PrintError(9);
181  } else {
182  SaveOutput();
183  }
184 
185  // close files and announce end
186  if (m_inComplexMode) {
187  PrintError(15);
189  }
190  CloseOutputFile();
191  PrintMessage(11);
192  return;
193 
194  } // end 'StandaloneEnd()'
195 
196 } // end SColdQcdCorrelatorAnalysis namespace
197 
198 // end ------------------------------------------------------------------------