Skip to content

Commit c9dfedd

Browse files
torkjellsdatterIda Torkjellsdatter Storehaugalibuild
authored
[PWGDQ] Add converter for updated REDUCEDMCEVENT table (ReducedInfoTables.h, CMakeList.txt, new task) (#13620)
Co-authored-by: Ida Torkjellsdatter Storehaug <idats@eduroam-193-157-190-10.wlan.uio.no> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 138aa09 commit c9dfedd

File tree

3 files changed

+68
-3
lines changed

3 files changed

+68
-3
lines changed

PWGDQ/DataModel/ReducedInfoTables.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,19 @@ DECLARE_SOA_TABLE(ReducedEventsInfo, "AOD", "REDUCEVENTINFO", //! Main event i
218218
// There is no explicit accounting for MC events which were not reconstructed!!!
219219
// However, for analysis which will require these events, a special skimming process function
220220
// can be constructed and the same data model could be used
221-
DECLARE_SOA_TABLE(ReducedMCEvents, "AOD", "REDUCEDMCEVENT", //! Event level MC truth information
221+
222+
DECLARE_SOA_TABLE(ReducedMCEvents_000, "AOD", "REDUCEDMCEVENT", //! Event level MC truth information
222223
o2::soa::Index<>,
223224
mccollision::GeneratorsID, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ,
224-
mccollision::T, mccollision::Weight, mccollision::ImpactParameter, cent::CentFT0C,
225-
mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10);
225+
mccollision::T, mccollision::Weight, mccollision::ImpactParameter);
226+
227+
DECLARE_SOA_TABLE_VERSIONED(ReducedMCEvents_001, "AOD", "REDUCEDMCEVENT", 1, //! Event level MC truth information
228+
o2::soa::Index<>,
229+
mccollision::GeneratorsID, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ,
230+
mccollision::T, mccollision::Weight, mccollision::ImpactParameter, cent::CentFT0C,
231+
mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10);
232+
233+
using ReducedMCEvents = ReducedMCEvents_001;
226234

227235
using ReducedEvent = ReducedEvents::iterator;
228236
using StoredReducedEvent = StoredReducedEvents::iterator;

PWGDQ/Tasks/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ o2physics_add_dpl_workflow(model-converter-event-extended
124124
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGDQCore
125125
COMPONENT_NAME Analysis)
126126

127+
o2physics_add_dpl_workflow(model-converter-mc-reduced-event
128+
SOURCES ModelConverterReducedMCEvents.cxx
129+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGDQCore
130+
COMPONENT_NAME Analysis)
131+
127132
o2physics_add_dpl_workflow(tag-and-probe
128133
SOURCES TagAndProbe.cxx
129134
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
13+
//
14+
// Task used to convert the data model from the old format to the new format. To avoid
15+
// the conflict with the old data model.
16+
17+
// other includes
18+
#include "PWGDQ/DataModel/ReducedInfoTables.h"
19+
20+
#include "DataFormatsParameters/GRPObject.h"
21+
#include "Framework/ASoAHelpers.h"
22+
#include "Framework/AnalysisDataModel.h"
23+
#include "Framework/AnalysisTask.h"
24+
#include "Framework/runDataProcessing.h"
25+
26+
#include <THashList.h>
27+
#include <TList.h>
28+
#include <TString.h>
29+
30+
using namespace o2;
31+
using namespace o2::framework;
32+
using namespace o2::framework::expressions;
33+
using namespace o2::aod;
34+
35+
struct reducedMCeventConverter000_001 {
36+
Produces<aod::ReducedMCEvents_001> reducedMCevent_001;
37+
38+
void process(aod::ReducedMCEvents_000 const& events)
39+
{
40+
for (const auto& event : events) {
41+
reducedMCevent_001(event.generatorsID(), event.mcPosX(), event.mcPosY(), event.mcPosZ(),
42+
event.t(), event.weight(), event.impactParameter(),
43+
-1.0f, -1.0f, -1.0f, -1.0f);
44+
}
45+
}
46+
};
47+
48+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
49+
{
50+
return WorkflowSpec{
51+
adaptAnalysisTask<reducedMCeventConverter000_001>(cfgc)};
52+
}

0 commit comments

Comments
 (0)