Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SCorrelatorJetTree.io.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SCorrelatorJetTree.io.h
1 // ----------------------------------------------------------------------------
2 // 'SCorrelatorJetTree.io.h'
3 // Derek Anderson
4 // 12.04.2022
5 //
6 //
7 // A module to produce a tree of jets for the sPHENIX
8 // Cold QCD Energy-Energy Correlator analysis.
9 //
10 // Derived from code by Antonio Silva (thanks!!)
11 // ----------------------------------------------------------------------------
12 
13 #pragma once
14 
15 using namespace std;
16 using namespace findNode;
17 
18 
19 namespace SColdQcdCorrelatorAnalysis {
20 
21  // i/o methods -------------------------------------------------------------
22 
23  void SCorrelatorJetTree::SetEvtVzRange(const pair<double, double> vzRange) {
24 
25  m_evtVzRange[0] = vzRange.first;
26  m_evtVzRange[1] = vzRange.second;
27  return;
28 
29  } // end 'SetEvtVzRange(pair<double, double>)'
30 
31 
32 
33  void SCorrelatorJetTree::SetEvtVrRange(const pair<double, double> vrRange) {
34 
35  m_evtVrRange[0] = vrRange.first;
36  m_evtVrRange[1] = vrRange.second;
37  return;
38 
39  } // end 'SetEvtVrRange(pair<double, double>)'
40 
41 
42 
43  void SCorrelatorJetTree::SetParPtRange(const pair<double, double> ptRange) {
44 
45  m_parPtRange[0] = ptRange.first;
46  m_parPtRange[1] = ptRange.second;
47  return;
48 
49  } // end 'SetParEtaRange(pair<double, double>)'
50 
51 
52 
53  void SCorrelatorJetTree::SetParEtaRange(const pair<double, double> etaRange) {
54 
55  m_parEtaRange[0] = etaRange.first;
56  m_parEtaRange[1] = etaRange.second;
57  return;
58 
59  } // end 'SetParEtaRange(pair<double, double>)'
60 
61 
62 
63  void SCorrelatorJetTree::SetTrackPtRange(const pair<double, double> ptRange) {
64 
65  m_trkPtRange[0] = ptRange.first;
66  m_trkPtRange[1] = ptRange.second;
67  return;
68 
69  } // end 'SetTrackPtRange(pair<double, double>)'
70 
71 
72 
73  void SCorrelatorJetTree::SetTrackEtaRange(const pair<double, double> etaRange) {
74 
75  m_trkEtaRange[0] = etaRange.first;
76  m_trkEtaRange[1] = etaRange.second;
77  return;
78 
79  } // end 'SetTrackEtaRange(pair<double, double>)'
80 
81 
82 
83  void SCorrelatorJetTree::SetTrackQualityRange(const pair<double, double> qualRange) {
84 
85  m_trkQualRange[0] = qualRange.first;
86  m_trkQualRange[1] = qualRange.second;
87  return;
88 
89  } // end 'SetTrackQualityRange(pair<double, double>)'
90 
91 
92 
93  void SCorrelatorJetTree::SetTrackNMvtxRange(const pair<double, double> nMvtxRange) {
94 
95  m_trkNMvtxRange[0] = nMvtxRange.first;
96  m_trkNMvtxRange[1] = nMvtxRange.second;
97  return;
98 
99  } // end 'SetTrackNMvtxRange(pair<double, double>)'
100 
101 
102 
103  void SCorrelatorJetTree::SetTrackNInttRange(const pair<double, double> nInttRange) {
104 
105  m_trkNInttRange[0] = nInttRange.first;
106  m_trkNInttRange[1] = nInttRange.second;
107  return;
108 
109  } // end 'SetTrackNInttRange(pair<double, double>)'
110 
111 
112 
113  void SCorrelatorJetTree::SetTrackNTpcRange(const pair<double, double> nTpcRange) {
114 
115  m_trkNTpcRange[0] = nTpcRange.first;
116  m_trkNTpcRange[1] = nTpcRange.second;
117  return;
118 
119  } // end SetTrackNTpcRange(pair<double, double>)'
120 
121 
122 
123  void SCorrelatorJetTree::SetTrackDcaRangeXY(const pair<double, double> dcaRangeXY) {
124 
125  m_trkDcaRangeXY[0] = dcaRangeXY.first;
126  m_trkDcaRangeXY[1] = dcaRangeXY.second;
127  return;
128 
129  } // end 'SetTrackDcaRangeXY(pair<double, double>)'
130 
131 
132 
133  void SCorrelatorJetTree::SetTrackDcaRangeZ(const pair<double, double> dcaRangeZ) {
134 
135  m_trkDcaRangeZ[0] = dcaRangeZ.first;
136  m_trkDcaRangeZ[1] = dcaRangeZ.second;
137  return;
138 
139  } // end 'SetTrackDcaRangeZ(pair<double, double>)'
140 
141 
142 
143  void SCorrelatorJetTree::SetTrackDeltaPtRange(const pair<double, double> deltaPtRange) {
144 
145  m_trkDeltaPtRange[0] = deltaPtRange.first;
146  m_trkDeltaPtRange[1] = deltaPtRange.second;
147  return;
148 
149  } // end 'SetTrackDeltaPtRange(pair<double, double>)'
150 
151 
152 
153  void SCorrelatorJetTree::SetTrackDcaSigmaParameters(const bool doDcaSigmaCut, const pair<double, double> ptFitMax, const pair<double, double> nSigma, const vector<double> paramDcaXY, const vector<double> paramDcaZ) {
154 
155  m_doDcaSigmaCut = doDcaSigmaCut;
156  m_dcaPtFitMaxXY = ptFitMax.first;
157  m_dcaPtFitMaxZ = ptFitMax.second;
158  m_nSigCutXY = nSigma.first;
159  m_nSigCutZ = nSigma.second;
160  for (uint8_t iParam = 0; iParam < CONST::NParam; iParam++) {
161 
162  // try to set dca xy values
163  try {
164  m_parSigDcaXY[iParam] = paramDcaXY.at(iParam);
165  } catch (std::out_of_range &out) {
166  cerr << "SCorrelatorJetTree::SetTrackDcaSigmaParameters: WARNING!\n"
167  << " Tried to pass a vector of wrong size for sigma dca xy fit parameters!\n"
168  << " Size of vector was " << paramDcaXY.size() << " but should've been " << CONST::NParam << "..."
169  << endl;
170  assert(paramDcaXY.size() == CONST::NParam);
171  }
172 
173  // try to set dca z values
174  try {
175  m_parSigDcaZ[iParam] = paramDcaZ.at(iParam);
176  } catch (std::out_of_range &out) {
177  cerr << "SCorrelatorJetTree::SetTrackDcaSigmaParameters: WARNING!\n"
178  << " Tried to pass a vector of wrong size for sigma dca z fit parameters!\n"
179  << " Size of vector was " << paramDcaZ.size() << " but should've been " << CONST::NParam << "..."
180  << endl;
181  assert(paramDcaZ.size() == CONST::NParam);
182  }
183  } // end parameter loop
184  return;
185 
186  } // end 'SetTrackDcaSigmaParameters(bool, pair<double, double>, pair<double, double>, vector<double>, vector<double>)'
187 
188 
189 
190  void SCorrelatorJetTree::SetFlowPtRange(const pair<double, double> ptRange) {
191 
192  m_flowPtRange[0] = ptRange.first;
193  m_flowPtRange[1] = ptRange.second;
194  return;
195 
196  } // end 'SetFlowPtRange(pair<double, double>)'
197 
198 
199 
200  void SCorrelatorJetTree::SetFlowEtaRange(const pair<double, double> etaRange) {
201 
202  m_flowEtaRange[0] = etaRange.first;
203  m_flowEtaRange[1] = etaRange.second;
204  return;
205 
206  } // end 'SetFlowEtaRange(pair<double, double>)'
207 
208 
209 
210  void SCorrelatorJetTree::SetECalPtRange(const pair<double, double> ptRange) {
211 
212  m_ecalPtRange[0] = ptRange.first;
213  m_ecalPtRange[1] = ptRange.second;
214  return;
215 
216  } // end 'SetECalPtRange(pair<double, double>)'
217 
218 
219 
220  void SCorrelatorJetTree::SetECalEtaRange(const pair<double, double> etaRange) {
221 
222  m_ecalEtaRange[0] = etaRange.first;
223  m_ecalEtaRange[1] = etaRange.second;
224  return;
225 
226  } // end 'SetECalEtaRange(pair<double, double>)'
227 
228 
229 
230  void SCorrelatorJetTree::SetHCalPtRange(const pair<double, double> ptRange) {
231 
232  m_hcalPtRange[0] = ptRange.first;
233  m_hcalPtRange[1] = ptRange.second;
234  return;
235 
236  } // end 'SetHCalPtRange(pair<double, double>)'
237 
238 
239 
240  void SCorrelatorJetTree::SetHCalEtaRange(const pair<double, double> etaRange) {
241 
242  m_hcalEtaRange[0] = etaRange.first;
243  m_hcalEtaRange[1] = etaRange.second;
244  return;
245 
246  } // end 'SetHCalEtaRange(pair<double, double>)'
247 
248 
249 
250  void SCorrelatorJetTree::SetJetAlgo(const ALGO jetAlgo) {
251 
252  switch (jetAlgo) {
253  case ALGO::ANTIKT:
254  m_jetAlgo = fastjet::antikt_algorithm;
255  break;
256  case ALGO::KT:
257  m_jetAlgo = fastjet::kt_algorithm;
258  break;
259  case ALGO::CAMBRIDGE:
260  m_jetAlgo = fastjet::cambridge_algorithm;
261  break;
262  default:
263  m_jetAlgo = fastjet::antikt_algorithm;
264  break;
265  }
266  return;
267 
268  } // end 'SetJetAlgo(ALGO)'
269 
270 
271 
272  void SCorrelatorJetTree::SetRecombScheme(const RECOMB recombScheme) {
273 
274  switch(recombScheme) {
275  case RECOMB::E_SCHEME:
276  m_recombScheme = fastjet::E_scheme;
277  break;
278  case RECOMB::PT_SCHEME:
279  m_recombScheme = fastjet::pt_scheme;
280  break;
281  case RECOMB::PT2_SCHEME:
282  m_recombScheme = fastjet::pt2_scheme;
283  break;
284  case RECOMB::ET_SCHEME:
285  m_recombScheme = fastjet::Et_scheme;
286  break;
287  case RECOMB::ET2_SCHEME:
288  m_recombScheme = fastjet::Et2_scheme;
289  break;
290  default:
291  m_recombScheme = fastjet::E_scheme;
292  break;
293  }
294  return;
295 
296  } // end 'setRecombScheme(RECOMB)'
297 
298 
299 
300  void SCorrelatorJetTree::SetJetParameters(const double rJet, uint32_t jetType, const ALGO jetAlgo, const RECOMB recombScheme) {
301 
302  SetJetR(rJet);
303  SetJetType(jetType);
304  SetJetAlgo(jetAlgo);
305  SetRecombScheme(recombScheme);
306  return;
307 
308  } // end 'setJetParameters(double, unint32_t, ALGO, RECOMB)'
309 
310 } // end SColdQcdCorrelatorAnalysis namespace
311 
312 // end ------------------------------------------------------------------------