forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEfficiency.cxx
More file actions
2863 lines (2397 loc) · 145 KB
/
Efficiency.cxx
File metadata and controls
2863 lines (2397 loc) · 145 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "TGeoGlobalMagField.h"
#include "ITSStudies/Efficiency.h"
#include "ITSStudies/ITSStudiesConfigParam.h"
#include "CommonUtils/TreeStreamRedirector.h"
#include "DataFormatsITS/TrackITS.h"
#include "DataFormatsITSMFT/ROFRecord.h"
#include "DataFormatsITSMFT/CompCluster.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
#include "DataFormatsGlobalTracking/RecoContainer.h"
#include "DetectorsBase/GRPGeomHelper.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/Task.h"
#include "ITSBase/GeometryTGeo.h"
#include "ITStracking/IOUtils.h"
#include "ReconstructionDataFormats/DCA.h"
#include "SimulationDataFormat/MCTrack.h"
#include "Steer/MCKinematicsReader.h"
#include "ReconstructionDataFormats/TrackParametrization.h"
#include <TEfficiency.h>
#include <TH1.h>
#include <TH1D.h>
#include <TH1I.h>
#include <TH2D.h>
#include <TH3D.h>
#include <TCanvas.h>
#include <TEfficiency.h>
#include <TStyle.h>
#include <TLegend.h>
#include <TGraphErrors.h>
#include <TGraphAsymmErrors.h>
#include <TF1.h>
#include <TObjArray.h>
#include <THStack.h>
#include <TString.h>
#include <TAttMarker.h>
#include <TArrayD.h>
#include <numeric>
#define NLAYERS 3
namespace o2::its::study
{
using namespace o2::framework;
using namespace o2::globaltracking;
using GTrackID = o2::dataformats::GlobalTrackID;
class EfficiencyStudy : public Task
{
public:
EfficiencyStudy(std::shared_ptr<DataRequest> dr,
mask_t src,
bool useMC,
std::shared_ptr<o2::steer::MCKinematicsReader> kineReader,
std::shared_ptr<o2::base::GRPGeomRequest> gr) : mDataRequest(dr), mTracksSrc(src), mUseMC(useMC), mKineReader(kineReader), mGGCCDBRequest(gr){};
~EfficiencyStudy() final = default;
void init(InitContext&) final;
void run(ProcessingContext&) final;
void endOfStream(EndOfStreamContext&) final;
void finaliseCCDB(ConcreteDataMatcher&, void*) final;
void initialiseRun(o2::globaltracking::RecoContainer&);
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);
int getDCAClusterTrackMC(int countDuplicated);
void studyDCAcutsMC();
void studyClusterSelectionMC();
void countDuplicatedAfterCuts();
void getEfficiency(bool isMC);
void process(o2::globaltracking::RecoContainer&);
void setClusterDictionary(const o2::itsmft::TopologyDictionary* d) { mDict = d; }
private:
void updateTimeDependentParams(ProcessingContext& pc);
bool mVerboseOutput = false;
bool mUseMC;
std::string mOutFileName;
double b;
std::shared_ptr<o2::steer::MCKinematicsReader> mKineReader;
GeometryTGeo* mGeometry;
const o2::itsmft::TopologyDictionary* mDict = nullptr;
float mrangesPt[NLAYERS][2] = {{0., 0.5}, {0.5, 2.}, {2., 7.5}};
// Spans
gsl::span<const o2::itsmft::ROFRecord> mTracksROFRecords;
gsl::span<const o2::itsmft::ROFRecord> mClustersROFRecords;
gsl::span<const o2::its::TrackITS> mTracks;
gsl::span<const o2::MCCompLabel> mTracksMCLabels;
gsl::span<const o2::itsmft::CompClusterExt> mClusters;
gsl::span<const unsigned char> mClusPatterns;
gsl::span<const int> mInputITSidxs;
const o2::dataformats::MCLabelContainer* mClustersMCLCont;
std::vector<o2::BaseCluster<float>> mITSClustersArray;
// Data
GTrackID::mask_t mTracksSrc{};
std::shared_ptr<DataRequest> mDataRequest;
// Utils
std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
std::unique_ptr<TFile> mOutFile;
int mDuplicated_layer[NLAYERS] = {0};
//// Histos
// DCA betweeen track and original cluster
std::unique_ptr<TH1D> mDCAxyOriginal[NLAYERS];
std::unique_ptr<TH1D> mDCAzOriginal[NLAYERS];
// DCA betweeen track and duplicated cluster
std::unique_ptr<TH1D> mDCAxyDuplicated;
std::unique_ptr<TH1D> mDCAzDuplicated;
// DCA betweeen track and duplicated cluster per layer
std::unique_ptr<TH1D> mDCAxyDuplicated_layer[NLAYERS];
std::unique_ptr<TH1D> mDCAzDuplicated_layer[NLAYERS];
// phi, eta, pt of the cluster
std::unique_ptr<TH1D> mPhiOriginal[NLAYERS];
std::unique_ptr<TH1D> mEtaOriginal[NLAYERS];
std::unique_ptr<TH1D> mPtOriginal[NLAYERS];
std::unique_ptr<TH1D> mPtDuplicated[NLAYERS];
std::unique_ptr<TH1D> mEtaDuplicated[NLAYERS];
std::unique_ptr<TH1D> mPhiDuplicated[NLAYERS];
std::unique_ptr<TH1D> mPhiOriginalIfDuplicated[NLAYERS];
std::unique_ptr<TH2D> mZvsPhiDUplicated[NLAYERS];
// position of the clusters
std::unique_ptr<TH3D> m3DClusterPositions;
std::unique_ptr<TH3D> m3DDuplicatedClusterPositions;
std::unique_ptr<TH2D> m2DClusterOriginalPositions;
std::unique_ptr<TH2D> m2DClusterDuplicatedPositions;
// Efficiency histos
std::unique_ptr<TH1D> mEfficiencyGoodMatch;
std::unique_ptr<TH1D> mEfficiencyFakeMatch;
std::unique_ptr<TH1D> mEfficiencyTotal;
std::unique_ptr<TH1D> mEfficiencyGoodMatch_layer[NLAYERS];
std::unique_ptr<TH1D> mEfficiencyFakeMatch_layer[NLAYERS];
std::unique_ptr<TH1D> mEfficiencyTotal_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyGoodMatchPt_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyFakeMatchPt_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyGoodMatchEta_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyFakeMatchEta_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyGoodMatchPhi_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyGoodMatchPhiOriginal_layer[NLAYERS];
std::unique_ptr<TH2D> mEfficiencyFakeMatchPhi_layer[NLAYERS];
// std::unique_ptr<TH2D> mEfficiencyColEta[NLAYERS];
std::unique_ptr<TH2D> mDenColEta[NLAYERS];
std::unique_ptr<TH2D> mNumColEta[NLAYERS];
std::unique_ptr<TH2D> mDenRowPhi[NLAYERS];
std::unique_ptr<TH2D> mNumRowPhi[NLAYERS];
std::unique_ptr<TH2D> mDenRowCol[NLAYERS];
std::unique_ptr<TH2D> mNumRowCol[NLAYERS];
// phi, eta, pt of the duplicated cluster per layer
std::unique_ptr<TH2D> mPt_EtaDupl[NLAYERS];
// duplicated per layer and per cut
std::unique_ptr<TH1D> mDuplicatedEtaAllPt[NLAYERS];
std::unique_ptr<TH1D> mDuplicatedEta[NLAYERS][3];
std::unique_ptr<TH1D> mDuplicatedPhiAllPt[NLAYERS];
std::unique_ptr<TH1D> mDuplicatedPhi[NLAYERS][3];
std::unique_ptr<TH1D> mDuplicatedPt[NLAYERS];
std::unique_ptr<TH1D> mDuplicatedRow[NLAYERS];
std::unique_ptr<TH1D> mDuplicatedCol[NLAYERS];
std::unique_ptr<TH1D> mDuplicatedZ[NLAYERS];
std::unique_ptr<TH2D> mDuplicatedPtEta[NLAYERS];
std::unique_ptr<TH2D> mDuplicatedPtPhi[NLAYERS];
std::unique_ptr<TH2D> mDuplicatedEtaPhi[NLAYERS];
// matches per layer and per cut
std::unique_ptr<TH1D> mNGoodMatchesEtaAllPt[NLAYERS];
std::unique_ptr<TH1D> mNGoodMatchesEta[NLAYERS][3];
std::unique_ptr<TH1D> mNGoodMatchesPhiAllPt[NLAYERS];
std::unique_ptr<TH1D> mNGoodMatchesPhi[NLAYERS][3];
std::unique_ptr<TH1D> mNFakeMatchesEtaAllPt[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesEta[NLAYERS][3];
std::unique_ptr<TH1D> mNFakeMatchesPhiAllPt[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesPhi[NLAYERS][3];
std::unique_ptr<TH1D> mNGoodMatchesPt[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesPt[NLAYERS];
std::unique_ptr<TH1D> mNGoodMatchesRow[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesRow[NLAYERS];
std::unique_ptr<TH1D> mNGoodMatchesCol[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesCol[NLAYERS];
std::unique_ptr<TH1D> mNGoodMatchesZ[NLAYERS];
std::unique_ptr<TH1D> mNFakeMatchesZ[NLAYERS];
std::unique_ptr<TH2D> mNGoodMatchesPtEta[NLAYERS];
std::unique_ptr<TH2D> mNFakeMatchesPtEta[NLAYERS];
std::unique_ptr<TH2D> mNGoodMatchesPtPhi[NLAYERS];
std::unique_ptr<TH2D> mNFakeMatchesPtPhi[NLAYERS];
std::unique_ptr<TH2D> mNGoodMatchesEtaPhi[NLAYERS];
std::unique_ptr<TH2D> mNFakeMatchesEtaPhi[NLAYERS];
// calculating the efficiency with TEfficiency class
std::unique_ptr<TEfficiency> mEffPtGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffPtFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffRowGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffRowFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffColGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffColFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffZGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffZFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffPtEtaGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffPtEtaFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffPtPhiGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffPtPhiFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffEtaPhiGood[NLAYERS];
std::unique_ptr<TEfficiency> mEffEtaPhiFake[NLAYERS];
std::unique_ptr<TEfficiency> mEffEtaGoodAllPt[NLAYERS];
std::unique_ptr<TEfficiency> mEffEtaGood[NLAYERS][3];
std::unique_ptr<TEfficiency> mEffEtaFakeAllPt[NLAYERS];
std::unique_ptr<TEfficiency> mEffEtaFake[NLAYERS][3];
std::unique_ptr<TEfficiency> mEffPhiGoodAllPt[NLAYERS];
std::unique_ptr<TEfficiency> mEffPhiGood[NLAYERS][3];
std::unique_ptr<TEfficiency> mEffPhiFakeAllPt[NLAYERS];
std::unique_ptr<TEfficiency> mEffPhiFake[NLAYERS][3];
std::unique_ptr<TH2D> mnGoodMatchesPt_layer[NLAYERS];
std::unique_ptr<TH2D> mnFakeMatchesPt_layer[NLAYERS];
std::unique_ptr<TH2D> mnGoodMatchesEta_layer[NLAYERS];
std::unique_ptr<TH2D> mnFakeMatchesEta_layer[NLAYERS];
std::unique_ptr<TH2D> mnGoodMatchesPhi_layer[NLAYERS];
std::unique_ptr<TH2D> mnGoodMatchesPhiOriginal_layer[NLAYERS];
std::unique_ptr<TH2D> mnFakeMatchesPhi_layer[NLAYERS];
std::unique_ptr<TH1D> DCAxyData[NLAYERS];
std::unique_ptr<TH1D> DCAzData[NLAYERS];
std::unique_ptr<TH1D> DCAxyRejected[NLAYERS];
std::unique_ptr<TH1D> DCAzRejected[NLAYERS];
std::unique_ptr<TH1D> denPt[NLAYERS];
std::unique_ptr<TH1D> numPt[NLAYERS];
std::unique_ptr<TH1D> numPtGood[NLAYERS];
std::unique_ptr<TH1D> numPtFake[NLAYERS];
std::unique_ptr<TH1D> denPhi[NLAYERS];
std::unique_ptr<TH1D> numPhi[NLAYERS];
std::unique_ptr<TH1D> numPhiGood[NLAYERS];
std::unique_ptr<TH1D> numPhiFake[NLAYERS];
std::unique_ptr<TH1D> denEta[NLAYERS];
std::unique_ptr<TH1D> numEta[NLAYERS];
std::unique_ptr<TH1D> numEtaGood[NLAYERS];
std::unique_ptr<TH1D> numEtaFake[NLAYERS];
std::unique_ptr<TH1D> denRow[NLAYERS];
std::unique_ptr<TH1D> numRow[NLAYERS];
std::unique_ptr<TH1D> numRowGood[NLAYERS];
std::unique_ptr<TH1D> numRowFake[NLAYERS];
std::unique_ptr<TH1D> denCol[NLAYERS];
std::unique_ptr<TH1D> numCol[NLAYERS];
std::unique_ptr<TH1D> numColGood[NLAYERS];
std::unique_ptr<TH1D> numColFake[NLAYERS];
std::unique_ptr<TH1D> denZ[NLAYERS];
std::unique_ptr<TH1D> numZ[NLAYERS];
std::unique_ptr<TH1D> numZGood[NLAYERS];
std::unique_ptr<TH1D> numZFake[NLAYERS];
std::unique_ptr<TH1D> numLayers;
std::unique_ptr<TH1D> denLayers;
std::unique_ptr<TH1D> numGoodLayers;
std::unique_ptr<TH1D> numFakeLayers;
int nDuplicatedClusters[NLAYERS] = {0};
int nTracksSelected[NLAYERS] = {0}; // denominator fot the efficiency calculation
std::unique_ptr<TH1D> IPOriginalxy[NLAYERS];
std::unique_ptr<TH1D> IPOriginalz[NLAYERS];
std::unique_ptr<TH1D> chipRowDuplicated[NLAYERS];
std::unique_ptr<TH1D> chipRowOriginalIfDuplicated[NLAYERS];
std::unique_ptr<TH1D> chi2trackAccepted;
/// checking where the duplicated not found are (histograms filled with the orifinal cluster variables)
std::unique_ptr<TH1D> phiFound[NLAYERS];
std::unique_ptr<TH1D> rowFound[NLAYERS];
std::unique_ptr<TH1D> phiNotFound[NLAYERS];
std::unique_ptr<TH1D> rowNotFound[NLAYERS];
std::unique_ptr<TH1D> zFound[NLAYERS];
std::unique_ptr<TH1D> zNotFound[NLAYERS];
std::unique_ptr<TH2D> colFoundOriginalVsDuplicated[NLAYERS];
std::unique_ptr<TH1D> colFoundOriginal[NLAYERS];
std::unique_ptr<TH1D> colNotFound[NLAYERS];
std::unique_ptr<TH1D> radiusFound[NLAYERS];
std::unique_ptr<TH1D> radiusNotFound[NLAYERS];
std::unique_ptr<TH2D> m2DClusterFoundPositions;
std::unique_ptr<TH2D> m2DClusterNotFoundPositions;
std::unique_ptr<TH1D> mChipNotFound;
std::unique_ptr<TH1D> mChipFound;
std::unique_ptr<TH2D> l0_00;
std::unique_ptr<TH2D> l1_15;
std::unique_ptr<TH2D> l2_19;
std::unique_ptr<TH2D> chipOrigVsOverlap;
std::unique_ptr<TH2D> chipmap;
};
void EfficiencyStudy::init(InitContext& ic)
{
LOGP(info, "init");
o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest);
auto& pars = o2::its::study::ITSEfficiencyParamConfig::Instance();
mOutFileName = pars.outFileName;
b = pars.b;
int nbPt = 75;
double xbins[nbPt + 1], ptcutl = 0.05, ptcuth = 7.5;
double a = std::log(ptcuth / ptcutl) / nbPt;
for (int i = 0; i <= nbPt; i++) {
xbins[i] = ptcutl * std::exp(i * a);
}
mOutFile = std::make_unique<TFile>(mOutFileName.c_str(), "recreate");
mDCAxyDuplicated = std::make_unique<TH1D>("dcaXYDuplicated", "Distance between track and duplicated cluster ;DCA xy (cm); ", 200, -0.01, 0.01);
mDCAzDuplicated = std::make_unique<TH1D>("dcaZDuplicated", "Distance between track and duplicated cluster ;DCA z (cm); ", 200, -0.01, 0.01);
m3DClusterPositions = std::make_unique<TH3D>("3DClusterPositions", ";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 400, -20, 20);
m3DDuplicatedClusterPositions = std::make_unique<TH3D>("3DDuplicatedClusterPositions", ";x (cm);y (cm);z (cm)", 200, -10, 10, 200, -10, 10, 500, -30, 30);
m2DClusterOriginalPositions = std::make_unique<TH2D>("m2DClusterOriginalPositions", ";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
m2DClusterDuplicatedPositions = std::make_unique<TH2D>("m2DClusterDuplicatedPositions", ";x (cm);y (cm)", 400, -10, 10, 400, -6, 6);
mEfficiencyGoodMatch = std::make_unique<TH1D>("mEfficiencyGoodMatch", ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
mEfficiencyFakeMatch = std::make_unique<TH1D>("mEfficiencyFakeMatch", ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
mEfficiencyTotal = std::make_unique<TH1D>("mEfficiencyTotal", ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
chi2trackAccepted = std::make_unique<TH1D>("chi2trackAccepted", "; $#chi^{2}", 500, 0, 100);
m2DClusterFoundPositions = std::make_unique<TH2D>("m2DClusterFoundPositions", ";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
m2DClusterNotFoundPositions = std::make_unique<TH2D>("m2DClusterNotFoundPositions", ";x (cm);y (cm)", 250, -5, 5, 250, -5, 5);
mChipNotFound = std::make_unique<TH1D>("mChipNotFound", ";chipID", 432, 0, 432);
mChipFound = std::make_unique<TH1D>("mChipFound", ";chipID", 432, 0, 432);
l0_00 = std::make_unique<TH2D>("l0_00", ";col; row", 2304, -0.5, 9215.5, 128, -0.5, 511.5);
l1_15 = std::make_unique<TH2D>("l1_15", ";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
l2_19 = std::make_unique<TH2D>("l2_19", ";col; row", 2304, -0.5, 9215.5, 512, -0.5, 511.5);
chipOrigVsOverlap = std::make_unique<TH2D>("chipOrigVsOverlap", ";chipID Overlap;chipID Original", 9, 0, 9, 9, 0, 9);
chipmap = std::make_unique<TH2D>("chipmap", ";Column;Row", 1024, 0, 1023, 512, -0.5, 511.5);
numLayers = std::make_unique<TH1D>("numLayers", "numLayers; ; Efficiency", 3, -0.5, 2.5);
numGoodLayers = std::make_unique<TH1D>("numGoodLayers", "numGoodLayers; ; Efficiency", 3, -0.5, 2.5);
numFakeLayers = std::make_unique<TH1D>("numFakeLayers", "numFakeLayers; ; Efficiency", 3, -0.5, 2.5);
denLayers = std::make_unique<TH1D>("denLayers", "denLayers; ; Efficiency", 3, -0.5, 2.5);
for (int i = 0; i < NLAYERS; i++) {
chipRowDuplicated[i] = std::make_unique<TH1D>(Form("chipPosDuplicated_L%d", i), Form("L%d; row", i), 512, -0.5, 511.5);
chipRowOriginalIfDuplicated[i] = std::make_unique<TH1D>(Form("chipPosOriginalIfDuplicated%d", i), Form("L%d; row", i), 512, -0.5, 511.5);
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);
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);
DCAxyRejected[i] = std::make_unique<TH1D>(Form("DCAxyRejected%d", i), "Distance between track and original cluster (rejected) ;DCA xy (cm); ", 30000, -30, 30);
DCAzRejected[i] = std::make_unique<TH1D>(Form("DCAzRejected%d", i), "Distance between track and original cluster (rejected) ;DCA z (cm); ", 30000, -30, 30);
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);
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);
mPhiOriginal[i] = std::make_unique<TH1D>(Form("phiOriginal_L%d", i), ";phi (rad); ", 90, -3.2, 3.2);
mEtaOriginal[i] = std::make_unique<TH1D>(Form("etaOriginal_L%d", i), ";eta (rad); ", 100, -2, 2);
mPtOriginal[i] = std::make_unique<TH1D>(Form("ptOriginal_L%d", i), ";pt (GeV/c); ", 100, 0, 10);
mZvsPhiDUplicated[i] = std::make_unique<TH2D>(Form("zvsphiDuplicated_L%d", i), ";z (cm);phi (rad)", 400, -20, 20, 90, -3.2, 3.2);
mPtDuplicated[i] = std::make_unique<TH1D>(Form("ptDuplicated_L%d", i), ";pt (GeV/c); ", nbPt, 0, 7.5); // xbins);
mEtaDuplicated[i] = std::make_unique<TH1D>(Form("etaDuplicated_L%d", i), ";eta; ", 40, -2, 2);
mPhiDuplicated[i] = std::make_unique<TH1D>(Form("phiDuplicated_L%d", i), ";phi (rad); ", 90, -3.2, 3.2);
mPhiOriginalIfDuplicated[i] = std::make_unique<TH1D>(Form("phiOriginalIfDuplicated_L%d", i), ";phi (rad); ", 90, -3.2, 3.2);
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);
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);
mEfficiencyGoodMatch_layer[i] = std::make_unique<TH1D>(Form("mEfficiencyGoodMatch_layer_L%d", i), ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
mEfficiencyFakeMatch_layer[i] = std::make_unique<TH1D>(Form("mEfficiencyFakeMatch_layer_L%d", i), ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
mEfficiencyTotal_layer[i] = std::make_unique<TH1D>(Form("mEfficiencyTotal_layer_L%d", i), ";#sigma(DCA) cut;Efficiency;", 20, 0.5, 20.5);
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, /* xbins*/ 20, 0.5, 20.5);
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, /* xbins*/ 20, 0.5, 20.5);
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);
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);
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);
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);
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);
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);
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 /* xbins*/);
mDuplicatedPt[i]->Sumw2();
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 /* xbins*/);
mNGoodMatchesPt[i]->Sumw2();
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 /* xbins*/);
mNFakeMatchesPt[i]->Sumw2();
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);
mDuplicatedRow[i]->Sumw2();
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);
mNGoodMatchesRow[i]->Sumw2();
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);
mNFakeMatchesRow[i]->Sumw2();
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);
mDuplicatedCol[i]->Sumw2();
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);
mNGoodMatchesCol[i]->Sumw2();
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);
mNFakeMatchesCol[i]->Sumw2();
mDuplicatedZ[i] = std::make_unique<TH1D>(Form("mDuplicatedZ_L%d", i), Form("; Z (cm); Number of duplciated clusters L%d", i), 100, -15, 15);
mDuplicatedZ[i]->Sumw2();
mNGoodMatchesZ[i] = std::make_unique<TH1D>(Form("mNGoodMatchesZ_L%d", i), Form("; Z (cm); Number of good matches L%d", i), 100, -15, 15);
mNGoodMatchesZ[i]->Sumw2();
mNFakeMatchesZ[i] = std::make_unique<TH1D>(Form("mNFakeMatchesZ_L%d", i), Form(";Z (cm); Number of fake matches L%d", i), 100, -15, 15);
mNFakeMatchesZ[i]->Sumw2();
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 /* xbins*/, 40, -2, 2);
mDuplicatedPtEta[i]->Sumw2();
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 /* xbins*/, 40, -2, 2);
mNGoodMatchesPtEta[i]->Sumw2();
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 /* xbins*/, 40, -2, 2);
mNFakeMatchesPtEta[i]->Sumw2();
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 /* xbins*/, 90, -3.2, 3.2);
mDuplicatedPtPhi[i]->Sumw2();
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 /* xbins*/, 90, -3.2, 3.2);
mNGoodMatchesPtPhi[i]->Sumw2();
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 /* xbins*/, 90, -3.2, 3.2);
mNFakeMatchesPtPhi[i]->Sumw2();
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);
mDuplicatedEtaPhi[i]->Sumw2();
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);
mNGoodMatchesEtaPhi[i]->Sumw2();
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);
mNFakeMatchesEtaPhi[i]->Sumw2();
mDuplicatedEtaAllPt[i] = std::make_unique<TH1D>(Form("mDuplicatedEtaAllPt_L%d", i), Form("; #eta; Number of duplicated clusters L%d", i), 40, -2, 2);
mNGoodMatchesEtaAllPt[i] = std::make_unique<TH1D>(Form("mNGoodMatchesEtaAllPt_L%d", i), Form("; #eta; Number of good matches L%d", i), 40, -2, 2);
mNFakeMatchesEtaAllPt[i] = std::make_unique<TH1D>(Form("mNFakeMatchesEtaAllPt_L%d", i), Form("; #eta; Number of fake matches L%d", i), 40, -2, 2);
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);
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);
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);
mnGoodMatchesPt_layer[i] = std::make_unique<TH2D>(Form("mnGoodMatchesPt_layer_L%d", i), ";pt; nGoodMatches", nbPt, 0, 7.5 /* xbins*/, 20, 0.5, 20.5);
mnFakeMatchesPt_layer[i] = std::make_unique<TH2D>(Form("mnFakeMatchesPt_layer_L%d", i), ";pt; nFakeMatches", nbPt, 0, 7.5 /* xbins*/, 20, 0.5, 20.5);
mnGoodMatchesEta_layer[i] = std::make_unique<TH2D>(Form("mnGoodMatchesEta_layer_L%d", i), ";#eta; nGoodMatches", 40, -2, 2, 20, 0.5, 20.5);
mnFakeMatchesEta_layer[i] = std::make_unique<TH2D>(Form("mnFakeMatchesEta_layer_L%d", i), ";#eta; nFakeMatches", 40, -2, 2, 20, 0.5, 20.5);
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);
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);
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);
denPt[i] = std::make_unique<TH1D>(Form("denPt_L%d", i), Form("denPt_L%d", i), nbPt, 0, 7.5 /* xbins*/);
numPt[i] = std::make_unique<TH1D>(Form("numPt_L%d", i), Form("numPt_L%d", i), nbPt, 0, 7.5 /* xbins*/);
numPtGood[i] = std::make_unique<TH1D>(Form("numPtGood_L%d", i), Form("numPtGood_L%d", i), nbPt, 0, 7.5 /* xbins*/);
numPtFake[i] = std::make_unique<TH1D>(Form("numPtFake_L%d", i), Form("numPtFake_L%d", i), nbPt, 0, 7.5 /* xbins*/);
denPhi[i] = std::make_unique<TH1D>(Form("denPhi_L%d", i), Form("denPhi_L%d", i), 90, -3.2, 3.2);
numPhi[i] = std::make_unique<TH1D>(Form("numPhi_L%d", i), Form("numPhi_L%d", i), 90, -3.2, 3.2);
numPhiGood[i] = std::make_unique<TH1D>(Form("numPhiGood_L%d", i), Form("numPhiGood_L%d", i), 90, -3.2, 3.2);
numPhiFake[i] = std::make_unique<TH1D>(Form("numPhiFake_L%d", i), Form("numPhiFake_L%d", i), 90, -3.2, 3.2);
denEta[i] = std::make_unique<TH1D>(Form("denEta_L%d", i), Form("denEta_L%d", i), 200, -2, 2);
numEta[i] = std::make_unique<TH1D>(Form("numEta_L%d", i), Form("numEta_L%d", i), 200, -2, 2);
numEtaGood[i] = std::make_unique<TH1D>(Form("numEtaGood_L%d", i), Form("numEtaGood_L%d", i), 200, -2, 2);
numEtaFake[i] = std::make_unique<TH1D>(Form("numEtaFake_L%d", i), Form("numEtaFake_L%d", i), 200, -2, 2);
denRow[i] = std::make_unique<TH1D>(Form("denRow_L%d", i), Form("denRow_L%d", i), 128, -0.5, 511.5);
numRow[i] = std::make_unique<TH1D>(Form("numRow_L%d", i), Form("numRow_L%d", i), 128, -0.5, 511.5);
numRowGood[i] = std::make_unique<TH1D>(Form("numRowGood_L%d", i), Form("numRowGood_L%d", i), 128, -0.5, 511.5);
numRowFake[i] = std::make_unique<TH1D>(Form("numRowFake_L%d", i), Form("numRowFake_L%d", i), 128, -0.5, 511.5);
denCol[i] = std::make_unique<TH1D>(Form("denCol_L%d", i), Form("denCol_L%d", i), 128, -0.5, 1023.5);
numCol[i] = std::make_unique<TH1D>(Form("numCol_L%d", i), Form("numCol_L%d", i), 128, -0.5, 1023.5);
numColGood[i] = std::make_unique<TH1D>(Form("numColGood_L%d", i), Form("numColGood_L%d", i), 128, -0.5, 1023.5);
numColFake[i] = std::make_unique<TH1D>(Form("numColFake_L%d", i), Form("numColFake_L%d", i), 128, -0.5, 1023.5);
denZ[i] = std::make_unique<TH1D>(Form("denZ_L%d", i), Form("denZ_L%d", i), 100, -15, 15);
numZ[i] = std::make_unique<TH1D>(Form("numZ_L%d", i), Form("numZ_L%d", i), 100, -15, 15);
numZGood[i] = std::make_unique<TH1D>(Form("numZGood_L%d", i), Form("numZGood_L%d", i), 100, -15, 15);
numZFake[i] = std::make_unique<TH1D>(Form("numZFake_L%d", i), Form("numZFake_L%d", i), 100, -15, 15);
mDenColEta[i] = std::make_unique<TH2D>(Form("mDenColEta_L%d", i), Form("mDenColEta_L%d", i), 128, -0.5, 1023.5, 50, -1, 1);
mNumColEta[i] = std::make_unique<TH2D>(Form("mNumColEta_L%d", i), Form("mNumColEta_L%d", i), 128, -0.5, 1023.5, 50, -1, 1);
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);
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);
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);
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);
IPOriginalxy[i] = std::make_unique<TH1D>(Form("IPOriginalxy_L%d", i), Form("IPOriginalxy_L%d", i), 500, -0.002, 0.002);
IPOriginalz[i] = std::make_unique<TH1D>(Form("IPOriginalz_L%d", i), Form("IPOriginalz_L%d", i), 200, -10, 10);
phiFound[i] = std::make_unique<TH1D>(Form("phiFound_L%d", i), Form("phiFound_L%d", i), 190, -3.2, 3.2);
rowFound[i] = std::make_unique<TH1D>(Form("rowFound_L%d", i), Form("rowFound_L%d", i), 128, -0.5, 511.5);
phiNotFound[i] = std::make_unique<TH1D>(Form("phiNotFound_L%d", i), Form("phiNotFound_L%d", i), 90, -3.2, 3.2);
rowNotFound[i] = std::make_unique<TH1D>(Form("rowNotFound_L%d", i), Form("rowNotFound_L%d", i), 128, -0.5, 511.5);
zFound[i] = std::make_unique<TH1D>(Form("zFound_L%d", i), Form("zFound_L%d", i), 100, -15, 15);
zNotFound[i] = std::make_unique<TH1D>(Form("zNotFound%d", i), Form("zNotFound%d", i), 100, -15, 15);
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);
colFoundOriginal[i] = std::make_unique<TH1D>(Form("colFoundOriginal_L%d", i), Form("colFoundOriginal_L%d; Col Original cluster;", i), 9216, -0.5, 9215.5);
colNotFound[i] = std::make_unique<TH1D>(Form("colNotFound_L%d", i), Form("colNotFound_L%d", i), 9216, -0.5, 9215.5);
radiusFound[i] = std::make_unique<TH1D>(Form("radiusFound_L%d", i), Form("radiusFound_L%d", i), 80, 0, 6);
radiusNotFound[i] = std::make_unique<TH1D>(Form("radiusNotFound_L%d", i), Form("radiusNotFound_L%d", i), 80, 0, 4);
for (int j = 0; j < 3; j++) {
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);
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);
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);
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);
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);
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);
}
}
gStyle->SetPalette(55);
}
void EfficiencyStudy::run(ProcessingContext& pc)
{
LOGP(info, "--------------- run");
o2::globaltracking::RecoContainer recoData;
recoData.collectData(pc, *mDataRequest.get());
updateTimeDependentParams(pc); // Make sure this is called after recoData.collectData, which may load some conditions
initialiseRun(recoData);
process(recoData);
}
void EfficiencyStudy::initialiseRun(o2::globaltracking::RecoContainer& recoData)
{
LOGP(info, "--------------- initialiseRun");
if (mUseMC) {
mTracksMCLabels = recoData.getITSTracksMCLabels();
mClustersMCLCont = recoData.getITSClustersMCLabels();
}
mITSClustersArray.clear();
mTracksROFRecords = recoData.getITSTracksROFRecords();
mTracks = recoData.getITSTracks();
mClusters = recoData.getITSClusters();
mClustersROFRecords = recoData.getITSClustersROFRecords();
mClusPatterns = recoData.getITSClustersPatterns();
mInputITSidxs = recoData.getITSTracksClusterRefs();
mITSClustersArray.reserve(mClusters.size());
auto pattIt = mClusPatterns.begin();
o2::its::ioutils::convertCompactClusters(mClusters, pattIt, mITSClustersArray, mDict); // clusters converted to 3D spacepoints
}
void EfficiencyStudy::stileEfficiencyGraph(std::unique_ptr<TEfficiency>& eff, const char* name, const char* title, bool bidimensional = false, const int markerStyle = kFullCircle, const double markersize = 1, const int markercolor = kBlack, const int linecolor = kBlack)
{
eff->SetName(name);
eff->SetTitle(title);
if (!bidimensional) {
eff->SetMarkerStyle(markerStyle);
eff->SetMarkerSize(markersize);
eff->SetMarkerColor(markercolor);
eff->SetLineColor(linecolor);
}
}
int EfficiencyStudy::getDCAClusterTrackMC(int countDuplicated = 0)
{
// get the DCA between the clusters and the track from MC and fill histograms: distance between original and duplicated cluster, DCA, phi, clusters
// used to study the DCA cut to be applied
LOGP(info, "--------------- getDCAClusterTrackMC");
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
o2::gpu::gpustd::array<float, 2> clusOriginalDCA, clusDuplicatedDCA;
auto propagator = o2::base::Propagator::Instance();
auto bz = o2::base::Propagator::Instance()->getNominalBz();
LOG(info) << ">>>>>>>>>>>> Magnetic field: " << bz;
unsigned int rofIndexTrack = 0;
unsigned int rofNEntriesTrack = 0;
unsigned int rofIndexClus = 0;
unsigned int rofNEntriesClus = 0;
int nLabels = 0;
unsigned int totClus = 0;
int duplicated = 0;
std::unordered_map<o2::MCCompLabel, std::vector<int>> label_vecClus[mClustersROFRecords.size()][NLAYERS]; // array of maps nRofs x Nlayers -> {label, vec(iClus)} where vec(iClus) are the clusters that share the same label
for (unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) { // loop on ROFRecords array
rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
for (unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) { // loop on tracks per ROF
auto track = mTracks[iTrack];
o2::track::TrackParCov trackParCov = mTracks[iTrack];
int firstClus = track.getFirstClusterEntry(); // get the first cluster of the track
int ncl = track.getNumberOfClusters(); // get the number of clusters of the track
if (ncl < 7) {
continue;
}
float ip[2]; // IP from 0,0,0 and the track should be the deplacement of the primary vertex
track.getImpactParams(0, 0, 0, 0, ip);
// if (abs(ip[0])>0.001 ) continue; ///pv not in (0,0,0)
auto& tracklab = mTracksMCLabels[iTrack];
if (tracklab.isFake()) {
continue;
}
auto pt = trackParCov.getPt();
auto eta = trackParCov.getEta();
// if (pt < mPtCuts[0] || pt > mPtCuts[1]) {
// continue;
// }
// if (eta < mEtaCuts[0] || eta > mEtaCuts[1]) {
// continue;
// }
float phioriginal = 0;
float phiduplicated = 0;
for (int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) { // loop on clusters associated to the track
auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]]; // cluster spacepoint in the tracking system
auto staveOriginal = mGeometry->getStave(clusOriginal.getSensorID());
auto chipOriginal = mGeometry->getChipIdInStave(clusOriginal.getSensorID());
UShort_t rowOriginal = clusOriginal.getRow();
UShort_t colOriginal = clusOriginal.getCol();
auto layer = mGeometry->getLayer(clusOriginal.getSensorID());
if (layer >= NLAYERS) {
continue; // checking only selected layers
}
auto labsTrack = mClustersMCLCont->getLabels(mInputITSidxs[iclTrack]); // get labels of the cluster associated to the track
o2::math_utils::Point3D<float> clusOriginalPointTrack = {clusOriginalPoint.getX(), clusOriginalPoint.getY(), clusOriginalPoint.getZ()};
o2::math_utils::Point3D<float> clusOriginalPointGlob = mGeometry->getMatrixT2G(clusOriginal.getSensorID()) * clusOriginalPointTrack;
phioriginal = clusOriginalPointGlob.phi(); // * 180 / M_PI;
mPhiOriginal[layer]->Fill(phioriginal);
mPtOriginal[layer]->Fill(pt);
mEtaOriginal[layer]->Fill(eta);
m3DClusterPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y(), clusOriginalPointGlob.z());
m2DClusterOriginalPositions->Fill(clusOriginalPointGlob.x(), clusOriginalPointGlob.y());
for (auto& labT : labsTrack) { // for each valid label iterate over ALL the clusters in the ROF to see if there are duplicates
if (labT != tracklab) {
continue;
}
nLabels++;
if (labT.isValid()) {
for (unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) { // iteration over ALL the clusters in the ROF
auto clusDuplicated = mClusters[iClus];
auto clusDuplicatedPoint = mITSClustersArray[iClus];
auto layerClus = mGeometry->getLayer(clusDuplicated.getSensorID());
if (layerClus != layer) {
continue;
}
o2::math_utils::Point3D<float> clusDuplicatedPointTrack = {clusDuplicatedPoint.getX(), clusDuplicatedPoint.getY(), clusDuplicatedPoint.getZ()};
o2::math_utils::Point3D<float> clusDuplicatedPointGlob = mGeometry->getMatrixT2G(clusDuplicated.getSensorID()) * clusDuplicatedPointTrack;
// phiduplicated = std::atan2(clusDuplicatedPointGlob.y(), clusDuplicatedPointGlob.x()) * 180 / M_PI + 180;
phiduplicated = clusDuplicatedPointGlob.phi(); // * 180 / M_PI;
auto labsClus = mClustersMCLCont->getLabels(iClus); // ideally I can have more than one label per cluster
for (auto labC : labsClus) {
if (labC == labT) {
label_vecClus[iROF][layerClus][labT].push_back(iClus); // same cluster: label from the track = label from the cluster
// if a duplicate cluster is found, propagate the track to the duplicate cluster and compute the distance from the original cluster
// if (clusOriginalPointGlob != clusDuplicatedPointGlob) { /// check that the duplicated cluster is not the original one just counted twice
// if (clusDuplicated.getSensorID() != clusOriginal.getSensorID()) { /// check that the duplicated cluster is not the original one just counted twice
// applying constraints: the cluster should be on the same layer, should be on an adjacent stave and on the same or adjacent chip position
if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
continue;
}
auto layerDuplicated = mGeometry->getLayer(clusDuplicated.getSensorID());
if (layerDuplicated != layerClus) {
continue;
}
auto staveDuplicated = mGeometry->getStave(clusDuplicated.getSensorID());
if (abs(staveDuplicated - staveOriginal) != 1) {
continue;
}
auto chipDuplicated = mGeometry->getChipIdInStave(clusDuplicated.getSensorID());
if (abs(chipDuplicated - chipOriginal) > 1) {
continue;
}
duplicated++;
if (countDuplicated == 0) {
UShort_t rowDuplicated = clusDuplicated.getRow();
UShort_t colDuplicated = clusDuplicated.getCol();
chipRowDuplicated[layerDuplicated]->Fill(rowDuplicated);
chipRowOriginalIfDuplicated[layerDuplicated]->Fill(rowOriginal);
mDuplicated_layer[layerDuplicated]++; // This has to be incremented at the first call
mPtDuplicated[layerClus]->Fill(pt);
mEtaDuplicated[layerClus]->Fill(eta);
mPhiDuplicated[layerClus]->Fill(phiduplicated);
mZvsPhiDUplicated[layerClus]->Fill(clusDuplicatedPointGlob.Z(), phiduplicated);
mPhiOriginalIfDuplicated[layerClus]->Fill(phioriginal);
}
if (countDuplicated == 1) {
for (int ipt = 0; ipt < 3; ipt++) {
if (pt >= mrangesPt[ipt][0] && pt < mrangesPt[ipt][1]) {
mDuplicatedEta[layerDuplicated][ipt]->Fill(eta);
mDuplicatedPhi[layerDuplicated][ipt]->Fill(phiduplicated);
}
}
UShort_t rowDuplicated = clusDuplicated.getRow();
mDuplicatedRow[layerDuplicated]->Fill(rowOriginal);
mDuplicatedCol[layerDuplicated]->Fill(clusOriginal.getCol());
mDuplicatedZ[layerDuplicated]->Fill(clusOriginalPointGlob.Z());
mDuplicatedPt[layerDuplicated]->Fill(pt);
mDuplicatedPtEta[layerDuplicated]->Fill(pt, eta);
mDuplicatedPtPhi[layerDuplicated]->Fill(pt, phiduplicated);
mDuplicatedEtaPhi[layerDuplicated]->Fill(eta, phiduplicated);
mDuplicatedEtaAllPt[layerDuplicated]->Fill(eta);
mDuplicatedPhiAllPt[layerDuplicated]->Fill(phiduplicated);
mPt_EtaDupl[layerClus]->Fill(pt, eta);
}
m3DClusterPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y(), clusDuplicatedPointGlob.z());
m2DClusterDuplicatedPositions->Fill(clusDuplicatedPointGlob.x(), clusDuplicatedPointGlob.y());
/// Compute the DCA between the cluster location and the track
/// first propagate to the original cluster
trackParCov.rotate(mGeometry->getSensorRefAlpha(clusOriginal.getSensorID()));
trackParCov.rotate(mGeometry->getSensorRefAlpha(clusOriginal.getSensorID()));
if (propagator->propagateToDCA(clusOriginalPointGlob, trackParCov, b, 2.f, matCorr, &clusOriginalDCA)) {
mDCAxyOriginal[layerClus]->Fill(clusOriginalDCA[0]);
mDCAzOriginal[layerClus]->Fill(clusOriginalDCA[1]);
}
/// then propagate to the duplicated cluster
trackParCov.rotate(mGeometry->getSensorRefAlpha(clusDuplicated.getSensorID()));
if (propagator->propagateToDCA(clusDuplicatedPointGlob, trackParCov, b, 2.f, matCorr, &clusDuplicatedDCA)) {
mDCAxyDuplicated->Fill(clusDuplicatedDCA[0]);
mDCAzDuplicated->Fill(clusDuplicatedDCA[1]);
mDCAxyDuplicated_layer[layerDuplicated]->Fill(clusDuplicatedDCA[0]);
mDCAzDuplicated_layer[layerDuplicated]->Fill(clusDuplicatedDCA[1]);
}
///////////////////////////////////////////////////////
}
}
}
}
}
} // end loop on clusters
totClus += NLAYERS; // summing only the number of clusters in the considered layers. Since the imposition of 7-clusters tracks, if the track is valid should release as clusters as the number of considered layers
} // end loop on tracks per ROF
} // end loop on ROFRecords array
LOGP(info, "Total number of clusters: {} ", totClus);
LOGP(info, "total nLabels: {}", nLabels);
LOGP(info, "Number of duplicated clusters: {}", duplicated);
if (mVerboseOutput && mUseMC) {
// printing the duplicates
for (unsigned int iROF = 0; iROF < mClustersROFRecords.size(); iROF++) {
LOGP(info, "°°°°°°°°°°°°°°°°°°°°°°°° ROF {} °°°°°°°°°°°°°°°°°°°°°°°°", iROF);
for (unsigned int lay = 0; lay < NLAYERS; lay++) {
LOGP(info, "°°°°°°°°°°°°°°°°°°°°°°°° LAYER {} °°°°°°°°°°°°°°°°°°°°°°°°", lay);
for (auto& it : label_vecClus[iROF][lay]) {
if (it.second.size() <= 1) {
continue; // printing only duplicates
}
std::cout << " \n++++++++++++ Label: ";
auto label = it.first;
it.first.print();
for (auto iClus : it.second) {
auto name = mGeometry->getSymbolicName(mClusters[iClus].getSensorID());
auto chipid = mClusters[iClus].getChipID();
auto clus = mClusters[iClus];
auto clusPoint = mITSClustersArray[iClus];
o2::math_utils::Point3D<float> clusPointTrack = {clusPoint.getX(), clusPoint.getY(), clusPoint.getZ()};
o2::math_utils::Point3D<float> clusPointGlob = mGeometry->getMatrixT2G(clus.getSensorID()) * clusPointTrack;
std::cout << "ROF: " << iROF << ", iClus: " << iClus << " -> chip: " << chipid << " = " << name << std::endl;
LOGP(info, "LOCtrack: {} {} {}", clusPointTrack.x(), clusPointTrack.y(), clusPointTrack.z());
LOGP(info, "LOCglob {} {} {}", clusPointGlob.x(), clusPointGlob.y(), clusPointGlob.z());
}
}
}
}
}
return duplicated;
}
void EfficiencyStudy::countDuplicatedAfterCuts()
{
// count the effective number of duplicated cluster good matches after applying the pt eta and phi cuts on the track
// to check the applied cuts
LOGP(info, "--------------- countDuplicatedAfterCuts");
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
o2::gpu::gpustd::array<float, 2> clusOriginalDCA, clusDuplicatedDCA;
auto propagator = o2::base::Propagator::Instance();
unsigned int rofIndexTrack = 0;
unsigned int rofNEntriesTrack = 0;
unsigned int rofIndexClus = 0;
unsigned int rofNEntriesClus = 0;
int nLabels = 0;
unsigned int totClus = 0;
int duplicated[3] = {0};
int possibleduplicated[3] = {0};
std::cout << "Track candidates: " << std::endl;
std::unordered_map<o2::MCCompLabel, std::vector<int>> label_vecClus[mClustersROFRecords.size()][NLAYERS]; // array of maps nRofs x Nlayers -> {label, vec(iClus)} where vec(iClus) are the clusters that share the same label
for (unsigned int iROF = 0; iROF < mTracksROFRecords.size(); iROF++) { // loop on ROFRecords array
std::cout << "ROF number: " << iROF << std::endl;
rofIndexTrack = mTracksROFRecords[iROF].getFirstEntry();
rofNEntriesTrack = mTracksROFRecords[iROF].getNEntries();
rofIndexClus = mClustersROFRecords[iROF].getFirstEntry();
rofNEntriesClus = mClustersROFRecords[iROF].getNEntries();
for (unsigned int iTrack = rofIndexTrack; iTrack < rofIndexTrack + rofNEntriesTrack; iTrack++) { // loop on tracks per ROF
auto track = mTracks[iTrack];
o2::track::TrackParCov trackParCov = mTracks[iTrack];
int firstClus = track.getFirstClusterEntry(); // get the first cluster of the track
int ncl = track.getNumberOfClusters(); // get the number of clusters of the track
if (ncl < 7) {
continue;
}
auto& tracklab = mTracksMCLabels[iTrack];
if (tracklab.isFake()) {
continue;
}
auto eta = trackParCov.getEta();
// applying the cuts on the track - only eta
if (eta < mEtaCuts[0] || eta >= mEtaCuts[1]) {
continue;
}
float phi = -999.;
float phiOriginal = -999.;
for (int iclTrack = firstClus; iclTrack < firstClus + ncl; iclTrack++) { // loop on clusters associated to the track
auto& clusOriginal = mClusters[mInputITSidxs[iclTrack]];
auto clusOriginalPoint = mITSClustersArray[mInputITSidxs[iclTrack]]; // cluster spacepoint in the tracking system
auto layerOriginal = mGeometry->getLayer(clusOriginal.getSensorID());
auto staveOriginal = mGeometry->getStave(clusOriginal.getSensorID());
auto chipOriginal = mGeometry->getChipIdInStave(clusOriginal.getSensorID());
auto layer = mGeometry->getLayer(clusOriginal.getSensorID());
if (layer >= NLAYERS) {
continue; // checking only selected layers
}
auto labsTrack = mClustersMCLCont->getLabels(mInputITSidxs[iclTrack]); // get labels of the cluster associated to the track
o2::math_utils::Point3D<float> clusOriginalPointTrack = {clusOriginalPoint.getX(), clusOriginalPoint.getY(), clusOriginalPoint.getZ()};
o2::math_utils::Point3D<float> clusOriginalPointGlob = mGeometry->getMatrixT2G(clusOriginal.getSensorID()) * clusOriginalPointTrack;
phiOriginal = clusOriginalPointGlob.phi(); // * 180 / M_PI;
if (abs(clusOriginalPointGlob.y()) < 0.5) { ///// excluding gap between bottom and top barrels
continue;
}
if (abs(clusOriginalPointGlob.z()) >= 10) { /// excluding external z
continue;
}
if (clusOriginal.getRow() < 2 || (clusOriginal.getRow() > 15 && clusOriginal.getRow() < 496) || clusOriginal.getRow() > 509) { //// cutting on the row
continue;
}
if (clusOriginal.getCol() < 160 || clusOriginal.getCol() > 870) { /// excluding the gap between two chips in the same stave (comment to obtain the plot efficiency col vs eta)
continue;
}
for (auto& labT : labsTrack) { // for each valid label iterate over ALL the clusters in the ROF to see if there are duplicates
if (labT != tracklab) {
continue;
}
if (labT.isValid()) {
for (unsigned int iClus = rofIndexClus; iClus < rofIndexClus + rofNEntriesClus; iClus++) { // iteration over ALL the clusters in the ROF
auto clusDuplicated = mClusters[iClus];
auto clusDuplicatedPoint = mITSClustersArray[iClus];
auto layerClus = mGeometry->getLayer(clusDuplicated.getSensorID());
if (layerClus != layer) {
continue;
}
o2::math_utils::Point3D<float> clusDuplicatedPointTrack = {clusDuplicatedPoint.getX(), clusDuplicatedPoint.getY(), clusDuplicatedPoint.getZ()};
o2::math_utils::Point3D<float> clusDuplicatedPointGlob = mGeometry->getMatrixT2G(clusDuplicated.getSensorID()) * clusDuplicatedPointTrack;
phi = clusDuplicatedPointGlob.phi(); // * 180 / M_PI;
auto labsClus = mClustersMCLCont->getLabels(iClus); // ideally I can have more than one label per cluster
for (auto labC : labsClus) {
if (labC == labT) {
label_vecClus[iROF][layerClus][labT].push_back(iClus); // same cluster: label from the track = label from the cluster
// if a duplicate cluster is found, propagate the track to the duplicate cluster and compute the distance from the original cluster
// if (clusOriginalPointGlob != clusDuplicatedPointGlob) { /// check that the duplicated cluster is not the original one just counted twice
// if (clusDuplicated.getSensorID() != clusOriginal.getSensorID()) { /// check that the duplicated cluster is not the original one just counted twice
// applying constraints: the cluster should be on the same layer, should be on an adjacent stave and on the same or adjacent chip position
if (clusDuplicated.getSensorID() == clusOriginal.getSensorID()) {
continue;
}
auto layerDuplicated = mGeometry->getLayer(clusDuplicated.getSensorID());
if (layerDuplicated != layerClus) {
continue;
}
auto staveDuplicated = mGeometry->getStave(clusDuplicated.getSensorID());
if (abs(staveDuplicated - staveOriginal) != 1) {
continue;
}
auto chipDuplicated = mGeometry->getChipIdInStave(clusDuplicated.getSensorID());
if (abs(chipDuplicated - chipOriginal) > 1) {
continue;
}
duplicated[layer]++;
std::cout << "Taken L" << layer << " # " << duplicated[layer] << " : eta, phi = " << eta << " , " << phiOriginal << " Label: " << std::endl;
labC.print();
}
}
}
}
}
} // end loop on clusters
totClus += ncl;
} // end loop on tracks per ROF
} // end loop on ROFRecords array
LOGP(info, "Total number of possible cluster duplicated in L0: {} ", possibleduplicated[0]);
LOGP(info, "Total number of possible cluster duplicated in L1: {} ", possibleduplicated[1]);
LOGP(info, "Total number of possible cluster duplicated in L2: {} ", possibleduplicated[2]);
LOGP(info, "Total number of cluster duplicated in L0: {} ", duplicated[0]);
LOGP(info, "Total number of cluster duplicated in L1: {} ", duplicated[1]);
LOGP(info, "Total number of cluster duplicated in L2: {} ", duplicated[2]);
}
void EfficiencyStudy::studyDCAcutsMC()
{
//// Study the DCA cuts to be applied
LOGP(info, "--------------- studyDCAcutsMC");
int duplicated = getDCAClusterTrackMC(0);
double meanDCAxyDuplicated[NLAYERS] = {0};
double meanDCAzDuplicated[NLAYERS] = {0};
double sigmaDCAxyDuplicated[NLAYERS] = {0};
double sigmaDCAzDuplicated[NLAYERS] = {0};