65 std::shared_ptr<o2::steer::MCKinematicsReader> kineReader,
66 std::shared_ptr<o2::base::GRPGeomRequest> gr) : mDataRequest(dr), mTracksSrc(
src), mUseMC(useMC), mKineReader(kineReader), mGGCCDBRequest(gr){};
74 void stileEfficiencyGraph(
std::unique_ptr<TEfficiency>& eff, const
char*
name, const
char* title,
bool bidimensional, const
int markerStyle, const
double markersize, const
int markercolor, const
int linercolor);
85 bool mVerboseOutput =
false;
87 std::string mOutFileName;
89 std::shared_ptr<o2::steer::MCKinematicsReader> mKineReader;
92 float mrangesPt[
NLAYERS][2] = {{0., 0.5}, {0.5, 2.}, {2., 7.5}};
95 gsl::span<const o2::itsmft::ROFRecord> mTracksROFRecords;
96 gsl::span<const o2::itsmft::ROFRecord> mClustersROFRecords;
97 gsl::span<const o2::its::TrackITS> mTracks;
98 gsl::span<const o2::MCCompLabel> mTracksMCLabels;
99 gsl::span<const o2::itsmft::CompClusterExt> mClusters;
100 gsl::span<const unsigned char> mClusPatterns;
101 gsl::span<const int> mInputITSidxs;
103 std::vector<o2::BaseCluster<float>> mITSClustersArray;
107 std::shared_ptr<DataRequest> mDataRequest;
110 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
111 std::unique_ptr<TFile> mOutFile;
112 int mDuplicated_layer[
NLAYERS] = {0};
117 std::unique_ptr<TH1D> mDCAxyOriginal[
NLAYERS];
118 std::unique_ptr<TH1D> mDCAzOriginal[
NLAYERS];
120 std::unique_ptr<TH1D> mDCAxyDuplicated;
121 std::unique_ptr<TH1D> mDCAzDuplicated;
124 std::unique_ptr<TH1D> mDCAxyDuplicated_layer[
NLAYERS];
125 std::unique_ptr<TH1D> mDCAzDuplicated_layer[
NLAYERS];
128 std::unique_ptr<TH1D> mPhiOriginal[
NLAYERS];
129 std::unique_ptr<TH1D> mEtaOriginal[
NLAYERS];
130 std::unique_ptr<TH1D> mPtOriginal[
NLAYERS];
131 std::unique_ptr<TH1D> mPtDuplicated[
NLAYERS];
132 std::unique_ptr<TH1D> mEtaDuplicated[
NLAYERS];
133 std::unique_ptr<TH1D> mPhiDuplicated[
NLAYERS];
134 std::unique_ptr<TH1D> mPhiOriginalIfDuplicated[
NLAYERS];
136 std::unique_ptr<TH2D> mZvsPhiDUplicated[
NLAYERS];
139 std::unique_ptr<TH3D> m3DClusterPositions;
140 std::unique_ptr<TH3D> m3DDuplicatedClusterPositions;
141 std::unique_ptr<TH2D> m2DClusterOriginalPositions;
142 std::unique_ptr<TH2D> m2DClusterDuplicatedPositions;
145 std::unique_ptr<TH1D> mEfficiencyGoodMatch;
146 std::unique_ptr<TH1D> mEfficiencyFakeMatch;
147 std::unique_ptr<TH1D> mEfficiencyTotal;
148 std::unique_ptr<TH1D> mEfficiencyGoodMatch_layer[
NLAYERS];
149 std::unique_ptr<TH1D> mEfficiencyFakeMatch_layer[
NLAYERS];
150 std::unique_ptr<TH1D> mEfficiencyTotal_layer[
NLAYERS];
151 std::unique_ptr<TH2D> mEfficiencyGoodMatchPt_layer[
NLAYERS];
152 std::unique_ptr<TH2D> mEfficiencyFakeMatchPt_layer[
NLAYERS];
153 std::unique_ptr<TH2D> mEfficiencyGoodMatchEta_layer[
NLAYERS];
154 std::unique_ptr<TH2D> mEfficiencyFakeMatchEta_layer[
NLAYERS];
155 std::unique_ptr<TH2D> mEfficiencyGoodMatchPhi_layer[
NLAYERS];
156 std::unique_ptr<TH2D> mEfficiencyGoodMatchPhiOriginal_layer[
NLAYERS];
157 std::unique_ptr<TH2D> mEfficiencyFakeMatchPhi_layer[
NLAYERS];
160 std::unique_ptr<TH2D> mDenColEta[
NLAYERS];
161 std::unique_ptr<TH2D> mNumColEta[
NLAYERS];
162 std::unique_ptr<TH2D> mDenRowPhi[
NLAYERS];
163 std::unique_ptr<TH2D> mNumRowPhi[
NLAYERS];
164 std::unique_ptr<TH2D> mDenRowCol[
NLAYERS];
165 std::unique_ptr<TH2D> mNumRowCol[
NLAYERS];
168 std::unique_ptr<TH2D> mPt_EtaDupl[
NLAYERS];
171 std::unique_ptr<TH1D> mDuplicatedEtaAllPt[
NLAYERS];
172 std::unique_ptr<TH1D> mDuplicatedEta[
NLAYERS][3];
173 std::unique_ptr<TH1D> mDuplicatedPhiAllPt[
NLAYERS];
174 std::unique_ptr<TH1D> mDuplicatedPhi[
NLAYERS][3];
175 std::unique_ptr<TH1D> mDuplicatedPt[
NLAYERS];
176 std::unique_ptr<TH1D> mDuplicatedRow[
NLAYERS];
177 std::unique_ptr<TH1D> mDuplicatedCol[
NLAYERS];
178 std::unique_ptr<TH1D> mDuplicatedZ[
NLAYERS];
179 std::unique_ptr<TH2D> mDuplicatedPtEta[
NLAYERS];
180 std::unique_ptr<TH2D> mDuplicatedPtPhi[
NLAYERS];
181 std::unique_ptr<TH2D> mDuplicatedEtaPhi[
NLAYERS];
184 std::unique_ptr<TH1D> mNGoodMatchesEtaAllPt[
NLAYERS];
185 std::unique_ptr<TH1D> mNGoodMatchesEta[
NLAYERS][3];
186 std::unique_ptr<TH1D> mNGoodMatchesPhiAllPt[
NLAYERS];
187 std::unique_ptr<TH1D> mNGoodMatchesPhi[
NLAYERS][3];
189 std::unique_ptr<TH1D> mNFakeMatchesEtaAllPt[
NLAYERS];
190 std::unique_ptr<TH1D> mNFakeMatchesEta[
NLAYERS][3];
191 std::unique_ptr<TH1D> mNFakeMatchesPhiAllPt[
NLAYERS];
192 std::unique_ptr<TH1D> mNFakeMatchesPhi[
NLAYERS][3];
194 std::unique_ptr<TH1D> mNGoodMatchesPt[
NLAYERS];
195 std::unique_ptr<TH1D> mNFakeMatchesPt[
NLAYERS];
197 std::unique_ptr<TH1D> mNGoodMatchesRow[
NLAYERS];
198 std::unique_ptr<TH1D> mNFakeMatchesRow[
NLAYERS];
200 std::unique_ptr<TH1D> mNGoodMatchesCol[
NLAYERS];
201 std::unique_ptr<TH1D> mNFakeMatchesCol[
NLAYERS];
203 std::unique_ptr<TH1D> mNGoodMatchesZ[
NLAYERS];
204 std::unique_ptr<TH1D> mNFakeMatchesZ[
NLAYERS];
206 std::unique_ptr<TH2D> mNGoodMatchesPtEta[
NLAYERS];
207 std::unique_ptr<TH2D> mNFakeMatchesPtEta[
NLAYERS];
209 std::unique_ptr<TH2D> mNGoodMatchesPtPhi[
NLAYERS];
210 std::unique_ptr<TH2D> mNFakeMatchesPtPhi[
NLAYERS];
212 std::unique_ptr<TH2D> mNGoodMatchesEtaPhi[
NLAYERS];
213 std::unique_ptr<TH2D> mNFakeMatchesEtaPhi[
NLAYERS];
216 std::unique_ptr<TEfficiency> mEffPtGood[
NLAYERS];
217 std::unique_ptr<TEfficiency> mEffPtFake[
NLAYERS];
218 std::unique_ptr<TEfficiency> mEffRowGood[
NLAYERS];
219 std::unique_ptr<TEfficiency> mEffRowFake[
NLAYERS];
220 std::unique_ptr<TEfficiency> mEffColGood[
NLAYERS];
221 std::unique_ptr<TEfficiency> mEffColFake[
NLAYERS];
222 std::unique_ptr<TEfficiency> mEffZGood[
NLAYERS];
223 std::unique_ptr<TEfficiency> mEffZFake[
NLAYERS];
224 std::unique_ptr<TEfficiency> mEffPtEtaGood[
NLAYERS];
225 std::unique_ptr<TEfficiency> mEffPtEtaFake[
NLAYERS];
226 std::unique_ptr<TEfficiency> mEffPtPhiGood[
NLAYERS];
227 std::unique_ptr<TEfficiency> mEffPtPhiFake[
NLAYERS];
228 std::unique_ptr<TEfficiency> mEffEtaPhiGood[
NLAYERS];
229 std::unique_ptr<TEfficiency> mEffEtaPhiFake[
NLAYERS];
231 std::unique_ptr<TEfficiency> mEffEtaGoodAllPt[
NLAYERS];
232 std::unique_ptr<TEfficiency> mEffEtaGood[
NLAYERS][3];
233 std::unique_ptr<TEfficiency> mEffEtaFakeAllPt[
NLAYERS];
234 std::unique_ptr<TEfficiency> mEffEtaFake[
NLAYERS][3];
236 std::unique_ptr<TEfficiency> mEffPhiGoodAllPt[
NLAYERS];
237 std::unique_ptr<TEfficiency> mEffPhiGood[
NLAYERS][3];
238 std::unique_ptr<TEfficiency> mEffPhiFakeAllPt[
NLAYERS];
239 std::unique_ptr<TEfficiency> mEffPhiFake[
NLAYERS][3];
241 std::unique_ptr<TH2D> mnGoodMatchesPt_layer[
NLAYERS];
242 std::unique_ptr<TH2D> mnFakeMatchesPt_layer[
NLAYERS];
244 std::unique_ptr<TH2D> mnGoodMatchesEta_layer[
NLAYERS];
245 std::unique_ptr<TH2D> mnFakeMatchesEta_layer[
NLAYERS];
247 std::unique_ptr<TH2D> mnGoodMatchesPhi_layer[
NLAYERS];
248 std::unique_ptr<TH2D> mnGoodMatchesPhiOriginal_layer[
NLAYERS];
249 std::unique_ptr<TH2D> mnFakeMatchesPhi_layer[
NLAYERS];
251 std::unique_ptr<TH1D> DCAxyData[
NLAYERS];
252 std::unique_ptr<TH1D> DCAzData[
NLAYERS];
254 std::unique_ptr<TH1D> DCAxyRejected[
NLAYERS];
255 std::unique_ptr<TH1D> DCAzRejected[
NLAYERS];
257 std::unique_ptr<TH1D> denPt[
NLAYERS];
258 std::unique_ptr<TH1D> numPt[
NLAYERS];
259 std::unique_ptr<TH1D> numPtGood[
NLAYERS];
260 std::unique_ptr<TH1D> numPtFake[
NLAYERS];
262 std::unique_ptr<TH1D> denPhi[
NLAYERS];
263 std::unique_ptr<TH1D> numPhi[
NLAYERS];
264 std::unique_ptr<TH1D> numPhiGood[
NLAYERS];
265 std::unique_ptr<TH1D> numPhiFake[
NLAYERS];
267 std::unique_ptr<TH1D> denEta[
NLAYERS];
268 std::unique_ptr<TH1D> numEta[
NLAYERS];
269 std::unique_ptr<TH1D> numEtaGood[
NLAYERS];
270 std::unique_ptr<TH1D> numEtaFake[
NLAYERS];
272 std::unique_ptr<TH1D> denRow[
NLAYERS];
273 std::unique_ptr<TH1D> numRow[
NLAYERS];
274 std::unique_ptr<TH1D> numRowGood[
NLAYERS];
275 std::unique_ptr<TH1D> numRowFake[
NLAYERS];
277 std::unique_ptr<TH1D> denCol[
NLAYERS];
278 std::unique_ptr<TH1D> numCol[
NLAYERS];
279 std::unique_ptr<TH1D> numColGood[
NLAYERS];
280 std::unique_ptr<TH1D> numColFake[
NLAYERS];
281 std::unique_ptr<TH1D> denZ[
NLAYERS];
282 std::unique_ptr<TH1D> numZ[
NLAYERS];
283 std::unique_ptr<TH1D> numZGood[
NLAYERS];
284 std::unique_ptr<TH1D> numZFake[
NLAYERS];
286 std::unique_ptr<TH1D> numLayers;
287 std::unique_ptr<TH1D> denLayers;
288 std::unique_ptr<TH1D> numGoodLayers;
289 std::unique_ptr<TH1D> numFakeLayers;
291 int nDuplicatedClusters[
NLAYERS] = {0};
292 int nTracksSelected[
NLAYERS] = {0};
294 std::unique_ptr<TH1D> IPOriginalxy[
NLAYERS];
295 std::unique_ptr<TH1D> IPOriginalz[
NLAYERS];
297 std::unique_ptr<TH1D> chipRowDuplicated[
NLAYERS];
298 std::unique_ptr<TH1D> chipRowOriginalIfDuplicated[
NLAYERS];
300 std::unique_ptr<TH1D> chi2trackAccepted;
303 std::unique_ptr<TH1D> phiFound[
NLAYERS];
304 std::unique_ptr<TH1D> rowFound[
NLAYERS];
305 std::unique_ptr<TH1D> phiNotFound[
NLAYERS];
306 std::unique_ptr<TH1D> rowNotFound[
NLAYERS];
307 std::unique_ptr<TH1D> zFound[
NLAYERS];
308 std::unique_ptr<TH1D> zNotFound[
NLAYERS];
309 std::unique_ptr<TH2D> colFoundOriginalVsDuplicated[
NLAYERS];
310 std::unique_ptr<TH1D> colFoundOriginal[
NLAYERS];
311 std::unique_ptr<TH1D> colNotFound[
NLAYERS];
312 std::unique_ptr<TH1D> radiusFound[
NLAYERS];
313 std::unique_ptr<TH1D> radiusNotFound[
NLAYERS];
314 std::unique_ptr<TH2D> m2DClusterFoundPositions;
315 std::unique_ptr<TH2D> m2DClusterNotFoundPositions;
316 std::unique_ptr<TH1D> mChipNotFound;
317 std::unique_ptr<TH1D> mChipFound;
318 std::unique_ptr<TH2D> l0_00;
319 std::unique_ptr<TH2D> l1_15;
320 std::unique_ptr<TH2D> l2_19;
321 std::unique_ptr<TH2D> chipOrigVsOverlap;
322 std::unique_ptr<TH2D> chipmap;
332 mOutFileName = pars.outFileName;
336 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
337 double a = std::log(ptcuth / ptcutl) / nbPt;
338 for (
int i = 0;
i <= nbPt;
i++) {
339 xbins[
i] = ptcutl * std::exp(
i *
a);
342 mOutFile = std::make_unique<TFile>(mOutFileName.c_str(),
"recreate");
344 mDCAxyDuplicated = std::make_unique<TH1D>(
"dcaXYDuplicated",
"Distance between track and duplicated cluster ;DCA xy (cm); ", 200, -0.01, 0.01);
345 mDCAzDuplicated = std::make_unique<TH1D>(
"dcaZDuplicated",
"Distance between track and duplicated cluster ;DCA z (cm); ", 200, -0.01, 0.01);
347 m3DClusterPositions = std::make_unique<TH3D>(
"3DClusterPositions",
";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 400, -20, 20);
348 m3DDuplicatedClusterPositions = std::make_unique<TH3D>(
"3DDuplicatedClusterPositions",
";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 500, -30, 30);
349 m2DClusterOriginalPositions = std::make_unique<TH2D>(
"m2DClusterOriginalPositions",
";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
350 m2DClusterDuplicatedPositions = std::make_unique<TH2D>(
"m2DClusterDuplicatedPositions",
";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
352 mEfficiencyGoodMatch = std::make_unique<TH1D>(
"mEfficiencyGoodMatch",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
353 mEfficiencyFakeMatch = std::make_unique<TH1D>(
"mEfficiencyFakeMatch",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
354 mEfficiencyTotal = std::make_unique<TH1D>(
"mEfficiencyTotal",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
356 chi2trackAccepted = std::make_unique<TH1D>(
"chi2trackAccepted",
"; $#chi^{2}", 500, 0, 100);
358 m2DClusterFoundPositions = std::make_unique<TH2D>(
"m2DClusterFoundPositions",
";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
359 m2DClusterNotFoundPositions = std::make_unique<TH2D>(
"m2DClusterNotFoundPositions",
";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
360 mChipNotFound = std::make_unique<TH1D>(
"mChipNotFound",
";chipID", 432, 0, 432);
361 mChipFound = std::make_unique<TH1D>(
"mChipFound",
";chipID", 432, 0, 432);
362 l0_00 = std::make_unique<TH2D>(
"l0_00",
";col; row", 2304, -0.5, 9215.5, 128, -0.5, 511.5);
363 l1_15 = std::make_unique<TH2D>(
"l1_15",
";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
364 l2_19 = std::make_unique<TH2D>(
"l2_19",
";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
365 chipOrigVsOverlap = std::make_unique<TH2D>(
"chipOrigVsOverlap",
";chipID Overlap;chipID Original", 9, 0, 9, 9, 0, 9);
366 chipmap = std::make_unique<TH2D>(
"chipmap",
";Column;Row", 1024, 0, 1023, 512, -0.5, 511.5);
368 numLayers = std::make_unique<TH1D>(
"numLayers",
"numLayers; ; Efficiency", 3, -0.5, 2.5);
369 numGoodLayers = std::make_unique<TH1D>(
"numGoodLayers",
"numGoodLayers; ; Efficiency", 3, -0.5, 2.5);
370 numFakeLayers = std::make_unique<TH1D>(
"numFakeLayers",
"numFakeLayers; ; Efficiency", 3, -0.5, 2.5);
371 denLayers = std::make_unique<TH1D>(
"denLayers",
"denLayers; ; Efficiency", 3, -0.5, 2.5);
375 chipRowDuplicated[
i] = std::make_unique<TH1D>(Form(
"chipPosDuplicated_L%d",
i), Form(
"L%d; row",
i), 512, -0.5, 511.5);
376 chipRowOriginalIfDuplicated[
i] = std::make_unique<TH1D>(Form(
"chipPosOriginalIfDuplicated%d",
i), Form(
"L%d; row",
i), 512, -0.5, 511.5);
378 DCAxyData[
i] = std::make_unique<TH1D>(Form(
"dcaXYData_L%d",
i),
"Distance between track and original cluster ;DCA xy (cm); ", 4000, -0.2, 0.2);
379 DCAzData[
i] = std::make_unique<TH1D>(Form(
"dcaZData_L%d",
i),
"Distance between track and original cluster ;DCA z (cm); ", 4000, -0.2, 0.2);
380 DCAxyRejected[
i] = std::make_unique<TH1D>(Form(
"DCAxyRejected%d",
i),
"Distance between track and original cluster (rejected) ;DCA xy (cm); ", 30000, -30, 30);
381 DCAzRejected[
i] = std::make_unique<TH1D>(Form(
"DCAzRejected%d",
i),
"Distance between track and original cluster (rejected) ;DCA z (cm); ", 30000, -30, 30);
383 mDCAxyOriginal[
i] = std::make_unique<TH1D>(Form(
"dcaXYOriginal_L%d",
i),
"Distance between track and original cluster ;DCA xy (cm); ", 200, -0.01, 0.01);
384 mDCAzOriginal[
i] = std::make_unique<TH1D>(Form(
"dcaZOriginal_L%d",
i),
"Distance between track and original cluster ;DCA z (cm); ", 200, -0.01, 0.01);
386 mPhiOriginal[
i] = std::make_unique<TH1D>(Form(
"phiOriginal_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
387 mEtaOriginal[
i] = std::make_unique<TH1D>(Form(
"etaOriginal_L%d",
i),
";eta (rad); ", 100, -2, 2);
388 mPtOriginal[
i] = std::make_unique<TH1D>(Form(
"ptOriginal_L%d",
i),
";pt (GeV/c); ", 100, 0, 10);
390 mZvsPhiDUplicated[
i] = std::make_unique<TH2D>(Form(
"zvsphiDuplicated_L%d",
i),
";z (cm);phi (rad)", 400, -20, 20, 90, -3.2, 3.2);
392 mPtDuplicated[
i] = std::make_unique<TH1D>(Form(
"ptDuplicated_L%d",
i),
";pt (GeV/c); ", nbPt, 0, 7.5);
393 mEtaDuplicated[
i] = std::make_unique<TH1D>(Form(
"etaDuplicated_L%d",
i),
";eta; ", 40, -2, 2);
394 mPhiDuplicated[
i] = std::make_unique<TH1D>(Form(
"phiDuplicated_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
395 mPhiOriginalIfDuplicated[
i] = std::make_unique<TH1D>(Form(
"phiOriginalIfDuplicated_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
396 mDCAxyDuplicated_layer[
i] = std::make_unique<TH1D>(Form(
"dcaXYDuplicated_layer_L%d",
i),
"Distance between track and duplicated cluster ;DCA xy (cm); ", 100, -0.01, 0.01);
397 mDCAzDuplicated_layer[
i] = std::make_unique<TH1D>(Form(
"dcaZDuplicated_layer_L%d",
i),
"Distance between track and duplicated cluster ;DCA z (cm); ", 100, -0.01, 0.01);
399 mEfficiencyGoodMatch_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyGoodMatch_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
400 mEfficiencyFakeMatch_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyFakeMatch_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
401 mEfficiencyTotal_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyTotal_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
403 mEfficiencyGoodMatchPt_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyGoodMatchPt_layer_L%d",
i),
";#it{p}_{T} (GeV/c);#sigma(DCA) cut;Efficiency;", nbPt, 0, 7.5, 20, 0.5, 20.5);
404 mEfficiencyFakeMatchPt_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyFakeMatchPt_layer_L%d",
i),
";#it{p}_{T} (GeV/c);#sigma(DCA) cut;Efficiency;", nbPt, 0, 7.5, 20, 0.5, 20.5);
406 mEfficiencyGoodMatchEta_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyGoodMatchEta_layer_L%d",
i),
";#eta;#sigma(DCA) cut;Efficiency;", 40, -2, 2, 20, 0.5, 20.5);
407 mEfficiencyFakeMatchEta_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyFakeMatchEta_layer_L%d",
i),
";#eta;#sigma(DCA) cut;Efficiency;", 40, -2, 2, 20, 0.5, 20.5);
409 mEfficiencyGoodMatchPhi_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyGoodMatchPhi_layer_L%d",
i),
";#phi;#sigma(DCA) cut;Efficiency;", 90, -3.2, 3.2, 20, 0.5, 20.5);
410 mEfficiencyGoodMatchPhiOriginal_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyGoodMatchPhiOriginal_layer_L%d",
i),
";#phi Original;#sigma(DCA) cut;Efficiency;", 90, -3.2, 3.2, 20, 0.5, 20.5);
411 mEfficiencyFakeMatchPhi_layer[
i] = std::make_unique<TH2D>(Form(
"mEfficiencyFakeMatchPhi_layer_L%d",
i),
";#phi;#sigma(DCA) cut;Efficiency;", 90, -3.2, 3.2, 20, 0.5, 20.5);
413 mPt_EtaDupl[
i] = std::make_unique<TH2D>(Form(
"mPt_EtaDupl_L%d",
i),
";#it{p}_{T} (GeV/c);#eta; ", 100, 0, 10, 100, -2, 2);
415 mDuplicatedPt[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedPt_log_L%d",
i), Form(
"; #it{p}_{T} (GeV/c); Number of duplciated clusters L%d",
i), nbPt, 0, 7.5 );
416 mDuplicatedPt[
i]->Sumw2();
417 mNGoodMatchesPt[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesPt_L%d",
i), Form(
"; #it{p}_{T} (GeV/c); Number of good matches L%d",
i), nbPt, 0, 7.5 );
418 mNGoodMatchesPt[
i]->Sumw2();
419 mNFakeMatchesPt[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesPt_L%d",
i), Form(
"; #it{p}_{T} (GeV/c); Number of fake matches L%d",
i), nbPt, 0, 7.5 );
420 mNFakeMatchesPt[
i]->Sumw2();
422 mDuplicatedRow[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedRow_L%d",
i), Form(
"; Row; Number of duplciated clusters L%d",
i), 128, -0.5, 511.5);
423 mDuplicatedRow[
i]->Sumw2();
424 mNGoodMatchesRow[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesRow_L%d",
i), Form(
"; Row; Number of good matches L%d",
i), 128, -0.5, 511.5);
425 mNGoodMatchesRow[
i]->Sumw2();
426 mNFakeMatchesRow[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesRow_L%d",
i), Form(
";Row; Number of fake matches L%d",
i), 128, -0.5, 511.5);
427 mNFakeMatchesRow[
i]->Sumw2();
429 mDuplicatedCol[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedCol_L%d",
i), Form(
"; Col; Number of duplciated clusters L%d",
i), 128, -0.5, 1023.5);
430 mDuplicatedCol[
i]->Sumw2();
431 mNGoodMatchesCol[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesCol_L%d",
i), Form(
"; Col; Number of good matches L%d",
i), 128, -0.5, 1023.5);
432 mNGoodMatchesCol[
i]->Sumw2();
433 mNFakeMatchesCol[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesCol_L%d",
i), Form(
";Col; Number of fake matches L%d",
i), 128, -0.5, 1023.5);
434 mNFakeMatchesCol[
i]->Sumw2();
436 mDuplicatedZ[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedZ_L%d",
i), Form(
"; Z (cm); Number of duplciated clusters L%d",
i), 100, -15, 15);
437 mDuplicatedZ[
i]->Sumw2();
438 mNGoodMatchesZ[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesZ_L%d",
i), Form(
"; Z (cm); Number of good matches L%d",
i), 100, -15, 15);
439 mNGoodMatchesZ[
i]->Sumw2();
440 mNFakeMatchesZ[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesZ_L%d",
i), Form(
";Z (cm); Number of fake matches L%d",
i), 100, -15, 15);
441 mNFakeMatchesZ[
i]->Sumw2();
443 mDuplicatedPtEta[
i] = std::make_unique<TH2D>(Form(
"mDuplicatedPtEta_log_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#eta; Number of duplciated clusters L%d",
i), nbPt, 0, 7.5 , 40, -2, 2);
444 mDuplicatedPtEta[
i]->Sumw2();
445 mNGoodMatchesPtEta[
i] = std::make_unique<TH2D>(Form(
"mNGoodMatchesPtEta_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#eta; Number of good matches L%d",
i), nbPt, 0, 7.5 , 40, -2, 2);
446 mNGoodMatchesPtEta[
i]->Sumw2();
447 mNFakeMatchesPtEta[
i] = std::make_unique<TH2D>(Form(
"mNFakeMatchesPtEta_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#eta; Number of good matches L%d",
i), nbPt, 0, 7.5 , 40, -2, 2);
448 mNFakeMatchesPtEta[
i]->Sumw2();
450 mDuplicatedPtPhi[
i] = std::make_unique<TH2D>(Form(
"mDuplicatedPtPhi_log_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#phi (rad); Number of duplciated clusters L%d",
i), nbPt, 0, 7.5 , 90, -3.2, 3.2);
451 mDuplicatedPtPhi[
i]->Sumw2();
452 mNGoodMatchesPtPhi[
i] = std::make_unique<TH2D>(Form(
"mNGoodMatchesPtPhi_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#phi (rad); Number of good matches L%d",
i), nbPt, 0, 7.5 , 90, -3.2, 3.2);
453 mNGoodMatchesPtPhi[
i]->Sumw2();
454 mNFakeMatchesPtPhi[
i] = std::make_unique<TH2D>(Form(
"mNFakeMatchesPtPhi_L%d",
i), Form(
"; #it{p}_{T} (GeV/c);#phi (rad); Number of good matches L%d",
i), nbPt, 0, 7.5 , 90, -3.2, 3.2);
455 mNFakeMatchesPtPhi[
i]->Sumw2();
457 mDuplicatedEtaPhi[
i] = std::make_unique<TH2D>(Form(
"mDuplicatedEtaPhi_L%d",
i), Form(
"; #eta;#phi (rad); Number of duplciated clusters L%d",
i), 40, -2, 2, 90, -3.2, 3.2);
458 mDuplicatedEtaPhi[
i]->Sumw2();
459 mNGoodMatchesEtaPhi[
i] = std::make_unique<TH2D>(Form(
"mNGoodMatchesEtaPhi_L%d",
i), Form(
"; #eta;#phi (rad); Number of good matches L%d",
i), 40, -2, 2, 90, -3.2, 3.2);
460 mNGoodMatchesEtaPhi[
i]->Sumw2();
461 mNFakeMatchesEtaPhi[
i] = std::make_unique<TH2D>(Form(
"mNFakeMatchesEtaPhi_L%d",
i), Form(
"; #eta;#phi (rad); Number of good matches L%d",
i), 40, -2, 2, 90, -3.2, 3.2);
462 mNFakeMatchesEtaPhi[
i]->Sumw2();
464 mDuplicatedEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedEtaAllPt_L%d",
i), Form(
"; #eta; Number of duplicated clusters L%d",
i), 40, -2, 2);
465 mNGoodMatchesEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesEtaAllPt_L%d",
i), Form(
"; #eta; Number of good matches L%d",
i), 40, -2, 2);
466 mNFakeMatchesEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesEtaAllPt_L%d",
i), Form(
"; #eta; Number of fake matches L%d",
i), 40, -2, 2);
468 mDuplicatedPhiAllPt[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedPhiAllPt_L%d",
i), Form(
"; #phi (rad); Number of duplicated clusters L%d",
i), 90, -3.2, 3.2);
469 mNGoodMatchesPhiAllPt[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesPhiAllPt_L%d",
i), Form(
"; #phi (rad); Number of good matches L%d",
i), 90, -3.2, 3.2);
470 mNFakeMatchesPhiAllPt[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesPhiAllPt_L%d",
i), Form(
"; #phi (rad); Number of fake matches L%d",
i), 90, -3.2, 3.2);
472 mnGoodMatchesPt_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesPt_layer_L%d",
i),
";pt; nGoodMatches", nbPt, 0, 7.5 , 20, 0.5, 20.5);
473 mnFakeMatchesPt_layer[
i] = std::make_unique<TH2D>(Form(
"mnFakeMatchesPt_layer_L%d",
i),
";pt; nFakeMatches", nbPt, 0, 7.5 , 20, 0.5, 20.5);
474 mnGoodMatchesEta_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesEta_layer_L%d",
i),
";#eta; nGoodMatches", 40, -2, 2, 20, 0.5, 20.5);
475 mnFakeMatchesEta_layer[
i] = std::make_unique<TH2D>(Form(
"mnFakeMatchesEta_layer_L%d",
i),
";#eta; nFakeMatches", 40, -2, 2, 20, 0.5, 20.5);
476 mnGoodMatchesPhi_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesPhi_layer_L%d",
i),
";#Phi; nGoodMatches", 90, -3.2, 3.2, 20, 0.5, 20.5);
477 mnGoodMatchesPhiOriginal_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesPhiOriginal_layer_L%d",
i),
";#Phi of the original Cluster; nGoodMatches", 90, -3.2, 3.2, 20, 0.5, 20.5);
478 mnFakeMatchesPhi_layer[
i] = std::make_unique<TH2D>(Form(
"mnFakeMatchesPhi_layer_L%d",
i),
";#Phi; nFakeMatches", 90, -3.2, 3.2, 20, 0.5, 20.5);
480 denPt[
i] = std::make_unique<TH1D>(Form(
"denPt_L%d",
i), Form(
"denPt_L%d",
i), nbPt, 0, 7.5 );
481 numPt[
i] = std::make_unique<TH1D>(Form(
"numPt_L%d",
i), Form(
"numPt_L%d",
i), nbPt, 0, 7.5 );
482 numPtGood[
i] = std::make_unique<TH1D>(Form(
"numPtGood_L%d",
i), Form(
"numPtGood_L%d",
i), nbPt, 0, 7.5 );
483 numPtFake[
i] = std::make_unique<TH1D>(Form(
"numPtFake_L%d",
i), Form(
"numPtFake_L%d",
i), nbPt, 0, 7.5 );
485 denPhi[
i] = std::make_unique<TH1D>(Form(
"denPhi_L%d",
i), Form(
"denPhi_L%d",
i), 90, -3.2, 3.2);
486 numPhi[
i] = std::make_unique<TH1D>(Form(
"numPhi_L%d",
i), Form(
"numPhi_L%d",
i), 90, -3.2, 3.2);
487 numPhiGood[
i] = std::make_unique<TH1D>(Form(
"numPhiGood_L%d",
i), Form(
"numPhiGood_L%d",
i), 90, -3.2, 3.2);
488 numPhiFake[
i] = std::make_unique<TH1D>(Form(
"numPhiFake_L%d",
i), Form(
"numPhiFake_L%d",
i), 90, -3.2, 3.2);
490 denEta[
i] = std::make_unique<TH1D>(Form(
"denEta_L%d",
i), Form(
"denEta_L%d",
i), 200, -2, 2);
491 numEta[
i] = std::make_unique<TH1D>(Form(
"numEta_L%d",
i), Form(
"numEta_L%d",
i), 200, -2, 2);
492 numEtaGood[
i] = std::make_unique<TH1D>(Form(
"numEtaGood_L%d",
i), Form(
"numEtaGood_L%d",
i), 200, -2, 2);
493 numEtaFake[
i] = std::make_unique<TH1D>(Form(
"numEtaFake_L%d",
i), Form(
"numEtaFake_L%d",
i), 200, -2, 2);
495 denRow[
i] = std::make_unique<TH1D>(Form(
"denRow_L%d",
i), Form(
"denRow_L%d",
i), 128, -0.5, 511.5);
496 numRow[
i] = std::make_unique<TH1D>(Form(
"numRow_L%d",
i), Form(
"numRow_L%d",
i), 128, -0.5, 511.5);
497 numRowGood[
i] = std::make_unique<TH1D>(Form(
"numRowGood_L%d",
i), Form(
"numRowGood_L%d",
i), 128, -0.5, 511.5);
498 numRowFake[
i] = std::make_unique<TH1D>(Form(
"numRowFake_L%d",
i), Form(
"numRowFake_L%d",
i), 128, -0.5, 511.5);
500 denCol[
i] = std::make_unique<TH1D>(Form(
"denCol_L%d",
i), Form(
"denCol_L%d",
i), 128, -0.5, 1023.5);
501 numCol[
i] = std::make_unique<TH1D>(Form(
"numCol_L%d",
i), Form(
"numCol_L%d",
i), 128, -0.5, 1023.5);
502 numColGood[
i] = std::make_unique<TH1D>(Form(
"numColGood_L%d",
i), Form(
"numColGood_L%d",
i), 128, -0.5, 1023.5);
503 numColFake[
i] = std::make_unique<TH1D>(Form(
"numColFake_L%d",
i), Form(
"numColFake_L%d",
i), 128, -0.5, 1023.5);
505 denZ[
i] = std::make_unique<TH1D>(Form(
"denZ_L%d",
i), Form(
"denZ_L%d",
i), 100, -15, 15);
506 numZ[
i] = std::make_unique<TH1D>(Form(
"numZ_L%d",
i), Form(
"numZ_L%d",
i), 100, -15, 15);
507 numZGood[
i] = std::make_unique<TH1D>(Form(
"numZGood_L%d",
i), Form(
"numZGood_L%d",
i), 100, -15, 15);
508 numZFake[
i] = std::make_unique<TH1D>(Form(
"numZFake_L%d",
i), Form(
"numZFake_L%d",
i), 100, -15, 15);
510 mDenColEta[
i] = std::make_unique<TH2D>(Form(
"mDenColEta_L%d",
i), Form(
"mDenColEta_L%d",
i), 128, -0.5, 1023.5, 50, -1, 1);
511 mNumColEta[
i] = std::make_unique<TH2D>(Form(
"mNumColEta_L%d",
i), Form(
"mNumColEta_L%d",
i), 128, -0.5, 1023.5, 50, -1, 1);
513 mDenRowPhi[
i] = std::make_unique<TH2D>(Form(
"mDenRowPhi_L%d",
i), Form(
"mDenRowPhi_L%d",
i), 128, -0.5, 511.5, 90, -3.2, 3.2);
514 mNumRowPhi[
i] = std::make_unique<TH2D>(Form(
"mNumRowPhi_L%d",
i), Form(
"mNumRowPhi_L%d",
i), 128, -0.5, 511.5, 90, -3.2, 3.2);
516 mDenRowCol[
i] = std::make_unique<TH2D>(Form(
"mDenRowCol_L%d",
i), Form(
"mDenRowCol_L%d",
i), 128, -0.5, 511.5, 128, -0.5, 1023.5);
517 mNumRowCol[
i] = std::make_unique<TH2D>(Form(
"mNumRowCol_L%d",
i), Form(
"mNumRowCol_L%d",
i), 128, -0.5, 511.5, 128, -0.5, 1023.5);
519 IPOriginalxy[
i] = std::make_unique<TH1D>(Form(
"IPOriginalxy_L%d",
i), Form(
"IPOriginalxy_L%d",
i), 500, -0.002, 0.002);
520 IPOriginalz[
i] = std::make_unique<TH1D>(Form(
"IPOriginalz_L%d",
i), Form(
"IPOriginalz_L%d",
i), 200, -10, 10);
522 phiFound[
i] = std::make_unique<TH1D>(Form(
"phiFound_L%d",
i), Form(
"phiFound_L%d",
i), 190, -3.2, 3.2);
523 rowFound[
i] = std::make_unique<TH1D>(Form(
"rowFound_L%d",
i), Form(
"rowFound_L%d",
i), 128, -0.5, 511.5);
524 phiNotFound[
i] = std::make_unique<TH1D>(Form(
"phiNotFound_L%d",
i), Form(
"phiNotFound_L%d",
i), 90, -3.2, 3.2);
525 rowNotFound[
i] = std::make_unique<TH1D>(Form(
"rowNotFound_L%d",
i), Form(
"rowNotFound_L%d",
i), 128, -0.5, 511.5);
526 zFound[
i] = std::make_unique<TH1D>(Form(
"zFound_L%d",
i), Form(
"zFound_L%d",
i), 100, -15, 15);
527 zNotFound[
i] = std::make_unique<TH1D>(Form(
"zNotFound%d",
i), Form(
"zNotFound%d",
i), 100, -15, 15);
528 colFoundOriginalVsDuplicated[
i] = std::make_unique<TH2D>(Form(
"colFoundOriginalVsDuplicated_L%d",
i), Form(
"colFoundOriginalVsDuplicated_L%d; Col Original cluster; Col Overlap cluster",
i), 9216, -0.5, 9215.5, 9216, -0.5, 9215.5);
529 colFoundOriginal[
i] = std::make_unique<TH1D>(Form(
"colFoundOriginal_L%d",
i), Form(
"colFoundOriginal_L%d; Col Original cluster;",
i), 9216, -0.5, 9215.5);
530 colNotFound[
i] = std::make_unique<TH1D>(Form(
"colNotFound_L%d",
i), Form(
"colNotFound_L%d",
i), 9216, -0.5, 9215.5);
531 radiusFound[
i] = std::make_unique<TH1D>(Form(
"radiusFound_L%d",
i), Form(
"radiusFound_L%d",
i), 80, 0, 6);
532 radiusNotFound[
i] = std::make_unique<TH1D>(Form(
"radiusNotFound_L%d",
i), Form(
"radiusNotFound_L%d",
i), 80, 0, 4);
534 for (
int j = 0;
j < 3;
j++) {
535 mDuplicatedEta[
i][
j] = std::make_unique<TH1D>(Form(
"mDuplicatedEta_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #eta; Number of duplicated clusters L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 40, -2, 2);
536 mNGoodMatchesEta[
i][
j] = std::make_unique<TH1D>(Form(
"mNGoodMatchesEta_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #eta; Number of good matches L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 40, -2, 2);
537 mNFakeMatchesEta[
i][
j] = std::make_unique<TH1D>(Form(
"mNFakeMatchesEta_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #eta; Number of fake matches L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 40, -2, 2);
539 mDuplicatedPhi[
i][
j] = std::make_unique<TH1D>(Form(
"mDuplicatedPhi_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #phi; Number of duplicated clusters L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 90, -3.2, 3.2);
540 mNGoodMatchesPhi[
i][
j] = std::make_unique<TH1D>(Form(
"mNGoodMatchesPhi_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #phi; Number of good matches L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 90, -3.2, 3.2);
541 mNFakeMatchesPhi[
i][
j] = std::make_unique<TH1D>(Form(
"mNFakeMatchesPhi_L%d_pt%d",
i,
j), Form(
"%f < #it{p}_{T} < %f GeV/c; #phi; Number of fake matches L%d", mrangesPt[
j][0], mrangesPt[
j][1],
i), 90, -3.2, 3.2);
544 gStyle->SetPalette(55);
992 LOGP(info,
"--------------- studyDCAcutsMC");
996 double meanDCAxyDuplicated[
NLAYERS] = {0};
997 double meanDCAzDuplicated[
NLAYERS] = {0};
998 double sigmaDCAxyDuplicated[
NLAYERS] = {0};
999 double sigmaDCAzDuplicated[
NLAYERS] = {0};
1001 std::ofstream ofs(
"dcaValues.csv", std::ofstream::out);
1002 ofs <<
"layer,dcaXY,dcaZ,sigmaDcaXY,sigmaDcaZ" << std::endl;
1004 for (
int l = 0; l <
NLAYERS; l++) {
1005 meanDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetMean();
1006 meanDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetMean();
1007 sigmaDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetRMS();
1008 sigmaDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetRMS();
1009 ofs << l <<
"," << meanDCAxyDuplicated[l] <<
"," << meanDCAzDuplicated[l] <<
"," << sigmaDCAxyDuplicated[l] <<
"," << sigmaDCAzDuplicated[l] << std::endl;
1012 for (
int l = 0; l <
NLAYERS; l++) {
1013 LOGP(info,
"meanDCAxyDuplicated L{}: {}, meanDCAzDuplicated: {}, sigmaDCAxyDuplicated: {}, sigmaDCAzDuplicated: {}", l, meanDCAxyDuplicated[l], meanDCAzDuplicated[l], sigmaDCAxyDuplicated[l], sigmaDCAzDuplicated[l]);
1025 unsigned int rofIndexTrack = 0;
1026 unsigned int rofNEntriesTrack = 0;
1027 unsigned int rofIndexClus = 0;
1028 unsigned int rofNEntriesClus = 0;
1030 unsigned int totClus = 0;
1032 unsigned int nDCAMatches[20] = {0};
1033 unsigned int nGoodMatches[20] = {0};
1034 unsigned int nFakeMatches[20] = {0};
1036 unsigned int nGoodMatches_layer[
NLAYERS][20] = {0};
1037 unsigned int nFakeMatches_layer[
NLAYERS][20] = {0};
1040 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
1041 double a = std::log(ptcuth / ptcutl) / nbPt;
1042 for (
int i = 0;
i <= nbPt;
i++) {
1043 xbins[
i] = ptcutl * std::exp(
i *
a);
1046 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
1047 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
1048 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
1050 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
1051 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
1053 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
1054 auto track = mTracks[iTrack];
1056 auto pt = trackParCov.getPt();
1057 auto eta = trackParCov.getEta();
1060 track.getImpactParams(0, 0, 0, 0, ip);
1063 float phiOriginal = -999.;
1064 int firstClus = track.getFirstClusterEntry();
1065 int ncl = track.getNumberOfClusters();
1071 auto& tracklab = mTracksMCLabels[iTrack];
1072 if (tracklab.isFake()) {
1076 if (mVerboseOutput) {
1077 LOGP(info,
"--------- track Label: ");
1081 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
1082 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
1083 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
1084 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
1085 if (layerOriginal >=
NLAYERS) {
1088 auto labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
1089 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
1090 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
1095 phiOriginal = clusOriginalPointGlob.phi();
1097 for (
auto& labT : labsOriginal) {
1098 if (labT != tracklab) {
1101 if (!labT.isValid()) {
1106 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
1107 auto clusDuplicated = mClusters[iClus];
1109 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
1112 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
1113 if (layerDuplicated != layerOriginal) {
1116 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
1117 if (abs(staveDuplicated - staveOriginal) != 1) {
1120 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
1121 if (abs(chipDuplicated - chipOriginal) > 1) {
1125 auto labsDuplicated = mClustersMCLCont->
getLabels(iClus);
1128 auto clusDuplicatedPoint = mITSClustersArray[iClus];
1132 phi = clusDuplicatedPointGlob.phi();
1136 if (propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
1137 if (mVerboseOutput) {
1138 LOGP(info,
"Propagation ok");
1141 for (
int i = 0;
i < 20;
i++) {
1142 if (abs(
dcaXY[layerDuplicated] - clusDuplicatedDCA[0]) < (
i + 1) *
sigmaDcaXY[layerDuplicated] && abs(
dcaZ[layerDuplicated] - clusDuplicatedDCA[1]) < (
i + 1) *
sigmaDcaZ[layerDuplicated]) {
1144 if (mVerboseOutput) {
1145 LOGP(info,
"Check DCA ok: {} < {}; {} < {}", abs(meanDCAxyDuplicated[layerDuplicated] - clusDuplicatedDCA[0]), (
i + 1) * sigmaDCAxyDuplicated[layerDuplicated], abs(meanDCAzDuplicated[layerDuplicated] - clusDuplicatedDCA[1]), (
i + 1) * sigmaDCAzDuplicated[layerDuplicated]);
1148 bool isGoodMatch =
false;
1150 for (
auto labD : labsDuplicated) {
1151 if (mVerboseOutput) {
1152 LOGP(info,
"tracklab, labD:");
1156 if (labD == tracklab) {
1164 nGoodMatches_layer[layerDuplicated][
i]++;
1165 mnGoodMatchesPt_layer[layerDuplicated]->Fill(pt,
i);
1166 mnGoodMatchesEta_layer[layerDuplicated]->Fill(eta,
i);
1167 mnGoodMatchesPhi_layer[layerDuplicated]->Fill(phi,
i);
1168 mnGoodMatchesPhiOriginal_layer[layerDuplicated]->Fill(phiOriginal,
i);
1172 nFakeMatches_layer[layerDuplicated][
i]++;
1173 mnFakeMatchesPt_layer[layerDuplicated]->Fill(pt,
i);
1174 mnFakeMatchesEta_layer[layerDuplicated]->Fill(eta,
i);
1175 mnFakeMatchesPhi_layer[layerDuplicated]->Fill(phi,
i);
1177 }
else if (mVerboseOutput) {
1178 LOGP(info,
"Check DCA failed");
1181 }
else if (mVerboseOutput) {
1182 LOGP(info,
"Propagation failed");
1190 for (
int i = 0;
i < 20;
i++) {
1191 LOGP(info,
"Cut: {} sigma -> number of duplicated clusters: {} nDCAMatches: {} nGoodMatches: {} nFakeMatches: {}",
i + 1, duplicated, nDCAMatches[
i], nGoodMatches[
i], nFakeMatches[
i]);
1192 mEfficiencyGoodMatch->SetBinContent(
i + 1, nGoodMatches[
i]);
1193 mEfficiencyFakeMatch->SetBinContent(
i + 1, nFakeMatches[
i]);
1194 mEfficiencyTotal->SetBinContent(
i + 1,
double(nGoodMatches[
i] + nFakeMatches[
i]));
1196 for (
int l = 0; l <
NLAYERS; l++) {
1197 mEfficiencyGoodMatch_layer[l]->SetBinContent(
i + 1, nGoodMatches_layer[l][
i]);
1198 mEfficiencyFakeMatch_layer[l]->SetBinContent(
i + 1, nFakeMatches_layer[l][
i]);
1199 mEfficiencyTotal_layer[l]->SetBinContent(
i + 1,
double(nGoodMatches_layer[l][
i] + nFakeMatches_layer[l][
i]));
1201 for (
int ipt = 0; ipt < mPtDuplicated[l]->GetNbinsX(); ipt++) {
1202 if (mPtDuplicated[l]->GetBinContent(ipt + 1) != 0) {
1203 mEfficiencyGoodMatchPt_layer[l]->SetBinContent(ipt + 1,
i + 1, mnGoodMatchesPt_layer[l]->GetBinContent(ipt + 1,
i + 1) / mPtDuplicated[l]->GetBinContent(ipt + 1));
1205 mEfficiencyFakeMatchPt_layer[l]->SetBinContent(ipt + 1,
i + 1, mnFakeMatchesPt_layer[l]->GetBinContent(ipt + 1,
i + 1) / mPtDuplicated[l]->GetBinContent(ipt + 1));
1208 for (
int ieta = 0; ieta < mEtaDuplicated[l]->GetNbinsX(); ieta++) {
1209 if (mEtaDuplicated[l]->GetBinContent(ieta + 1) != 0) {
1210 mEfficiencyGoodMatchEta_layer[l]->SetBinContent(ieta + 1,
i + 1, mnGoodMatchesEta_layer[l]->GetBinContent(ieta + 1,
i + 1) / mEtaDuplicated[l]->GetBinContent(ieta + 1));
1212 mEfficiencyFakeMatchEta_layer[l]->SetBinContent(ieta + 1,
i + 1, mnFakeMatchesEta_layer[l]->GetBinContent(ieta + 1,
i + 1) / mEtaDuplicated[l]->GetBinContent(ieta + 1));
1215 for (
int iphi = 0; iphi < mPhiDuplicated[l]->GetNbinsX(); iphi++) {
1216 if (mPhiDuplicated[l]->GetBinContent(iphi + 1) != 0) {
1217 mEfficiencyGoodMatchPhi_layer[l]->SetBinContent(iphi + 1,
i + 1, mnGoodMatchesPhi_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiDuplicated[l]->GetBinContent(iphi + 1));
1219 mEfficiencyFakeMatchPhi_layer[l]->SetBinContent(iphi + 1,
i + 1, mnFakeMatchesPhi_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiDuplicated[l]->GetBinContent(iphi + 1));
1222 for (
int iphi = 0; iphi < mPhiOriginalIfDuplicated[l]->GetNbinsX(); iphi++) {
1223 if (mPhiOriginalIfDuplicated[l]->GetBinContent(iphi + 1) != 0) {
1224 mEfficiencyGoodMatchPhiOriginal_layer[l]->SetBinContent(iphi + 1,
i + 1, mnGoodMatchesPhiOriginal_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiOriginalIfDuplicated[l]->GetBinContent(iphi + 1));
1230 std::cout <<
"+++++++++ Duplicated in layer L" <<
i <<
": " << mDuplicated_layer[
i] << std::endl;
1233 for (
int l = 0; l <
NLAYERS; l++) {
1234 mEfficiencyGoodMatch_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1235 mEfficiencyFakeMatch_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1236 mEfficiencyTotal_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1239 mEfficiencyGoodMatch->Scale(1. /
double(duplicated),
"b");
1240 mEfficiencyFakeMatch->Scale(1. /
double(duplicated),
"b");
1241 mEfficiencyTotal->Scale(1. /
double(duplicated),
"b");
1243 mOutFile->mkdir(
"EffVsDCA2D/");
1244 mOutFile->cd(
"EffVsDCA2D/");
1245 for (
int l = 0; l <
NLAYERS; l++) {
1246 mEfficiencyGoodMatchPt_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1247 mEfficiencyGoodMatchPt_layer[l]->Write();
1248 mEfficiencyGoodMatchEta_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1249 mEfficiencyGoodMatchEta_layer[l]->Write();
1250 mEfficiencyGoodMatchPhi_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1251 mEfficiencyGoodMatchPhi_layer[l]->Write();
1252 mEfficiencyGoodMatchPhiOriginal_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1253 mEfficiencyGoodMatchPhiOriginal_layer[l]->Write();
1254 mEfficiencyFakeMatchPt_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1255 mEfficiencyFakeMatchPt_layer[l]->Write();
1256 mEfficiencyFakeMatchEta_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1257 mEfficiencyFakeMatchEta_layer[l]->Write();
1258 mEfficiencyFakeMatchPhi_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1259 mEfficiencyFakeMatchPhi_layer[l]->Write();
1262 mOutFile->mkdir(
"Efficiency/");
1263 mOutFile->cd(
"Efficiency/");
1264 mEfficiencyGoodMatch->Write();
1265 mEfficiencyFakeMatch->Write();
1266 mEfficiencyTotal->Write();
1267 for (
int l = 0; l <
NLAYERS; l++) {
1269 mEfficiencyGoodMatch_layer[l]->Write();
1270 mEfficiencyFakeMatch_layer[l]->Write();
1271 mEfficiencyTotal_layer[l]->Write();
1273 mEfficiencyGoodMatch_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1274 mEfficiencyFakeMatch_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1275 mEfficiencyTotal_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1278 mEfficiencyGoodMatch->GetYaxis()->SetRangeUser(-0.1, 1.1);
1279 mEfficiencyFakeMatch->GetYaxis()->SetRangeUser(-0.1, 1.1);
1280 mEfficiencyTotal->GetYaxis()->SetRangeUser(-0.1, 1.1);
1283 c.SetName(
"EffVsDCA_allLayers");
1284 auto leg = std::make_unique<TLegend>(0.75, 0.45, 0.89, 0.65);
1285 leg->AddEntry(mEfficiencyGoodMatch.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"p");
1286 leg->AddEntry(mEfficiencyFakeMatch.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"p");
1287 leg->AddEntry(mEfficiencyTotal.get(),
"#frac{# tot matches}{# tot duplicated clusters}",
"p");
1289 mEfficiencyGoodMatch->Draw(
"P l E1_NOSTAT PLC PMC ");
1290 mEfficiencyFakeMatch->Draw(
"same P l E1_NOSTAT PLC PMC");
1291 mEfficiencyTotal->Draw(
"same P l E1_NOSTAT PLC PMC");
1296 for (
int l = 0; l <
NLAYERS; l++) {
1298 cc[l].SetName(Form(
"EffVsDCA_layer_L%d", l));
1300 auto leg = std::make_unique<TLegend>(0.75, 0.45, 0.89, 0.65);
1301 leg->AddEntry(mEfficiencyGoodMatch_layer[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"p");
1302 leg->AddEntry(mEfficiencyFakeMatch_layer[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"p");
1303 leg->AddEntry(mEfficiencyTotal_layer[l].
get(),
"#frac{# tot matches}{# tot duplicated clusters}",
"p");
1305 mEfficiencyGoodMatch_layer[l]->SetLineColor(kBlue + 3);
1306 mEfficiencyGoodMatch_layer[l]->SetMarkerColor(kBlue + 3);
1307 mEfficiencyGoodMatch_layer[l]->Draw(
"P l E1_NOSTAT");
1308 mEfficiencyFakeMatch_layer[l]->SetLineColor(kAzure + 7);
1309 mEfficiencyFakeMatch_layer[l]->SetMarkerColor(kAzure + 7);
1310 mEfficiencyFakeMatch_layer[l]->Draw(
"same P l E1_NOSTAT");
1311 mEfficiencyTotal_layer[l]->SetLineColor(kGreen + 1);
1312 mEfficiencyTotal_layer[l]->SetMarkerColor(kGreen + 1);
1313 mEfficiencyTotal_layer[l]->Draw(
"same P l E1_NOSTAT");
1326 LOGP(info,
"--------------- studyClusterSelection");
1330 std::cout <<
"duplicated: " << duplicated << std::endl;
1332 double meanDCAxyDuplicated[
NLAYERS] = {0};
1333 double meanDCAzDuplicated[
NLAYERS] = {0};
1334 double sigmaDCAxyDuplicated[
NLAYERS] = {0};
1335 double sigmaDCAzDuplicated[
NLAYERS] = {0};
1337 for (
int l = 0; l <
NLAYERS; l++) {
1338 meanDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetMean();
1339 meanDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetMean();
1340 sigmaDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetRMS();
1341 sigmaDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetRMS();
1344 for (
int l = 0; l <
NLAYERS; l++) {
1345 LOGP(info,
"meanDCAxyDuplicated L{}: {}, meanDCAzDuplicated: {}, sigmaDCAxyDuplicated: {}, sigmaDCAzDuplicated: {}", l, meanDCAxyDuplicated[l], meanDCAzDuplicated[l], sigmaDCAxyDuplicated[l], sigmaDCAzDuplicated[l]);
1352 unsigned int rofIndexTrack = 0;
1353 unsigned int rofNEntriesTrack = 0;
1354 unsigned int rofIndexClus = 0;
1355 unsigned int rofNEntriesClus = 0;
1357 unsigned int totClus = 0;
1359 unsigned int nDCAMatches[15] = {0};
1360 unsigned int nGoodMatches[15] = {0};
1361 unsigned int nFakeMatches[15] = {0};
1363 std::map<std::tuple<int, double, o2::MCCompLabel>,
bool> clusterMatchesPtEta[100][100] = {};
1365 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
1366 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
1367 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
1369 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
1370 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
1373 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
1374 auto track = mTracks[iTrack];
1379 track.getImpactParams(0, 0, 0, 0, ip);
1381 int firstClus = track.getFirstClusterEntry();
1382 int ncl = track.getNumberOfClusters();
1388 auto& tracklab = mTracksMCLabels[iTrack];
1389 if (tracklab.isFake()) {
1393 auto pt = trackParCov.getPt();
1394 auto eta = trackParCov.getEta();
1397 float phiOriginal = -999.;
1398 float phiDuplicated = -999.;
1399 UShort_t
row = -999;
1401 if (mVerboseOutput) {
1402 LOGP(info,
"--------- track Label: ");
1405 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
1406 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
1407 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
1408 if (layerOriginal >=
NLAYERS) {
1412 IPOriginalxy[layerOriginal]->Fill(ip[0]);
1413 IPOriginalz[layerOriginal]->Fill(ip[1]);
1415 UShort_t rowOriginal = clusOriginal.getRow();
1417 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
1421 auto phiOriginal = clusOriginalPointGlob.phi();
1423 auto labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
1424 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
1425 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
1427 std::tuple<int, double, gsl::span<const o2::MCCompLabel>> clusID_rDCA_label = {0, 999., gsl::span<const o2::MCCompLabel>()};
1429 bool adjacentFound = 0;
1431 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
1432 auto clusDuplicated = mClusters[iClus];
1435 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
1438 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
1439 if (layerDuplicated != layerOriginal) {
1442 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
1443 if (abs(staveDuplicated - staveOriginal) != 1) {
1446 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
1447 if (abs(chipDuplicated - chipOriginal) > 1) {
1451 auto labsDuplicated = mClustersMCLCont->
getLabels(iClus);
1454 auto clusDuplicatedPoint = mITSClustersArray[iClus];
1459 auto phiDuplicated = clusDuplicatedPointGlob.phi();
1463 if (!propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
1468 if (!(clusDuplicatedDCA[0] >
mDCACutsXY[layerDuplicated][0] && clusDuplicatedDCA[0] <
mDCACutsXY[layerDuplicated][1] && clusDuplicatedDCA[1] >
mDCACutsZ[layerDuplicated][0] && clusDuplicatedDCA[1] <
mDCACutsZ[layerDuplicated][1])) {
1472 if (mVerboseOutput) {
1473 LOGP(info,
"Propagation ok");
1475 double rDCA = std::hypot(clusDuplicatedDCA[0], clusDuplicatedDCA[1]);
1478 if (rDCA < std::get<1>(clusID_rDCA_label)) {
1479 clusID_rDCA_label = {iClus, rDCA, labsDuplicated};
1480 phi = phiDuplicated;
1490 if (!adjacentFound) {
1494 bool isGood =
false;
1495 for (
auto lab : std::get<2>(clusID_rDCA_label)) {
1496 if (lab == tracklab) {
1499 mNGoodMatchesPt[layerOriginal]->Fill(pt);
1500 mNGoodMatchesRow[layerOriginal]->Fill(
row);
1501 mNGoodMatchesCol[layerOriginal]->Fill(clusOriginal.getCol());
1502 mNGoodMatchesZ[layerOriginal]->Fill(clusOriginalPointGlob.Z());
1503 mNGoodMatchesPtEta[layerOriginal]->Fill(pt, eta);
1504 mNGoodMatchesPtPhi[layerOriginal]->Fill(pt, phi);
1505 mNGoodMatchesEtaPhi[layerOriginal]->Fill(eta, phi);
1507 mNGoodMatchesEtaAllPt[layerOriginal]->Fill(eta);
1508 mNGoodMatchesPhiAllPt[layerOriginal]->Fill(phi);
1509 for (
int ipt = 0; ipt < 3; ipt++) {
1510 if (pt >= mrangesPt[ipt][0] && pt < mrangesPt[ipt][1]) {
1511 mNGoodMatchesEta[layerOriginal][ipt]->Fill(eta);
1512 mNGoodMatchesPhi[layerOriginal][ipt]->Fill(phi);
1521 mNFakeMatchesPt[layerOriginal]->Fill(pt);
1522 mNFakeMatchesRow[layerOriginal]->Fill(
row);
1523 mNFakeMatchesCol[layerOriginal]->Fill(clusOriginal.getCol());
1524 mNFakeMatchesZ[layerOriginal]->Fill(clusOriginalPointGlob.Z());
1525 mNFakeMatchesPtEta[layerOriginal]->Fill(pt, eta);
1526 mNFakeMatchesPtPhi[layerOriginal]->Fill(pt, phi);
1527 mNFakeMatchesEtaPhi[layerOriginal]->Fill(eta, phi);
1528 mNFakeMatchesEtaAllPt[layerOriginal]->Fill(eta);
1529 mNFakeMatchesPhiAllPt[layerOriginal]->Fill(phi);
1531 for (
int ipt = 0; ipt < 3; ipt++) {
1532 if (pt >= mrangesPt[ipt][0] && pt < mrangesPt[ipt][1]) {
1533 mNFakeMatchesEta[layerOriginal][ipt]->Fill(eta);
1534 mNFakeMatchesPhi[layerOriginal][ipt]->Fill(phi);
1542 mOutFile->mkdir(
"EfficiencyCuts/");
1543 mOutFile->cd(
"EfficiencyCuts/");
1545 std::cout <<
"Calculating efficiency..." << std::endl;
1546 std::unique_ptr<TH1D> axpt = std::make_unique<TH1D>(
"axpt",
"", 1, 0.05, 7.5);
1547 std::unique_ptr<TH1D> axRow = std::make_unique<TH1D>(
"axRow",
"", 1, -0.5, 511.5);
1548 std::unique_ptr<TH1D> axCol = std::make_unique<TH1D>(
"axRow",
"", 1, -0.5, 1023.5);
1549 std::unique_ptr<TH1D> axZ = std::make_unique<TH1D>(
"axZ",
"", 1, -15, 15);
1550 std::unique_ptr<TH2D> axptetaGood = std::make_unique<TH2D>(
"axptetaGood",
"", 1, 0.05, 7.5, 1, -2, 2);
1551 std::unique_ptr<TH2D> axptetaFake = std::make_unique<TH2D>(
"axptetaFake",
"", 1, 0.05, 7.5, 1, -2, 2);
1552 std::unique_ptr<TH2D> axptphiGood = std::make_unique<TH2D>(
"axptphiGood",
"", 1, 0.05, 7.5, 1, -3.2, 3.2);
1553 std::unique_ptr<TH2D> axptphiFake = std::make_unique<TH2D>(
"axptphiFake",
"", 1, 0.05, 7.5, 1, -3.2, 3.2);
1554 std::unique_ptr<TH2D> axetaphiGood = std::make_unique<TH2D>(
"axetaphiGood",
"", 1, -2, 2, 1, -3.2, 3.2);
1555 std::unique_ptr<TH2D> axetaphiFake = std::make_unique<TH2D>(
"axetaphiFake",
"", 1, -2, 2, 1, -3.2, 3.2);
1556 std::unique_ptr<TH1D> axetaAllPt = std::make_unique<TH1D>(
"axetaAllPt",
"", 1, -2, 2);
1557 std::unique_ptr<TH1D> axeta[
NLAYERS];
1558 std::unique_ptr<TH1D> axphi[
NLAYERS];
1559 for (
int ipt = 0; ipt < 3; ipt++) {
1560 axeta[ipt] = std::make_unique<TH1D>(Form(
"axeta%d", ipt), Form(
"axeta%d", ipt), 1, -2, 2);
1561 axphi[ipt] = std::make_unique<TH1D>(Form(
"axphi%d", ipt), Form(
"axphi%d", ipt), 1, -3.2, 3.2);
1563 std::unique_ptr<TH1D> axphiAllPt = std::make_unique<TH1D>(
"axphi",
"", 1, -3.2, 3.2);
1565 std::unique_ptr<TCanvas> effPt[
NLAYERS];
1566 std::unique_ptr<TCanvas> effRow[
NLAYERS];
1567 std::unique_ptr<TCanvas> effCol[
NLAYERS];
1568 std::unique_ptr<TCanvas> effZ[
NLAYERS];
1569 std::unique_ptr<TCanvas> effPtEta[
NLAYERS][2];
1570 std::unique_ptr<TCanvas> effPtPhi[
NLAYERS][2];
1571 std::unique_ptr<TCanvas> effEtaPhi[
NLAYERS][2];
1572 std::unique_ptr<TCanvas> effEtaAllPt[
NLAYERS];
1573 std::unique_ptr<TCanvas> effEta[
NLAYERS][3];
1574 std::unique_ptr<TCanvas> effPhiAllPt[
NLAYERS];
1575 std::unique_ptr<TCanvas> effPhi[
NLAYERS][3];
1578 for (
int l = 0; l < 3; l++) {
1579 if (mVerboseOutput) {
1580 std::cout <<
"Pt L" << l <<
"\n\n";
1584 effPt[l] = std::make_unique<TCanvas>(Form(
"effPt_L%d", l));
1586 mEffPtGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPt[l], *mDuplicatedPt[l]);
1587 stileEfficiencyGraph(mEffPtGood[l], Form(
"mEffPtGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1589 for (
int ibin = 1; ibin <= mNFakeMatchesPt[l]->GetNbinsX(); ibin++) {
1590 if (mNFakeMatchesPt[l]->GetBinContent(ibin) > mDuplicatedPt[l]->GetBinContent(ibin)) {
1591 std::cout <<
"--- Pt: Npass = " << mNFakeMatchesPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1592 mNFakeMatchesPt[l]->SetBinContent(ibin, mDuplicatedPt[l]->GetBinContent(ibin));
1595 mEffPtFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPt[l], *mDuplicatedPt[l]);
1596 stileEfficiencyGraph(mEffPtFake[l], Form(
"mEffPtFake_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1598 axpt->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});Efficiency", l));
1599 axpt->GetYaxis()->SetRangeUser(-0.1, 1.1);
1600 axpt->GetXaxis()->SetRangeUser(0.05, 7.5);
1602 mEffPtGood[l]->Draw(
"same p");
1603 mEffPtFake[l]->Draw(
"same p");
1605 auto legpt = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1606 legpt->AddEntry(mEffPtGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1607 legpt->AddEntry(mEffPtFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1608 legpt->Draw(
"same");
1612 effPtEta[l][0] = std::make_unique<TCanvas>(Form(
"effPtEtaGood_L%d", l));
1614 mEffPtEtaGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtEta[l], *mDuplicatedPtEta[l]);
1615 stileEfficiencyGraph(mEffPtEtaGood[l], Form(
"mEffPtEtaGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1617 axptetaGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1618 axptetaGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1619 axptetaGood->GetYaxis()->SetRangeUser(-2., 2.);
1620 axptetaGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1621 axptetaGood->Draw();
1622 mEffPtEtaGood[l]->Draw(
"same colz");
1623 effPtEta[l][0]->Update();
1624 effPtEta[l][0]->Write();
1626 if (mVerboseOutput) {
1627 std::cout <<
"Underflow (bin 0,0): " << mNFakeMatchesPtEta[l]->GetBinContent(0, 0) <<
" " << mDuplicatedPtEta[l]->GetBinContent(0, 0) << std::endl;
1628 std::cout <<
"Overflow (bin nbinsx,nbinsy): " << mNFakeMatchesPtEta[l]->GetNbinsX() <<
" " << mNFakeMatchesPtEta[l]->GetNbinsY() <<
" -> " << mNFakeMatchesPtEta[l]->GetBinContent(mNFakeMatchesPtEta[l]->GetNbinsX(), mNFakeMatchesPtEta[l]->GetNbinsY()) <<
" " << mDuplicatedPtEta[l]->GetBinContent(mNFakeMatchesPtEta[l]->GetNbinsX(), mNFakeMatchesPtEta[l]->GetNbinsY()) << std::endl;
1631 for (
int ibin = 1; ibin <= mNFakeMatchesPtEta[l]->GetNbinsX(); ibin++) {
1632 for (
int jbin = 1; jbin <= mNFakeMatchesPtEta[l]->GetNbinsY(); jbin++) {
1633 if (mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) > mDuplicatedPtEta[l]->GetBinContent(ibin, jbin)) {
1634 if (mVerboseOutput) {
1635 std::cout <<
"--- PtEta fakematches : Npass = " << mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtEta[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1637 mNFakeMatchesPtEta[l]->SetBinContent(ibin, jbin, mDuplicatedPtEta[l]->GetBinContent(ibin, jbin));
1643 effRow[l] = std::make_unique<TCanvas>(Form(
"effRow_L%d", l));
1645 for (
int ibin = 1; ibin <= mNGoodMatchesRow[l]->GetNbinsX(); ibin++) {
1646 std::cout <<
"--- Good Row: Npass = " << mNGoodMatchesRow[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedRow[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1649 mEffRowGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesRow[l], *mDuplicatedRow[l]);
1650 stileEfficiencyGraph(mEffRowGood[l], Form(
"mEffRowGood_L%d", l), Form(
"L%d;Row;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1652 for (
int ibin = 1; ibin <= mNFakeMatchesRow[l]->GetNbinsX(); ibin++) {
1653 if (mNFakeMatchesRow[l]->GetBinContent(ibin) > mDuplicatedRow[l]->GetBinContent(ibin)) {
1654 std::cout <<
"--- Row: Npass = " << mNFakeMatchesRow[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedRow[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1655 mNFakeMatchesRow[l]->SetBinContent(ibin, mDuplicatedRow[l]->GetBinContent(ibin));
1658 mEffRowFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesRow[l], *mDuplicatedRow[l]);
1659 stileEfficiencyGraph(mEffRowFake[l], Form(
"mEffRowFake_L%d", l), Form(
"L%d;Row;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1661 axRow->SetTitle(Form(
"L%d;Row;Efficiency", l));
1662 axRow->GetYaxis()->SetRangeUser(-0.1, 1.1);
1663 axRow->GetXaxis()->SetRangeUser(0, 512);
1665 mEffRowGood[l]->Draw(
"same p");
1666 mEffRowFake[l]->Draw(
"same p");
1668 auto legRow = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1669 legRow->AddEntry(mEffRowGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1670 legRow->AddEntry(mEffRowFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1671 legRow->Draw(
"same");
1675 effCol[l] = std::make_unique<TCanvas>(Form(
"effCol_L%d", l));
1677 for (
int ibin = 1; ibin <= mNGoodMatchesCol[l]->GetNbinsX(); ibin++) {
1678 std::cout <<
"--- Good Col: Npass = " << mNGoodMatchesCol[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedCol[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1681 mEffColGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesCol[l], *mDuplicatedCol[l]);
1682 stileEfficiencyGraph(mEffColGood[l], Form(
"mEffColGood_L%d", l), Form(
"L%d;Col;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1684 for (
int ibin = 1; ibin <= mNFakeMatchesCol[l]->GetNbinsX(); ibin++) {
1685 if (mNFakeMatchesCol[l]->GetBinContent(ibin) > mDuplicatedCol[l]->GetBinContent(ibin)) {
1686 std::cout <<
"--- Col: Npass = " << mNFakeMatchesCol[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedCol[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1687 mNFakeMatchesCol[l]->SetBinContent(ibin, mDuplicatedCol[l]->GetBinContent(ibin));
1690 mEffColFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesCol[l], *mDuplicatedCol[l]);
1691 stileEfficiencyGraph(mEffColFake[l], Form(
"mEffColFake_L%d", l), Form(
"L%d;Col;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1693 axCol->SetTitle(Form(
"L%d;Col;Efficiency", l));
1694 axCol->GetYaxis()->SetRangeUser(-0.1, 1.1);
1695 axCol->GetXaxis()->SetRangeUser(0, 1024);
1697 mEffColGood[l]->Draw(
"same p");
1698 mEffColFake[l]->Draw(
"same p");
1700 auto legCol = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1701 legCol->AddEntry(mEffColGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1702 legCol->AddEntry(mEffColFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1703 legCol->Draw(
"same");
1707 effZ[l] = std::make_unique<TCanvas>(Form(
"effZ_L%d", l));
1709 for (
int ibin = 1; ibin <= mNGoodMatchesZ[l]->GetNbinsX(); ibin++) {
1710 std::cout <<
"--- Good Z: Npass = " << mNGoodMatchesZ[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedZ[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1713 mEffZGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesZ[l], *mDuplicatedZ[l]);
1714 stileEfficiencyGraph(mEffZGood[l], Form(
"mEffZGood_L%d", l), Form(
"L%d;Z;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1716 for (
int ibin = 1; ibin <= mNFakeMatchesZ[l]->GetNbinsX(); ibin++) {
1717 if (mNFakeMatchesZ[l]->GetBinContent(ibin) > mDuplicatedZ[l]->GetBinContent(ibin)) {
1718 std::cout <<
"--- Z: Npass = " << mNFakeMatchesZ[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedZ[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1719 mNFakeMatchesZ[l]->SetBinContent(ibin, mDuplicatedZ[l]->GetBinContent(ibin));
1722 mEffZFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesZ[l], *mDuplicatedZ[l]);
1723 stileEfficiencyGraph(mEffZFake[l], Form(
"mEffZFake_L%d", l), Form(
"L%d;Z;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1725 axZ->SetTitle(Form(
"L%d;Z;Efficiency", l));
1726 axZ->GetYaxis()->SetRangeUser(-0.1, 1.1);
1727 axZ->GetXaxis()->SetRangeUser(0, 512);
1729 mEffZGood[l]->Draw(
"same p");
1730 mEffZFake[l]->Draw(
"same p");
1732 auto legZ = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1733 legZ->AddEntry(mEffZGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1734 legZ->AddEntry(mEffZFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1739 effPtEta[l][0] = std::make_unique<TCanvas>(Form(
"effPtEtaGood_L%d", l));
1741 mEffPtEtaGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtEta[l], *mDuplicatedPtEta[l]);
1742 stileEfficiencyGraph(mEffPtEtaGood[l], Form(
"mEffPtEtaGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1744 axptetaGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1745 axptetaGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1746 axptetaGood->GetYaxis()->SetRangeUser(-2., 2.);
1747 axptetaGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1748 axptetaGood->Draw();
1749 mEffPtEtaGood[l]->Draw(
"same colz");
1750 effPtEta[l][0]->Update();
1751 effPtEta[l][0]->Write();
1753 if (mVerboseOutput) {
1754 std::cout <<
"Underflow (bin 0,0): " << mNFakeMatchesPtEta[l]->GetBinContent(0, 0) <<
" " << mDuplicatedPtEta[l]->GetBinContent(0, 0) << std::endl;
1755 std::cout <<
"Overflow (bin nbinsx,nbinsy): " << mNFakeMatchesPtEta[l]->GetNbinsX() <<
" " << mNFakeMatchesPtEta[l]->GetNbinsY() <<
" -> " << mNFakeMatchesPtEta[l]->GetBinContent(mNFakeMatchesPtEta[l]->GetNbinsX(), mNFakeMatchesPtEta[l]->GetNbinsY()) <<
" " << mDuplicatedPtEta[l]->GetBinContent(mNFakeMatchesPtEta[l]->GetNbinsX(), mNFakeMatchesPtEta[l]->GetNbinsY()) << std::endl;
1758 for (
int ibin = 1; ibin <= mNFakeMatchesPtEta[l]->GetNbinsX(); ibin++) {
1759 for (
int jbin = 1; jbin <= mNFakeMatchesPtEta[l]->GetNbinsY(); jbin++) {
1760 if (mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) > mDuplicatedPtEta[l]->GetBinContent(ibin, jbin)) {
1761 if (mVerboseOutput) {
1762 std::cout <<
"--- PtEta fakematches : Npass = " << mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtEta[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1764 mNFakeMatchesPtEta[l]->SetBinContent(ibin, jbin, mDuplicatedPtEta[l]->GetBinContent(ibin, jbin));
1770 effPtEta[l][1] = std::make_unique<TCanvas>(Form(
"effPtEtaFake_L%d", l));
1772 mEffPtEtaFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPtEta[l], *mDuplicatedPtEta[l]);
1773 stileEfficiencyGraph(mEffPtEtaFake[l], Form(
"mEffPtEtaFake_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1774 axptetaFake->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1775 axptetaFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1776 axptetaFake->GetYaxis()->SetRangeUser(-2., 2.);
1777 axptetaFake->GetXaxis()->SetRangeUser(0.05, 7.5);
1778 axptetaFake->Draw();
1779 mEffPtEtaFake[l]->Draw(
"same colz");
1780 effPtEta[l][1]->Update();
1781 effPtEta[l][1]->Write();
1784 effPtPhi[l][0] = std::make_unique<TCanvas>(Form(
"effPtPhiGood_L%d", l));
1786 mEffPtPhiGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtPhi[l], *mDuplicatedPtPhi[l]);
1787 stileEfficiencyGraph(mEffPtPhiGood[l], Form(
"mEffPtPhiGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l),
true);
1789 axptphiGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l));
1790 axptphiGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1791 axptphiGood->GetYaxis()->SetRangeUser(-3.2, 3.2);
1792 axptphiGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1793 axptphiGood->Draw();
1794 mEffPtPhiGood[l]->Draw(
"same colz");
1795 effPtPhi[l][0]->Update();
1796 effPtPhi[l][0]->Write();
1798 for (
int ibin = 1; ibin <= mNFakeMatchesPtPhi[l]->GetNbinsX(); ibin++) {
1799 for (
int jbin = 1; jbin <= mNFakeMatchesPtPhi[l]->GetNbinsY(); jbin++) {
1800 if (mNFakeMatchesPtPhi[l]->GetBinContent(ibin, jbin) > mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin)) {
1801 if (mVerboseOutput) {
1802 std::cout <<
"--- Pt: Npass = " << mNFakeMatchesPtPhi[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1804 mNFakeMatchesPtPhi[l]->SetBinContent(ibin, jbin, mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin));
1810 effPtPhi[l][1] = std::make_unique<TCanvas>(Form(
"effPtPhiFake_L%d", l));
1812 mEffPtPhiFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPtPhi[l], *mDuplicatedPtPhi[l]);
1813 stileEfficiencyGraph(mEffPtPhiFake[l], Form(
"mEffPtPhiFake_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l),
true);
1814 axptphiFake->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l));
1815 axptphiFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1816 axptphiFake->GetYaxis()->SetRangeUser(-3.2, 3.2);
1817 axptphiFake->GetXaxis()->SetRangeUser(0.05, 7.5);
1818 axptphiFake->Draw();
1819 mEffPtPhiFake[l]->Draw(
"same colz");
1820 effPtPhi[l][1]->Update();
1821 effPtPhi[l][1]->Write();
1824 effEtaPhi[l][0] = std::make_unique<TCanvas>(Form(
"effEtaPhiGood_L%d", l));
1826 mEffEtaPhiGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesEtaPhi[l], *mDuplicatedEtaPhi[l]);
1827 stileEfficiencyGraph(mEffEtaPhiGood[l], Form(
"mEffEtaPhiGood_L%d", l), Form(
"L%d;#eta;#phi (rad);Efficiency", l),
true);
1829 axetaphiGood->SetTitle(Form(
"L%d;#eta;#phi (rad);Efficiency", l));
1830 axetaphiGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1831 axetaphiGood->GetYaxis()->SetRangeUser(-3.2, 3.2);
1832 axetaphiGood->GetXaxis()->SetRangeUser(-2, 2);
1833 axetaphiGood->Draw();
1834 mEffEtaPhiGood[l]->Draw(
"same colz");
1835 effEtaPhi[l][0]->Update();
1836 effEtaPhi[l][0]->Write();
1838 for (
int ibin = 1; ibin <= mNFakeMatchesEtaPhi[l]->GetNbinsX(); ibin++) {
1839 for (
int jbin = 1; jbin <= mNFakeMatchesEtaPhi[l]->GetNbinsY(); jbin++) {
1840 if (mNFakeMatchesEtaPhi[l]->GetBinContent(ibin, jbin) > mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin)) {
1841 if (mVerboseOutput) {
1842 std::cout <<
"--- Eta: Npass = " << mNFakeMatchesEtaPhi[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1844 mNFakeMatchesEtaPhi[l]->SetBinContent(ibin, jbin, mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin));
1850 effEtaPhi[l][1] = std::make_unique<TCanvas>(Form(
"effEtaPhiFake_L%d", l));
1852 mEffEtaPhiFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesEtaPhi[l], *mDuplicatedEtaPhi[l]);
1853 stileEfficiencyGraph(mEffEtaPhiFake[l], Form(
"mEffEtaPhiFake_L%d", l), Form(
"L%d;#eta;#phi (rad);Efficiency", l),
true);
1854 axetaphiFake->SetTitle(Form(
"L%d;#eta;#phi (rad);Efficiency", l));
1855 axetaphiFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1856 axetaphiFake->GetYaxis()->SetRangeUser(-3.2, 3.2);
1857 axetaphiFake->GetXaxis()->SetRangeUser(-2, 2);
1858 axetaphiFake->Draw();
1859 mEffEtaPhiFake[l]->Draw(
"same colz");
1860 effEtaPhi[l][1]->Update();
1861 effEtaPhi[l][1]->Write();
1864 if (mVerboseOutput) {
1865 std::cout <<
"Eta L" << l <<
"\n\n";
1868 effEtaAllPt[l] = std::make_unique<TCanvas>(Form(
"effEtaAllPt_L%d", l));
1870 mEffEtaGoodAllPt[l] = std::make_unique<TEfficiency>(*mNGoodMatchesEtaAllPt[l], *mDuplicatedEtaAllPt[l]);
1871 stileEfficiencyGraph(mEffEtaGoodAllPt[l], Form(
"mEffEtaGoodAllPt_L%d", l), Form(
"L%d;#eta;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1873 for (
int ibin = 1; ibin <= mNFakeMatchesEtaAllPt[l]->GetNbinsX(); ibin++) {
1874 if (mNFakeMatchesEtaAllPt[l]->GetBinContent(ibin) > mDuplicatedEtaAllPt[l]->GetBinContent(ibin)) {
1875 if (mVerboseOutput) {
1876 std::cout <<
"--- EtaAllPt: Npass = " << mNFakeMatchesEtaAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedEtaAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1878 mNFakeMatchesEtaAllPt[l]->SetBinContent(ibin, mDuplicatedEtaAllPt[l]->GetBinContent(ibin));
1881 mEffEtaFakeAllPt[l] = std::make_unique<TEfficiency>(*mNFakeMatchesEtaAllPt[l], *mDuplicatedEtaAllPt[l]);
1882 stileEfficiencyGraph(mEffEtaFakeAllPt[l], Form(
"mEffEtaFakeAllPt_L%d", l), Form(
"L%d;#eta;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1884 axetaAllPt->SetTitle(Form(
"L%d;#eta;Efficiency", l));
1885 axetaAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
1888 mEffEtaGoodAllPt[l]->Draw(
"same p");
1889 mEffEtaFakeAllPt[l]->Draw(
"same p");
1891 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1892 legEta->AddEntry(mEffEtaGoodAllPt[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1893 legEta->AddEntry(mEffEtaFakeAllPt[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1894 legEta->Draw(
"same");
1895 effEtaAllPt[l]->Write();
1898 for (
int ipt = 0; ipt < 3; ipt++) {
1900 effEta[l][ipt] = std::make_unique<TCanvas>(Form(
"effEta_L%d_pt%d", l, ipt));
1902 mEffEtaGood[l][ipt] = std::make_unique<TEfficiency>(*mNGoodMatchesEta[l][ipt], *mDuplicatedEta[l][ipt]);
1903 stileEfficiencyGraph(mEffEtaGood[l][ipt], Form(
"mEffEtaGood_L%d_pt%d", l, ipt), Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#eta;Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1905 for (
int ibin = 1; ibin <= mNFakeMatchesEta[l][ipt]->GetNbinsX(); ibin++) {
1906 if (mNFakeMatchesEta[l][ipt]->GetBinContent(ibin) > mDuplicatedEta[l][ipt]->GetBinContent(ibin)) {
1907 if (mVerboseOutput) {
1908 std::cout <<
"--- Eta : Npass = " << mNFakeMatchesEta[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedEta[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1910 mNFakeMatchesEta[l][ipt]->SetBinContent(ibin, mDuplicatedEta[l][ipt]->GetBinContent(ibin));
1914 mEffEtaFake[l][ipt] = std::make_unique<TEfficiency>(*mNFakeMatchesEta[l][ipt], *mDuplicatedEta[l][ipt]);
1915 stileEfficiencyGraph(mEffEtaFake[l][ipt], Form(
"mEffEtaFake_L%d_pt%d", l, ipt), Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#eta;Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1917 axeta[ipt]->SetTitle(Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#eta;Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]));
1918 axeta[ipt]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1921 mEffEtaGood[l][ipt]->Draw(
"same p");
1922 mEffEtaFake[l][ipt]->Draw(
"same p");
1924 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1925 legEta->AddEntry(mEffEtaGood[l][ipt].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1926 legEta->AddEntry(mEffEtaFake[l][ipt].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1927 legEta->Draw(
"same");
1928 effEta[l][ipt]->Write();
1931 effPhi[l][ipt] = std::make_unique<TCanvas>(Form(
"effPhi_L%d_pt%d", l, ipt));
1933 for (
int ibin = 1; ibin <= mNGoodMatchesPhi[l][ipt]->GetNbinsX(); ibin++) {
1934 if (mNGoodMatchesPhi[l][ipt]->GetBinContent(ibin) > mDuplicatedPhi[l][ipt]->GetBinContent(ibin)) {
1935 if (mVerboseOutput) {
1936 std::cout <<
"--- Phi L: Npass = " << mNGoodMatchesPhi[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhi[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1938 mNGoodMatchesPhi[l][ipt]->SetBinContent(ibin, 0);
1942 mEffPhiGood[l][ipt] = std::make_unique<TEfficiency>(*mNGoodMatchesPhi[l][ipt], *mDuplicatedPhi[l][ipt]);
1943 stileEfficiencyGraph(mEffPhiGood[l][ipt], Form(
"mEffPhiGood_L%d_pt%d", l, ipt), Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#phi (rad);Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1945 for (
int ibin = 1; ibin <= mNFakeMatchesPhi[l][ipt]->GetNbinsX(); ibin++) {
1946 if (mNFakeMatchesPhi[l][ipt]->GetBinContent(ibin) > mDuplicatedPhi[l][ipt]->GetBinContent(ibin)) {
1947 if (mVerboseOutput) {
1948 std::cout <<
"--- Phi L: Npass = " << mNFakeMatchesPhi[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhi[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1950 mNFakeMatchesPhi[l][ipt]->SetBinContent(ibin, mDuplicatedPhi[l][ipt]->GetBinContent(ibin));
1954 mEffPhiFake[l][ipt] = std::make_unique<TEfficiency>(*mNFakeMatchesPhi[l][ipt], *mDuplicatedPhi[l][ipt]);
1955 stileEfficiencyGraph(mEffPhiFake[l][ipt], Form(
"mEffPhiFake_L%d_pt%d", l, ipt), Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#phi (rad);Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1957 axphi[ipt]->SetTitle(Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#phi (rad);Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]));
1958 axphi[ipt]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1961 mEffPhiGood[l][ipt]->Draw(
"same p");
1962 mEffPhiFake[l][ipt]->Draw(
"same p");
1964 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1965 legPhi->AddEntry(mEffPhiGood[l][ipt].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1966 legPhi->AddEntry(mEffPhiFake[l][ipt].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1967 legPhi->Draw(
"same");
1968 effPhi[l][ipt]->Write();
1972 if (mVerboseOutput) {
1973 std::cout <<
"Phi L" << l <<
"\n\n";
1976 effPhiAllPt[l] = std::make_unique<TCanvas>(Form(
"effPhiAllPt_L%d", l));
1978 for (
int ibin = 1; ibin <= mNGoodMatchesPhiAllPt[l]->GetNbinsX(); ibin++) {
1979 if (mNGoodMatchesPhiAllPt[l]->GetBinContent(ibin) > mDuplicatedPhiAllPt[l]->GetBinContent(ibin)) {
1980 if (mVerboseOutput) {
1981 std::cout <<
"--- phi all good Npass = " << mNGoodMatchesPhiAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhiAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1983 mNGoodMatchesPhiAllPt[l]->SetBinContent(ibin, 0);
1987 mEffPhiGoodAllPt[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPhiAllPt[l], *mDuplicatedPhiAllPt[l]);
1988 stileEfficiencyGraph(mEffPhiGoodAllPt[l], Form(
"mEffPhiGoodAllPt_L%d", l), Form(
"L%d;#phi;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1990 for (
int ibin = 1; ibin <= mNFakeMatchesPhiAllPt[l]->GetNbinsX(); ibin++) {
1991 if (mNFakeMatchesPhiAllPt[l]->GetBinContent(ibin) > mDuplicatedPhiAllPt[l]->GetBinContent(ibin)) {
1992 if (mVerboseOutput) {
1993 std::cout <<
"--- phi all fake Npass = " << mNFakeMatchesPhiAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhiAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1995 mNFakeMatchesPhiAllPt[l]->SetBinContent(ibin, mDuplicatedPhiAllPt[l]->GetBinContent(ibin));
1998 mEffPhiFakeAllPt[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPhiAllPt[l], *mDuplicatedPhiAllPt[l]);
1999 stileEfficiencyGraph(mEffPhiFakeAllPt[l], Form(
"mEffPhiFakeAllPt_L%d", l), Form(
"L%d;#phi;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2001 axphiAllPt->SetTitle(Form(
"L%d;#phi;Efficiency", l));
2002 axphiAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2004 mEffPhiGoodAllPt[l]->Draw(
"same p");
2005 mEffPhiFakeAllPt[l]->Draw(
"same p");
2007 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2008 legPhi->AddEntry(mEffPhiGoodAllPt[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2009 legPhi->AddEntry(mEffPhiFakeAllPt[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2010 legPhi->Draw(
"same");
2011 effPhiAllPt[l]->Write();
2015 std::unique_ptr<TCanvas> effRowAll = std::make_unique<TCanvas>(
"effRowAll");
2016 auto numRowGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesRow[0]->Clone(
"numRowGoodAll"));
2017 numRowGoodAll->Add(mNGoodMatchesRow[1].
get());
2018 numRowGoodAll->Add(mNGoodMatchesRow[2].
get());
2019 numRowGoodAll->Write();
2020 auto numRowFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesRow[0]->Clone(
"numRowFakeAll"));
2021 numRowFakeAll->Add(mNFakeMatchesRow[1].
get());
2022 numRowFakeAll->Add(mNFakeMatchesRow[2].
get());
2023 numRowFakeAll->Write();
2024 auto denRowAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedRow[0]->Clone(
"denRowAll"));
2025 denRowAll->Add(mDuplicatedRow[1].
get());
2026 denRowAll->Add(mDuplicatedRow[2].
get());
2029 std::unique_ptr<TEfficiency> mEffRowGoodAll = std::make_unique<TEfficiency>(*numRowGoodAll, *denRowAll);
2030 stileEfficiencyGraph(mEffRowGoodAll,
"mEffRowGoodAll",
"L0 + L1 + L2;Row;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2031 std::unique_ptr<TEfficiency> mEffRowFakeAll = std::make_unique<TEfficiency>(*numRowFakeAll, *denRowAll);
2032 stileEfficiencyGraph(mEffRowFakeAll,
"mEffRowFakeAll",
"L0 + L1 + L2;Row;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2033 axRow->SetTitle(
"L0 + L1 + L2;Row;Efficiency");
2034 axRow->GetYaxis()->SetRangeUser(-0.1, 1.1);
2036 mEffRowGoodAll->Draw(
"same p");
2037 mEffRowFakeAll->Draw(
"same p");
2039 auto legRow = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2040 legRow->AddEntry(mEffRowGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2041 legRow->AddEntry(mEffRowFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2042 legRow->Draw(
"same");
2046 std::unique_ptr<TCanvas> effColAll = std::make_unique<TCanvas>(
"effColAll");
2047 auto numColGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesCol[0]->Clone(
"numColGoodAll"));
2048 numColGoodAll->Add(mNGoodMatchesCol[1].
get());
2049 numColGoodAll->Add(mNGoodMatchesCol[2].
get());
2050 numColGoodAll->Write();
2051 auto numColFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesCol[0]->Clone(
"numColFakeAll"));
2052 numColFakeAll->Add(mNFakeMatchesCol[1].
get());
2053 numColFakeAll->Add(mNFakeMatchesCol[2].
get());
2054 numColFakeAll->Write();
2055 auto denColAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedCol[0]->Clone(
"denColAll"));
2056 denColAll->Add(mDuplicatedCol[1].
get());
2057 denColAll->Add(mDuplicatedCol[2].
get());
2060 std::unique_ptr<TEfficiency> mEffColGoodAll = std::make_unique<TEfficiency>(*numColGoodAll, *denColAll);
2061 stileEfficiencyGraph(mEffColGoodAll,
"mEffColGoodAll",
"L0 + L1 + L2;Column;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2062 std::unique_ptr<TEfficiency> mEffColFakeAll = std::make_unique<TEfficiency>(*numColFakeAll, *denColAll);
2063 stileEfficiencyGraph(mEffColFakeAll,
"mEffColFakeAll",
"L0 + L1 + L2;Column;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2064 axCol->SetTitle(
"L0 + L1 + L2;Col;Efficiency");
2065 axCol->GetYaxis()->SetRangeUser(-0.1, 1.1);
2067 mEffColGoodAll->Draw(
"same p");
2068 mEffColFakeAll->Draw(
"same p");
2070 auto legCol = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2071 legCol->AddEntry(mEffColGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2072 legCol->AddEntry(mEffColFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2073 legCol->Draw(
"same");
2077 std::unique_ptr<TCanvas> effZAll = std::make_unique<TCanvas>(
"effZAll");
2078 auto numZGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesZ[0]->Clone(
"numZGoodAll"));
2079 numZGoodAll->Add(mNGoodMatchesZ[1].
get());
2080 numZGoodAll->Add(mNGoodMatchesZ[2].
get());
2081 numZGoodAll->Write();
2082 auto numZFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesZ[0]->Clone(
"numZFakeAll"));
2083 numZFakeAll->Add(mNFakeMatchesZ[1].
get());
2084 numZFakeAll->Add(mNFakeMatchesZ[2].
get());
2085 numZFakeAll->Write();
2086 auto denZAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedZ[0]->Clone(
"denZAll"));
2087 denZAll->Add(mDuplicatedZ[1].
get());
2088 denZAll->Add(mDuplicatedZ[2].
get());
2091 std::unique_ptr<TEfficiency> mEffZGoodAll = std::make_unique<TEfficiency>(*numZGoodAll, *denZAll);
2092 stileEfficiencyGraph(mEffZGoodAll,
"mEffZGoodAll",
"L0 + L1 + L2;Z;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2093 std::unique_ptr<TEfficiency> mEffZFakeAll = std::make_unique<TEfficiency>(*numZFakeAll, *denZAll);
2094 stileEfficiencyGraph(mEffZFakeAll,
"mEffZFakeAll",
"L0 + L1 + L2;Z;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2095 axZ->SetTitle(
"L0 + L1 + L2;Z;Efficiency");
2096 axZ->GetYaxis()->SetRangeUser(-0.1, 1.1);
2098 mEffZGoodAll->Draw(
"same p");
2099 mEffZFakeAll->Draw(
"same p");
2101 auto legZ = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2102 legZ->AddEntry(mEffZGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2103 legZ->AddEntry(mEffZFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2108 std::unique_ptr<TCanvas> effEtaAll = std::make_unique<TCanvas>(
"effEtaAll");
2109 auto numEtaGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesEtaAllPt[0]->Clone(
"numEtaGoodAll"));
2110 numEtaGoodAll->Add(mNGoodMatchesEtaAllPt[1].
get());
2111 numEtaGoodAll->Add(mNGoodMatchesEtaAllPt[2].
get());
2112 numEtaGoodAll->Write();
2113 auto numEtaFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesEtaAllPt[0]->Clone(
"numEtaFakeAll"));
2114 numEtaFakeAll->Add(mNFakeMatchesEtaAllPt[1].
get());
2115 numEtaFakeAll->Add(mNFakeMatchesEtaAllPt[2].
get());
2116 numEtaFakeAll->Write();
2117 auto denEtaAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedEtaAllPt[0]->Clone(
"denEtaAll"));
2118 denEtaAll->Add(mDuplicatedEtaAllPt[1].
get());
2119 denEtaAll->Add(mDuplicatedEtaAllPt[2].
get());
2122 std::unique_ptr<TEfficiency> mEffEtaGoodAll = std::make_unique<TEfficiency>(*numEtaGoodAll, *denEtaAll);
2123 stileEfficiencyGraph(mEffEtaGoodAll,
"mEffEtaGoodAll",
"L0 + L1 + L2;#Eta;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2124 std::unique_ptr<TEfficiency> mEffEtaFakeAll = std::make_unique<TEfficiency>(*numEtaFakeAll, *denEtaAll);
2125 stileEfficiencyGraph(mEffEtaFakeAll,
"mEffEtaFakeAll",
"L0 + L1 + L2;#Eta;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2126 axetaAllPt->SetTitle(
"L0 + L1 + L2;Eta;Efficiency");
2127 axetaAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2129 mEffEtaGoodAll->Draw(
"same p");
2130 mEffEtaFakeAll->Draw(
"same p");
2132 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2133 legEta->AddEntry(mEffEtaGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2134 legEta->AddEntry(mEffEtaFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2135 legEta->Draw(
"same");
2139 std::unique_ptr<TCanvas> effPhiAll = std::make_unique<TCanvas>(
"effPhiAll");
2140 auto numPhiGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesPhiAllPt[0]->Clone(
"numPhiGoodAll"));
2141 numPhiGoodAll->Add(mNGoodMatchesPhiAllPt[1].
get());
2142 numPhiGoodAll->Add(mNGoodMatchesPhiAllPt[2].
get());
2143 numPhiGoodAll->Write();
2144 auto numPhiFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesPhiAllPt[0]->Clone(
"numPhiFakeAll"));
2145 numPhiFakeAll->Add(mNFakeMatchesPhiAllPt[1].
get());
2146 numPhiFakeAll->Add(mNFakeMatchesPhiAllPt[2].
get());
2147 numPhiFakeAll->Write();
2148 auto denPhiAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedPhiAllPt[0]->Clone(
"denPhiAll"));
2149 denPhiAll->Add(mDuplicatedPhiAllPt[1].
get());
2150 denPhiAll->Add(mDuplicatedPhiAllPt[2].
get());
2153 std::unique_ptr<TEfficiency> mEffPhiGoodAll = std::make_unique<TEfficiency>(*numPhiGoodAll, *denPhiAll);
2154 stileEfficiencyGraph(mEffPhiGoodAll,
"mEffPhiGoodAll",
"L0 + L1 + L2;#Phi (rad);Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2155 std::unique_ptr<TEfficiency> mEffPhiFakeAll = std::make_unique<TEfficiency>(*numPhiFakeAll, *denPhiAll);
2156 stileEfficiencyGraph(mEffPhiFakeAll,
"mEffPhiFakeAll",
"L0 + L1 + L2;#Phi (rad);Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2157 axphiAllPt->SetTitle(
"L0 + L1 + L2;Phi;Efficiency");
2158 axphiAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2160 mEffPhiGoodAll->Draw(
"same p");
2161 mEffPhiFakeAll->Draw(
"same p");
2163 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2164 legPhi->AddEntry(mEffPhiGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2165 legPhi->AddEntry(mEffPhiFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2166 legPhi->Draw(
"same");
2176 LOGP(info,
"getEfficiency()");
2182 unsigned int rofIndexTrack = 0;
2183 unsigned int rofNEntriesTrack = 0;
2184 unsigned int rofIndexClus = 0;
2185 unsigned int rofNEntriesClus = 0;
2188 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
2189 double a = std::log(ptcuth / ptcutl) / nbPt;
2190 for (
int i = 0;
i <= nbPt;
i++) {
2191 xbins[
i] = ptcutl * std::exp(
i *
a);
2197 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
2199 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
2200 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
2202 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
2203 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
2206 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
2207 auto track = mTracks[iTrack];
2210 auto pt = trackParCov.getPt();
2211 auto eta = trackParCov.getEta();
2213 float phiOriginal = -999.;
2215 float chi2 = track.getChi2();
2218 track.getImpactParams(0, 0, 0, 0, ip);
2227 int firstClus = track.getFirstClusterEntry();
2228 int ncl = track.getNumberOfClusters();
2237 tracklab = mTracksMCLabels[iTrack];
2243 if (mVerboseOutput && isMC) {
2244 LOGP(info,
"track Label: ");
2248 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
2249 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
2250 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
2251 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
2253 UShort_t rowOriginal = clusOriginal.getRow();
2254 UShort_t colOriginal = clusOriginal.getCol();
2257 if (clusOriginal.getChipID() >= 0 && clusOriginal.getChipID() <= 8) {
2258 l0_00->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2260 if (clusOriginal.getChipID() >= 252 && clusOriginal.getChipID() <= 260) {
2261 l1_15->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2263 if (clusOriginal.getChipID() >= 423 && clusOriginal.getChipID() <= 431) {
2264 l2_19->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2268 if (layerOriginal >=
NLAYERS) {
2272 chipmap->Fill(clusOriginal.getCol(), clusOriginal.getRow());
2274 IPOriginalxy[layerOriginal]->Fill(ip[0]);
2275 IPOriginalz[layerOriginal]->Fill(ip[1]);
2280 phiOriginal = clusOriginalPointGlob.phi();
2282 if (abs(clusOriginalPointGlob.y()) < 0.5) {
2286 if (abs(clusOriginalPointGlob.z()) >= 10) {
2290 if (rowOriginal < 2 || (rowOriginal > 15 && rowOriginal < 496) || rowOriginal > 509) {
2300 if (clusOriginal.getCol() < 160 || clusOriginal.getCol() > 870) {
2305 m2DClusterOriginalPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y());
2306 m3DClusterPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y(), clusOriginalPointGlob.z());
2307 chi2trackAccepted->Fill(chi2);
2308 denPt[layerOriginal]->Fill(pt);
2309 denPhi[layerOriginal]->Fill(phiOriginal);
2310 denEta[layerOriginal]->Fill(eta);
2311 denRow[layerOriginal]->Fill(rowOriginal);
2312 denCol[layerOriginal]->Fill(clusOriginal.getCol());
2313 denZ[layerOriginal]->Fill(clusOriginalPointGlob.z());
2314 nTracksSelected[layerOriginal]++;
2315 mDenColEta[layerOriginal]->Fill(clusOriginal.getCol(), eta);
2316 mDenRowPhi[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginalPointGlob.z());
2317 mDenRowCol[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginal.getCol());
2318 denLayers->Fill(layerOriginal);
2321 gsl::span<const o2::MCCompLabel> labsOriginal = {};
2323 labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
2326 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
2327 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
2329 std::tuple<int, double, gsl::span<const o2::MCCompLabel>> clusID_rDCA_label = {0, 999., gsl::span<const o2::MCCompLabel>()};
2331 bool adjacentFound = 0;
2332 float phiDuplicated = -999.;
2333 float ptDuplicated = -999.;
2334 float etaDuplicated = -999.;
2335 float clusZ = -999.;
2340 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
2341 auto clusDuplicated = mClusters[iClus];
2342 auto clusDuplicatedPoint = mITSClustersArray[iClus];
2346 phi = clusDuplicatedPointGlob.phi();
2349 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
2352 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
2353 if (layerDuplicated != layerOriginal) {
2356 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
2357 if (abs(staveDuplicated - staveOriginal) != 1) {
2360 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
2361 if (abs(chipDuplicated - chipOriginal) > 1) {
2365 gsl::span<const o2::MCCompLabel> labsDuplicated = {};
2367 labsDuplicated = mClustersMCLCont->
getLabels(iClus);
2373 if (!propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
2377 DCAxyData[layerDuplicated]->Fill(clusDuplicatedDCA[0]);
2378 DCAzData[layerDuplicated]->Fill(clusDuplicatedDCA[1]);
2381 if (!(clusDuplicatedDCA[0] >
mDCACutsXY[layerDuplicated][0] && clusDuplicatedDCA[0] <
mDCACutsXY[layerDuplicated][1] && clusDuplicatedDCA[1] >
mDCACutsZ[layerDuplicated][0] && clusDuplicatedDCA[1] <
mDCACutsZ[layerDuplicated][1])) {
2382 DCAxyRejected[layerDuplicated]->Fill(clusDuplicatedDCA[0]);
2383 DCAzRejected[layerDuplicated]->Fill(clusDuplicatedDCA[1]);
2387 m2DClusterDuplicatedPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y());
2388 m3DDuplicatedClusterPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y(), clusDuplicatedPointGlob.z());
2390 if (mVerboseOutput) {
2391 LOGP(info,
"Propagation ok");
2393 double rDCA = std::hypot(clusDuplicatedDCA[0], clusDuplicatedDCA[1]);
2396 if (rDCA < std::get<1>(clusID_rDCA_label)) {
2398 clusID_rDCA_label = {iClus, rDCA, labsDuplicated};
2400 clusID_rDCA_label = {iClus, rDCA, gsl::span<const o2::MCCompLabel>()};
2402 phiDuplicated = phiOriginal;
2404 etaDuplicated = eta;
2405 clusZ = clusOriginalPointGlob.z();
2406 clusDuplicatedSelected = clusDuplicated;
2413 if (!adjacentFound) {
2414 radiusNotFound[layerOriginal]->Fill(sqrt(clusOriginalPointGlob.x() * clusOriginalPointGlob.x() + clusOriginalPointGlob.y() * clusOriginalPointGlob.y()));
2415 colNotFound[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)));
2416 rowNotFound[layerOriginal]->Fill(rowOriginal);
2417 zNotFound[layerOriginal]->Fill(clusOriginalPointGlob.z());
2418 phiNotFound[layerOriginal]->Fill(phiOriginal);
2422 chipOrigVsOverlap->Fill(clusOriginal.getChipID() % 9, clusDuplicatedSelected.
getChipID() % 9);
2423 mChipFound->Fill(clusOriginal.getChipID());
2424 zFound[layerOriginal]->Fill(clusOriginalPointGlob.z());
2425 radiusFound[layerOriginal]->Fill(sqrt(clusOriginalPointGlob.x() * clusOriginalPointGlob.x() + clusOriginalPointGlob.y() * clusOriginalPointGlob.y()));
2426 colFoundOriginalVsDuplicated[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusDuplicatedSelected.
getCol() + (1024 * (clusDuplicatedSelected.
getChipID() % 9)));
2427 colFoundOriginal[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)));
2428 m2DClusterFoundPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y());
2429 phiFound[layerOriginal]->Fill(phiOriginal);
2430 rowFound[layerOriginal]->Fill(rowOriginal);
2432 nDuplicatedClusters[layerOriginal]++;
2433 numPt[layerOriginal]->Fill(pt);
2434 numPhi[layerOriginal]->Fill(phiDuplicated);
2435 numEta[layerOriginal]->Fill(etaDuplicated);
2436 numRow[layerOriginal]->Fill(rowOriginal);
2437 numCol[layerOriginal]->Fill(clusOriginal.getCol());
2438 numZ[layerOriginal]->Fill(clusOriginalPointGlob.z());
2439 mZvsPhiDUplicated[layerOriginal]->Fill(clusZ, phiDuplicated);
2440 mNumColEta[layerOriginal]->Fill(clusOriginal.getCol(), eta);
2441 mNumRowPhi[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginalPointGlob.z());
2442 mNumRowCol[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginal.getCol());
2443 numLayers->Fill(layerOriginal);
2447 bool isGood =
false;
2448 for (
auto lab : std::get<2>(clusID_rDCA_label)) {
2449 if (lab == tracklab) {
2451 numPtGood[layerOriginal]->Fill(ptDuplicated);
2452 numPhiGood[layerOriginal]->Fill(phiDuplicated);
2453 numEtaGood[layerOriginal]->Fill(etaDuplicated);
2454 numRowGood[layerOriginal]->Fill(rowOriginal);
2455 numColGood[layerOriginal]->Fill(clusOriginal.getCol());
2456 numZGood[layerOriginal]->Fill(clusOriginalPointGlob.z());
2457 numGoodLayers->Fill(layerOriginal);
2462 numPtFake[layerOriginal]->Fill(ptDuplicated);
2463 numPhiFake[layerOriginal]->Fill(phiDuplicated);
2464 numEtaFake[layerOriginal]->Fill(etaDuplicated);
2465 numRowFake[layerOriginal]->Fill(rowOriginal);
2466 numColFake[layerOriginal]->Fill(clusOriginal.getCol());
2467 numZFake[layerOriginal]->Fill(clusOriginalPointGlob.z());
2468 numFakeLayers->Fill(layerOriginal);
2476 std::cout <<
" Num of duplicated clusters L0: " << nDuplicatedClusters[0] <<
" N tracks selected: " << nTracksSelected[0] << std::endl;
2477 std::cout <<
" Num of duplicated clusters L1: " << nDuplicatedClusters[1] <<
" N tracks selected: " << nTracksSelected[1] << std::endl;
2478 std::cout <<
" Num of duplicated clusters L2: " << nDuplicatedClusters[2] <<
" N tracks selected: " << nTracksSelected[2] << std::endl;
2480 std::cout <<
" --------- N total clusters: " << totNClusters << std::endl;
2481 std::cout <<
" --------- N duplicated clusters: " << nDuplClusters << std::endl;