17 namespace SColdQcdCorrelatorAnalysis {
21 void SEnergyCorrelator::SetInputTree(
const string &iTreeName,
const bool isTruthTree,
const bool isEmbedTree) {
24 if (m_inDebugMode) PrintDebug(18);
26 m_inTreeName = iTreeName;
27 m_isInputTreeTruth = isTruthTree;
28 m_isInputTreeEmbed = isEmbedTree;
35 void SEnergyCorrelator::SetJetParameters(
const vector<pair<double, double>> &pTjetBins,
const pair<double, double> etaJetRange) {
38 if (m_inDebugMode) PrintDebug(20);
40 m_etaJetRange = etaJetRange;
41 m_nBinsJetPt = pTjetBins.size();
42 for (uint32_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
43 const double minPt = pTjetBins.at(iPtBin).first;
44 const double maxPt = pTjetBins.at(iPtBin).second;
45 const pair<double, double> ptBin = {
minPt, maxPt};
46 m_ptJetBins.push_back(ptBin);
48 m_ptJetRange.first = m_ptJetBins[0].first;
49 m_ptJetRange.second = m_ptJetBins[m_nBinsJetPt - 1].second;
52 if (m_inStandaloneMode) PrintMessage(6);
59 void SEnergyCorrelator::SetConstituentParameters(
const pair<double, double> momCstRange,
const pair<double, double> drCstRange,
const bool applyCstCuts) {
62 if (m_inDebugMode) PrintDebug(24);
64 m_momCstRange = momCstRange;
65 m_drCstRange = drCstRange;
66 m_applyCstCuts = applyCstCuts;
69 if (m_inStandaloneMode) PrintMessage(12);
76 void SEnergyCorrelator::SetCorrelatorParameters(
const uint32_t nPointCorr,
const uint64_t nBinsDr,
const pair<double, double> drBinRange) {
79 if (m_inDebugMode) PrintDebug(19);
81 m_nPointCorr = nPointCorr;
83 m_drBinRange = drBinRange;
86 if (m_inStandaloneMode) PrintMessage(5);
93 void SEnergyCorrelator::SetSubEventsToUse(
const uint16_t subEvtOpt,
const vector<int> vecSubEvtsToUse) {
96 if (m_inDebugMode) PrintDebug(32);
99 m_subEvtOpt = subEvtOpt;
100 if (m_subEvtOpt != 0) {
101 m_selectSubEvts =
true;
105 if (vecSubEvtsToUse.size() > 0) {
106 m_selectSubEvts =
true;
108 for (
const int subEvtToUse : vecSubEvtsToUse) {
109 m_subEvtsToUse.push_back(subEvtToUse);
114 if (m_inStandaloneMode) PrintMessage(15);
121 void SEnergyCorrelator::GrabInputNode() {
124 if (m_inDebugMode) PrintDebug(3);
133 void SEnergyCorrelator::OpenInputFiles() {
136 if (m_inDebugMode) PrintDebug(11);
139 m_inChain =
new TChain(m_inTreeName.data());
146 bool isFileGood =
true;
148 for (
const string&
inFileName : m_inFileNames) {
149 bytes = m_inChain -> Add(
inFileName.data(), 0);
150 isFileGood = (bytes > 0);
162 void SEnergyCorrelator::OpenOutputFile() {
165 if (m_inDebugMode) PrintDebug(15);
168 m_outFile =
new TFile(m_outFileName.data(),
"recreate");
179 void SEnergyCorrelator::SaveOutput() {
182 if (m_inDebugMode) PrintDebug(9);
185 for (
size_t iPtBin = 0; iPtBin < m_nBinsJetPt; iPtBin++) {
186 m_outHistVarDrAxis[iPtBin] ->
Write();
187 m_outHistErrDrAxis[iPtBin] ->
Write();
188 m_outHistVarLnDrAxis[iPtBin] ->
Write();
189 m_outHistErrLnDrAxis[iPtBin] ->
Write();
193 if (m_doSecondCstLoop) {
195 hCstPtOneVsDr ->
Write();
196 hCstPtTwoVsDr ->
Write();
197 hCstPtFracVsDr ->
Write();
198 hCstPhiOneVsDr ->
Write();
199 hCstPhiTwoVsDr ->
Write();
200 hCstEtaOneVsDr ->
Write();
201 hCstEtaTwoVsDr ->
Write();
202 hDeltaPhiOneVsDr ->
Write();
203 hDeltaPhiTwoVsDr ->
Write();
204 hDeltaEtaOneVsDr ->
Write();
205 hDeltaEtaTwoVsDr ->
Write();
206 hJetPtFracOneVsDr ->
Write();
207 hJetPtFracTwoVsDr ->
Write();
208 hCstPairWeightVsDr ->
Write();
212 if (m_inStandaloneMode) PrintMessage(10);
219 void SEnergyCorrelator::CloseOutputFile() {
222 if (m_inDebugMode) PrintDebug(30);
226 m_outFile ->
Close();