Skip to content

Commit c08e294

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 3a9265f + 8ac448f commit c08e294

File tree

135 files changed

+14080
-5768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+14080
-5768
lines changed

ALICE3/DataModel/OTFMulticharm.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,24 @@ DECLARE_SOA_TABLE(MCharmCores, "AOD", "MCharmCores",
116116
otfmulticharm::Eta,
117117

118118
otfmulticharm::XiDCAxy,
119-
otfmulticharm::XicDCAxy,
120-
otfmulticharm::XiccDCAxy,
121119
otfmulticharm::XiDCAz,
120+
otfmulticharm::XicDCAxy,
122121
otfmulticharm::XicDCAz,
122+
otfmulticharm::XiccDCAxy,
123123
otfmulticharm::XiccDCAz,
124124

125125
otfmulticharm::PiFromXiDCAxy,
126-
otfmulticharm::PiFromLaDCAxy,
127-
otfmulticharm::PrFromLaDCAxy,
128126
otfmulticharm::PiFromXiDCAz,
127+
otfmulticharm::PiFromLaDCAxy,
129128
otfmulticharm::PiFromLaDCAz,
129+
otfmulticharm::PrFromLaDCAxy,
130130
otfmulticharm::PrFromLaDCAz,
131131

132132
otfmulticharm::Pi1cDCAxy,
133-
otfmulticharm::Pi2cDCAxy,
134-
otfmulticharm::PiccDCAxy,
135133
otfmulticharm::Pi1cDCAz,
134+
otfmulticharm::Pi2cDCAxy,
136135
otfmulticharm::Pi2cDCAz,
136+
otfmulticharm::PiccDCAxy,
137137
otfmulticharm::PiccDCAz,
138138

139139
otfmulticharm::XicDecayRadius2D,

Common/DataModel/OccupancyTables.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ namespace trackmeanocc
209209
{
210210
DECLARE_SOA_INDEX_COLUMN(Track, track);
211211

212+
// DECLARE_SOA_INDEX_COLUMN(TracksQA, tracksQA);// this is not working
213+
212214
DECLARE_SOA_COLUMN(TmoPrimUnfm80, tmoPrimUnfm80, float);
213215
DECLARE_SOA_COLUMN(TmoFV0AUnfm80, tmoFV0AUnfm80, float);
214216
DECLARE_SOA_COLUMN(TmoFV0CUnfm80, tmoFV0CUnfm80, float);
@@ -281,7 +283,7 @@ DECLARE_SOA_COLUMN(TwmoRobustMultExtraTableUnfm80, twmoRobustMultExtraTableUnfm8
281283
// using Tracks = aod::Tracks;
282284
// DECLARE_SOA_INDEX_TABLE_USER(TrackMeanOccs0, Tracks, "TRACKMEANOCCS0", o2::aod::trackmeanocc::TrackId);
283285

284-
DECLARE_SOA_TABLE(TmoTrackId, "AOD", "TMOTRACKID", o2::aod::trackmeanocc::TrackId);
286+
DECLARE_SOA_TABLE(TmoTrackIds, "AOD", "TMOTRACKIDS", o2::aod::trackmeanocc::TrackId);
285287

286288
DECLARE_SOA_TABLE(TmoPrim, "AOD", "TMOPRIM", o2::soa::Index<>, // TrackMeanOccDet
287289
o2::aod::trackmeanocc::TmoPrimUnfm80);
@@ -377,5 +379,21 @@ DECLARE_SOA_TABLE(TwmoRNtrackDet, "AOD", "TWMORNTRACKDET", o2::soa::Index<>,
377379
DECLARE_SOA_TABLE(TwmoRMultExtra, "AOD", "TWMORMULTEXTRA", o2::soa::Index<>,
378380
o2::aod::trackmeanocc::TwmoRobustMultExtraTableUnfm80);
379381

382+
using Tmo = aod::TmoTrackIds::iterator;
383+
384+
using TrackQA = TracksQAVersion::iterator;
385+
386+
namespace trackmeanocc
387+
{
388+
DECLARE_SOA_INDEX_COLUMN_FULL(Tmo, tmo, int64_t, TmoTrackIds, "");
389+
DECLARE_SOA_INDEX_COLUMN_FULL(TrackQA, trackQA, int64_t, TracksQAVersion, "");
390+
} // namespace trackmeanocc
391+
392+
DECLARE_SOA_TABLE(TrackToTracksQA, "AOD", "TRACKTOTRACKSQA", o2::aod::trackmeanocc::TrackQAId);
393+
DECLARE_SOA_TABLE(TrackToTmo, "AOD", "TRACKTOTMO", o2::aod::trackmeanocc::TmoId);
394+
395+
DECLARE_SOA_TABLE(TrackQAToTmo, "AOD", "TRACKQATOTMO", o2::aod::trackmeanocc::TmoId);
396+
DECLARE_SOA_TABLE(TmoToTrackQA, "AOD", "TMOTOTRACKQA", o2::aod::trackmeanocc::TrackQAId);
397+
380398
} // namespace o2::aod
381399
#endif // COMMON_DATAMODEL_OCCUPANCYTABLES_H_
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 SelectionStudyTables
13+
/// \brief tables meant to do event selection studies for O-O / light systems
14+
///
15+
/// \author ALICE
16+
17+
#include "Framework/ASoA.h"
18+
#include "Framework/AnalysisDataModel.h"
19+
20+
#include <vector>
21+
22+
#ifndef COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
23+
#define COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
24+
25+
namespace o2::aod
26+
{
27+
namespace selectionstudy
28+
{
29+
DECLARE_SOA_COLUMN(PtPions, ptPions, std::vector<float>);
30+
DECLARE_SOA_COLUMN(PtKaons, ptKaons, std::vector<float>);
31+
DECLARE_SOA_COLUMN(PtProtons, ptProtons, std::vector<float>);
32+
DECLARE_SOA_COLUMN(PtK0s, ptPK0s, std::vector<float>);
33+
DECLARE_SOA_COLUMN(PtLambdas, ptLambdas, std::vector<float>);
34+
DECLARE_SOA_COLUMN(PtXis, ptXis, std::vector<float>);
35+
DECLARE_SOA_COLUMN(PtOmegas, ptOmegas, std::vector<float>);
36+
DECLARE_SOA_COLUMN(PtPhis, ptPhis, std::vector<float>);
37+
DECLARE_SOA_COLUMN(PtKStars, ptKStars, std::vector<float>);
38+
DECLARE_SOA_COLUMN(PtDs, ptDs, std::vector<float>);
39+
DECLARE_SOA_COLUMN(PtLambdaCs, ptLambdaCs, std::vector<float>);
40+
DECLARE_SOA_COLUMN(PtJPsis, ptJPsis, std::vector<float>);
41+
} // namespace selectionstudy
42+
43+
DECLARE_SOA_TABLE(PIDPts, "AOD", "PIDPTS", o2::soa::Index<>,
44+
o2::aod::selectionstudy::PtPions,
45+
o2::aod::selectionstudy::PtKaons,
46+
o2::aod::selectionstudy::PtProtons,
47+
o2::aod::selectionstudy::PtK0s,
48+
o2::aod::selectionstudy::PtLambdas,
49+
o2::aod::selectionstudy::PtXis,
50+
o2::aod::selectionstudy::PtOmegas,
51+
o2::aod::selectionstudy::PtPhis,
52+
o2::aod::selectionstudy::PtKStars,
53+
o2::aod::selectionstudy::PtDs,
54+
o2::aod::selectionstudy::PtLambdaCs,
55+
o2::aod::selectionstudy::PtJPsis);
56+
} // namespace o2::aod
57+
#endif // COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_

Common/TableProducer/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ o2physics_add_dpl_workflow(event-selection
2727
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCCDB
2828
COMPONENT_NAME Analysis)
2929

30+
o2physics_add_dpl_workflow(event-selection-service
31+
SOURCES eventSelectionService.cxx
32+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCCDB
33+
COMPONENT_NAME Analysis)
34+
3035
o2physics_add_dpl_workflow(multiplicity-table
3136
SOURCES multiplicityTable.cxx
3237
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
@@ -160,3 +165,7 @@ o2physics_add_dpl_workflow(muon-realignment
160165
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::DetectorsCommonDataFormats O2::MathUtils O2::MCHTracking O2::DataFormatsMCH O2::GlobalTracking O2::MCHBase O2::MCHGeometryTransformer O2::CommonUtils
161166
COMPONENT_NAME Analysis)
162167

168+
o2physics_add_dpl_workflow(selectionstudytable
169+
SOURCES selectionStudyTable.cxx
170+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
171+
COMPONENT_NAME Analysis)
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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 eventSelectionTester.cxx
13+
/// \brief unified, self-configuring event selection task
14+
/// \author ALICE
15+
16+
//===============================================================
17+
//
18+
// Unified, self-configuring event selection task
19+
//
20+
//===============================================================
21+
22+
#include "MetadataHelper.h"
23+
24+
#include "Common/Core/trackUtilities.h"
25+
#include "Common/DataModel/TrackSelectionTables.h"
26+
#include "Common/Tools/EventSelectionTools.h"
27+
28+
#include "CCDB/BasicCCDBManager.h"
29+
#include "CCDB/CcdbApi.h"
30+
#include "CommonConstants/GeomConstants.h"
31+
#include "CommonUtils/NameConf.h"
32+
#include "DataFormatsCalibration/MeanVertexObject.h"
33+
#include "DataFormatsParameters/GRPMagField.h"
34+
#include "DetectorsBase/GeometryManager.h"
35+
#include "DetectorsBase/Propagator.h"
36+
#include "Framework/AnalysisDataModel.h"
37+
#include "Framework/AnalysisTask.h"
38+
#include "Framework/HistogramRegistry.h"
39+
#include "Framework/RunningWorkflowInfo.h"
40+
#include "Framework/runDataProcessing.h"
41+
#include "ReconstructionDataFormats/DCA.h"
42+
43+
using namespace o2;
44+
using namespace o2::framework;
45+
46+
MetadataHelper metadataInfo; // Metadata helper
47+
48+
using BCsWithRun2InfosTimestampsAndMatches = soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps, aod::Run2MatchedToBCSparse>;
49+
using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
50+
using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra>;
51+
using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra>;
52+
53+
struct eventselectionRun2 {
54+
o2::common::eventselection::bcselConfigurables bcselOpts;
55+
o2::common::eventselection::BcSelectionModule bcselmodule;
56+
57+
o2::common::eventselection::evselConfigurables evselOpts;
58+
o2::common::eventselection::EventSelectionModule evselmodule;
59+
60+
Produces<aod::BcSels> bcsel;
61+
Produces<aod::EvSels> evsel;
62+
63+
// for slicing
64+
SliceCache cache;
65+
66+
// CCDB boilerplate declarations
67+
o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
68+
Service<o2::ccdb::BasicCCDBManager> ccdb;
69+
70+
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
71+
72+
// the best: have readable cursors
73+
// this: a stopgap solution to avoid spawning yet another device
74+
std::vector<o2::common::eventselection::bcselEntry> bcselsbuffer;
75+
76+
// auxiliary
77+
Partition<FullTracks> tracklets = (aod::track::trackType == static_cast<uint8_t>(o2::aod::track::TrackTypeEnum::Run2Tracklet));
78+
Preslice<FullTracks> perCollision = aod::track::collisionId;
79+
80+
void init(o2::framework::InitContext& context)
81+
{
82+
// CCDB boilerplate init
83+
ccdb->setCaching(true);
84+
ccdb->setLocalObjectValidityChecking();
85+
ccdb->setURL(ccdburl.value);
86+
87+
// task-specific
88+
bcselmodule.init(context, bcselOpts, histos);
89+
evselmodule.init(context, evselOpts, histos, metadataInfo);
90+
}
91+
92+
void process(BCsWithRun2InfosTimestampsAndMatches const& bcs,
93+
aod::Collisions const& collisions,
94+
aod::Zdcs const&,
95+
aod::FV0As const&,
96+
aod::FV0Cs const&,
97+
aod::FT0s const&,
98+
aod::FDDs const&,
99+
FullTracks const&)
100+
{
101+
bcselmodule.processRun2(ccdb, bcs, bcselsbuffer, bcsel);
102+
evselmodule.processRun2(ccdb, histos, collisions, tracklets, cache, bcselsbuffer, evsel);
103+
}
104+
};
105+
106+
struct eventselectionRun3 {
107+
o2::common::eventselection::bcselConfigurables bcselOpts;
108+
o2::common::eventselection::BcSelectionModule bcselmodule;
109+
110+
o2::common::eventselection::evselConfigurables evselOpts;
111+
o2::common::eventselection::EventSelectionModule evselmodule;
112+
113+
o2::common::eventselection::lumiConfigurables lumiOpts;
114+
o2::common::eventselection::LumiModule lumimodule;
115+
116+
Produces<aod::BcSels> bcsel;
117+
Produces<aod::EvSels> evsel;
118+
119+
// for slicing
120+
SliceCache cache;
121+
122+
// CCDB boilerplate declarations
123+
o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
124+
Service<o2::ccdb::BasicCCDBManager> ccdb;
125+
126+
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
127+
128+
// the best: have readable cursors
129+
// this: a stopgap solution to avoid spawning yet another device
130+
std::vector<o2::common::eventselection::bcselEntry> bcselsbuffer;
131+
132+
// auxiliary
133+
Partition<FullTracksIU> pvTracks = ((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor));
134+
Preslice<FullTracksIU> perCollisionIU = aod::track::collisionId;
135+
136+
void init(o2::framework::InitContext& context)
137+
{
138+
// CCDB boilerplate init
139+
ccdb->setCaching(true);
140+
ccdb->setLocalObjectValidityChecking();
141+
ccdb->setURL(ccdburl.value);
142+
143+
// task-specific
144+
bcselmodule.init(context, bcselOpts, histos);
145+
evselmodule.init(context, evselOpts, histos, metadataInfo);
146+
lumimodule.init(context, lumiOpts, histos);
147+
}
148+
149+
void process(aod::Collisions const& collisions,
150+
BCsWithRun3Matchings const& bcs,
151+
aod::Zdcs const&,
152+
aod::FV0As const&,
153+
aod::FT0s const& ft0s, // to resolve iterator
154+
aod::FDDs const&,
155+
FullTracksIU const&)
156+
{
157+
bcselmodule.processRun3(ccdb, histos, bcs, bcselsbuffer, bcsel);
158+
evselmodule.processRun3(ccdb, histos, bcs, collisions, pvTracks, ft0s, cache, bcselsbuffer, evsel);
159+
lumimodule.process(ccdb, histos, bcs, bcselsbuffer);
160+
}
161+
};
162+
163+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
164+
{
165+
// Parse the metadata for later too
166+
metadataInfo.initMetadata(cfgc);
167+
168+
bool isRun3 = true, hasRunInfo = false;
169+
if (cfgc.options().hasOption("aod-metadata-Run") == true) {
170+
hasRunInfo = true;
171+
if (cfgc.options().get<std::string>("aod-metadata-Run") == "2") {
172+
isRun3 = false;
173+
}
174+
}
175+
176+
LOGF(info, "Event selection autoconfiguring from metadata. Availability of info for Run 2/3 is %i", hasRunInfo);
177+
if (!hasRunInfo) {
178+
LOGF(info, "Metadata info missing or incomplete. Make sure --aod-file is provided at the end of the last workflow and that the AO2D has metadata stored.");
179+
LOGF(info, "Initializing with Run 3 data as default. Please note you will not be able to change settings manually.");
180+
LOGF(info, "You should instead make sure the metadata is read in correctly.");
181+
return WorkflowSpec{adaptAnalysisTask<eventselectionRun3>(cfgc)};
182+
} else {
183+
LOGF(info, "Metadata successfully read in. Is this Run 3? %i - will self-configure.", isRun3);
184+
if (isRun3) {
185+
return WorkflowSpec{adaptAnalysisTask<eventselectionRun3>(cfgc)};
186+
} else {
187+
return WorkflowSpec{adaptAnalysisTask<eventselectionRun2>(cfgc)};
188+
}
189+
}
190+
throw std::runtime_error("Unsupported run type / problem when configuring event selection!");
191+
}

0 commit comments

Comments
 (0)