Skip to content

Commit 2d5b544

Browse files
Add event preselections in strangeness builder and strangeness derived data producer
1 parent 40ac982 commit 2d5b544

11 files changed

Lines changed: 699 additions & 222 deletions

Common/TableProducer/propagationService.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct propagationService {
7777
o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts;
7878
o2::pwglf::strangenessbuilder::cascadeConfigurables cascadeBuilderOpts;
7979
o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts;
80+
o2::pwglf::strangenessbuilder::eventSelectOpts eventSelectOpts;
8081
o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule;
8182

8283
// the track tuner object -> needs to be here as it inherits from ConfigurableGroup (+ has its own copy of ccdbApi)
@@ -99,7 +100,7 @@ struct propagationService {
99100

100101
// task-specific
101102
trackPropagation.init(trackPropagationConfigurables, trackTunerObj, histos, initContext);
102-
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
103+
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, eventSelectOpts, histos, initContext);
103104
}
104105

105106
void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIU const& tracks, aod::BCsWithTimestamps const& bcs)

Common/TableProducer/propagationServiceRun2.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct propagationServiceRun2 {
7575
o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts;
7676
o2::pwglf::strangenessbuilder::cascadeConfigurables cascadeBuilderOpts;
7777
o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts;
78+
o2::pwglf::strangenessbuilder::eventSelectOpts eventSelectOpts;
7879
o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule;
7980

8081
// registry
@@ -89,7 +90,7 @@ struct propagationServiceRun2 {
8990
ccdb->setFatalWhenNull(false);
9091

9192
// task-specific
92-
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
93+
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, eventSelectOpts, histos, initContext);
9394
}
9495

9596
void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, FullTracksExt const& tracks, aod::BCsWithTimestamps const& bcs)

Common/TableProducer/propagationServiceV2.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct propagationServiceV2 {
8282
o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts;
8383
o2::pwglf::strangenessbuilder::cascadeConfigurables cascadeBuilderOpts;
8484
o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts;
85+
o2::pwglf::strangenessbuilder::eventSelectOpts eventSelectOpts;
8586
o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule;
8687

8788
// the track tuner object -> needs to be here as it inherits from ConfigurableGroup (+ has its own copy of ccdbApi)
@@ -106,7 +107,7 @@ struct propagationServiceV2 {
106107

107108
// task-specific
108109
trackPropagation.init(trackPropagationConfigurables, trackTunerObj, histos, initContext);
109-
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
110+
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, eventSelectOpts, histos, initContext);
110111
}
111112

112113
// Load MatLUT once (needs rectifyPtrFromFile, kept manual), set B-field and mean vertex

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,17 @@ DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_002, "AOD", "DAUTRACKTOFPID", 2, //
182182
dautrack::TOFExpTimeKa<dautrack::Length, dautrack::TOFExpMom>,
183183
dautrack::TOFExpTimePr<dautrack::Length, dautrack::TOFExpMom>);
184184

185-
using DauTrackTOFPIDs = DauTrackTOFPIDs_002; // second gen: with collision Id, with TOFExpMom
185+
DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_003, "AOD", "DAUTRACKTOFPID", 3, // raw table (for posterior TOF calculation)
186+
o2::soa::Index<>,
187+
bc::GlobalBC, dautrack::DauTrackExtraId,
188+
dautrack::TOFSignal, dautrack::TOFEvTime, dautrack::TOFEvTimeErr,
189+
dautrack::Length, dautrack::TOFExpMom,
190+
dautrack::TOFExpTimeEl<dautrack::Length, dautrack::TOFExpMom>,
191+
dautrack::TOFExpTimePi<dautrack::Length, dautrack::TOFExpMom>,
192+
dautrack::TOFExpTimeKa<dautrack::Length, dautrack::TOFExpMom>,
193+
dautrack::TOFExpTimePr<dautrack::Length, dautrack::TOFExpMom>);
194+
195+
using DauTrackTOFPIDs = DauTrackTOFPIDs_003; // second gen: with collision Id, with TOFExpMom
186196

187197
namespace v0data
188198
{

PWGLF/DataModel/LFStrangenessTables.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ DECLARE_SOA_COLUMN(DataframeID, dataframeID, uint64_t); //! Data frame ID (what
4444
DECLARE_SOA_TABLE(StraOrigins, "AOD", "STRAORIGIN", //! Table which contains the IDs of all dataframes merged into this dataframe
4545
o2::soa::Index<>, straorigin::DataframeID);
4646

47+
// for keeping track of the number of selected collisions
48+
namespace straselections
49+
{
50+
DECLARE_SOA_COLUMN(TotalNbrOfCollisions, totalNbrOfCollisions, int); //! total number of analysed collisions
51+
DECLARE_SOA_COLUMN(TotalNbrOfSelCollisions, totalNbrOfSelCollisions, int); //! total number of selected collisions
52+
} // namespace straselections
53+
54+
DECLARE_SOA_TABLE(StraSelections, "AOD", "STRASELECTIONS", //! keep track of the number of analysed collisions in this DF
55+
o2::soa::Index<>, straselections::TotalNbrOfCollisions, straselections::TotalNbrOfSelCollisions);
56+
4757
namespace stracollision
4858
{
4959
DECLARE_SOA_DYNAMIC_COLUMN(IsUPC, isUPC, //! check whether this is a UPC or hadronic collision
@@ -410,8 +420,10 @@ DECLARE_SOA_TABLE(StraMCCollMults_000, "AOD", "STRAMCCOLLMULTS", //! MC collisio
410420
mult::MultMCFT0A, mult::MultMCFT0C, mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10, o2::soa::Marker<2>);
411421
DECLARE_SOA_TABLE_VERSIONED(StraMCCollMults_001, "AOD", "STRAMCCOLLMULTS", 1, //! MC collision multiplicities
412422
mult::MultMCFT0A, mult::MultMCFT0C, mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10, stramccollision::TotalMultMCParticles);
423+
DECLARE_SOA_TABLE_VERSIONED(StraMCCollMults_002, "AOD", "STRAMCCOLLMULTS", 2, //! MC collision multiplicities
424+
mult::MultMCFT0A, mult::MultMCFT0C, mult::MultMCFV0A, mult::MultMCFDDA, mult::MultMCFDDC, mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10, stramccollision::TotalMultMCParticles);
413425

414-
using StraMCCollMults = StraMCCollMults_001;
426+
using StraMCCollMults = StraMCCollMults_002;
415427

416428
namespace dautrack
417429
{

PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter3
3434
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3535
COMPONENT_NAME Analysis)
3636

37+
o2physics_add_dpl_workflow(stradautrackstofpidconverter4
38+
SOURCES stradautrackstofpidconverter4.cxx
39+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
40+
COMPONENT_NAME Analysis)
41+
3742
o2physics_add_dpl_workflow(stradautracksextraconverter
3843
SOURCES stradautracksextraconverter.cxx
3944
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
@@ -134,6 +139,11 @@ o2physics_add_dpl_workflow(stramccollisionconverter
134139
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
135140
COMPONENT_NAME Analysis)
136141

142+
o2physics_add_dpl_workflow(stramccollisionconverter2
143+
SOURCES stramccollisionconverter2.cxx
144+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
145+
COMPONENT_NAME Analysis)
146+
137147
o2physics_add_dpl_workflow(strastampsconverter
138148
SOURCES strastampsconverter.cxx
139149
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
@@ -154,8 +164,8 @@ o2physics_add_dpl_workflow(stramccollmultconverter
154164
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
155165
COMPONENT_NAME Analysis)
156166

157-
o2physics_add_dpl_workflow(stramccollisionconverter2
158-
SOURCES stramccollisionconverter2.cxx
167+
o2physics_add_dpl_workflow(stramccollmultconverter2
168+
SOURCES stramccollmultconverter2.cxx
159169
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
160170
COMPONENT_NAME Analysis)
161171

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
//
12+
/// \file stradautrackstofpidconverter4.cxx
13+
/// \brief Converts DauTrackTOFPID_002 into DauTrackTOFPID_003
14+
///
15+
/// \author David Dobrigkeit Chinellato <david.dobrigkeit.chinellato@cern.ch>, Austrian Academy of Sciences & MBI
16+
/// \author Romain Schotter <romain.schotter@cern.ch>, Austrian Academy of Sciences & MBI
17+
18+
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
19+
#include "PWGLF/DataModel/LFStrangenessTables.h"
20+
21+
#include "Framework/AnalysisDataModel.h"
22+
#include "Framework/AnalysisTask.h"
23+
#include "Framework/runDataProcessing.h"
24+
25+
using namespace o2;
26+
using namespace o2::framework;
27+
28+
// converts DauTrackTOFPIDs_002 to _003
29+
struct stradautrackstofpidconverter4 {
30+
Produces<aod::DauTrackTOFPIDs_003> dautracktofpids;
31+
32+
void process(aod::DauTrackTOFPIDs_002 const& dauTracks, soa::Join<aod::StraCollisions, aod::StraStamps> const& collisions)
33+
{
34+
// create new TOFPIDs
35+
dautracktofpids.reserve(dauTracks.size());
36+
for (const auto& dauTrack : dauTracks) {
37+
uint64_t bc = 0;
38+
if (dauTrack.straCollisionId() >= 0) {
39+
auto collision = collisions.rawIteratorAt(dauTrack.straCollisionId());
40+
bc = collision.globalBC();
41+
}
42+
dautracktofpids(
43+
bc,
44+
dauTrack.dauTrackExtraId(),
45+
dauTrack.tofSignal(),
46+
dauTrack.tofEvTime(),
47+
dauTrack.tofEvTimeErr(),
48+
dauTrack.length(),
49+
dauTrack.tofExpMom());
50+
}
51+
}
52+
};
53+
54+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
55+
{
56+
return WorkflowSpec{
57+
adaptAnalysisTask<stradautrackstofpidconverter4>(cfgc)};
58+
}

0 commit comments

Comments
 (0)