11 #ifndef SENERGYCORRELATOR_H
12 #define SENERGYCORRELATOR_H
30 #include <TDirectory.h>
31 #include <Math/Vector4D.h>
43 #include <fastjet/PseudoJet.hh>
45 #include "/sphenix/user/danderson/eec/EnergyEnergyCorrelators/eec/include/EECLongestSide.hh"
48 using namespace fastjet;
52 namespace SColdQcdCorrelatorAnalysis {
61 SEnergyCorrelator(
const string &
name =
"SEnergyCorrelator",
const bool isComplex =
false,
const bool doDebug =
false,
const bool inBatch =
false);
76 void SetInputNode(
const string &iNodeName) {m_inNodeName = iNodeName;}
77 void SetOutputFile(
const string &oFileName) {m_outFileName = oFileName;}
79 void SetInputFiles(
const vector<string> &vecInFileNames) {m_inFileNames = vecInFileNames;}
82 void SetInputTree(
const string &iTreeName,
const bool isTruthTree =
false,
const bool isEmbedTree =
false);
83 void SetJetParameters(
const vector<pair<double, double>> &pTjetBins,
const pair<double, double> etaJetRange);
84 void SetConstituentParameters(
const pair<double, double> momCstRange,
const pair<double, double> drCstRange,
const bool applyCstCuts =
false);
85 void SetCorrelatorParameters(
const uint32_t nPointCorr,
const uint64_t nBinsDr,
const pair<double, double> drBinRange);
86 void SetSubEventsToUse(
const uint16_t subEvtOpt = 0,
const vector<int> vecSubEvtsToUse = {});
129 void GrabInputNode();
130 void OpenInputFiles();
131 void OpenOutputFile();
133 void CloseOutputFile();
136 void InitializeMembers();
137 void InitializeHists();
138 void InitializeCorrs();
139 void InitializeTree();
140 void PrintMessage(
const uint32_t code,
const uint64_t nEvts = 0,
const uint64_t
event = 0);
141 void PrintDebug(
const uint32_t code);
142 void PrintError(
const uint32_t code,
const size_t nDrBinEdges = 0,
const size_t iDrBin = 0,
const string sInFileName =
"");
143 bool CheckCriticalParameters();
148 void DoCorrelatorCalculation();
149 void ExtractHistsFromCorr();
150 bool ApplyJetCuts(
const double ptJet,
const double etaJet);
151 bool ApplyCstCuts(
const double momCst,
const double drCst);
152 bool CheckIfSubEvtGood(
const int embedID);
153 uint32_t GetJetPtBin(
const double ptJet);
156 TFile* m_outFile = NULL;
157 TFile* m_inFile = NULL;
158 TChain* m_inChain = NULL;
185 bool m_inDebugMode =
false;
186 bool m_inBatchMode =
false;
187 bool m_inComplexMode =
false;
188 bool m_inStandaloneMode =
false;
189 bool m_isInputTreeTruth =
false;
190 bool m_isInputTreeEmbed =
false;
191 bool m_applyCstCuts =
false;
192 bool m_selectSubEvts =
false;
193 bool m_doSecondCstLoop =
false;
194 string m_moduleName =
"";
195 string m_inNodeName =
"";
196 string m_inTreeName =
"";
197 string m_outFileName =
"";
198 uint16_t m_subEvtOpt = 0;
204 uint32_t m_nPointCorr = 0;
205 uint64_t m_nBinsDr = 0;
206 size_t m_nBinsJetPt = 0;
207 pair<double, double> m_drBinRange = {-999., -999.};
208 pair<double, double> m_ptJetRange = {-999., -999.};
209 pair<double, double> m_etaJetRange = {-999., -999.};
210 pair<double, double> m_momCstRange = {-999., -999.};
211 pair<double, double> m_drCstRange = {-999., -999.};
217 vector<contrib::eec::EECLongestSide<contrib::eec::hist::axis::log>*>
m_eecLongSide;
220 int m_evtNumChrgPars = -999;
221 int m_partonID[CONST::NPARTONS] = {-999, -999};
222 double m_partonMomX[CONST::NPARTONS] = {-999., -999.};
223 double m_partonMomY[CONST::NPARTONS] = {-999., -999.};
224 double m_partonMomZ[CONST::NPARTONS] = {-999., -999.};
225 double m_evtSumPar = -999.;
226 vector<vector<int>>* m_cstID = NULL;
227 vector<vector<int>>* m_cstEmbedID = NULL;
229 int m_evtNumTrks = -999;
230 double m_evtSumECal = -999.;
231 double m_evtSumHCal = -999.;
232 vector<vector<int>>* m_cstMatchID = NULL;
235 int m_evtNumJets = -999;
236 double m_evtVtxX = -999.;
237 double m_evtVtxY = -999.;
238 double m_evtVtxZ = -999.;
239 vector<unsigned long>* m_jetNumCst = NULL;
240 vector<unsigned int>* m_jetID = NULL;
241 vector<unsigned int>* m_jetTruthID = NULL;
242 vector<double>* m_jetEnergy = NULL;
243 vector<double>* m_jetPt = NULL;
244 vector<double>* m_jetEta = NULL;
245 vector<double>* m_jetPhi = NULL;
246 vector<double>* m_jetArea = NULL;
247 vector<vector<double>>* m_cstZ = NULL;
248 vector<vector<double>>* m_cstDr = NULL;
249 vector<vector<double>>* m_cstEnergy = NULL;
250 vector<vector<double>>* m_cstPt = NULL;
251 vector<vector<double>>* m_cstEta = NULL;
252 vector<vector<double>>* m_cstPhi = NULL;
255 TBranch* m_brPartonID[CONST::NPARTONS] = {NULL, NULL};
256 TBranch* m_brPartonMomX[CONST::NPARTONS] = {NULL, NULL};
257 TBranch* m_brPartonMomY[CONST::NPARTONS] = {NULL, NULL};
258 TBranch* m_brPartonMomZ[CONST::NPARTONS] = {NULL, NULL};
259 TBranch* m_brEvtSumPar = NULL;
260 TBranch* m_brCstID = NULL;
261 TBranch* m_brCstEmbedID = NULL;
263 TBranch* m_brEvtNumTrks = NULL;
264 TBranch* m_brEvtSumECal = NULL;
265 TBranch* m_brEvtSumHCal = NULL;
266 TBranch* m_brCstMatchID = NULL;
269 TBranch* m_brEvtNumJets = NULL;
270 TBranch* m_brEvtVtxX = NULL;
271 TBranch* m_brEvtVtxY = NULL;
272 TBranch* m_brEvtVtxZ = NULL;
273 TBranch* m_brJetNumCst = NULL;
274 TBranch* m_brJetID = NULL;
275 TBranch* m_brJetEnergy = NULL;
276 TBranch* m_brJetPt = NULL;
277 TBranch* m_brJetEta = NULL;
278 TBranch* m_brJetPhi = NULL;
279 TBranch* m_brJetArea = NULL;
280 TBranch* m_brCstZ = NULL;
281 TBranch* m_brCstDr = NULL;
282 TBranch* m_brCstPt = NULL;
283 TBranch* m_brCstEnergy = NULL;
284 TBranch* m_brCstEta = NULL;
285 TBranch* m_brCstPhi = NULL;