forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdptDptFilter.h
More file actions
1872 lines (1735 loc) · 76.3 KB
/
dptDptFilter.h
File metadata and controls
1872 lines (1735 loc) · 76.3 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.
/// \file dptDptFilter.h
/// \brief Filters collisions and tracks according to selection criteria
/// \author victor.gonzalez.sebastian@gmail.com
#ifndef PWGCF_TABLEPRODUCER_DPTDPTFILTER_H_
#define PWGCF_TABLEPRODUCER_DPTDPTFILTER_H_
#include "PWGCF/Core/AnalysisConfigurableCuts.h"
#include "Common/Core/RecoDecay.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "ReconstructionDataFormats/PID.h"
#include <CCDB/BasicCCDBManager.h>
#include <TF1.h>
#include <TList.h>
#include <TMCProcess.h>
#include <TPDGCode.h>
#include <bitset>
#include <fstream>
#include <functional>
#include <iomanip>
#include <locale>
#include <map>
#include <ranges>
#include <sstream>
#include <string>
#include <vector>
namespace o2
{
namespace aod
{
using CollisionsEvSelCent = soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentNTPVs>;
using CollisionEvSelCent = soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentNTPVs>::iterator;
using CollisionsEvSelRun2Cent = soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::CentRun2V0Ms, aod::CentRun2CL0s, aod::CentRun2CL1s>;
using CollisionEvSelRun2Cent = soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::CentRun2V0Ms, aod::CentRun2CL0s, aod::CentRun2CL1s>::iterator;
using CollisionsEvSel = soa::Join<aod::Collisions, aod::Mults, aod::EvSels>;
using CollisionEvSel = soa::Join<aod::Collisions, aod::Mults, aod::EvSels>::iterator;
using TrackData = soa::Join<aod::Tracks, aod::TracksCov, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>::iterator;
} // namespace aod
namespace analysis
{
namespace dptdptfilter
{
/// \enum SystemType
/// \brief The type of the system under analysis
enum SystemType {
kNoSystem = 0, ///< no system defined
kpp, ///< **p-p** system
kpPb, ///< **p-Pb** system
kPbp, ///< **Pb-p** system
kPbPb, ///< **Pb-Pb** system
kXeXe, ///< **Xe-Xe** system
kppRun3, ///< **p-p Run 3** system
kPbPbRun3, ///< **Pb-Pb Run 3** system
knSystems ///< number of handled systems
};
/// \enum DataType
/// \brief Which kind of data is the task addressing
enum DataType {
kData = 0, ///< actual data, not generated
kMC, ///< Generator level and detector level
kFastMC, ///< Gererator level but stored dataset
kOnTheFly, ///< On the fly generator level data
kDataNoEvtSel, ///< actual data but not event selection available yet
knGenData ///< number of different generator data types
};
/// \enum CentMultEstimatorType
/// \brief The detector used to estimate centrality/multiplicity
enum CentMultEstimatorType {
kNOCM = 0, ///< do not use centrality/multiplicity estimator
kV0M, ///< V0M centrality/multiplicity estimator Run 1/2
kCL0, ///< CL0 centrality/multiplicity estimator Run 1/2
kCL1, ///< CL1 centrality/multiplicity estimator Run 1/2
kFV0A, ///< FV0A centrality/multiplicity estimator Run 3
kFT0M, ///< FT0M centrality/multiplicity estimator Run 3
kFT0A, ///< FT0A centrality/multiplicity estimator Run 3
kFT0C, ///< FT0C centrality/multiplicity estimator Run 3
kNTPV, ///< NTPV centrality/multiplicity estimator Run 3
knCentMultEstimators ///< number of centrality/mutiplicity estimator
};
/// \enum TriggerSelectionType
/// \brief The type of trigger to apply for event selection
enum TriggerSelectionType {
kNONE = 0, ///< do not use trigger selection
kMB, ///< Minimum bias trigger
kMBEXTRA, ///< Additional Run3 event quality
kVTXTOFMATCHED, ///< at least one vertex contributor is matched to TOF
kVTXTRDMATCHED, ///< at least one vertex contributor is matched to TRD
kVTXTRDTOFMATCHED, ///< at least one vertex contributor is matched to TRD and TOF
kEXTRAVTXTOFMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TOF
kEXTRAVTXTRDMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TRD
kEXTRAVTXTRDTOFMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TRD and TOF
knEventSelection ///< number of triggers for event selection
};
/// \enum OccupancyEstimationType
/// \brief The type of occupancy estimation
enum OccupancyEstimationType {
kNOOCC = 0, ///< do not use occupancy estimation
kTRACKSOCC, ///< occupancy estimated using tracks
kFT0COCC, ///< occupancy estimated using the FT0C
knOccupancyEstimators ///< the number of occupancy estimators
};
/// \enum CollisionSelectionFlags
/// \brief The different criteria for selecting/rejecting collisions
enum CollisionSelectionFlags {
kIN = 0, ///< new unhandled, yet, event
kMBBIT, ///< minimum bias
kINT7BIT, ///< INT7 Run 1/2
kSEL7BIT, ///< Sel7 Run 1/2
kSEL8BIT, ///< Sel8
kNOSAMEBUNCHPUPBIT, ///< no same bunch pile up
kISGOODZVTXFT0VSPVBIT, ///< good zvtx FT0 vs PV
kISVERTEXITSTPCBIT, ///< is vertex TPC and ITS
kISVERTEXTOFMATCHEDBIT, ///< vertex contributor with TOF matched
kISVERTEXTRDMATCHEDBIT, ///< vertex contributor with TRD matche
kNOCOLLINTIMERANGEBIT, ///< no collision in time range
kNOCOLLINROFBIT, ///< no collision in readout
kOCCUPANCYBIT, ///< occupancy within limits
kISGOODITSLAYER3BIT, ///< right level of inactive chips for ITS layer 3
kISGOODITSLAYER0123BIT, ///< right level of inactive chips for ITS layers 0,1,2, and 3
kISGOODITSLAYERALLBIT, ///< right level of inactive chips for all seven ITS layers
kCENTRALITYBIT, ///< centrality cut passed
kZVERTEXBIT, ///< zvtx cut passed
kSELECTED, ///< the event has passed all selections
knCollisionSelectionFlags ///< number of flags
};
/// \enum StrongDebugging
/// \brief Enable a per track information debugging. Only for local analyses
enum StrongDebugging {
kNODEBUG = 0, ///< do not debug
kDEBUG ///< output debugging information on a per track basis to a text file
};
/// \enum TpcExclusionMethod
/// \brief Methods for excluding tracks witin the TPC
enum TpcExclusionMethod {
kNOEXCLUSION = 0, ///< do not exclude tracks within the TPC
kSTATIC, ///< exclude tracks statically on the bins of the TPC sector borders; only valid if 72 bins and origin shifted by 0.5
kDYNAMIC ///< pT dependent exclusion matching the sector borders a la Alex Dobrin
};
/// \enum ItsDeadMapsCheckType
/// \brief Check for the right level of ITS dead chips
enum ItsDeadMapsCheckType {
kNOCHECK = 0, ///< no check
kGOODITSLAYER3, ///< check good the 3 ITS layer
kGOODITSLAYER0123, ///< check good the 0,1,2,and 3 ITS layers
kGOODITSLAYERALL, ///< check good all ITS layers
kNOGOODITSLAYER3, ///< check no good the 3 ITS layer
kNOGOODITSLAYER0123, ///< check no good the 0,1,2,and 3 ITS layers
kNOGOODITSLAYERALL ///< check no good all ITS layers
};
//============================================================================================
// The debug output stream
//============================================================================================
std::ofstream debugstream;
//============================================================================================
// The overall minimum momentum
//============================================================================================
float overallminp = 0.0f;
//============================================================================================
// The collision selection flags and configuration objects
//============================================================================================
std::bitset<32> collisionFlags;
//============================================================================================
// The DptDptFilter configuration objects
//============================================================================================
int ptbins = 18;
float ptlow = 0.2, ptup = 2.0;
int etabins = 16;
float etalow = -0.8, etaup = 0.8;
int zvtxbins = 40;
float zvtxlow = -10.0, zvtxup = 10.0;
int phibins = 72;
float philow = 0.0f;
float phiup = constants::math::TwoPI;
float phibinshift = 0.0f;
struct TpcExcludeTrack; ///< forward declaration of the excluder object
bool onlyInOneSide = false; ///< select only tracks that don't cross the TPC central membrane
extern TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
/* selection criteria from PWGMM */
static constexpr int kTrackTypePWGMM = 4;
// default quality criteria for tracks with ITS contribution
static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionITS =
o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF |
o2::aod::track::TrackSelectionFlags::kITSHits;
// default quality criteria for tracks with TPC contribution
static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionTPC =
o2::aod::track::TrackSelectionFlags::kTPCNCls |
o2::aod::track::TrackSelectionFlags::kTPCCrossedRowsOverNCls |
o2::aod::track::TrackSelectionFlags::kTPCChi2NDF;
// default standard DCA cuts
static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionDCA =
o2::aod::track::TrackSelectionFlags::kDCAz | o2::aod::track::TrackSelectionFlags::kDCAxy;
struct DptDptTrackSelection; // forward struct declaration
int tracktype = 1;
std::vector<DptDptTrackSelection*> trackFilters = {}; // the vector of track selectors
struct DptDptTrackSelection {
DptDptTrackSelection(TrackSelection* stdTs, TList* outputList, const char* name) : stdTrackSelection(stdTs)
{
passedHistogram = new TH1F(name, name, ptbins, ptlow, ptup);
outputList->Add(passedHistogram);
}
DptDptTrackSelection(TrackSelection* stdTs, std::function<float(float)> ptDepCut, TList* outputList, const char* name)
: stdTrackSelection(stdTs),
maxDcazPtDep(ptDepCut)
{
passedHistogram = new TH1F(name, name, ptbins, ptlow, ptup);
outputList->Add(passedHistogram);
}
void setMaxDcaXY(float max)
{
maxDCAxy = max;
stdTrackSelection->SetMaxDcaXY(max);
}
void setMaxDcaZ(float max)
{
maxDCAz = max;
stdTrackSelection->SetMaxDcaZ(max);
}
void setMaxDcazPtDep(std::function<float(float)> ptDepCut)
{
maxDcazPtDep = ptDepCut;
}
void setRequirePvContributor(bool pvc = true)
{
requirePvContributor = pvc;
}
template <typename TrackObject>
bool isSelected(TrackObject const& track) const
{
if (stdTrackSelection->IsSelected(track)) {
auto checkDca2Dcut = [&](auto const& track) {
if (dca2Dcut) {
if (track.dcaXY() * track.dcaXY() / maxDCAxy / maxDCAxy + track.dcaZ() * track.dcaZ() / maxDCAz / maxDCAz > 1) {
return false;
} else {
return true;
}
} else {
return true;
}
};
auto checkDcaZcut = [&](auto const& track) {
return ((maxDcazPtDep) ? std::fabs(track.dcaZ()) <= maxDcazPtDep(track.pt()) : true);
};
/* tight pT dependent DCAz cut */
if (!checkDcaZcut(track)) {
return false;
}
/* 2D DCA xy-o-z cut */
if (!checkDca2Dcut(track)) {
return false;
}
/* primary vertex contributor */
if (requirePvContributor) {
if (!track.isPVContributor()) {
return false;
}
}
passedHistogram->Fill(track.pt());
return true;
} else {
return false;
}
}
static void initializeTrackSelection(TrackSelectionTuneCfg& tune, TList* outputList)
{
auto addTrackFilter = [](auto filter) {
trackFilters.push_back(filter);
};
auto highQualityTpcTrack = [](TList* outList, const char* name) {
DptDptTrackSelection* tpcTrack = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outList, name);
tpcTrack->stdTrackSelection->ResetITSRequirements();
tpcTrack->stdTrackSelection->SetRequireITSRefit(false);
tpcTrack->stdTrackSelection->SetMinNClustersTPC(120);
tpcTrack->stdTrackSelection->SetMaxTPCFractionSharedCls(0.2f);
return tpcTrack;
};
auto highQualityItsOnlyTrack = [](TList* outList, const char* name) {
DptDptTrackSelection* itsTrack = new DptDptTrackSelection(new TrackSelection(), [](float pt) { return 0.004f + 0.013f / pt; }, outList, name);
itsTrack->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
itsTrack->stdTrackSelection->SetRequireITSRefit(true);
itsTrack->stdTrackSelection->SetRequireHitsInITSLayers(2, {0, 1, 2});
itsTrack->stdTrackSelection->SetMaxChi2PerClusterITS(36.0f);
itsTrack->stdTrackSelection->SetMaxDcaXYPtDep([](float pt) { return 0.004f + 0.013f / pt; });
return itsTrack;
};
switch (tracktype) {
case 1: { /* Run2 global track */
DptDptTrackSelection* globalRun2 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outputList, "TType1Global");
globalRun2->stdTrackSelection->SetTrackType(o2::aod::track::Run2Track); // Run 2 track asked by default
globalRun2->stdTrackSelection->SetMaxChi2PerClusterTPC(2.5f);
DptDptTrackSelection* globalSDDRun2 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionSDD()), outputList, "TType1Sdd");
globalSDDRun2->stdTrackSelection->SetTrackType(o2::aod::track::Run2Track); // Run 2 track asked by default
globalSDDRun2->stdTrackSelection->SetMaxChi2PerClusterTPC(2.5f);
addTrackFilter(globalRun2);
addTrackFilter(globalSDDRun2);
} break;
case 3: { /* Run3 track */
DptDptTrackSelection* globalRun3 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outputList, "TType3Global");
globalRun3->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
globalRun3->stdTrackSelection->ResetITSRequirements();
globalRun3->stdTrackSelection->SetRequireHitsInITSLayers(1, {0, 1, 2});
DptDptTrackSelection* globalSDDRun3 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outputList, "TType3Sdd");
globalSDDRun3->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
globalSDDRun3->stdTrackSelection->ResetITSRequirements();
globalSDDRun3->stdTrackSelection->SetRequireNoHitsInITSLayers({0, 1, 2});
globalSDDRun3->stdTrackSelection->SetRequireHitsInITSLayers(1, {3});
addTrackFilter(globalRun3);
addTrackFilter(globalSDDRun3);
} break;
case 5: { /* Run2 TPC only track */
DptDptTrackSelection* tpcOnly = new DptDptTrackSelection(new TrackSelection, outputList, "TType5");
tpcOnly->stdTrackSelection->SetTrackType(o2::aod::track::Run2Track); // Run 2 track asked by default
tpcOnly->stdTrackSelection->SetMinNClustersTPC(50);
tpcOnly->stdTrackSelection->SetMaxChi2PerClusterTPC(4);
tpcOnly->setMaxDcaZ(3.2f);
tpcOnly->setMaxDcaXY(2.4f);
tpcOnly->dca2Dcut = true;
addTrackFilter(tpcOnly);
} break;
case 7: { /* Run3 TPC only track */
DptDptTrackSelection* tpcOnly = new DptDptTrackSelection(new TrackSelection, outputList, "TType7");
tpcOnly->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
tpcOnly->stdTrackSelection->SetMinNClustersTPC(50);
tpcOnly->stdTrackSelection->SetMaxChi2PerClusterTPC(4);
tpcOnly->setMaxDcaZ(3.2f);
tpcOnly->setMaxDcaXY(2.4f);
tpcOnly->dca2Dcut = true;
addTrackFilter(tpcOnly);
} break;
case 10: { /* Run3 track primary vertex contributor */
DptDptTrackSelection* globalRun3 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outputList, "TType10Global");
globalRun3->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
globalRun3->stdTrackSelection->ResetITSRequirements();
globalRun3->stdTrackSelection->SetRequireHitsInITSLayers(1, {0, 1, 2});
globalRun3->setRequirePvContributor(true);
DptDptTrackSelection* globalSDDRun3 = new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelection()), outputList, "TType10Sdd");
globalSDDRun3->stdTrackSelection->SetTrackType(o2::aod::track::TrackTypeEnum::Track);
globalSDDRun3->stdTrackSelection->ResetITSRequirements();
globalSDDRun3->stdTrackSelection->SetRequireNoHitsInITSLayers({0, 1, 2});
globalSDDRun3->stdTrackSelection->SetRequireHitsInITSLayers(1, {3});
globalSDDRun3->setRequirePvContributor(true);
addTrackFilter(globalRun3);
addTrackFilter(globalSDDRun3);
} break;
case 30: { /* Run 3 default global track: kAny on 3 IB layers of ITS */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default)), outputList, "TType30"));
} break;
case 31: { /* Run 3 global track: kTwo on 3 IB layers of ITS */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibTwo, TrackSelection::GlobalTrackRun3DCAxyCut::Default)), outputList, "TType31"));
} break;
case 32: { /* Run 3 global track: kAny on all 7 layers of ITS */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default)), outputList, "TType32"));
} break;
case 33: { /* Run 3 global track: kAll on all 7 layers of ITS */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::Default)), outputList, "TType33"));
} break;
case 40: { /* Run 3 global track: kAny on 3 IB layers of ITS, tighter DCAxy */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), outputList, "TType40"));
} break;
case 41: { /* Run 3 global track: kTwo on 3 IB layers of ITS, tighter DCAxy */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibTwo, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), outputList, "TType41"));
} break;
case 42: { /* Run 3 global track: kAny on all 7 layers of ITS, tighter DCAxy */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), outputList, "TType42"));
} break;
case 43: { /* Run 3 global track: kAll on all 7 layers of ITS, tighter DCAxy */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), outputList, "TType43"));
} break;
case 50: { /* Run 3 global track: kAny on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType50"));
} break;
case 51: { /* Run 3 global track: kTwo on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibTwo, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType51"));
} break;
case 52: { /* Run 3 global track: kAny on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType52"));
} break;
case 53: { /* Run 3 global track: kAll on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType53"));
} break;
case 60: { /* Run 3 global track: kAny on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus TPC+TOF only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType60Global"));
addTrackFilter(highQualityTpcTrack(outputList, "TType60Tpc"));
} break;
case 61: { /* Run 3 global track: kTwo on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus TPC+TOF only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibTwo, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType61Global"));
addTrackFilter(highQualityTpcTrack(outputList, "TType61Tpc"));
} break;
case 62: { /* Run 3 global track: kAny on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus TPC+TOF only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType62Global"));
addTrackFilter(highQualityTpcTrack(outputList, "TType62Tpc"));
} break;
case 63: { /* Run 3 global track: kAll on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus TPC+TOF only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType63Global"));
addTrackFilter(highQualityTpcTrack(outputList, "TType63Tpc"));
} break;
case 70: { /* Run 3 global track: kAny on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus ITS only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType70Global"));
addTrackFilter(highQualityItsOnlyTrack(outputList, "TType70Its"));
} break;
case 71: { /* Run 3 global track: kTwo on 3 IB layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus ITS only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibTwo, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType71Global"));
addTrackFilter(highQualityItsOnlyTrack(outputList, "TType71Its"));
} break;
case 72: { /* Run 3 global track: kAny on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus ITS only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType72Global"));
addTrackFilter(highQualityItsOnlyTrack(outputList, "TType72Its"));
} break;
case 73: { /* Run 3 global track: kAll on all 7 layers of ITS, tighter DCAxy, tighter pT dep DCAz, plus ITS only tracks */
addTrackFilter(new DptDptTrackSelection(new TrackSelection(getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::ppPass3)), [](float pt) { return 0.004f + 0.013f / pt; }, outputList, "TType73Global"));
addTrackFilter(highQualityItsOnlyTrack(outputList, "TType73Its"));
} break;
default:
break;
}
if (tune.mUseIt) {
for (auto const& filter : trackFilters) {
if (tune.mUseTPCclusters) {
filter->stdTrackSelection->SetMinNClustersTPC(tune.mTPCclusters);
}
if (tune.mUseTPCxRows) {
filter->stdTrackSelection->SetMinNCrossedRowsTPC(tune.mTPCxRows);
}
if (tune.mUseTPCXRoFClusters) {
filter->stdTrackSelection->SetMinNCrossedRowsOverFindableClustersTPC(tune.mTPCXRoFClusters);
}
if (tune.mUseDCAxy) {
/* DCAxy is tricky due to how the pT dependence is implemented */
filter->stdTrackSelection->SetMaxDcaXYPtDep([&tune](float) { return tune.mDCAxy; });
filter->setMaxDcaXY(tune.mDCAxy);
}
if (tune.mUseDCAz) {
/* DCAz is tricky due to how the pT dependence is implemented */
filter->setMaxDcazPtDep([&tune](float) { return tune.mDCAz; });
filter->setMaxDcaZ(tune.mDCAz);
}
if (tune.mUseFractionTpcSharedClusters) {
filter->stdTrackSelection->SetMaxTPCFractionSharedCls(tune.mFractionTpcSharedClusters);
}
}
}
}
float maxDCAxy = 1e6;
float maxDCAz = 1e6;
TrackSelection* stdTrackSelection = nullptr;
std::function<float(float)> maxDcazPtDep = {};
TH1* passedHistogram = nullptr;
bool dca2Dcut = false;
bool requirePvContributor = false;
};
inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdate, const char* period = "")
{
std::tm cfgtm = {};
std::stringstream ss(ccdbdate);
ss >> std::get_time(&cfgtm, "%Y%m%d");
cfgtm.tm_hour = 12;
int64_t timestamp = std::mktime(&cfgtm) * 1000;
TList* lst = nullptr;
if (std::strlen(period) != 0) {
std::map<std::string, std::string> metadata{{"Period", period}};
lst = ccdb->template getSpecific<TList>(ccdbpath, timestamp, metadata);
} else {
lst = ccdb->template getForTimeStamp<TList>(ccdbpath, timestamp);
}
if (lst != nullptr) {
LOGF(info, "Correctly loaded CCDB input object");
} else {
LOGF(error, "CCDB input object could not be loaded");
}
return lst;
}
SystemType fSystem = kNoSystem;
DataType fDataType = kData;
CentMultEstimatorType fCentMultEstimator = kV0M;
TriggerSelectionType fTriggerSelection = kMB;
OccupancyEstimationType fOccupancyEstimation = kNOOCC; /* the occupancy estimator to use */
ItsDeadMapsCheckType fItsDeadMapCheck = kNOCHECK; /* the check of the ITS dead maps to use */
float fMinOccupancy = 0.0f; /* the minimum allowed occupancy */
float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */
/* adaptations for the pp nightly checks */
analysis::CheckRangeCfg traceDCAOutliers;
bool traceOutOfSpeciesParticles = false;
int recoIdMethod = 0;
float particleMaxDCAxy = 999.9f;
float particleMaxDCAZ = 999.9f;
bool traceCollId0 = false;
inline TriggerSelectionType getTriggerSelection(std::string const& triggstr)
{
if (triggstr.empty() || triggstr == "MB") {
return kMB;
} else if (triggstr == "MBEXTRA") {
return kMBEXTRA;
} else if (triggstr == "VTXTOFMATCHED") {
return kVTXTOFMATCHED;
} else if (triggstr == "VTXTRDMATCHED") {
return kVTXTRDMATCHED;
} else if (triggstr == "VTXTRDTOFMATCHED") {
return kVTXTRDTOFMATCHED;
} else if (triggstr == "EXTRAVTXTOFMATCHED") {
return kEXTRAVTXTOFMATCHED;
} else if (triggstr == "EXTRAVTXTRDMATCHED") {
return kEXTRAVTXTRDMATCHED;
} else if (triggstr == "EXTRAVTXTRDTOFMATCHED") {
return kEXTRAVTXTRDTOFMATCHED;
} else if (triggstr == "None") {
return kNONE;
} else {
LOGF(fatal, "Wrong trigger selection: %s", triggstr.c_str());
return kNONE;
}
}
inline SystemType getSystemType(std::string const& sysstr)
{
/* we have to figure out how extract the system type */
if (sysstr.empty() || (sysstr == "PbPb")) {
return kPbPb;
} else if (sysstr == "pp") {
return kpp;
} else if (sysstr == "pPb") {
return kpPb;
} else if (sysstr == "Pbp") {
return kPbp;
} else if (sysstr == "pPb") {
return kpPb;
} else if (sysstr == "XeXe") {
return kXeXe;
} else if (sysstr == "ppRun3") {
return kppRun3;
} else if (sysstr == "PbPbRun3") {
return kPbPbRun3;
} else {
LOGF(fatal, "DptDptCorrelations::getSystemType(). Wrong system type: %s", sysstr.c_str());
}
return kPbPb;
}
/// \brief Type of data according to the configuration string
/// \param datastr The data type configuration string
/// \return Internal code for the passed kind of data string
inline DataType getDataType(std::string const& datastr)
{
/* we have to figure out how extract the type of data*/
if (datastr.empty() || (datastr == "data")) {
return kData;
} else if (datastr == "datanoevsel") {
return kDataNoEvtSel;
} else if (datastr == "MC") {
return kMC;
} else if (datastr == "FastMC") {
return kFastMC;
} else if (datastr == "OnTheFlyMC") {
return kOnTheFly;
} else {
LOGF(fatal, "DptDptCorrelations::getDataType(). Wrong type of dat: %d", datastr.c_str());
}
return kData;
}
inline CentMultEstimatorType getCentMultEstimator(std::string const& datastr)
{
if (datastr == "V0M") {
return kV0M;
} else if (datastr == "CL0") {
return kCL0;
} else if (datastr == "CL1") {
return kCL1;
} else if (datastr == "FV0A") {
return kFV0A;
} else if (datastr == "FT0M") {
return kFT0M;
} else if (datastr == "FT0A") {
return kFT0A;
} else if (datastr == "FT0C") {
return kFT0C;
} else if (datastr == "NTPV") {
return kNTPV;
} else if (datastr == "NOCM") {
return kNOCM;
} else {
LOGF(fatal, "Centrality/Multiplicity estimator %s not supported yet", datastr.c_str());
}
return kNOCM;
}
inline std::string getCentMultEstimatorName(CentMultEstimatorType est)
{
switch (est) {
case kV0M:
return "V0M";
break;
case kCL0:
return "CL0";
break;
case kCL1:
return "CL1";
break;
case kFV0A:
return "FV0A";
break;
case kFT0M:
return "FT0M";
break;
case kFT0A:
return "FT0A";
break;
case kFT0C:
return "FT0C";
break;
case kNTPV:
return "NTPV";
break;
case kNOCM:
return "NOCM";
break;
default:
LOGF(fatal, "Centrality/Multiplicity estimator %d not supported yet", (int)est);
return "WRONG";
break;
}
}
inline OccupancyEstimationType getOccupancyEstimator(const std::string& estimator)
{
if (estimator == "None") {
return kNOOCC;
} else if (estimator == "Tracks") {
return kTRACKSOCC;
} else if (estimator == "FT0C") {
return kFT0COCC;
} else {
LOGF(fatal, "Occupancy estimator %s not supported yet", estimator.c_str());
return kNOOCC;
}
}
inline ItsDeadMapsCheckType getItsDeadMapCheck(const std::string& check)
{
if (check.length() == 0 || check == "None") {
return kNOCHECK;
} else if (check == "goodIts3") {
return kGOODITSLAYER3;
} else if (check == "goodIts0123") {
return kGOODITSLAYER0123;
} else if (check == "goodItsAll") {
return kGOODITSLAYERALL;
} else if (check == "noGoodIts3") {
return kNOGOODITSLAYER3;
} else if (check == "noGoodIts0123") {
return kNOGOODITSLAYER0123;
} else if (check == "noGoodItsAll") {
return kNOGOODITSLAYERALL;
} else {
LOGF(fatal, "ITS dead map check %s not implemented", check.c_str());
return kNOCHECK;
}
}
//////////////////////////////////////////////////////////////////////////////////
/// Trigger selection
//////////////////////////////////////////////////////////////////////////////////
/// \brief Trigger selection for reconstructed and detector level collision tables
template <typename CollisionObject>
inline bool triggerSelectionReco(CollisionObject const& collision)
{
bool trigsel = false;
switch (fSystem) {
case kpp:
case kpPb:
case kPbp:
case kPbPb:
case kXeXe:
switch (fTriggerSelection) {
case kMB:
switch (fDataType) {
case kData:
if (collision.alias_bit(kINT7)) {
collisionFlags.set(kINT7BIT);
if (collision.sel7()) {
trigsel = true;
collisionFlags.set(kSEL7BIT);
}
}
break;
case kMC:
if (collision.sel7()) {
trigsel = true;
collisionFlags.set(kSEL7BIT);
}
break;
default:
collisionFlags.set(kMBBIT);
trigsel = true;
break;
}
break;
case kNONE:
trigsel = true;
break;
default:
break;
}
break;
case kppRun3:
case kPbPbRun3: {
auto run3Accepted = [](auto const& coll) {
return coll.sel8() &&
coll.selection_bit(aod::evsel::kNoCollInTimeRangeStandard) &&
coll.selection_bit(aod::evsel::kNoCollInRofStandard);
};
auto run3ExtraAccepted = [](auto const& coll) {
return coll.sel8() &&
coll.selection_bit(aod::evsel::kNoSameBunchPileup) &&
coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) &&
coll.selection_bit(aod::evsel::kIsVertexITSTPC);
};
auto setCollisionFlags = [](auto& flags, auto const& coll) {
flags.set(kSEL8BIT, coll.sel8() != 0);
flags.set(kNOSAMEBUNCHPUPBIT, coll.selection_bit(aod::evsel::kNoSameBunchPileup));
flags.set(kISGOODZVTXFT0VSPVBIT, coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV));
flags.set(kISVERTEXITSTPCBIT, coll.selection_bit(aod::evsel::kIsVertexITSTPC));
flags.set(kISVERTEXTOFMATCHEDBIT, coll.selection_bit(aod::evsel::kIsVertexTOFmatched));
flags.set(kISVERTEXTRDMATCHEDBIT, coll.selection_bit(aod::evsel::kIsVertexTRDmatched));
flags.set(kNOCOLLINTIMERANGEBIT, coll.selection_bit(aod::evsel::kNoCollInTimeRangeStandard));
flags.set(kNOCOLLINROFBIT, coll.selection_bit(aod::evsel::kNoCollInRofStandard));
flags.set(kISGOODITSLAYER3BIT, coll.selection_bit(aod::evsel::kIsGoodITSLayer3));
flags.set(kISGOODITSLAYER0123BIT, coll.selection_bit(aod::evsel::kIsGoodITSLayer0123));
flags.set(kISGOODITSLAYERALLBIT, coll.selection_bit(aod::evsel::kIsGoodITSLayersAll));
};
switch (fTriggerSelection) {
case kMB:
if (run3Accepted(collision)) {
trigsel = true;
}
break;
case kMBEXTRA:
if (run3ExtraAccepted(collision)) {
trigsel = true;
}
break;
case kVTXTOFMATCHED:
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
trigsel = true;
}
break;
case kVTXTRDMATCHED:
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched)) {
trigsel = true;
}
break;
case kVTXTRDTOFMATCHED:
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
trigsel = true;
}
break;
case kEXTRAVTXTOFMATCHED:
if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
trigsel = true;
}
break;
case kEXTRAVTXTRDMATCHED:
if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched)) {
trigsel = true;
}
break;
case kEXTRAVTXTRDTOFMATCHED:
if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
trigsel = true;
}
break;
case kNONE:
trigsel = true;
break;
default:
break;
}
setCollisionFlags(collisionFlags, collision);
} break;
default:
break;
}
return trigsel;
}
/// \brief Trigger selection by default: unknow subscribed collision table
template <typename CollisionObject>
inline bool triggerSelection(CollisionObject const&)
{
LOGF(fatal, "Trigger selection not implemented for this kind of collisions");
return false;
}
/// \brief Trigger selection for reconstructed collision tables without centrality/multiplicity
template <>
inline bool triggerSelection<aod::CollisionEvSel>(aod::CollisionEvSel const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for reconstructed collision tables with Run 2 centrality/multiplicity
template <>
inline bool triggerSelection<aod::CollisionEvSelRun2Cent>(aod::CollisionEvSelRun2Cent const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for reconstructed collision tables with centrality/multiplicity
template <>
inline bool triggerSelection<aod::CollisionEvSelCent>(aod::CollisionEvSelCent const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for detector level collision tables without centrality/multiplicity
template <>
inline bool triggerSelection<soa::Join<aod::CollisionsEvSel, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSel, aod::McCollisionLabels>::iterator const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for detector level collision tables with Run 2 centrality/multiplicity
template <>
inline bool triggerSelection<soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for detector level collision tables with centrality/multiplicity
template <>
inline bool triggerSelection<soa::Join<aod::CollisionsEvSelCent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelCent, aod::McCollisionLabels>::iterator const& collision)
{
return triggerSelectionReco(collision);
}
/// \brief Trigger selection for generator level collison table
template <>
inline bool triggerSelection<aod::McCollision>(aod::McCollision const&)
{
return true;
}
//////////////////////////////////////////////////////////////////////////////////
/// Multiplicity extraction
//////////////////////////////////////////////////////////////////////////////////
static constexpr float kValidPercentileLowLimit = 0.0f;
static constexpr float kValidPercentileUpLimit = 100.0f;
/// \brief Extract the collision multiplicity from the event selection information
template <typename CollisionObject>
inline float extractMultiplicity(CollisionObject const& collision, CentMultEstimatorType est)
{
switch (est) {
case kV0M:
return collision.multFV0M();
break;
case kCL0:
return collision.multTracklets();
break;
case kCL1:
return collision.multTracklets();
break;
case kFV0A:
return collision.multFV0A();
break;
case kFT0M:
return collision.multFT0M();
break;
case kFT0A:
return collision.multFT0A();
break;
case kFT0C:
return collision.multFT0M();
break;
case kNTPV:
return collision.multNTracksPV();
break;
case kNOCM:
return collision.multFT0M();
break;
default:
LOGF(fatal, "Centrality/Multiplicity estimator %d not supported yet", (int)est);
return collision.multFT0M();
break;
}
}
//////////////////////////////////////////////////////////////////////////////////
/// Centrality selection
//////////////////////////////////////////////////////////////////////////////////
/// \brief Centrality/multiplicity percentile
template <typename CollisionObject>
requires(o2::aod::HasRun2Centrality<CollisionObject>)
float getCentMultPercentile(CollisionObject collision)
{
switch (fCentMultEstimator) {
case kV0M:
return collision.centRun2V0M();
case kCL0:
return collision.centRun2CL0();
case kCL1:
return collision.centRun2CL1();
default:
return 105.0;
}
}
template <typename CollisionObject>
requires(o2::aod::HasCentrality<CollisionObject>)
float getCentMultPercentile(CollisionObject collision)
{
switch (fCentMultEstimator) {
case kFV0A:
return collision.centFV0A();
case kFT0M:
return collision.centFT0M();
case kFT0A:
return collision.centFT0A();
case kFT0C:
return collision.centFT0C();
case kNTPV:
return collision.centNTPV();
default:
return 105.0;
}
}
/// \brief Centrality selection when there is centrality/multiplicity information
template <typename CollisionObject>
inline bool centralitySelectionMult(CollisionObject collision, float& centmult)
{
float mult = getCentMultPercentile(collision);
if (mult < kValidPercentileUpLimit && kValidPercentileLowLimit < mult) {
centmult = mult;
collisionFlags.set(kCENTRALITYBIT);
return true;
}
return false;
}
/// \brief Centrality selection when there is not centrality/multiplicity information
template <typename CollisionObject>
inline bool centralitySelectionNoMult(CollisionObject const&, float& centmult)
{
bool centmultsel = false;
switch (fCentMultEstimator) {
case kNOCM:
centmult = 50.0;