Skip to content

Commit 9fc8940

Browse files
[PWGLF] Add RCTFlagsChecker in strangeness data model (#10889)
1 parent 081f278 commit 9fc8940

File tree

5 files changed

+135
-3
lines changed

5 files changed

+135
-3
lines changed

PWGLF/DataModel/LFStrangenessTables.h

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,43 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_004, "AOD", "STRAEVSELS", 4, //!
226226
// stracollision::EnergyCommonZNC<mult::MultZNC>,
227227
stracollision::IsUPC<udcollision::GapSide>);
228228

229+
DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! debug information
230+
evsel::Sel8, evsel::Selection, //! event selection: sel8
231+
mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, // FIT detectors
232+
mult::MultFDDA, mult::MultFDDC,
233+
mult::MultNTracksPVeta1, // track multiplicities with eta cut for INEL>0
234+
mult::MultPVTotalContributors, // number of PV contribs total
235+
mult::MultNTracksGlobal, // global track multiplicities
236+
mult::MultNTracksITSTPC, // track multiplicities, PV contribs, no eta cut
237+
mult::MultAllTracksTPCOnly, // TPConly track multiplicities, all, no eta cut
238+
mult::MultAllTracksITSTPC, // ITSTPC track multiplicities, all, no eta cut
239+
mult::MultZNA, mult::MultZNC, mult::MultZEM1, // ZDC signals
240+
mult::MultZEM2, mult::MultZPA, mult::MultZPC,
241+
evsel::NumTracksInTimeRange, // add occupancy in specified time interval by a number of tracks from nearby collisions
242+
evsel::SumAmpFT0CInTimeRange, // add occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions
243+
udcollision::GapSide, // UPC info: 0 for side A, 1 for side C, 2 for both sides, 3 neither A or C, 4 not enough or too many pv contributors
244+
udcollision::TotalFT0AmplitudeA, // UPC info: re-assigned FT0-A amplitude, in case of SG event, from the most active bc
245+
udcollision::TotalFT0AmplitudeC, // UPC info: re-assigned FT0-C amplitude, in case of SG event, from the most active bc
246+
udcollision::TotalFV0AmplitudeA, // UPC info: re-assigned FV0-A amplitude, in case of SG event, from the most active bc
247+
udcollision::TotalFDDAmplitudeA, // UPC info: re-assigned FDD-A amplitude, in case of SG event, from the most active bc
248+
udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc
249+
udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc
250+
udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc
251+
252+
collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings
253+
evsel::Alias, // trigger aliases (e.g. kTVXinTRD for v2)
254+
evsel::Rct, // Bitmask of RCT flags
255+
256+
// Dynamic columns for manipulating information
257+
// stracollision::TotalFV0AmplitudeA<mult::MultFV0A>,
258+
// stracollision::TotalFT0AmplitudeA<mult::MultFT0A>,
259+
// stracollision::TotalFT0AmplitudeC<mult::MultFT0C>,
260+
// stracollision::TotalFDDAmplitudeA<mult::MultFDDA>,
261+
// stracollision::TotalFDDAmplitudeC<mult::MultFDDC>,
262+
// stracollision::EnergyCommonZNA<mult::MultZNA>,
263+
// stracollision::EnergyCommonZNC<mult::MultZNC>,
264+
stracollision::IsUPC<udcollision::GapSide>);
265+
229266
DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information
230267
evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8
231268
mult::MultFT0A, mult::MultFT0C, // FIT detectors
@@ -266,7 +303,7 @@ DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! informat
266303

267304
using StraRawCents = StraRawCents_004;
268305
using StraCents = StraCents_001;
269-
using StraEvSels = StraEvSels_004;
306+
using StraEvSels = StraEvSels_005;
270307
using StraStamps = StraStamps_001;
271308
using StraCollision = StraCollisions::iterator;
272309
using StraCent = StraCents_001::iterator;

PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ o2physics_add_dpl_workflow(straevselsconverter4
5454
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::ITStracking
5555
COMPONENT_NAME Analysis)
5656

57+
o2physics_add_dpl_workflow(straevselsconverter5
58+
SOURCES straevselsconverter5.cxx
59+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::ITStracking
60+
COMPONENT_NAME Analysis)
61+
5762
o2physics_add_dpl_workflow(straevselsconverter2rawcents
5863
SOURCES straevselsconverter2rawcents.cxx
5964
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
#include "Framework/runDataProcessing.h"
12+
#include "Framework/AnalysisTask.h"
13+
#include "Framework/AnalysisDataModel.h"
14+
#include "ITStracking/Vertexer.h"
15+
#include "PWGLF/DataModel/LFStrangenessTables.h"
16+
17+
using namespace o2;
18+
using namespace o2::framework;
19+
20+
// Converts Stra Event selections from 004 to 005
21+
struct straevselsconverter5 {
22+
Produces<aod::StraEvSels_005> straEvSels_005;
23+
24+
void process(aod::StraEvSels_004 const& straEvSels_004)
25+
{
26+
for (auto& values : straEvSels_004) {
27+
straEvSels_005(values.sel8(),
28+
values.selection_raw(),
29+
values.multFT0A(),
30+
values.multFT0C(),
31+
values.multFT0A(),
32+
0 /*dummy FDDA value*/,
33+
0 /*dummy FDDC value*/,
34+
values.multNTracksPVeta1(),
35+
values.multPVTotalContributors(),
36+
values.multNTracksGlobal(),
37+
values.multNTracksITSTPC(),
38+
values.multAllTracksTPCOnly(),
39+
values.multAllTracksITSTPC(),
40+
values.multZNA(),
41+
values.multZNC(),
42+
values.multZEM1(),
43+
values.multZEM2(),
44+
values.multZPA(),
45+
values.multZPC(),
46+
values.trackOccupancyInTimeRange(),
47+
0 /*dummy occupancy value*/,
48+
values.gapSide(),
49+
values.totalFT0AmplitudeA(),
50+
values.totalFT0AmplitudeC(),
51+
values.totalFV0AmplitudeA(),
52+
values.totalFDDAmplitudeA(),
53+
values.totalFDDAmplitudeC(),
54+
values.energyCommonZNA(),
55+
values.energyCommonZNC(),
56+
values.flags(),
57+
0 /*dummy Alias value*/,
58+
0 /*dummy Rct value*/);
59+
}
60+
}
61+
};
62+
63+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
64+
{
65+
return WorkflowSpec{
66+
adaptAnalysisTask<straevselsconverter5>(cfgc)};
67+
}

PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ struct strangederivedbuilder {
516516
energyCommonZNA, energyCommonZNC,
517517
// Collision flags
518518
collision.flags(),
519-
collision.alias_raw());
519+
collision.alias_raw(),
520+
collision.rct_raw());
520521
} else { // We are in Run 2
521522
strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(),
522523
collision.centRun2SPDTracklets(), collision.centRun2SPDClusters());

PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "CommonConstants/PhysicsConstants.h"
5353
#include "Common/Core/trackUtilities.h"
5454
#include "Common/CCDB/ctpRateFetcher.h"
55+
#include "Common/DataModel/EventSelection.h"
5556
#include "PWGLF/DataModel/LFStrangenessTables.h"
5657
#include "PWGLF/DataModel/LFStrangenessMLTables.h"
5758
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
@@ -70,6 +71,8 @@ using namespace o2::framework;
7071
using namespace o2::framework::expressions;
7172
using std::array;
7273

74+
using namespace o2::aod::rctsel;
75+
7376
using DauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;
7477
using DauMCTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackMCIds, aod::DauTrackTPCPIDs>;
7578
using V0Candidates = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras, aod::V0TOFPIDs, aod::V0TOFNSigmas, aod::V0LambdaMLScores, aod::V0AntiLambdaMLScores, aod::V0K0ShortMLScores>;
@@ -202,6 +205,15 @@ struct derivedlambdakzeroanalysis {
202205
Configurable<bool> doTreatPiToMuon{"doTreatPiToMuon", false, "Take pi decay into muon into account in MC"};
203206
Configurable<bool> doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"};
204207

208+
struct : ConfigurableGroup {
209+
std::string prefix = "rctConfigurations"; // JSON group name
210+
Configurable<std::string> cfgRCTLabel{"cfgRCTLabel", "", "Which detector condition requirements? (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"};
211+
Configurable<bool> cfgCheckZDC{"cfgCheckZDC", false, "Include ZDC flags in the bit selection (for Pb-Pb only)"};
212+
Configurable<bool> cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};
213+
} rctConfigurations;
214+
215+
RCTFlagsChecker rctFlagsChecker{rctConfigurations.cfgRCTLabel.value};
216+
205217
// Machine learning evaluation for pre-selection and corresponding information generation
206218
o2::ml::OnnxModel mlCustomModelK0Short;
207219
o2::ml::OnnxModel mlCustomModelLambda;
@@ -538,8 +550,11 @@ struct derivedlambdakzeroanalysis {
538550
secondaryMaskSelectionLambda = maskTopological | maskTrackProperties | maskLambdaSpecific;
539551
secondaryMaskSelectionAntiLambda = maskTopological | maskTrackProperties | maskAntiLambdaSpecific;
540552

553+
// Initialise the RCTFlagsChecker
554+
rctFlagsChecker.init(rctConfigurations.cfgRCTLabel.value, rctConfigurations.cfgCheckZDC, rctConfigurations.cfgTreatLimitedAcceptanceAsBad);
555+
541556
// Event Counters
542-
histos.add("hEventSelection", "hEventSelection", kTH1F, {{20, -0.5f, +19.5f}});
557+
histos.add("hEventSelection", "hEventSelection", kTH1F, {{21, -0.5f, +20.5f}});
543558
if (isRun3) {
544559
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions");
545560
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut");
@@ -566,6 +581,7 @@ struct derivedlambdakzeroanalysis {
566581
}
567582
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(19, "Below min IR");
568583
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(20, "Above max IR");
584+
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(21, "RCT flags");
569585
} else {
570586
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions");
571587
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut");
@@ -1838,6 +1854,12 @@ struct derivedlambdakzeroanalysis {
18381854
if (fillHists)
18391855
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);
18401856

1857+
if (!rctConfigurations.cfgRCTLabel.value.empty() && !rctFlagsChecker(collision)) {
1858+
return false;
1859+
}
1860+
if (fillHists)
1861+
histos.fill(HIST("hEventSelection"), 20 /* Pass CBT condition */);
1862+
18411863
} else { // we are in Run 2
18421864
if (eventSelections.requireSel8 && !collision.sel8()) {
18431865
return false;

0 commit comments

Comments
 (0)