diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 2ad18c11bfd..8fc3931d97b 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -218,11 +218,19 @@ DECLARE_SOA_TABLE(ReducedEventsInfo, "AOD", "REDUCEVENTINFO", //! Main event i // There is no explicit accounting for MC events which were not reconstructed!!! // However, for analysis which will require these events, a special skimming process function // can be constructed and the same data model could be used -DECLARE_SOA_TABLE(ReducedMCEvents, "AOD", "REDUCEDMCEVENT", //! Event level MC truth information + +DECLARE_SOA_TABLE(ReducedMCEvents_000, "AOD", "REDUCEDMCEVENT", //! Event level MC truth information o2::soa::Index<>, mccollision::GeneratorsID, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ, - mccollision::T, mccollision::Weight, mccollision::ImpactParameter, cent::CentFT0C, - mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10); + mccollision::T, mccollision::Weight, mccollision::ImpactParameter); + +DECLARE_SOA_TABLE_VERSIONED(ReducedMCEvents_001, "AOD", "REDUCEDMCEVENT", 1, //! Event level MC truth information + o2::soa::Index<>, + mccollision::GeneratorsID, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ, + mccollision::T, mccollision::Weight, mccollision::ImpactParameter, cent::CentFT0C, + mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10); + +using ReducedMCEvents = ReducedMCEvents_001; using ReducedEvent = ReducedEvents::iterator; using StoredReducedEvent = StoredReducedEvents::iterator; diff --git a/PWGDQ/Tasks/CMakeLists.txt b/PWGDQ/Tasks/CMakeLists.txt index ba4a3e14870..0b57b90f48f 100644 --- a/PWGDQ/Tasks/CMakeLists.txt +++ b/PWGDQ/Tasks/CMakeLists.txt @@ -124,6 +124,11 @@ o2physics_add_dpl_workflow(model-converter-event-extended PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGDQCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(model-converter-mc-reduced-event + SOURCES ModelConverterReducedMCEvents.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::PWGDQCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tag-and-probe SOURCES TagAndProbe.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore diff --git a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx new file mode 100644 index 00000000000..f4e28daee31 --- /dev/null +++ b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx @@ -0,0 +1,52 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no +// +// Task used to convert the data model from the old format to the new format. To avoid +// the conflict with the old data model. + +// other includes +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod; + +struct reducedMCeventConverter000_001 { + Produces reducedMCevent_001; + + void process(aod::ReducedMCEvents_000 const& events) + { + for (const auto& event : events) { + reducedMCevent_001(event.generatorsID(), event.mcPosX(), event.mcPosY(), event.mcPosZ(), + event.t(), event.weight(), event.impactParameter(), + -1.0f, -1.0f, -1.0f, -1.0f); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +}