Skip to content

Commit 3bb4d37

Browse files
victor-gonzalezVictor
andauthored
Support for the new event selection criteria (#5437)
Co-authored-by: Victor <victor@cern.ch>
1 parent 8101fd0 commit 3bb4d37

File tree

2 files changed

+47
-15
lines changed

2 files changed

+47
-15
lines changed

PWGCF/TableProducer/dptdptfilter.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ struct DptDptFilter {
174174
Configurable<std::string> cfgCentMultEstimator{"centmultestimator", "V0M", "Centrality/multiplicity estimator detector: V0M,CL0,CL1,FV0A,FT0M,FT0A,FT0C,NTPV,NOCM: none. Default V0M"};
175175
Configurable<std::string> cfgSystem{"syst", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"};
176176
Configurable<std::string> cfgDataType{"datatype", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"};
177-
Configurable<std::string> cfgTriggSel{"triggsel", "MB", "Trigger selection: MB, None. Default MB"};
177+
Configurable<std::string> cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"};
178178
Configurable<std::string> cfgCentSpec{"centralities", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"};
179179
Configurable<float> cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"};
180180
Configurable<o2::analysis::DptDptBinningCuts> cfgBinning{"binning",
@@ -515,7 +515,7 @@ struct DptDptFilterTracks {
515515
std::string cfgCCDBPeriod{"LHC22o"};
516516

517517
Configurable<bool> cfgFullDerivedData{"fullderiveddata", false, "Produce the full derived data for external storage. Default false"};
518-
Configurable<int> cfgTrackType{"trktype", 4, "Type of selected tracks: 0 = no selection, 1 = Run2 global tracks FB96, 3 = Run3 tracks, 4 = Run3 tracks MM sel, 5 = Run2 TPC only tracks, 7 = Run 3 TPC only tracks. Default 4"};
518+
Configurable<int> cfgTrackType{"trktype", 4, "Type of selected tracks: 0 = no selection;1 = Run2 global tracks FB96;3 = Run3 tracks;4 = Run3 tracks MM sel;5 = Run2 TPC only tracks;7 = Run 3 TPC only tracks;30-33 = any/two on 3 ITS,any/all in 7 ITS;40-43 same as 30-33 w tighter DCAxy. Default 4"};
519519
Configurable<o2::analysis::CheckRangeCfg> cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"};
520520
Configurable<float> cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"};
521521
Configurable<int> cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle. Default 0"};
@@ -1092,7 +1092,7 @@ template <typename CollisionObjects, typename TrackObject>
10921092
int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& collisions, TrackObject const& track)
10931093
{
10941094
bool ambiguoustrack = false;
1095-
int tracktype = 0; /* no ambiguous */
1095+
int ambtracktype = 0; /* no ambiguous */
10961096
std::vector<double> zvertexes{};
10971097
/* ambiguous tracks checks if required */
10981098
if constexpr (has_type_v<aod::track_association::CollisionIds, typename TrackObject::all_columns>) {
@@ -1102,17 +1102,17 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col
11021102
/* ambiguous track! */
11031103
ambiguoustrack = true;
11041104
/* in principle we should not be here because the track is associated to two collisions at least */
1105-
tracktype = 2;
1105+
ambtracktype = 2;
11061106
zvertexes.push_back(collisions.iteratorAt(track.collisionId()).posZ());
11071107
zvertexes.push_back(collisions.iteratorAt(track.compatibleCollIds()[0]).posZ());
11081108
} else {
11091109
/* we consider the track as no ambiguous */
1110-
tracktype = 1;
1110+
ambtracktype = 1;
11111111
}
11121112
} else {
11131113
/* ambiguous track! */
11141114
ambiguoustrack = true;
1115-
tracktype = 3;
1115+
ambtracktype = 3;
11161116
/* the track is associated to more than one collision */
11171117
for (const auto& collIdx : track.compatibleCollIds()) {
11181118
zvertexes.push_back(collisions.iteratorAt(collIdx).posZ());
@@ -1124,10 +1124,10 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col
11241124
float multiplicityclass = (track.template collision_as<soa::Join<aod::Collisions, aod::DptDptCFCollisionsInfo>>()).centmult();
11251125
if (ambiguoustrack) {
11261126
/* keep track of ambiguous tracks */
1127-
fhAmbiguousTrackType->Fill(tracktype, multiplicityclass);
1127+
fhAmbiguousTrackType->Fill(ambtracktype, multiplicityclass);
11281128
fhAmbiguousTrackPt->Fill(track.pt(), multiplicityclass);
11291129
fhAmbiguityDegree->Fill(zvertexes.size(), multiplicityclass);
1130-
if (tracktype == 2) {
1130+
if (ambtracktype == 2) {
11311131
fhCompatibleCollisionsZVtxRms->Fill(-computeRMS(zvertexes), multiplicityclass);
11321132
} else {
11331133
fhCompatibleCollisionsZVtxRms->Fill(computeRMS(zvertexes), multiplicityclass);
@@ -1136,7 +1136,7 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col
11361136
} else {
11371137
if (checkAmbiguousTracks) {
11381138
/* feedback of no ambiguous tracks only if checks required */
1139-
fhAmbiguousTrackType->Fill(tracktype, multiplicityclass);
1139+
fhAmbiguousTrackType->Fill(ambtracktype, multiplicityclass);
11401140
}
11411141
return selectTrack(track);
11421142
}

PWGCF/TableProducer/dptdptfilter.h

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ enum CentMultEstimatorType {
9292
/// \enum TriggerSelectionType
9393
/// \brief The type of trigger to apply for event selection
9494
enum TriggerSelectionType {
95-
kNONE = 0, ///< do not use trigger selection
96-
kMB, ///< Minimum bias trigger
97-
knEventSelection ///< number of triggers for event selection
95+
kNONE = 0, ///< do not use trigger selection
96+
kMB, ///< Minimum bias trigger
97+
kVTXTOFMATCHED, ///< at least one vertex contributor is matched to TOF
98+
kVTXTRDMATCHED, ///< at least one vertex contributor is matched to TRD
99+
kVTXTRDTOFMATCHED, ///< at least one vertex contributor is matched to TRD and TOF
100+
knEventSelection ///< number of triggers for event selection
98101
};
99102

100103
//============================================================================================
@@ -278,6 +281,12 @@ inline TriggerSelectionType getTriggerSelection(std::string const& triggstr)
278281
{
279282
if (triggstr.empty() || triggstr == "MB") {
280283
return kMB;
284+
} else if (triggstr == "VTXTOFMATCHED") {
285+
return kVTXTOFMATCHED;
286+
} else if (triggstr == "VTXTRDMATCHED") {
287+
return kVTXTRDMATCHED;
288+
} else if (triggstr == "VTXTRDTOFMATCHED") {
289+
return kVTXTRDTOFMATCHED;
281290
} else if (triggstr == "None") {
282291
return kNONE;
283292
} else {
@@ -439,10 +448,33 @@ inline bool triggerSelectionReco(CollisionObject const& collision)
439448
}
440449
break;
441450
case kppRun3:
442-
case kPbPbRun3:
451+
case kPbPbRun3: {
452+
auto run3Accepted = [](auto const& coll) {
453+
return coll.sel8() &&
454+
coll.selection_bit(aod::evsel::kNoITSROFrameBorder) &&
455+
coll.selection_bit(aod::evsel::kNoTimeFrameBorder) &&
456+
coll.selection_bit(aod::evsel::kNoSameBunchPileup) &&
457+
coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) &&
458+
coll.selection_bit(aod::evsel::kIsVertexITSTPC);
459+
};
443460
switch (fTriggerSelection) {
444461
case kMB:
445-
if (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
462+
if (run3Accepted(collision)) {
463+
trigsel = true;
464+
}
465+
break;
466+
case kVTXTOFMATCHED:
467+
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
468+
trigsel = true;
469+
}
470+
break;
471+
case kVTXTRDMATCHED:
472+
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched)) {
473+
trigsel = true;
474+
}
475+
break;
476+
case kVTXTRDTOFMATCHED:
477+
if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) {
446478
trigsel = true;
447479
}
448480
break;
@@ -452,7 +484,7 @@ inline bool triggerSelectionReco(CollisionObject const& collision)
452484
default:
453485
break;
454486
}
455-
break;
487+
} break;
456488
default:
457489
break;
458490
}

0 commit comments

Comments
 (0)