66 std::shared_ptr<o2::steer::MCKinematicsReader> kineReader,
67 std::shared_ptr<o2::base::GRPGeomRequest> gr) : mDataRequest(dr), mTracksSrc(
src), mUseMC(useMC), mKineReader(kineReader), mGGCCDBRequest(gr){};
75 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);
86 bool mVerboseOutput =
false;
88 std::string mOutFileName;
90 std::shared_ptr<o2::steer::MCKinematicsReader> mKineReader;
93 float mrangesPt[
NLAYERS][2] = {{0., 0.5}, {0.5, 2.}, {2., 7.5}};
96 gsl::span<const o2::itsmft::ROFRecord> mTracksROFRecords;
97 gsl::span<const o2::itsmft::ROFRecord> mClustersROFRecords;
98 gsl::span<const o2::its::TrackITS> mTracks;
99 gsl::span<const o2::MCCompLabel> mTracksMCLabels;
100 gsl::span<const o2::itsmft::CompClusterExt> mClusters;
101 gsl::span<const unsigned char> mClusPatterns;
102 gsl::span<const int> mInputITSidxs;
104 std::vector<o2::BaseCluster<float>> mITSClustersArray;
108 std::shared_ptr<DataRequest> mDataRequest;
111 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
112 std::unique_ptr<TFile> mOutFile;
113 int mDuplicated_layer[
NLAYERS] = {0};
118 std::unique_ptr<TH1D> mDCAxyOriginal[
NLAYERS];
119 std::unique_ptr<TH1D> mDCAzOriginal[
NLAYERS];
121 std::unique_ptr<TH1D> mDCAxyDuplicated;
122 std::unique_ptr<TH1D> mDCAzDuplicated;
125 std::unique_ptr<TH1D> mDCAxyDuplicated_layer[
NLAYERS];
126 std::unique_ptr<TH1D> mDCAzDuplicated_layer[
NLAYERS];
129 std::unique_ptr<TH1D> mPhiOriginal[
NLAYERS];
130 std::unique_ptr<TH1D> mEtaOriginal[
NLAYERS];
131 std::unique_ptr<TH1D> mPtOriginal[
NLAYERS];
132 std::unique_ptr<TH1D> mPtDuplicated[
NLAYERS];
133 std::unique_ptr<TH1D> mEtaDuplicated[
NLAYERS];
134 std::unique_ptr<TH1D> mPhiDuplicated[
NLAYERS];
135 std::unique_ptr<TH1D> mPhiOriginalIfDuplicated[
NLAYERS];
137 std::unique_ptr<TH2D> mZvsPhiDUplicated[
NLAYERS];
140 std::unique_ptr<TH3D> m3DClusterPositions;
141 std::unique_ptr<TH3D> m3DDuplicatedClusterPositions;
142 std::unique_ptr<TH2D> m2DClusterOriginalPositions;
143 std::unique_ptr<TH2D> m2DClusterDuplicatedPositions;
146 std::unique_ptr<TH1D> mEfficiencyGoodMatch;
147 std::unique_ptr<TH1D> mEfficiencyFakeMatch;
148 std::unique_ptr<TH1D> mEfficiencyTotal;
149 std::unique_ptr<TH1D> mEfficiencyGoodMatch_layer[
NLAYERS];
150 std::unique_ptr<TH1D> mEfficiencyFakeMatch_layer[
NLAYERS];
151 std::unique_ptr<TH1D> mEfficiencyTotal_layer[
NLAYERS];
152 std::unique_ptr<TH2D> mEfficiencyGoodMatchPt_layer[
NLAYERS];
153 std::unique_ptr<TH2D> mEfficiencyFakeMatchPt_layer[
NLAYERS];
154 std::unique_ptr<TH2D> mEfficiencyGoodMatchEta_layer[
NLAYERS];
155 std::unique_ptr<TH2D> mEfficiencyFakeMatchEta_layer[
NLAYERS];
156 std::unique_ptr<TH2D> mEfficiencyGoodMatchPhi_layer[
NLAYERS];
157 std::unique_ptr<TH2D> mEfficiencyGoodMatchPhiOriginal_layer[
NLAYERS];
158 std::unique_ptr<TH2D> mEfficiencyFakeMatchPhi_layer[
NLAYERS];
161 std::unique_ptr<TH2D> mDenColEta[
NLAYERS];
162 std::unique_ptr<TH2D> mNumColEta[
NLAYERS];
163 std::unique_ptr<TH2D> mDenRowPhi[
NLAYERS];
164 std::unique_ptr<TH2D> mNumRowPhi[
NLAYERS];
165 std::unique_ptr<TH2D> mDenRowCol[
NLAYERS];
166 std::unique_ptr<TH2D> mNumRowCol[
NLAYERS];
169 std::unique_ptr<TH2D> mPt_EtaDupl[
NLAYERS];
172 std::unique_ptr<TH1D> mDuplicatedEtaAllPt[
NLAYERS];
173 std::unique_ptr<TH1D> mDuplicatedEta[
NLAYERS][3];
174 std::unique_ptr<TH1D> mDuplicatedPhiAllPt[
NLAYERS];
175 std::unique_ptr<TH1D> mDuplicatedPhi[
NLAYERS][3];
176 std::unique_ptr<TH1D> mDuplicatedPt[
NLAYERS];
177 std::unique_ptr<TH1D> mDuplicatedRow[
NLAYERS];
178 std::unique_ptr<TH1D> mDuplicatedCol[
NLAYERS];
179 std::unique_ptr<TH1D> mDuplicatedZ[
NLAYERS];
180 std::unique_ptr<TH2D> mDuplicatedPtEta[
NLAYERS];
181 std::unique_ptr<TH2D> mDuplicatedPtPhi[
NLAYERS];
182 std::unique_ptr<TH2D> mDuplicatedEtaPhi[
NLAYERS];
185 std::unique_ptr<TH1D> mNGoodMatchesEtaAllPt[
NLAYERS];
186 std::unique_ptr<TH1D> mNGoodMatchesEta[
NLAYERS][3];
187 std::unique_ptr<TH1D> mNGoodMatchesPhiAllPt[
NLAYERS];
188 std::unique_ptr<TH1D> mNGoodMatchesPhi[
NLAYERS][3];
190 std::unique_ptr<TH1D> mNFakeMatchesEtaAllPt[
NLAYERS];
191 std::unique_ptr<TH1D> mNFakeMatchesEta[
NLAYERS][3];
192 std::unique_ptr<TH1D> mNFakeMatchesPhiAllPt[
NLAYERS];
193 std::unique_ptr<TH1D> mNFakeMatchesPhi[
NLAYERS][3];
195 std::unique_ptr<TH1D> mNGoodMatchesPt[
NLAYERS];
196 std::unique_ptr<TH1D> mNFakeMatchesPt[
NLAYERS];
198 std::unique_ptr<TH1D> mNGoodMatchesRow[
NLAYERS];
199 std::unique_ptr<TH1D> mNFakeMatchesRow[
NLAYERS];
201 std::unique_ptr<TH1D> mNGoodMatchesCol[
NLAYERS];
202 std::unique_ptr<TH1D> mNFakeMatchesCol[
NLAYERS];
204 std::unique_ptr<TH1D> mNGoodMatchesZ[
NLAYERS];
205 std::unique_ptr<TH1D> mNFakeMatchesZ[
NLAYERS];
207 std::unique_ptr<TH2D> mNGoodMatchesPtEta[
NLAYERS];
208 std::unique_ptr<TH2D> mNFakeMatchesPtEta[
NLAYERS];
210 std::unique_ptr<TH2D> mNGoodMatchesPtPhi[
NLAYERS];
211 std::unique_ptr<TH2D> mNFakeMatchesPtPhi[
NLAYERS];
213 std::unique_ptr<TH2D> mNGoodMatchesEtaPhi[
NLAYERS];
214 std::unique_ptr<TH2D> mNFakeMatchesEtaPhi[
NLAYERS];
217 std::unique_ptr<TEfficiency> mEffPtGood[
NLAYERS];
218 std::unique_ptr<TEfficiency> mEffPtFake[
NLAYERS];
219 std::unique_ptr<TEfficiency> mEffRowGood[
NLAYERS];
220 std::unique_ptr<TEfficiency> mEffRowFake[
NLAYERS];
221 std::unique_ptr<TEfficiency> mEffColGood[
NLAYERS];
222 std::unique_ptr<TEfficiency> mEffColFake[
NLAYERS];
223 std::unique_ptr<TEfficiency> mEffZGood[
NLAYERS];
224 std::unique_ptr<TEfficiency> mEffZFake[
NLAYERS];
225 std::unique_ptr<TEfficiency> mEffPtEtaGood[
NLAYERS];
226 std::unique_ptr<TEfficiency> mEffPtEtaFake[
NLAYERS];
227 std::unique_ptr<TEfficiency> mEffPtPhiGood[
NLAYERS];
228 std::unique_ptr<TEfficiency> mEffPtPhiFake[
NLAYERS];
229 std::unique_ptr<TEfficiency> mEffEtaPhiGood[
NLAYERS];
230 std::unique_ptr<TEfficiency> mEffEtaPhiFake[
NLAYERS];
232 std::unique_ptr<TEfficiency> mEffEtaGoodAllPt[
NLAYERS];
233 std::unique_ptr<TEfficiency> mEffEtaGood[
NLAYERS][3];
234 std::unique_ptr<TEfficiency> mEffEtaFakeAllPt[
NLAYERS];
235 std::unique_ptr<TEfficiency> mEffEtaFake[
NLAYERS][3];
237 std::unique_ptr<TEfficiency> mEffPhiGoodAllPt[
NLAYERS];
238 std::unique_ptr<TEfficiency> mEffPhiGood[
NLAYERS][3];
239 std::unique_ptr<TEfficiency> mEffPhiFakeAllPt[
NLAYERS];
240 std::unique_ptr<TEfficiency> mEffPhiFake[
NLAYERS][3];
242 std::unique_ptr<TH2D> mnGoodMatchesPt_layer[
NLAYERS];
243 std::unique_ptr<TH2D> mnFakeMatchesPt_layer[
NLAYERS];
245 std::unique_ptr<TH2D> mnGoodMatchesEta_layer[
NLAYERS];
246 std::unique_ptr<TH2D> mnFakeMatchesEta_layer[
NLAYERS];
248 std::unique_ptr<TH2D> mnGoodMatchesPhi_layer[
NLAYERS];
249 std::unique_ptr<TH2D> mnGoodMatchesPhiOriginal_layer[
NLAYERS];
250 std::unique_ptr<TH2D> mnFakeMatchesPhi_layer[
NLAYERS];
252 std::unique_ptr<TH1D> DCAxyData[
NLAYERS];
253 std::unique_ptr<TH1D> DCAzData[
NLAYERS];
255 std::unique_ptr<TH1D> DCAxyRejected[
NLAYERS];
256 std::unique_ptr<TH1D> DCAzRejected[
NLAYERS];
258 std::unique_ptr<TH1D> denPt[
NLAYERS];
259 std::unique_ptr<TH1D> numPt[
NLAYERS];
260 std::unique_ptr<TH1D> numPtGood[
NLAYERS];
261 std::unique_ptr<TH1D> numPtFake[
NLAYERS];
263 std::unique_ptr<TH1D> denPhi[
NLAYERS];
264 std::unique_ptr<TH1D> numPhi[
NLAYERS];
265 std::unique_ptr<TH1D> numPhiGood[
NLAYERS];
266 std::unique_ptr<TH1D> numPhiFake[
NLAYERS];
268 std::unique_ptr<TH1D> denEta[
NLAYERS];
269 std::unique_ptr<TH1D> numEta[
NLAYERS];
270 std::unique_ptr<TH1D> numEtaGood[
NLAYERS];
271 std::unique_ptr<TH1D> numEtaFake[
NLAYERS];
273 std::unique_ptr<TH1D> denRow[
NLAYERS];
274 std::unique_ptr<TH1D> numRow[
NLAYERS];
275 std::unique_ptr<TH1D> numRowGood[
NLAYERS];
276 std::unique_ptr<TH1D> numRowFake[
NLAYERS];
278 std::unique_ptr<TH1D> denCol[
NLAYERS];
279 std::unique_ptr<TH1D> numCol[
NLAYERS];
280 std::unique_ptr<TH1D> numColGood[
NLAYERS];
281 std::unique_ptr<TH1D> numColFake[
NLAYERS];
282 std::unique_ptr<TH1D> denZ[
NLAYERS];
283 std::unique_ptr<TH1D> numZ[
NLAYERS];
284 std::unique_ptr<TH1D> numZGood[
NLAYERS];
285 std::unique_ptr<TH1D> numZFake[
NLAYERS];
287 std::unique_ptr<TH1D> numLayers;
288 std::unique_ptr<TH1D> denLayers;
289 std::unique_ptr<TH1D> numGoodLayers;
290 std::unique_ptr<TH1D> numFakeLayers;
292 int nDuplicatedClusters[
NLAYERS] = {0};
293 int nTracksSelected[
NLAYERS] = {0};
295 std::unique_ptr<TH1D> IPOriginalxy[
NLAYERS];
296 std::unique_ptr<TH1D> IPOriginalz[
NLAYERS];
298 std::unique_ptr<TH1D> chipRowDuplicated[
NLAYERS];
299 std::unique_ptr<TH1D> chipRowOriginalIfDuplicated[
NLAYERS];
301 std::unique_ptr<TH1D> chi2trackAccepted;
304 std::unique_ptr<TH1D> phiFound[
NLAYERS];
305 std::unique_ptr<TH1D> rowFound[
NLAYERS];
306 std::unique_ptr<TH1D> phiNotFound[
NLAYERS];
307 std::unique_ptr<TH1D> rowNotFound[
NLAYERS];
308 std::unique_ptr<TH1D> zFound[
NLAYERS];
309 std::unique_ptr<TH1D> zNotFound[
NLAYERS];
310 std::unique_ptr<TH2D> colFoundOriginalVsDuplicated[
NLAYERS];
311 std::unique_ptr<TH1D> colFoundOriginal[
NLAYERS];
312 std::unique_ptr<TH1D> colNotFound[
NLAYERS];
313 std::unique_ptr<TH1D> radiusFound[
NLAYERS];
314 std::unique_ptr<TH1D> radiusNotFound[
NLAYERS];
315 std::unique_ptr<TH2D> m2DClusterFoundPositions;
316 std::unique_ptr<TH2D> m2DClusterNotFoundPositions;
317 std::unique_ptr<TH1D> mChipNotFound;
318 std::unique_ptr<TH1D> mChipFound;
319 std::unique_ptr<TH2D> l0_00;
320 std::unique_ptr<TH2D> l1_15;
321 std::unique_ptr<TH2D> l2_19;
322 std::unique_ptr<TH2D> chipOrigVsOverlap;
323 std::unique_ptr<TH2D> chipmap;
333 mOutFileName = pars.outFileName;
337 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
338 double a = std::log(ptcuth / ptcutl) / nbPt;
339 for (
int i = 0;
i <= nbPt;
i++) {
340 xbins[
i] = ptcutl * std::exp(
i *
a);
343 mOutFile = std::make_unique<TFile>(mOutFileName.c_str(),
"recreate");
345 mDCAxyDuplicated = std::make_unique<TH1D>(
"dcaXYDuplicated",
"Distance between track and duplicated cluster ;DCA xy (cm); ", 200, -0.01, 0.01);
346 mDCAzDuplicated = std::make_unique<TH1D>(
"dcaZDuplicated",
"Distance between track and duplicated cluster ;DCA z (cm); ", 200, -0.01, 0.01);
348 m3DClusterPositions = std::make_unique<TH3D>(
"3DClusterPositions",
";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 400, -20, 20);
349 m3DDuplicatedClusterPositions = std::make_unique<TH3D>(
"3DDuplicatedClusterPositions",
";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 500, -30, 30);
350 m2DClusterOriginalPositions = std::make_unique<TH2D>(
"m2DClusterOriginalPositions",
";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
351 m2DClusterDuplicatedPositions = std::make_unique<TH2D>(
"m2DClusterDuplicatedPositions",
";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
353 mEfficiencyGoodMatch = std::make_unique<TH1D>(
"mEfficiencyGoodMatch",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
354 mEfficiencyFakeMatch = std::make_unique<TH1D>(
"mEfficiencyFakeMatch",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
355 mEfficiencyTotal = std::make_unique<TH1D>(
"mEfficiencyTotal",
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
357 chi2trackAccepted = std::make_unique<TH1D>(
"chi2trackAccepted",
"; $#chi^{2}", 500, 0, 100);
359 m2DClusterFoundPositions = std::make_unique<TH2D>(
"m2DClusterFoundPositions",
";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
360 m2DClusterNotFoundPositions = std::make_unique<TH2D>(
"m2DClusterNotFoundPositions",
";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
361 mChipNotFound = std::make_unique<TH1D>(
"mChipNotFound",
";chipID", 432, 0, 432);
362 mChipFound = std::make_unique<TH1D>(
"mChipFound",
";chipID", 432, 0, 432);
363 l0_00 = std::make_unique<TH2D>(
"l0_00",
";col; row", 2304, -0.5, 9215.5, 128, -0.5, 511.5);
364 l1_15 = std::make_unique<TH2D>(
"l1_15",
";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
365 l2_19 = std::make_unique<TH2D>(
"l2_19",
";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
366 chipOrigVsOverlap = std::make_unique<TH2D>(
"chipOrigVsOverlap",
";chipID Overlap;chipID Original", 9, 0, 9, 9, 0, 9);
367 chipmap = std::make_unique<TH2D>(
"chipmap",
";Column;Row", 1024, 0, 1023, 512, -0.5, 511.5);
369 numLayers = std::make_unique<TH1D>(
"numLayers",
"numLayers; ; Efficiency", 3, -0.5, 2.5);
370 numGoodLayers = std::make_unique<TH1D>(
"numGoodLayers",
"numGoodLayers; ; Efficiency", 3, -0.5, 2.5);
371 numFakeLayers = std::make_unique<TH1D>(
"numFakeLayers",
"numFakeLayers; ; Efficiency", 3, -0.5, 2.5);
372 denLayers = std::make_unique<TH1D>(
"denLayers",
"denLayers; ; Efficiency", 3, -0.5, 2.5);
376 chipRowDuplicated[
i] = std::make_unique<TH1D>(Form(
"chipPosDuplicated_L%d",
i), Form(
"L%d; row",
i), 512, -0.5, 511.5);
377 chipRowOriginalIfDuplicated[
i] = std::make_unique<TH1D>(Form(
"chipPosOriginalIfDuplicated%d",
i), Form(
"L%d; row",
i), 512, -0.5, 511.5);
379 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);
380 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);
381 DCAxyRejected[
i] = std::make_unique<TH1D>(Form(
"DCAxyRejected%d",
i),
"Distance between track and original cluster (rejected) ;DCA xy (cm); ", 30000, -30, 30);
382 DCAzRejected[
i] = std::make_unique<TH1D>(Form(
"DCAzRejected%d",
i),
"Distance between track and original cluster (rejected) ;DCA z (cm); ", 30000, -30, 30);
384 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);
385 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);
387 mPhiOriginal[
i] = std::make_unique<TH1D>(Form(
"phiOriginal_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
388 mEtaOriginal[
i] = std::make_unique<TH1D>(Form(
"etaOriginal_L%d",
i),
";eta (rad); ", 100, -2, 2);
389 mPtOriginal[
i] = std::make_unique<TH1D>(Form(
"ptOriginal_L%d",
i),
";pt (GeV/c); ", 100, 0, 10);
391 mZvsPhiDUplicated[
i] = std::make_unique<TH2D>(Form(
"zvsphiDuplicated_L%d",
i),
";z (cm);phi (rad)", 400, -20, 20, 90, -3.2, 3.2);
393 mPtDuplicated[
i] = std::make_unique<TH1D>(Form(
"ptDuplicated_L%d",
i),
";pt (GeV/c); ", nbPt, 0, 7.5);
394 mEtaDuplicated[
i] = std::make_unique<TH1D>(Form(
"etaDuplicated_L%d",
i),
";eta; ", 40, -2, 2);
395 mPhiDuplicated[
i] = std::make_unique<TH1D>(Form(
"phiDuplicated_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
396 mPhiOriginalIfDuplicated[
i] = std::make_unique<TH1D>(Form(
"phiOriginalIfDuplicated_L%d",
i),
";phi (rad); ", 90, -3.2, 3.2);
397 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);
398 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);
400 mEfficiencyGoodMatch_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyGoodMatch_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
401 mEfficiencyFakeMatch_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyFakeMatch_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
402 mEfficiencyTotal_layer[
i] = std::make_unique<TH1D>(Form(
"mEfficiencyTotal_layer_L%d",
i),
";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
404 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);
405 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);
407 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);
408 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);
410 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);
411 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);
412 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);
414 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);
416 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 );
417 mDuplicatedPt[
i]->Sumw2();
418 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 );
419 mNGoodMatchesPt[
i]->Sumw2();
420 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 );
421 mNFakeMatchesPt[
i]->Sumw2();
423 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);
424 mDuplicatedRow[
i]->Sumw2();
425 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);
426 mNGoodMatchesRow[
i]->Sumw2();
427 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);
428 mNFakeMatchesRow[
i]->Sumw2();
430 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);
431 mDuplicatedCol[
i]->Sumw2();
432 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);
433 mNGoodMatchesCol[
i]->Sumw2();
434 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);
435 mNFakeMatchesCol[
i]->Sumw2();
437 mDuplicatedZ[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedZ_L%d",
i), Form(
"; Z (cm); Number of duplciated clusters L%d",
i), 100, -15, 15);
438 mDuplicatedZ[
i]->Sumw2();
439 mNGoodMatchesZ[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesZ_L%d",
i), Form(
"; Z (cm); Number of good matches L%d",
i), 100, -15, 15);
440 mNGoodMatchesZ[
i]->Sumw2();
441 mNFakeMatchesZ[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesZ_L%d",
i), Form(
";Z (cm); Number of fake matches L%d",
i), 100, -15, 15);
442 mNFakeMatchesZ[
i]->Sumw2();
444 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);
445 mDuplicatedPtEta[
i]->Sumw2();
446 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);
447 mNGoodMatchesPtEta[
i]->Sumw2();
448 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);
449 mNFakeMatchesPtEta[
i]->Sumw2();
451 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);
452 mDuplicatedPtPhi[
i]->Sumw2();
453 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);
454 mNGoodMatchesPtPhi[
i]->Sumw2();
455 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);
456 mNFakeMatchesPtPhi[
i]->Sumw2();
458 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);
459 mDuplicatedEtaPhi[
i]->Sumw2();
460 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);
461 mNGoodMatchesEtaPhi[
i]->Sumw2();
462 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);
463 mNFakeMatchesEtaPhi[
i]->Sumw2();
465 mDuplicatedEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mDuplicatedEtaAllPt_L%d",
i), Form(
"; #eta; Number of duplicated clusters L%d",
i), 40, -2, 2);
466 mNGoodMatchesEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mNGoodMatchesEtaAllPt_L%d",
i), Form(
"; #eta; Number of good matches L%d",
i), 40, -2, 2);
467 mNFakeMatchesEtaAllPt[
i] = std::make_unique<TH1D>(Form(
"mNFakeMatchesEtaAllPt_L%d",
i), Form(
"; #eta; Number of fake matches L%d",
i), 40, -2, 2);
469 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);
470 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);
471 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);
473 mnGoodMatchesPt_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesPt_layer_L%d",
i),
";pt; nGoodMatches", nbPt, 0, 7.5 , 20, 0.5, 20.5);
474 mnFakeMatchesPt_layer[
i] = std::make_unique<TH2D>(Form(
"mnFakeMatchesPt_layer_L%d",
i),
";pt; nFakeMatches", nbPt, 0, 7.5 , 20, 0.5, 20.5);
475 mnGoodMatchesEta_layer[
i] = std::make_unique<TH2D>(Form(
"mnGoodMatchesEta_layer_L%d",
i),
";#eta; nGoodMatches", 40, -2, 2, 20, 0.5, 20.5);
476 mnFakeMatchesEta_layer[
i] = std::make_unique<TH2D>(Form(
"mnFakeMatchesEta_layer_L%d",
i),
";#eta; nFakeMatches", 40, -2, 2, 20, 0.5, 20.5);
477 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);
478 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);
479 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);
481 denPt[
i] = std::make_unique<TH1D>(Form(
"denPt_L%d",
i), Form(
"denPt_L%d",
i), nbPt, 0, 7.5 );
482 numPt[
i] = std::make_unique<TH1D>(Form(
"numPt_L%d",
i), Form(
"numPt_L%d",
i), nbPt, 0, 7.5 );
483 numPtGood[
i] = std::make_unique<TH1D>(Form(
"numPtGood_L%d",
i), Form(
"numPtGood_L%d",
i), nbPt, 0, 7.5 );
484 numPtFake[
i] = std::make_unique<TH1D>(Form(
"numPtFake_L%d",
i), Form(
"numPtFake_L%d",
i), nbPt, 0, 7.5 );
486 denPhi[
i] = std::make_unique<TH1D>(Form(
"denPhi_L%d",
i), Form(
"denPhi_L%d",
i), 90, -3.2, 3.2);
487 numPhi[
i] = std::make_unique<TH1D>(Form(
"numPhi_L%d",
i), Form(
"numPhi_L%d",
i), 90, -3.2, 3.2);
488 numPhiGood[
i] = std::make_unique<TH1D>(Form(
"numPhiGood_L%d",
i), Form(
"numPhiGood_L%d",
i), 90, -3.2, 3.2);
489 numPhiFake[
i] = std::make_unique<TH1D>(Form(
"numPhiFake_L%d",
i), Form(
"numPhiFake_L%d",
i), 90, -3.2, 3.2);
491 denEta[
i] = std::make_unique<TH1D>(Form(
"denEta_L%d",
i), Form(
"denEta_L%d",
i), 200, -2, 2);
492 numEta[
i] = std::make_unique<TH1D>(Form(
"numEta_L%d",
i), Form(
"numEta_L%d",
i), 200, -2, 2);
493 numEtaGood[
i] = std::make_unique<TH1D>(Form(
"numEtaGood_L%d",
i), Form(
"numEtaGood_L%d",
i), 200, -2, 2);
494 numEtaFake[
i] = std::make_unique<TH1D>(Form(
"numEtaFake_L%d",
i), Form(
"numEtaFake_L%d",
i), 200, -2, 2);
496 denRow[
i] = std::make_unique<TH1D>(Form(
"denRow_L%d",
i), Form(
"denRow_L%d",
i), 128, -0.5, 511.5);
497 numRow[
i] = std::make_unique<TH1D>(Form(
"numRow_L%d",
i), Form(
"numRow_L%d",
i), 128, -0.5, 511.5);
498 numRowGood[
i] = std::make_unique<TH1D>(Form(
"numRowGood_L%d",
i), Form(
"numRowGood_L%d",
i), 128, -0.5, 511.5);
499 numRowFake[
i] = std::make_unique<TH1D>(Form(
"numRowFake_L%d",
i), Form(
"numRowFake_L%d",
i), 128, -0.5, 511.5);
501 denCol[
i] = std::make_unique<TH1D>(Form(
"denCol_L%d",
i), Form(
"denCol_L%d",
i), 128, -0.5, 1023.5);
502 numCol[
i] = std::make_unique<TH1D>(Form(
"numCol_L%d",
i), Form(
"numCol_L%d",
i), 128, -0.5, 1023.5);
503 numColGood[
i] = std::make_unique<TH1D>(Form(
"numColGood_L%d",
i), Form(
"numColGood_L%d",
i), 128, -0.5, 1023.5);
504 numColFake[
i] = std::make_unique<TH1D>(Form(
"numColFake_L%d",
i), Form(
"numColFake_L%d",
i), 128, -0.5, 1023.5);
506 denZ[
i] = std::make_unique<TH1D>(Form(
"denZ_L%d",
i), Form(
"denZ_L%d",
i), 100, -15, 15);
507 numZ[
i] = std::make_unique<TH1D>(Form(
"numZ_L%d",
i), Form(
"numZ_L%d",
i), 100, -15, 15);
508 numZGood[
i] = std::make_unique<TH1D>(Form(
"numZGood_L%d",
i), Form(
"numZGood_L%d",
i), 100, -15, 15);
509 numZFake[
i] = std::make_unique<TH1D>(Form(
"numZFake_L%d",
i), Form(
"numZFake_L%d",
i), 100, -15, 15);
511 mDenColEta[
i] = std::make_unique<TH2D>(Form(
"mDenColEta_L%d",
i), Form(
"mDenColEta_L%d",
i), 128, -0.5, 1023.5, 50, -1, 1);
512 mNumColEta[
i] = std::make_unique<TH2D>(Form(
"mNumColEta_L%d",
i), Form(
"mNumColEta_L%d",
i), 128, -0.5, 1023.5, 50, -1, 1);
514 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);
515 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);
517 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);
518 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);
520 IPOriginalxy[
i] = std::make_unique<TH1D>(Form(
"IPOriginalxy_L%d",
i), Form(
"IPOriginalxy_L%d",
i), 500, -0.002, 0.002);
521 IPOriginalz[
i] = std::make_unique<TH1D>(Form(
"IPOriginalz_L%d",
i), Form(
"IPOriginalz_L%d",
i), 200, -10, 10);
523 phiFound[
i] = std::make_unique<TH1D>(Form(
"phiFound_L%d",
i), Form(
"phiFound_L%d",
i), 190, -3.2, 3.2);
524 rowFound[
i] = std::make_unique<TH1D>(Form(
"rowFound_L%d",
i), Form(
"rowFound_L%d",
i), 128, -0.5, 511.5);
525 phiNotFound[
i] = std::make_unique<TH1D>(Form(
"phiNotFound_L%d",
i), Form(
"phiNotFound_L%d",
i), 90, -3.2, 3.2);
526 rowNotFound[
i] = std::make_unique<TH1D>(Form(
"rowNotFound_L%d",
i), Form(
"rowNotFound_L%d",
i), 128, -0.5, 511.5);
527 zFound[
i] = std::make_unique<TH1D>(Form(
"zFound_L%d",
i), Form(
"zFound_L%d",
i), 100, -15, 15);
528 zNotFound[
i] = std::make_unique<TH1D>(Form(
"zNotFound%d",
i), Form(
"zNotFound%d",
i), 100, -15, 15);
529 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);
530 colFoundOriginal[
i] = std::make_unique<TH1D>(Form(
"colFoundOriginal_L%d",
i), Form(
"colFoundOriginal_L%d; Col Original cluster;",
i), 9216, -0.5, 9215.5);
531 colNotFound[
i] = std::make_unique<TH1D>(Form(
"colNotFound_L%d",
i), Form(
"colNotFound_L%d",
i), 9216, -0.5, 9215.5);
532 radiusFound[
i] = std::make_unique<TH1D>(Form(
"radiusFound_L%d",
i), Form(
"radiusFound_L%d",
i), 80, 0, 6);
533 radiusNotFound[
i] = std::make_unique<TH1D>(Form(
"radiusNotFound_L%d",
i), Form(
"radiusNotFound_L%d",
i), 80, 0, 4);
535 for (
int j = 0;
j < 3;
j++) {
536 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);
537 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);
538 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);
540 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);
541 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);
542 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);
545 gStyle->SetPalette(55);
1001 LOGP(info,
"--------------- studyDCAcutsMC");
1005 double meanDCAxyDuplicated[
NLAYERS] = {0};
1006 double meanDCAzDuplicated[
NLAYERS] = {0};
1007 double sigmaDCAxyDuplicated[
NLAYERS] = {0};
1008 double sigmaDCAzDuplicated[
NLAYERS] = {0};
1010 std::ofstream ofs(
"dcaValues.csv", std::ofstream::out);
1011 ofs <<
"layer,dcaXY,dcaZ,sigmaDcaXY,sigmaDcaZ" << std::endl;
1013 for (
int l = 0; l <
NLAYERS; l++) {
1014 meanDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetMean();
1015 meanDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetMean();
1016 sigmaDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetRMS();
1017 sigmaDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetRMS();
1018 ofs << l <<
"," << meanDCAxyDuplicated[l] <<
"," << meanDCAzDuplicated[l] <<
"," << sigmaDCAxyDuplicated[l] <<
"," << sigmaDCAzDuplicated[l] << std::endl;
1021 for (
int l = 0; l <
NLAYERS; l++) {
1022 LOGP(info,
"meanDCAxyDuplicated L{}: {}, meanDCAzDuplicated: {}, sigmaDCAxyDuplicated: {}, sigmaDCAzDuplicated: {}", l, meanDCAxyDuplicated[l], meanDCAzDuplicated[l], sigmaDCAxyDuplicated[l], sigmaDCAzDuplicated[l]);
1031 std::array<float, 2> clusOriginalDCA, clusDuplicatedDCA;
1034 unsigned int rofIndexTrack = 0;
1035 unsigned int rofNEntriesTrack = 0;
1036 unsigned int rofIndexClus = 0;
1037 unsigned int rofNEntriesClus = 0;
1039 unsigned int totClus = 0;
1041 unsigned int nDCAMatches[20] = {0};
1042 unsigned int nGoodMatches[20] = {0};
1043 unsigned int nFakeMatches[20] = {0};
1045 unsigned int nGoodMatches_layer[
NLAYERS][20] = {0};
1046 unsigned int nFakeMatches_layer[
NLAYERS][20] = {0};
1049 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
1050 double a = std::log(ptcuth / ptcutl) / nbPt;
1051 for (
int i = 0;
i <= nbPt;
i++) {
1052 xbins[
i] = ptcutl * std::exp(
i *
a);
1055 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
1056 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
1057 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
1059 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
1060 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
1062 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
1063 auto track = mTracks[iTrack];
1065 auto pt = trackParCov.getPt();
1066 auto eta = trackParCov.getEta();
1069 track.getImpactParams(0, 0, 0, 0, ip);
1072 float phiOriginal = -999.;
1073 int firstClus =
track.getFirstClusterEntry();
1074 int ncl =
track.getNumberOfClusters();
1080 auto& tracklab = mTracksMCLabels[iTrack];
1081 if (tracklab.isFake()) {
1085 if (mVerboseOutput) {
1086 LOGP(info,
"--------- track Label: ");
1090 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
1091 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
1092 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
1093 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
1094 if (layerOriginal >=
NLAYERS) {
1097 auto labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
1098 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
1099 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
1104 phiOriginal = clusOriginalPointGlob.phi();
1106 for (
auto& labT : labsOriginal) {
1107 if (labT != tracklab) {
1110 if (!labT.isValid()) {
1115 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
1116 auto clusDuplicated = mClusters[iClus];
1118 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
1121 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
1122 if (layerDuplicated != layerOriginal) {
1125 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
1126 if (abs(staveDuplicated - staveOriginal) != 1) {
1129 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
1130 if (abs(chipDuplicated - chipOriginal) > 1) {
1134 auto labsDuplicated = mClustersMCLCont->
getLabels(iClus);
1137 auto clusDuplicatedPoint = mITSClustersArray[iClus];
1141 phi = clusDuplicatedPointGlob.phi();
1145 if (propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
1146 if (mVerboseOutput) {
1147 LOGP(info,
"Propagation ok");
1150 for (
int i = 0;
i < 20;
i++) {
1151 if (std::abs(
dcaXY[layerDuplicated] - clusDuplicatedDCA[0]) < (
i + 1) *
sigmaDcaXY[layerDuplicated] && std::abs(
dcaZ[layerDuplicated] - clusDuplicatedDCA[1]) < (
i + 1) *
sigmaDcaZ[layerDuplicated]) {
1153 if (mVerboseOutput) {
1154 LOGP(info,
"Check DCA ok: {} < {}; {} < {}", std::abs(meanDCAxyDuplicated[layerDuplicated] - clusDuplicatedDCA[0]), (
i + 1) * sigmaDCAxyDuplicated[layerDuplicated], std::abs(meanDCAzDuplicated[layerDuplicated] - clusDuplicatedDCA[1]), (
i + 1) * sigmaDCAzDuplicated[layerDuplicated]);
1157 bool isGoodMatch =
false;
1159 for (
auto labD : labsDuplicated) {
1160 if (mVerboseOutput) {
1161 LOGP(info,
"tracklab, labD:");
1165 if (labD == tracklab) {
1173 nGoodMatches_layer[layerDuplicated][
i]++;
1174 mnGoodMatchesPt_layer[layerDuplicated]->Fill(pt,
i);
1175 mnGoodMatchesEta_layer[layerDuplicated]->Fill(eta,
i);
1176 mnGoodMatchesPhi_layer[layerDuplicated]->Fill(phi,
i);
1177 mnGoodMatchesPhiOriginal_layer[layerDuplicated]->Fill(phiOriginal,
i);
1181 nFakeMatches_layer[layerDuplicated][
i]++;
1182 mnFakeMatchesPt_layer[layerDuplicated]->Fill(pt,
i);
1183 mnFakeMatchesEta_layer[layerDuplicated]->Fill(eta,
i);
1184 mnFakeMatchesPhi_layer[layerDuplicated]->Fill(phi,
i);
1186 }
else if (mVerboseOutput) {
1187 LOGP(info,
"Check DCA failed");
1190 }
else if (mVerboseOutput) {
1191 LOGP(info,
"Propagation failed");
1199 for (
int i = 0;
i < 20;
i++) {
1200 LOGP(info,
"Cut: {} sigma -> number of duplicated clusters: {} nDCAMatches: {} nGoodMatches: {} nFakeMatches: {}",
i + 1, duplicated, nDCAMatches[
i], nGoodMatches[
i], nFakeMatches[
i]);
1201 mEfficiencyGoodMatch->SetBinContent(
i + 1, nGoodMatches[
i]);
1202 mEfficiencyFakeMatch->SetBinContent(
i + 1, nFakeMatches[
i]);
1203 mEfficiencyTotal->SetBinContent(
i + 1,
double(nGoodMatches[
i] + nFakeMatches[
i]));
1205 for (
int l = 0; l <
NLAYERS; l++) {
1206 mEfficiencyGoodMatch_layer[l]->SetBinContent(
i + 1, nGoodMatches_layer[l][
i]);
1207 mEfficiencyFakeMatch_layer[l]->SetBinContent(
i + 1, nFakeMatches_layer[l][
i]);
1208 mEfficiencyTotal_layer[l]->SetBinContent(
i + 1,
double(nGoodMatches_layer[l][
i] + nFakeMatches_layer[l][
i]));
1210 for (
int ipt = 0; ipt < mPtDuplicated[l]->GetNbinsX(); ipt++) {
1211 if (mPtDuplicated[l]->GetBinContent(ipt + 1) != 0) {
1212 mEfficiencyGoodMatchPt_layer[l]->SetBinContent(ipt + 1,
i + 1, mnGoodMatchesPt_layer[l]->GetBinContent(ipt + 1,
i + 1) / mPtDuplicated[l]->GetBinContent(ipt + 1));
1214 mEfficiencyFakeMatchPt_layer[l]->SetBinContent(ipt + 1,
i + 1, mnFakeMatchesPt_layer[l]->GetBinContent(ipt + 1,
i + 1) / mPtDuplicated[l]->GetBinContent(ipt + 1));
1217 for (
int ieta = 0; ieta < mEtaDuplicated[l]->GetNbinsX(); ieta++) {
1218 if (mEtaDuplicated[l]->GetBinContent(ieta + 1) != 0) {
1219 mEfficiencyGoodMatchEta_layer[l]->SetBinContent(ieta + 1,
i + 1, mnGoodMatchesEta_layer[l]->GetBinContent(ieta + 1,
i + 1) / mEtaDuplicated[l]->GetBinContent(ieta + 1));
1221 mEfficiencyFakeMatchEta_layer[l]->SetBinContent(ieta + 1,
i + 1, mnFakeMatchesEta_layer[l]->GetBinContent(ieta + 1,
i + 1) / mEtaDuplicated[l]->GetBinContent(ieta + 1));
1224 for (
int iphi = 0; iphi < mPhiDuplicated[l]->GetNbinsX(); iphi++) {
1225 if (mPhiDuplicated[l]->GetBinContent(iphi + 1) != 0) {
1226 mEfficiencyGoodMatchPhi_layer[l]->SetBinContent(iphi + 1,
i + 1, mnGoodMatchesPhi_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiDuplicated[l]->GetBinContent(iphi + 1));
1228 mEfficiencyFakeMatchPhi_layer[l]->SetBinContent(iphi + 1,
i + 1, mnFakeMatchesPhi_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiDuplicated[l]->GetBinContent(iphi + 1));
1231 for (
int iphi = 0; iphi < mPhiOriginalIfDuplicated[l]->GetNbinsX(); iphi++) {
1232 if (mPhiOriginalIfDuplicated[l]->GetBinContent(iphi + 1) != 0) {
1233 mEfficiencyGoodMatchPhiOriginal_layer[l]->SetBinContent(iphi + 1,
i + 1, mnGoodMatchesPhiOriginal_layer[l]->GetBinContent(iphi + 1,
i + 1) / mPhiOriginalIfDuplicated[l]->GetBinContent(iphi + 1));
1239 std::cout <<
"+++++++++ Duplicated in layer L" <<
i <<
": " << mDuplicated_layer[
i] << std::endl;
1242 for (
int l = 0; l <
NLAYERS; l++) {
1243 mEfficiencyGoodMatch_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1244 mEfficiencyFakeMatch_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1245 mEfficiencyTotal_layer[l]->Scale(1. /
double(mDuplicated_layer[l]),
"b");
1248 mEfficiencyGoodMatch->Scale(1. /
double(duplicated),
"b");
1249 mEfficiencyFakeMatch->Scale(1. /
double(duplicated),
"b");
1250 mEfficiencyTotal->Scale(1. /
double(duplicated),
"b");
1252 mOutFile->mkdir(
"EffVsDCA2D/");
1253 mOutFile->cd(
"EffVsDCA2D/");
1254 for (
int l = 0; l <
NLAYERS; l++) {
1255 mEfficiencyGoodMatchPt_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1256 mEfficiencyGoodMatchPt_layer[l]->Write();
1257 mEfficiencyGoodMatchEta_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1258 mEfficiencyGoodMatchEta_layer[l]->Write();
1259 mEfficiencyGoodMatchPhi_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1260 mEfficiencyGoodMatchPhi_layer[l]->Write();
1261 mEfficiencyGoodMatchPhiOriginal_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1262 mEfficiencyGoodMatchPhiOriginal_layer[l]->Write();
1263 mEfficiencyFakeMatchPt_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1264 mEfficiencyFakeMatchPt_layer[l]->Write();
1265 mEfficiencyFakeMatchEta_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1266 mEfficiencyFakeMatchEta_layer[l]->Write();
1267 mEfficiencyFakeMatchPhi_layer[l]->GetZaxis()->SetRangeUser(0, 1);
1268 mEfficiencyFakeMatchPhi_layer[l]->Write();
1271 mOutFile->mkdir(
"Efficiency/");
1272 mOutFile->cd(
"Efficiency/");
1273 mEfficiencyGoodMatch->Write();
1274 mEfficiencyFakeMatch->Write();
1275 mEfficiencyTotal->Write();
1276 for (
int l = 0; l <
NLAYERS; l++) {
1278 mEfficiencyGoodMatch_layer[l]->Write();
1279 mEfficiencyFakeMatch_layer[l]->Write();
1280 mEfficiencyTotal_layer[l]->Write();
1282 mEfficiencyGoodMatch_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1283 mEfficiencyFakeMatch_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1284 mEfficiencyTotal_layer[l]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1287 mEfficiencyGoodMatch->GetYaxis()->SetRangeUser(-0.1, 1.1);
1288 mEfficiencyFakeMatch->GetYaxis()->SetRangeUser(-0.1, 1.1);
1289 mEfficiencyTotal->GetYaxis()->SetRangeUser(-0.1, 1.1);
1292 c.SetName(
"EffVsDCA_allLayers");
1293 auto leg = std::make_unique<TLegend>(0.75, 0.45, 0.89, 0.65);
1294 leg->AddEntry(mEfficiencyGoodMatch.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"p");
1295 leg->AddEntry(mEfficiencyFakeMatch.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"p");
1296 leg->AddEntry(mEfficiencyTotal.get(),
"#frac{# tot matches}{# tot duplicated clusters}",
"p");
1298 mEfficiencyGoodMatch->Draw(
"P l E1_NOSTAT PLC PMC ");
1299 mEfficiencyFakeMatch->Draw(
"same P l E1_NOSTAT PLC PMC");
1300 mEfficiencyTotal->Draw(
"same P l E1_NOSTAT PLC PMC");
1305 for (
int l = 0; l <
NLAYERS; l++) {
1307 cc[l].SetName(Form(
"EffVsDCA_layer_L%d", l));
1309 auto leg = std::make_unique<TLegend>(0.75, 0.45, 0.89, 0.65);
1310 leg->AddEntry(mEfficiencyGoodMatch_layer[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"p");
1311 leg->AddEntry(mEfficiencyFakeMatch_layer[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"p");
1312 leg->AddEntry(mEfficiencyTotal_layer[l].
get(),
"#frac{# tot matches}{# tot duplicated clusters}",
"p");
1314 mEfficiencyGoodMatch_layer[l]->SetLineColor(kBlue + 3);
1315 mEfficiencyGoodMatch_layer[l]->SetMarkerColor(kBlue + 3);
1316 mEfficiencyGoodMatch_layer[l]->Draw(
"P l E1_NOSTAT");
1317 mEfficiencyFakeMatch_layer[l]->SetLineColor(kAzure + 7);
1318 mEfficiencyFakeMatch_layer[l]->SetMarkerColor(kAzure + 7);
1319 mEfficiencyFakeMatch_layer[l]->Draw(
"same P l E1_NOSTAT");
1320 mEfficiencyTotal_layer[l]->SetLineColor(kGreen + 1);
1321 mEfficiencyTotal_layer[l]->SetMarkerColor(kGreen + 1);
1322 mEfficiencyTotal_layer[l]->Draw(
"same P l E1_NOSTAT");
1335 LOGP(info,
"--------------- studyClusterSelection");
1339 std::cout <<
"duplicated: " << duplicated << std::endl;
1341 double meanDCAxyDuplicated[
NLAYERS] = {0};
1342 double meanDCAzDuplicated[
NLAYERS] = {0};
1343 double sigmaDCAxyDuplicated[
NLAYERS] = {0};
1344 double sigmaDCAzDuplicated[
NLAYERS] = {0};
1346 for (
int l = 0; l <
NLAYERS; l++) {
1347 meanDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetMean();
1348 meanDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetMean();
1349 sigmaDCAxyDuplicated[l] = mDCAxyDuplicated_layer[l]->GetRMS();
1350 sigmaDCAzDuplicated[l] = mDCAzDuplicated_layer[l]->GetRMS();
1353 for (
int l = 0; l <
NLAYERS; l++) {
1354 LOGP(info,
"meanDCAxyDuplicated L{}: {}, meanDCAzDuplicated: {}, sigmaDCAxyDuplicated: {}, sigmaDCAzDuplicated: {}", l, meanDCAxyDuplicated[l], meanDCAzDuplicated[l], sigmaDCAxyDuplicated[l], sigmaDCAzDuplicated[l]);
1358 std::array<float, 2> clusOriginalDCA, clusDuplicatedDCA;
1361 unsigned int rofIndexTrack = 0;
1362 unsigned int rofNEntriesTrack = 0;
1363 unsigned int rofIndexClus = 0;
1364 unsigned int rofNEntriesClus = 0;
1366 unsigned int totClus = 0;
1368 unsigned int nDCAMatches[15] = {0};
1369 unsigned int nGoodMatches[15] = {0};
1370 unsigned int nFakeMatches[15] = {0};
1372 std::map<std::tuple<int, double, o2::MCCompLabel>,
bool> clusterMatchesPtEta[100][100] = {};
1374 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
1375 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
1376 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
1378 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
1379 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
1382 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
1383 auto track = mTracks[iTrack];
1388 track.getImpactParams(0, 0, 0, 0, ip);
1390 int firstClus =
track.getFirstClusterEntry();
1391 int ncl =
track.getNumberOfClusters();
1397 auto& tracklab = mTracksMCLabels[iTrack];
1398 if (tracklab.isFake()) {
1402 auto pt = trackParCov.getPt();
1403 auto eta = trackParCov.getEta();
1406 float phiOriginal = -999.;
1407 float phiDuplicated = -999.;
1408 UShort_t
row = -999;
1410 if (mVerboseOutput) {
1411 LOGP(info,
"--------- track Label: ");
1414 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
1415 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
1416 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
1417 if (layerOriginal >=
NLAYERS) {
1421 IPOriginalxy[layerOriginal]->Fill(ip[0]);
1422 IPOriginalz[layerOriginal]->Fill(ip[1]);
1424 UShort_t rowOriginal = clusOriginal.getRow();
1426 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
1430 auto phiOriginal = clusOriginalPointGlob.phi();
1432 auto labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
1433 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
1434 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
1436 std::tuple<int, double, gsl::span<const o2::MCCompLabel>> clusID_rDCA_label = {0, 999., gsl::span<const o2::MCCompLabel>()};
1438 bool adjacentFound = 0;
1440 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
1441 auto clusDuplicated = mClusters[iClus];
1444 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
1447 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
1448 if (layerDuplicated != layerOriginal) {
1451 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
1452 if (abs(staveDuplicated - staveOriginal) != 1) {
1455 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
1456 if (abs(chipDuplicated - chipOriginal) > 1) {
1460 auto labsDuplicated = mClustersMCLCont->
getLabels(iClus);
1463 auto clusDuplicatedPoint = mITSClustersArray[iClus];
1468 auto phiDuplicated = clusDuplicatedPointGlob.phi();
1472 if (!propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
1477 if (!(clusDuplicatedDCA[0] >
mDCACutsXY[layerDuplicated][0] && clusDuplicatedDCA[0] <
mDCACutsXY[layerDuplicated][1] && clusDuplicatedDCA[1] >
mDCACutsZ[layerDuplicated][0] && clusDuplicatedDCA[1] <
mDCACutsZ[layerDuplicated][1])) {
1481 if (mVerboseOutput) {
1482 LOGP(info,
"Propagation ok");
1484 double rDCA = std::hypot(clusDuplicatedDCA[0], clusDuplicatedDCA[1]);
1487 if (rDCA < std::get<1>(clusID_rDCA_label)) {
1488 clusID_rDCA_label = {iClus, rDCA, labsDuplicated};
1489 phi = phiDuplicated;
1499 if (!adjacentFound) {
1503 bool isGood =
false;
1504 for (
auto lab : std::get<2>(clusID_rDCA_label)) {
1505 if (lab == tracklab) {
1508 mNGoodMatchesPt[layerOriginal]->Fill(pt);
1509 mNGoodMatchesRow[layerOriginal]->Fill(
row);
1510 mNGoodMatchesCol[layerOriginal]->Fill(clusOriginal.getCol());
1511 mNGoodMatchesZ[layerOriginal]->Fill(clusOriginalPointGlob.Z());
1512 mNGoodMatchesPtEta[layerOriginal]->Fill(pt, eta);
1513 mNGoodMatchesPtPhi[layerOriginal]->Fill(pt, phi);
1514 mNGoodMatchesEtaPhi[layerOriginal]->Fill(eta, phi);
1516 mNGoodMatchesEtaAllPt[layerOriginal]->Fill(eta);
1517 mNGoodMatchesPhiAllPt[layerOriginal]->Fill(phi);
1518 for (
int ipt = 0; ipt < 3; ipt++) {
1519 if (pt >= mrangesPt[ipt][0] && pt < mrangesPt[ipt][1]) {
1520 mNGoodMatchesEta[layerOriginal][ipt]->Fill(eta);
1521 mNGoodMatchesPhi[layerOriginal][ipt]->Fill(phi);
1530 mNFakeMatchesPt[layerOriginal]->Fill(pt);
1531 mNFakeMatchesRow[layerOriginal]->Fill(
row);
1532 mNFakeMatchesCol[layerOriginal]->Fill(clusOriginal.getCol());
1533 mNFakeMatchesZ[layerOriginal]->Fill(clusOriginalPointGlob.Z());
1534 mNFakeMatchesPtEta[layerOriginal]->Fill(pt, eta);
1535 mNFakeMatchesPtPhi[layerOriginal]->Fill(pt, phi);
1536 mNFakeMatchesEtaPhi[layerOriginal]->Fill(eta, phi);
1537 mNFakeMatchesEtaAllPt[layerOriginal]->Fill(eta);
1538 mNFakeMatchesPhiAllPt[layerOriginal]->Fill(phi);
1540 for (
int ipt = 0; ipt < 3; ipt++) {
1541 if (pt >= mrangesPt[ipt][0] && pt < mrangesPt[ipt][1]) {
1542 mNFakeMatchesEta[layerOriginal][ipt]->Fill(eta);
1543 mNFakeMatchesPhi[layerOriginal][ipt]->Fill(phi);
1551 mOutFile->mkdir(
"EfficiencyCuts/");
1552 mOutFile->cd(
"EfficiencyCuts/");
1554 std::cout <<
"Calculating efficiency..." << std::endl;
1555 std::unique_ptr<TH1D> axpt = std::make_unique<TH1D>(
"axpt",
"", 1, 0.05, 7.5);
1556 std::unique_ptr<TH1D> axRow = std::make_unique<TH1D>(
"axRow",
"", 1, -0.5, 511.5);
1557 std::unique_ptr<TH1D> axCol = std::make_unique<TH1D>(
"axRow",
"", 1, -0.5, 1023.5);
1558 std::unique_ptr<TH1D> axZ = std::make_unique<TH1D>(
"axZ",
"", 1, -15, 15);
1559 std::unique_ptr<TH2D> axptetaGood = std::make_unique<TH2D>(
"axptetaGood",
"", 1, 0.05, 7.5, 1, -2, 2);
1560 std::unique_ptr<TH2D> axptetaFake = std::make_unique<TH2D>(
"axptetaFake",
"", 1, 0.05, 7.5, 1, -2, 2);
1561 std::unique_ptr<TH2D> axptphiGood = std::make_unique<TH2D>(
"axptphiGood",
"", 1, 0.05, 7.5, 1, -3.2, 3.2);
1562 std::unique_ptr<TH2D> axptphiFake = std::make_unique<TH2D>(
"axptphiFake",
"", 1, 0.05, 7.5, 1, -3.2, 3.2);
1563 std::unique_ptr<TH2D> axetaphiGood = std::make_unique<TH2D>(
"axetaphiGood",
"", 1, -2, 2, 1, -3.2, 3.2);
1564 std::unique_ptr<TH2D> axetaphiFake = std::make_unique<TH2D>(
"axetaphiFake",
"", 1, -2, 2, 1, -3.2, 3.2);
1565 std::unique_ptr<TH1D> axetaAllPt = std::make_unique<TH1D>(
"axetaAllPt",
"", 1, -2, 2);
1566 std::unique_ptr<TH1D> axeta[
NLAYERS];
1567 std::unique_ptr<TH1D> axphi[
NLAYERS];
1568 for (
int ipt = 0; ipt < 3; ipt++) {
1569 axeta[ipt] = std::make_unique<TH1D>(Form(
"axeta%d", ipt), Form(
"axeta%d", ipt), 1, -2, 2);
1570 axphi[ipt] = std::make_unique<TH1D>(Form(
"axphi%d", ipt), Form(
"axphi%d", ipt), 1, -3.2, 3.2);
1572 std::unique_ptr<TH1D> axphiAllPt = std::make_unique<TH1D>(
"axphi",
"", 1, -3.2, 3.2);
1574 std::unique_ptr<TCanvas> effPt[
NLAYERS];
1575 std::unique_ptr<TCanvas> effRow[
NLAYERS];
1576 std::unique_ptr<TCanvas> effCol[
NLAYERS];
1577 std::unique_ptr<TCanvas> effZ[
NLAYERS];
1578 std::unique_ptr<TCanvas> effPtEta[
NLAYERS][2];
1579 std::unique_ptr<TCanvas> effPtPhi[
NLAYERS][2];
1580 std::unique_ptr<TCanvas> effEtaPhi[
NLAYERS][2];
1581 std::unique_ptr<TCanvas> effEtaAllPt[
NLAYERS];
1582 std::unique_ptr<TCanvas> effEta[
NLAYERS][3];
1583 std::unique_ptr<TCanvas> effPhiAllPt[
NLAYERS];
1584 std::unique_ptr<TCanvas> effPhi[
NLAYERS][3];
1587 for (
int l = 0; l < 3; l++) {
1588 if (mVerboseOutput) {
1589 std::cout <<
"Pt L" << l <<
"\n\n";
1593 effPt[l] = std::make_unique<TCanvas>(Form(
"effPt_L%d", l));
1595 mEffPtGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPt[l], *mDuplicatedPt[l]);
1596 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);
1598 for (
int ibin = 1; ibin <= mNFakeMatchesPt[l]->GetNbinsX(); ibin++) {
1599 if (mNFakeMatchesPt[l]->GetBinContent(ibin) > mDuplicatedPt[l]->GetBinContent(ibin)) {
1600 std::cout <<
"--- Pt: Npass = " << mNFakeMatchesPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1601 mNFakeMatchesPt[l]->SetBinContent(ibin, mDuplicatedPt[l]->GetBinContent(ibin));
1604 mEffPtFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPt[l], *mDuplicatedPt[l]);
1605 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);
1607 axpt->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});Efficiency", l));
1608 axpt->GetYaxis()->SetRangeUser(-0.1, 1.1);
1609 axpt->GetXaxis()->SetRangeUser(0.05, 7.5);
1611 mEffPtGood[l]->Draw(
"same p");
1612 mEffPtFake[l]->Draw(
"same p");
1614 auto legpt = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1615 legpt->AddEntry(mEffPtGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1616 legpt->AddEntry(mEffPtFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1617 legpt->Draw(
"same");
1621 effPtEta[l][0] = std::make_unique<TCanvas>(Form(
"effPtEtaGood_L%d", l));
1623 mEffPtEtaGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtEta[l], *mDuplicatedPtEta[l]);
1624 stileEfficiencyGraph(mEffPtEtaGood[l], Form(
"mEffPtEtaGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1626 axptetaGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1627 axptetaGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1628 axptetaGood->GetYaxis()->SetRangeUser(-2., 2.);
1629 axptetaGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1630 axptetaGood->Draw();
1631 mEffPtEtaGood[l]->Draw(
"same colz");
1632 effPtEta[l][0]->Update();
1633 effPtEta[l][0]->Write();
1635 if (mVerboseOutput) {
1636 std::cout <<
"Underflow (bin 0,0): " << mNFakeMatchesPtEta[l]->GetBinContent(0, 0) <<
" " << mDuplicatedPtEta[l]->GetBinContent(0, 0) << std::endl;
1637 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;
1640 for (
int ibin = 1; ibin <= mNFakeMatchesPtEta[l]->GetNbinsX(); ibin++) {
1641 for (
int jbin = 1; jbin <= mNFakeMatchesPtEta[l]->GetNbinsY(); jbin++) {
1642 if (mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) > mDuplicatedPtEta[l]->GetBinContent(ibin, jbin)) {
1643 if (mVerboseOutput) {
1644 std::cout <<
"--- PtEta fakematches : Npass = " << mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtEta[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1646 mNFakeMatchesPtEta[l]->SetBinContent(ibin, jbin, mDuplicatedPtEta[l]->GetBinContent(ibin, jbin));
1652 effRow[l] = std::make_unique<TCanvas>(Form(
"effRow_L%d", l));
1654 for (
int ibin = 1; ibin <= mNGoodMatchesRow[l]->GetNbinsX(); ibin++) {
1655 std::cout <<
"--- Good Row: Npass = " << mNGoodMatchesRow[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedRow[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1658 mEffRowGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesRow[l], *mDuplicatedRow[l]);
1659 stileEfficiencyGraph(mEffRowGood[l], Form(
"mEffRowGood_L%d", l), Form(
"L%d;Row;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1661 for (
int ibin = 1; ibin <= mNFakeMatchesRow[l]->GetNbinsX(); ibin++) {
1662 if (mNFakeMatchesRow[l]->GetBinContent(ibin) > mDuplicatedRow[l]->GetBinContent(ibin)) {
1663 std::cout <<
"--- Row: Npass = " << mNFakeMatchesRow[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedRow[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1664 mNFakeMatchesRow[l]->SetBinContent(ibin, mDuplicatedRow[l]->GetBinContent(ibin));
1667 mEffRowFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesRow[l], *mDuplicatedRow[l]);
1668 stileEfficiencyGraph(mEffRowFake[l], Form(
"mEffRowFake_L%d", l), Form(
"L%d;Row;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1670 axRow->SetTitle(Form(
"L%d;Row;Efficiency", l));
1671 axRow->GetYaxis()->SetRangeUser(-0.1, 1.1);
1672 axRow->GetXaxis()->SetRangeUser(0, 512);
1674 mEffRowGood[l]->Draw(
"same p");
1675 mEffRowFake[l]->Draw(
"same p");
1677 auto legRow = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1678 legRow->AddEntry(mEffRowGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1679 legRow->AddEntry(mEffRowFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1680 legRow->Draw(
"same");
1684 effCol[l] = std::make_unique<TCanvas>(Form(
"effCol_L%d", l));
1686 for (
int ibin = 1; ibin <= mNGoodMatchesCol[l]->GetNbinsX(); ibin++) {
1687 std::cout <<
"--- Good Col: Npass = " << mNGoodMatchesCol[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedCol[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1690 mEffColGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesCol[l], *mDuplicatedCol[l]);
1691 stileEfficiencyGraph(mEffColGood[l], Form(
"mEffColGood_L%d", l), Form(
"L%d;Col;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1693 for (
int ibin = 1; ibin <= mNFakeMatchesCol[l]->GetNbinsX(); ibin++) {
1694 if (mNFakeMatchesCol[l]->GetBinContent(ibin) > mDuplicatedCol[l]->GetBinContent(ibin)) {
1695 std::cout <<
"--- Col: Npass = " << mNFakeMatchesCol[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedCol[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1696 mNFakeMatchesCol[l]->SetBinContent(ibin, mDuplicatedCol[l]->GetBinContent(ibin));
1699 mEffColFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesCol[l], *mDuplicatedCol[l]);
1700 stileEfficiencyGraph(mEffColFake[l], Form(
"mEffColFake_L%d", l), Form(
"L%d;Col;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1702 axCol->SetTitle(Form(
"L%d;Col;Efficiency", l));
1703 axCol->GetYaxis()->SetRangeUser(-0.1, 1.1);
1704 axCol->GetXaxis()->SetRangeUser(0, 1024);
1706 mEffColGood[l]->Draw(
"same p");
1707 mEffColFake[l]->Draw(
"same p");
1709 auto legCol = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1710 legCol->AddEntry(mEffColGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1711 legCol->AddEntry(mEffColFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1712 legCol->Draw(
"same");
1716 effZ[l] = std::make_unique<TCanvas>(Form(
"effZ_L%d", l));
1718 for (
int ibin = 1; ibin <= mNGoodMatchesZ[l]->GetNbinsX(); ibin++) {
1719 std::cout <<
"--- Good Z: Npass = " << mNGoodMatchesZ[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedZ[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1722 mEffZGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesZ[l], *mDuplicatedZ[l]);
1723 stileEfficiencyGraph(mEffZGood[l], Form(
"mEffZGood_L%d", l), Form(
"L%d;Z;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1725 for (
int ibin = 1; ibin <= mNFakeMatchesZ[l]->GetNbinsX(); ibin++) {
1726 if (mNFakeMatchesZ[l]->GetBinContent(ibin) > mDuplicatedZ[l]->GetBinContent(ibin)) {
1727 std::cout <<
"--- Z: Npass = " << mNFakeMatchesZ[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedZ[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1728 mNFakeMatchesZ[l]->SetBinContent(ibin, mDuplicatedZ[l]->GetBinContent(ibin));
1731 mEffZFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesZ[l], *mDuplicatedZ[l]);
1732 stileEfficiencyGraph(mEffZFake[l], Form(
"mEffZFake_L%d", l), Form(
"L%d;Z;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1734 axZ->SetTitle(Form(
"L%d;Z;Efficiency", l));
1735 axZ->GetYaxis()->SetRangeUser(-0.1, 1.1);
1736 axZ->GetXaxis()->SetRangeUser(0, 512);
1738 mEffZGood[l]->Draw(
"same p");
1739 mEffZFake[l]->Draw(
"same p");
1741 auto legZ = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1742 legZ->AddEntry(mEffZGood[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1743 legZ->AddEntry(mEffZFake[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1748 effPtEta[l][0] = std::make_unique<TCanvas>(Form(
"effPtEtaGood_L%d", l));
1750 mEffPtEtaGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtEta[l], *mDuplicatedPtEta[l]);
1751 stileEfficiencyGraph(mEffPtEtaGood[l], Form(
"mEffPtEtaGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1753 axptetaGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1754 axptetaGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1755 axptetaGood->GetYaxis()->SetRangeUser(-2., 2.);
1756 axptetaGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1757 axptetaGood->Draw();
1758 mEffPtEtaGood[l]->Draw(
"same colz");
1759 effPtEta[l][0]->Update();
1760 effPtEta[l][0]->Write();
1762 if (mVerboseOutput) {
1763 std::cout <<
"Underflow (bin 0,0): " << mNFakeMatchesPtEta[l]->GetBinContent(0, 0) <<
" " << mDuplicatedPtEta[l]->GetBinContent(0, 0) << std::endl;
1764 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;
1767 for (
int ibin = 1; ibin <= mNFakeMatchesPtEta[l]->GetNbinsX(); ibin++) {
1768 for (
int jbin = 1; jbin <= mNFakeMatchesPtEta[l]->GetNbinsY(); jbin++) {
1769 if (mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) > mDuplicatedPtEta[l]->GetBinContent(ibin, jbin)) {
1770 if (mVerboseOutput) {
1771 std::cout <<
"--- PtEta fakematches : Npass = " << mNFakeMatchesPtEta[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtEta[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1773 mNFakeMatchesPtEta[l]->SetBinContent(ibin, jbin, mDuplicatedPtEta[l]->GetBinContent(ibin, jbin));
1779 effPtEta[l][1] = std::make_unique<TCanvas>(Form(
"effPtEtaFake_L%d", l));
1781 mEffPtEtaFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPtEta[l], *mDuplicatedPtEta[l]);
1782 stileEfficiencyGraph(mEffPtEtaFake[l], Form(
"mEffPtEtaFake_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l),
true);
1783 axptetaFake->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#eta;Efficiency", l));
1784 axptetaFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1785 axptetaFake->GetYaxis()->SetRangeUser(-2., 2.);
1786 axptetaFake->GetXaxis()->SetRangeUser(0.05, 7.5);
1787 axptetaFake->Draw();
1788 mEffPtEtaFake[l]->Draw(
"same colz");
1789 effPtEta[l][1]->Update();
1790 effPtEta[l][1]->Write();
1793 effPtPhi[l][0] = std::make_unique<TCanvas>(Form(
"effPtPhiGood_L%d", l));
1795 mEffPtPhiGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPtPhi[l], *mDuplicatedPtPhi[l]);
1796 stileEfficiencyGraph(mEffPtPhiGood[l], Form(
"mEffPtPhiGood_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l),
true);
1798 axptphiGood->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l));
1799 axptphiGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1800 axptphiGood->GetYaxis()->SetRangeUser(-3.2, 3.2);
1801 axptphiGood->GetXaxis()->SetRangeUser(0.05, 7.5);
1802 axptphiGood->Draw();
1803 mEffPtPhiGood[l]->Draw(
"same colz");
1804 effPtPhi[l][0]->Update();
1805 effPtPhi[l][0]->Write();
1807 for (
int ibin = 1; ibin <= mNFakeMatchesPtPhi[l]->GetNbinsX(); ibin++) {
1808 for (
int jbin = 1; jbin <= mNFakeMatchesPtPhi[l]->GetNbinsY(); jbin++) {
1809 if (mNFakeMatchesPtPhi[l]->GetBinContent(ibin, jbin) > mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin)) {
1810 if (mVerboseOutput) {
1811 std::cout <<
"--- Pt: Npass = " << mNFakeMatchesPtPhi[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1813 mNFakeMatchesPtPhi[l]->SetBinContent(ibin, jbin, mDuplicatedPtPhi[l]->GetBinContent(ibin, jbin));
1819 effPtPhi[l][1] = std::make_unique<TCanvas>(Form(
"effPtPhiFake_L%d", l));
1821 mEffPtPhiFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPtPhi[l], *mDuplicatedPtPhi[l]);
1822 stileEfficiencyGraph(mEffPtPhiFake[l], Form(
"mEffPtPhiFake_L%d", l), Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l),
true);
1823 axptphiFake->SetTitle(Form(
"L%d;#it{p}_{T} (GeV/#it{c});#phi (rad);Efficiency", l));
1824 axptphiFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1825 axptphiFake->GetYaxis()->SetRangeUser(-3.2, 3.2);
1826 axptphiFake->GetXaxis()->SetRangeUser(0.05, 7.5);
1827 axptphiFake->Draw();
1828 mEffPtPhiFake[l]->Draw(
"same colz");
1829 effPtPhi[l][1]->Update();
1830 effPtPhi[l][1]->Write();
1833 effEtaPhi[l][0] = std::make_unique<TCanvas>(Form(
"effEtaPhiGood_L%d", l));
1835 mEffEtaPhiGood[l] = std::make_unique<TEfficiency>(*mNGoodMatchesEtaPhi[l], *mDuplicatedEtaPhi[l]);
1836 stileEfficiencyGraph(mEffEtaPhiGood[l], Form(
"mEffEtaPhiGood_L%d", l), Form(
"L%d;#eta;#phi (rad);Efficiency", l),
true);
1838 axetaphiGood->SetTitle(Form(
"L%d;#eta;#phi (rad);Efficiency", l));
1839 axetaphiGood->GetZaxis()->SetRangeUser(-0.1, 1.1);
1840 axetaphiGood->GetYaxis()->SetRangeUser(-3.2, 3.2);
1841 axetaphiGood->GetXaxis()->SetRangeUser(-2, 2);
1842 axetaphiGood->Draw();
1843 mEffEtaPhiGood[l]->Draw(
"same colz");
1844 effEtaPhi[l][0]->Update();
1845 effEtaPhi[l][0]->Write();
1847 for (
int ibin = 1; ibin <= mNFakeMatchesEtaPhi[l]->GetNbinsX(); ibin++) {
1848 for (
int jbin = 1; jbin <= mNFakeMatchesEtaPhi[l]->GetNbinsY(); jbin++) {
1849 if (mNFakeMatchesEtaPhi[l]->GetBinContent(ibin, jbin) > mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin)) {
1850 if (mVerboseOutput) {
1851 std::cout <<
"--- Eta: Npass = " << mNFakeMatchesEtaPhi[l]->GetBinContent(ibin, jbin) <<
", Nall = " << mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin) <<
" for ibin = " << ibin <<
", jbin = " << jbin << std::endl;
1853 mNFakeMatchesEtaPhi[l]->SetBinContent(ibin, jbin, mDuplicatedEtaPhi[l]->GetBinContent(ibin, jbin));
1859 effEtaPhi[l][1] = std::make_unique<TCanvas>(Form(
"effEtaPhiFake_L%d", l));
1861 mEffEtaPhiFake[l] = std::make_unique<TEfficiency>(*mNFakeMatchesEtaPhi[l], *mDuplicatedEtaPhi[l]);
1862 stileEfficiencyGraph(mEffEtaPhiFake[l], Form(
"mEffEtaPhiFake_L%d", l), Form(
"L%d;#eta;#phi (rad);Efficiency", l),
true);
1863 axetaphiFake->SetTitle(Form(
"L%d;#eta;#phi (rad);Efficiency", l));
1864 axetaphiFake->GetZaxis()->SetRangeUser(-0.1, 1.1);
1865 axetaphiFake->GetYaxis()->SetRangeUser(-3.2, 3.2);
1866 axetaphiFake->GetXaxis()->SetRangeUser(-2, 2);
1867 axetaphiFake->Draw();
1868 mEffEtaPhiFake[l]->Draw(
"same colz");
1869 effEtaPhi[l][1]->Update();
1870 effEtaPhi[l][1]->Write();
1873 if (mVerboseOutput) {
1874 std::cout <<
"Eta L" << l <<
"\n\n";
1877 effEtaAllPt[l] = std::make_unique<TCanvas>(Form(
"effEtaAllPt_L%d", l));
1879 mEffEtaGoodAllPt[l] = std::make_unique<TEfficiency>(*mNGoodMatchesEtaAllPt[l], *mDuplicatedEtaAllPt[l]);
1880 stileEfficiencyGraph(mEffEtaGoodAllPt[l], Form(
"mEffEtaGoodAllPt_L%d", l), Form(
"L%d;#eta;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1882 for (
int ibin = 1; ibin <= mNFakeMatchesEtaAllPt[l]->GetNbinsX(); ibin++) {
1883 if (mNFakeMatchesEtaAllPt[l]->GetBinContent(ibin) > mDuplicatedEtaAllPt[l]->GetBinContent(ibin)) {
1884 if (mVerboseOutput) {
1885 std::cout <<
"--- EtaAllPt: Npass = " << mNFakeMatchesEtaAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedEtaAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1887 mNFakeMatchesEtaAllPt[l]->SetBinContent(ibin, mDuplicatedEtaAllPt[l]->GetBinContent(ibin));
1890 mEffEtaFakeAllPt[l] = std::make_unique<TEfficiency>(*mNFakeMatchesEtaAllPt[l], *mDuplicatedEtaAllPt[l]);
1891 stileEfficiencyGraph(mEffEtaFakeAllPt[l], Form(
"mEffEtaFakeAllPt_L%d", l), Form(
"L%d;#eta;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
1893 axetaAllPt->SetTitle(Form(
"L%d;#eta;Efficiency", l));
1894 axetaAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
1897 mEffEtaGoodAllPt[l]->Draw(
"same p");
1898 mEffEtaFakeAllPt[l]->Draw(
"same p");
1900 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1901 legEta->AddEntry(mEffEtaGoodAllPt[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1902 legEta->AddEntry(mEffEtaFakeAllPt[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1903 legEta->Draw(
"same");
1904 effEtaAllPt[l]->Write();
1907 for (
int ipt = 0; ipt < 3; ipt++) {
1909 effEta[l][ipt] = std::make_unique<TCanvas>(Form(
"effEta_L%d_pt%d", l, ipt));
1911 mEffEtaGood[l][ipt] = std::make_unique<TEfficiency>(*mNGoodMatchesEta[l][ipt], *mDuplicatedEta[l][ipt]);
1912 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);
1914 for (
int ibin = 1; ibin <= mNFakeMatchesEta[l][ipt]->GetNbinsX(); ibin++) {
1915 if (mNFakeMatchesEta[l][ipt]->GetBinContent(ibin) > mDuplicatedEta[l][ipt]->GetBinContent(ibin)) {
1916 if (mVerboseOutput) {
1917 std::cout <<
"--- Eta : Npass = " << mNFakeMatchesEta[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedEta[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1919 mNFakeMatchesEta[l][ipt]->SetBinContent(ibin, mDuplicatedEta[l][ipt]->GetBinContent(ibin));
1923 mEffEtaFake[l][ipt] = std::make_unique<TEfficiency>(*mNFakeMatchesEta[l][ipt], *mDuplicatedEta[l][ipt]);
1924 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);
1926 axeta[ipt]->SetTitle(Form(
"L%d %.1f #leq #it{p}_{T} < %.1f GeV/#it{c};#eta;Efficiency", l, mrangesPt[ipt][0], mrangesPt[ipt][1]));
1927 axeta[ipt]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1930 mEffEtaGood[l][ipt]->Draw(
"same p");
1931 mEffEtaFake[l][ipt]->Draw(
"same p");
1933 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1934 legEta->AddEntry(mEffEtaGood[l][ipt].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1935 legEta->AddEntry(mEffEtaFake[l][ipt].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1936 legEta->Draw(
"same");
1937 effEta[l][ipt]->Write();
1940 effPhi[l][ipt] = std::make_unique<TCanvas>(Form(
"effPhi_L%d_pt%d", l, ipt));
1942 for (
int ibin = 1; ibin <= mNGoodMatchesPhi[l][ipt]->GetNbinsX(); ibin++) {
1943 if (mNGoodMatchesPhi[l][ipt]->GetBinContent(ibin) > mDuplicatedPhi[l][ipt]->GetBinContent(ibin)) {
1944 if (mVerboseOutput) {
1945 std::cout <<
"--- Phi L: Npass = " << mNGoodMatchesPhi[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhi[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1947 mNGoodMatchesPhi[l][ipt]->SetBinContent(ibin, 0);
1951 mEffPhiGood[l][ipt] = std::make_unique<TEfficiency>(*mNGoodMatchesPhi[l][ipt], *mDuplicatedPhi[l][ipt]);
1952 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);
1954 for (
int ibin = 1; ibin <= mNFakeMatchesPhi[l][ipt]->GetNbinsX(); ibin++) {
1955 if (mNFakeMatchesPhi[l][ipt]->GetBinContent(ibin) > mDuplicatedPhi[l][ipt]->GetBinContent(ibin)) {
1956 if (mVerboseOutput) {
1957 std::cout <<
"--- Phi L: Npass = " << mNFakeMatchesPhi[l][ipt]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhi[l][ipt]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1959 mNFakeMatchesPhi[l][ipt]->SetBinContent(ibin, mDuplicatedPhi[l][ipt]->GetBinContent(ibin));
1963 mEffPhiFake[l][ipt] = std::make_unique<TEfficiency>(*mNFakeMatchesPhi[l][ipt], *mDuplicatedPhi[l][ipt]);
1964 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);
1966 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]));
1967 axphi[ipt]->GetYaxis()->SetRangeUser(-0.1, 1.1);
1970 mEffPhiGood[l][ipt]->Draw(
"same p");
1971 mEffPhiFake[l][ipt]->Draw(
"same p");
1973 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
1974 legPhi->AddEntry(mEffPhiGood[l][ipt].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
1975 legPhi->AddEntry(mEffPhiFake[l][ipt].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
1976 legPhi->Draw(
"same");
1977 effPhi[l][ipt]->Write();
1981 if (mVerboseOutput) {
1982 std::cout <<
"Phi L" << l <<
"\n\n";
1985 effPhiAllPt[l] = std::make_unique<TCanvas>(Form(
"effPhiAllPt_L%d", l));
1987 for (
int ibin = 1; ibin <= mNGoodMatchesPhiAllPt[l]->GetNbinsX(); ibin++) {
1988 if (mNGoodMatchesPhiAllPt[l]->GetBinContent(ibin) > mDuplicatedPhiAllPt[l]->GetBinContent(ibin)) {
1989 if (mVerboseOutput) {
1990 std::cout <<
"--- phi all good Npass = " << mNGoodMatchesPhiAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhiAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
1992 mNGoodMatchesPhiAllPt[l]->SetBinContent(ibin, 0);
1996 mEffPhiGoodAllPt[l] = std::make_unique<TEfficiency>(*mNGoodMatchesPhiAllPt[l], *mDuplicatedPhiAllPt[l]);
1997 stileEfficiencyGraph(mEffPhiGoodAllPt[l], Form(
"mEffPhiGoodAllPt_L%d", l), Form(
"L%d;#phi;Efficiency", l),
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
1999 for (
int ibin = 1; ibin <= mNFakeMatchesPhiAllPt[l]->GetNbinsX(); ibin++) {
2000 if (mNFakeMatchesPhiAllPt[l]->GetBinContent(ibin) > mDuplicatedPhiAllPt[l]->GetBinContent(ibin)) {
2001 if (mVerboseOutput) {
2002 std::cout <<
"--- phi all fake Npass = " << mNFakeMatchesPhiAllPt[l]->GetBinContent(ibin) <<
", Nall = " << mDuplicatedPhiAllPt[l]->GetBinContent(ibin) <<
" for ibin = " << ibin << std::endl;
2004 mNFakeMatchesPhiAllPt[l]->SetBinContent(ibin, mDuplicatedPhiAllPt[l]->GetBinContent(ibin));
2007 mEffPhiFakeAllPt[l] = std::make_unique<TEfficiency>(*mNFakeMatchesPhiAllPt[l], *mDuplicatedPhiAllPt[l]);
2008 stileEfficiencyGraph(mEffPhiFakeAllPt[l], Form(
"mEffPhiFakeAllPt_L%d", l), Form(
"L%d;#phi;Efficiency", l),
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2010 axphiAllPt->SetTitle(Form(
"L%d;#phi;Efficiency", l));
2011 axphiAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2013 mEffPhiGoodAllPt[l]->Draw(
"same p");
2014 mEffPhiFakeAllPt[l]->Draw(
"same p");
2016 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2017 legPhi->AddEntry(mEffPhiGoodAllPt[l].
get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2018 legPhi->AddEntry(mEffPhiFakeAllPt[l].
get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2019 legPhi->Draw(
"same");
2020 effPhiAllPt[l]->Write();
2024 std::unique_ptr<TCanvas> effRowAll = std::make_unique<TCanvas>(
"effRowAll");
2025 auto numRowGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesRow[0]->Clone(
"numRowGoodAll"));
2026 numRowGoodAll->Add(mNGoodMatchesRow[1].
get());
2027 numRowGoodAll->Add(mNGoodMatchesRow[2].
get());
2028 numRowGoodAll->Write();
2029 auto numRowFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesRow[0]->Clone(
"numRowFakeAll"));
2030 numRowFakeAll->Add(mNFakeMatchesRow[1].
get());
2031 numRowFakeAll->Add(mNFakeMatchesRow[2].
get());
2032 numRowFakeAll->Write();
2033 auto denRowAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedRow[0]->Clone(
"denRowAll"));
2034 denRowAll->Add(mDuplicatedRow[1].
get());
2035 denRowAll->Add(mDuplicatedRow[2].
get());
2038 std::unique_ptr<TEfficiency> mEffRowGoodAll = std::make_unique<TEfficiency>(*numRowGoodAll, *denRowAll);
2039 stileEfficiencyGraph(mEffRowGoodAll,
"mEffRowGoodAll",
"L0 + L1 + L2;Row;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2040 std::unique_ptr<TEfficiency> mEffRowFakeAll = std::make_unique<TEfficiency>(*numRowFakeAll, *denRowAll);
2041 stileEfficiencyGraph(mEffRowFakeAll,
"mEffRowFakeAll",
"L0 + L1 + L2;Row;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2042 axRow->SetTitle(
"L0 + L1 + L2;Row;Efficiency");
2043 axRow->GetYaxis()->SetRangeUser(-0.1, 1.1);
2045 mEffRowGoodAll->Draw(
"same p");
2046 mEffRowFakeAll->Draw(
"same p");
2048 auto legRow = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2049 legRow->AddEntry(mEffRowGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2050 legRow->AddEntry(mEffRowFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2051 legRow->Draw(
"same");
2055 std::unique_ptr<TCanvas> effColAll = std::make_unique<TCanvas>(
"effColAll");
2056 auto numColGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesCol[0]->Clone(
"numColGoodAll"));
2057 numColGoodAll->Add(mNGoodMatchesCol[1].
get());
2058 numColGoodAll->Add(mNGoodMatchesCol[2].
get());
2059 numColGoodAll->Write();
2060 auto numColFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesCol[0]->Clone(
"numColFakeAll"));
2061 numColFakeAll->Add(mNFakeMatchesCol[1].
get());
2062 numColFakeAll->Add(mNFakeMatchesCol[2].
get());
2063 numColFakeAll->Write();
2064 auto denColAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedCol[0]->Clone(
"denColAll"));
2065 denColAll->Add(mDuplicatedCol[1].
get());
2066 denColAll->Add(mDuplicatedCol[2].
get());
2069 std::unique_ptr<TEfficiency> mEffColGoodAll = std::make_unique<TEfficiency>(*numColGoodAll, *denColAll);
2070 stileEfficiencyGraph(mEffColGoodAll,
"mEffColGoodAll",
"L0 + L1 + L2;Column;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2071 std::unique_ptr<TEfficiency> mEffColFakeAll = std::make_unique<TEfficiency>(*numColFakeAll, *denColAll);
2072 stileEfficiencyGraph(mEffColFakeAll,
"mEffColFakeAll",
"L0 + L1 + L2;Column;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2073 axCol->SetTitle(
"L0 + L1 + L2;Col;Efficiency");
2074 axCol->GetYaxis()->SetRangeUser(-0.1, 1.1);
2076 mEffColGoodAll->Draw(
"same p");
2077 mEffColFakeAll->Draw(
"same p");
2079 auto legCol = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2080 legCol->AddEntry(mEffColGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2081 legCol->AddEntry(mEffColFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2082 legCol->Draw(
"same");
2086 std::unique_ptr<TCanvas> effZAll = std::make_unique<TCanvas>(
"effZAll");
2087 auto numZGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesZ[0]->Clone(
"numZGoodAll"));
2088 numZGoodAll->Add(mNGoodMatchesZ[1].
get());
2089 numZGoodAll->Add(mNGoodMatchesZ[2].
get());
2090 numZGoodAll->Write();
2091 auto numZFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesZ[0]->Clone(
"numZFakeAll"));
2092 numZFakeAll->Add(mNFakeMatchesZ[1].
get());
2093 numZFakeAll->Add(mNFakeMatchesZ[2].
get());
2094 numZFakeAll->Write();
2095 auto denZAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedZ[0]->Clone(
"denZAll"));
2096 denZAll->Add(mDuplicatedZ[1].
get());
2097 denZAll->Add(mDuplicatedZ[2].
get());
2100 std::unique_ptr<TEfficiency> mEffZGoodAll = std::make_unique<TEfficiency>(*numZGoodAll, *denZAll);
2101 stileEfficiencyGraph(mEffZGoodAll,
"mEffZGoodAll",
"L0 + L1 + L2;Z;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2102 std::unique_ptr<TEfficiency> mEffZFakeAll = std::make_unique<TEfficiency>(*numZFakeAll, *denZAll);
2103 stileEfficiencyGraph(mEffZFakeAll,
"mEffZFakeAll",
"L0 + L1 + L2;Z;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2104 axZ->SetTitle(
"L0 + L1 + L2;Z;Efficiency");
2105 axZ->GetYaxis()->SetRangeUser(-0.1, 1.1);
2107 mEffZGoodAll->Draw(
"same p");
2108 mEffZFakeAll->Draw(
"same p");
2110 auto legZ = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2111 legZ->AddEntry(mEffZGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2112 legZ->AddEntry(mEffZFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2117 std::unique_ptr<TCanvas> effEtaAll = std::make_unique<TCanvas>(
"effEtaAll");
2118 auto numEtaGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesEtaAllPt[0]->Clone(
"numEtaGoodAll"));
2119 numEtaGoodAll->Add(mNGoodMatchesEtaAllPt[1].
get());
2120 numEtaGoodAll->Add(mNGoodMatchesEtaAllPt[2].
get());
2121 numEtaGoodAll->Write();
2122 auto numEtaFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesEtaAllPt[0]->Clone(
"numEtaFakeAll"));
2123 numEtaFakeAll->Add(mNFakeMatchesEtaAllPt[1].
get());
2124 numEtaFakeAll->Add(mNFakeMatchesEtaAllPt[2].
get());
2125 numEtaFakeAll->Write();
2126 auto denEtaAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedEtaAllPt[0]->Clone(
"denEtaAll"));
2127 denEtaAll->Add(mDuplicatedEtaAllPt[1].
get());
2128 denEtaAll->Add(mDuplicatedEtaAllPt[2].
get());
2131 std::unique_ptr<TEfficiency> mEffEtaGoodAll = std::make_unique<TEfficiency>(*numEtaGoodAll, *denEtaAll);
2132 stileEfficiencyGraph(mEffEtaGoodAll,
"mEffEtaGoodAll",
"L0 + L1 + L2;#Eta;Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2133 std::unique_ptr<TEfficiency> mEffEtaFakeAll = std::make_unique<TEfficiency>(*numEtaFakeAll, *denEtaAll);
2134 stileEfficiencyGraph(mEffEtaFakeAll,
"mEffEtaFakeAll",
"L0 + L1 + L2;#Eta;Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2135 axetaAllPt->SetTitle(
"L0 + L1 + L2;Eta;Efficiency");
2136 axetaAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2138 mEffEtaGoodAll->Draw(
"same p");
2139 mEffEtaFakeAll->Draw(
"same p");
2141 auto legEta = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2142 legEta->AddEntry(mEffEtaGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2143 legEta->AddEntry(mEffEtaFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2144 legEta->Draw(
"same");
2148 std::unique_ptr<TCanvas> effPhiAll = std::make_unique<TCanvas>(
"effPhiAll");
2149 auto numPhiGoodAll = std::unique_ptr<TH1D>((TH1D*)mNGoodMatchesPhiAllPt[0]->Clone(
"numPhiGoodAll"));
2150 numPhiGoodAll->Add(mNGoodMatchesPhiAllPt[1].
get());
2151 numPhiGoodAll->Add(mNGoodMatchesPhiAllPt[2].
get());
2152 numPhiGoodAll->Write();
2153 auto numPhiFakeAll = std::unique_ptr<TH1D>((TH1D*)mNFakeMatchesPhiAllPt[0]->Clone(
"numPhiFakeAll"));
2154 numPhiFakeAll->Add(mNFakeMatchesPhiAllPt[1].
get());
2155 numPhiFakeAll->Add(mNFakeMatchesPhiAllPt[2].
get());
2156 numPhiFakeAll->Write();
2157 auto denPhiAll = std::unique_ptr<TH1D>((TH1D*)mDuplicatedPhiAllPt[0]->Clone(
"denPhiAll"));
2158 denPhiAll->Add(mDuplicatedPhiAllPt[1].
get());
2159 denPhiAll->Add(mDuplicatedPhiAllPt[2].
get());
2162 std::unique_ptr<TEfficiency> mEffPhiGoodAll = std::make_unique<TEfficiency>(*numPhiGoodAll, *denPhiAll);
2163 stileEfficiencyGraph(mEffPhiGoodAll,
"mEffPhiGoodAll",
"L0 + L1 + L2;#Phi (rad);Efficiency",
false, kFullDiamond, 1, kGreen + 3, kGreen + 3);
2164 std::unique_ptr<TEfficiency> mEffPhiFakeAll = std::make_unique<TEfficiency>(*numPhiFakeAll, *denPhiAll);
2165 stileEfficiencyGraph(mEffPhiFakeAll,
"mEffPhiFakeAll",
"L0 + L1 + L2;#Phi (rad);Efficiency",
false, kFullDiamond, 1, kRed + 1, kRed + 1);
2166 axphiAllPt->SetTitle(
"L0 + L1 + L2;Phi;Efficiency");
2167 axphiAllPt->GetYaxis()->SetRangeUser(-0.1, 1.1);
2169 mEffPhiGoodAll->Draw(
"same p");
2170 mEffPhiFakeAll->Draw(
"same p");
2172 auto legPhi = std::make_unique<TLegend>(0.70, 0.15, 0.89, 0.35);
2173 legPhi->AddEntry(mEffPhiGoodAll.get(),
"#frac{# good matches}{# tot duplicated clusters}",
"pl");
2174 legPhi->AddEntry(mEffPhiFakeAll.get(),
"#frac{# fake matches}{# tot duplicated clusters}",
"pl");
2175 legPhi->Draw(
"same");
2185 LOGP(info,
"getEfficiency()");
2188 std::array<float, 2> clusOriginalDCA, clusDuplicatedDCA;
2191 unsigned int rofIndexTrack = 0;
2192 unsigned int rofNEntriesTrack = 0;
2193 unsigned int rofIndexClus = 0;
2194 unsigned int rofNEntriesClus = 0;
2197 double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
2198 double a = std::log(ptcuth / ptcutl) / nbPt;
2199 for (
int i = 0;
i <= nbPt;
i++) {
2200 xbins[
i] = ptcutl * std::exp(
i *
a);
2206 for (
unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) {
2208 rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
2209 rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
2211 rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
2212 rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
2215 for (
unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) {
2216 auto track = mTracks[iTrack];
2219 auto pt = trackParCov.getPt();
2220 auto eta = trackParCov.getEta();
2222 float phiOriginal = -999.;
2227 track.getImpactParams(0, 0, 0, 0, ip);
2236 int firstClus =
track.getFirstClusterEntry();
2237 int ncl =
track.getNumberOfClusters();
2246 tracklab = mTracksMCLabels[iTrack];
2252 if (mVerboseOutput && isMC) {
2253 LOGP(info,
"track Label: ");
2257 for (
int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) {
2258 auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
2259 auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]];
2260 auto layerOriginal = mGeometry->
getLayer(clusOriginal.getSensorID());
2262 UShort_t rowOriginal = clusOriginal.getRow();
2263 UShort_t colOriginal = clusOriginal.getCol();
2266 if (clusOriginal.getChipID() >= 0 && clusOriginal.getChipID() <= 8) {
2267 l0_00->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2269 if (clusOriginal.getChipID() >= 252 && clusOriginal.getChipID() <= 260) {
2270 l1_15->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2272 if (clusOriginal.getChipID() >= 423 && clusOriginal.getChipID() <= 431) {
2273 l2_19->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusOriginal.getRow());
2277 if (layerOriginal >=
NLAYERS) {
2281 chipmap->Fill(clusOriginal.getCol(), clusOriginal.getRow());
2283 IPOriginalxy[layerOriginal]->Fill(ip[0]);
2284 IPOriginalz[layerOriginal]->Fill(ip[1]);
2289 phiOriginal = clusOriginalPointGlob.phi();
2291 if (std::abs(clusOriginalPointGlob.y()) < 0.5) {
2295 if (std::abs(clusOriginalPointGlob.z()) >= 10) {
2299 if (rowOriginal < 2 || (rowOriginal > 15 && rowOriginal < 496) || rowOriginal > 509) {
2309 if (clusOriginal.getCol() < 160 || clusOriginal.getCol() > 870) {
2314 m2DClusterOriginalPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y());
2315 m3DClusterPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y(), clusOriginalPointGlob.z());
2316 chi2trackAccepted->Fill(
chi2);
2317 denPt[layerOriginal]->Fill(pt);
2318 denPhi[layerOriginal]->Fill(phiOriginal);
2319 denEta[layerOriginal]->Fill(eta);
2320 denRow[layerOriginal]->Fill(rowOriginal);
2321 denCol[layerOriginal]->Fill(clusOriginal.getCol());
2322 denZ[layerOriginal]->Fill(clusOriginalPointGlob.z());
2323 nTracksSelected[layerOriginal]++;
2324 mDenColEta[layerOriginal]->Fill(clusOriginal.getCol(), eta);
2325 mDenRowPhi[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginalPointGlob.z());
2326 mDenRowCol[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginal.getCol());
2327 denLayers->Fill(layerOriginal);
2330 gsl::span<const o2::MCCompLabel> labsOriginal = {};
2332 labsOriginal = mClustersMCLCont->
getLabels(mInputITSidxs[iclTrack]);
2335 auto staveOriginal = mGeometry->
getStave(clusOriginal.getSensorID());
2336 auto chipOriginal = mGeometry->
getChipIdInStave(clusOriginal.getSensorID());
2338 std::tuple<int, double, gsl::span<const o2::MCCompLabel>> clusID_rDCA_label = {0, 999., gsl::span<const o2::MCCompLabel>()};
2340 bool adjacentFound = 0;
2341 float phiDuplicated = -999.;
2342 float ptDuplicated = -999.;
2343 float etaDuplicated = -999.;
2344 float clusZ = -999.;
2349 for (
unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) {
2350 auto clusDuplicated = mClusters[iClus];
2351 auto clusDuplicatedPoint = mITSClustersArray[iClus];
2355 phi = clusDuplicatedPointGlob.phi();
2358 if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
2361 auto layerDuplicated = mGeometry->
getLayer(clusDuplicated.getSensorID());
2362 if (layerDuplicated != layerOriginal) {
2365 auto staveDuplicated = mGeometry->
getStave(clusDuplicated.getSensorID());
2366 if (abs(staveDuplicated - staveOriginal) != 1) {
2369 auto chipDuplicated = mGeometry->
getChipIdInStave(clusDuplicated.getSensorID());
2370 if (abs(chipDuplicated - chipOriginal) > 1) {
2374 gsl::span<const o2::MCCompLabel> labsDuplicated = {};
2376 labsDuplicated = mClustersMCLCont->
getLabels(iClus);
2382 if (!propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov,
b, 2.f, matCorr, &clusDuplicatedDCA)) {
2386 DCAxyData[layerDuplicated]->Fill(clusDuplicatedDCA[0]);
2387 DCAzData[layerDuplicated]->Fill(clusDuplicatedDCA[1]);
2390 if (!(clusDuplicatedDCA[0] >
mDCACutsXY[layerDuplicated][0] && clusDuplicatedDCA[0] <
mDCACutsXY[layerDuplicated][1] && clusDuplicatedDCA[1] >
mDCACutsZ[layerDuplicated][0] && clusDuplicatedDCA[1] <
mDCACutsZ[layerDuplicated][1])) {
2391 DCAxyRejected[layerDuplicated]->Fill(clusDuplicatedDCA[0]);
2392 DCAzRejected[layerDuplicated]->Fill(clusDuplicatedDCA[1]);
2396 m2DClusterDuplicatedPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y());
2397 m3DDuplicatedClusterPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y(), clusDuplicatedPointGlob.z());
2399 if (mVerboseOutput) {
2400 LOGP(info,
"Propagation ok");
2402 double rDCA = std::hypot(clusDuplicatedDCA[0], clusDuplicatedDCA[1]);
2405 if (rDCA < std::get<1>(clusID_rDCA_label)) {
2407 clusID_rDCA_label = {iClus, rDCA, labsDuplicated};
2409 clusID_rDCA_label = {iClus, rDCA, gsl::span<const o2::MCCompLabel>()};
2411 phiDuplicated = phiOriginal;
2413 etaDuplicated = eta;
2414 clusZ = clusOriginalPointGlob.z();
2415 clusDuplicatedSelected = clusDuplicated;
2422 if (!adjacentFound) {
2423 radiusNotFound[layerOriginal]->Fill(sqrt(clusOriginalPointGlob.x() * clusOriginalPointGlob.x() + clusOriginalPointGlob.y() * clusOriginalPointGlob.y()));
2424 colNotFound[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)));
2425 rowNotFound[layerOriginal]->Fill(rowOriginal);
2426 zNotFound[layerOriginal]->Fill(clusOriginalPointGlob.z());
2427 phiNotFound[layerOriginal]->Fill(phiOriginal);
2431 chipOrigVsOverlap->Fill(clusOriginal.getChipID() % 9, clusDuplicatedSelected.
getChipID() % 9);
2432 mChipFound->Fill(clusOriginal.getChipID());
2433 zFound[layerOriginal]->Fill(clusOriginalPointGlob.z());
2434 radiusFound[layerOriginal]->Fill(sqrt(clusOriginalPointGlob.x() * clusOriginalPointGlob.x() + clusOriginalPointGlob.y() * clusOriginalPointGlob.y()));
2435 colFoundOriginalVsDuplicated[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)), clusDuplicatedSelected.
getCol() + (1024 * (clusDuplicatedSelected.
getChipID() % 9)));
2436 colFoundOriginal[layerOriginal]->Fill(clusOriginal.getCol() + (1024 * (clusOriginal.getChipID() % 9)));
2437 m2DClusterFoundPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y());
2438 phiFound[layerOriginal]->Fill(phiOriginal);
2439 rowFound[layerOriginal]->Fill(rowOriginal);
2441 nDuplicatedClusters[layerOriginal]++;
2442 numPt[layerOriginal]->Fill(pt);
2443 numPhi[layerOriginal]->Fill(phiDuplicated);
2444 numEta[layerOriginal]->Fill(etaDuplicated);
2445 numRow[layerOriginal]->Fill(rowOriginal);
2446 numCol[layerOriginal]->Fill(clusOriginal.getCol());
2447 numZ[layerOriginal]->Fill(clusOriginalPointGlob.z());
2448 mZvsPhiDUplicated[layerOriginal]->Fill(clusZ, phiDuplicated);
2449 mNumColEta[layerOriginal]->Fill(clusOriginal.getCol(), eta);
2450 mNumRowPhi[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginalPointGlob.z());
2451 mNumRowCol[layerOriginal]->Fill(clusOriginal.getRow(), clusOriginal.getCol());
2452 numLayers->Fill(layerOriginal);
2456 bool isGood =
false;
2457 for (
auto lab : std::get<2>(clusID_rDCA_label)) {
2458 if (lab == tracklab) {
2460 numPtGood[layerOriginal]->Fill(ptDuplicated);
2461 numPhiGood[layerOriginal]->Fill(phiDuplicated);
2462 numEtaGood[layerOriginal]->Fill(etaDuplicated);
2463 numRowGood[layerOriginal]->Fill(rowOriginal);
2464 numColGood[layerOriginal]->Fill(clusOriginal.getCol());
2465 numZGood[layerOriginal]->Fill(clusOriginalPointGlob.z());
2466 numGoodLayers->Fill(layerOriginal);
2471 numPtFake[layerOriginal]->Fill(ptDuplicated);
2472 numPhiFake[layerOriginal]->Fill(phiDuplicated);
2473 numEtaFake[layerOriginal]->Fill(etaDuplicated);
2474 numRowFake[layerOriginal]->Fill(rowOriginal);
2475 numColFake[layerOriginal]->Fill(clusOriginal.getCol());
2476 numZFake[layerOriginal]->Fill(clusOriginalPointGlob.z());
2477 numFakeLayers->Fill(layerOriginal);
2485 std::cout <<
" Num of duplicated clusters L0: " << nDuplicatedClusters[0] <<
" N tracks selected: " << nTracksSelected[0] << std::endl;
2486 std::cout <<
" Num of duplicated clusters L1: " << nDuplicatedClusters[1] <<
" N tracks selected: " << nTracksSelected[1] << std::endl;
2487 std::cout <<
" Num of duplicated clusters L2: " << nDuplicatedClusters[2] <<
" N tracks selected: " << nTracksSelected[2] << std::endl;
2489 std::cout <<
" --------- N total clusters: " << totNClusters << std::endl;
2490 std::cout <<
" --------- N duplicated clusters: " << nDuplClusters << std::endl;