diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/CMakeLists.txt b/PWGEM/PhotonMeson/TableProducer/Converters/CMakeLists.txt index 8ee98eb4d36..63a2f1814c5 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/CMakeLists.txt +++ b/PWGEM/PhotonMeson/TableProducer/Converters/CMakeLists.txt @@ -25,3 +25,7 @@ o2physics_add_dpl_workflow(phosid-converter1 PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(converter-emevent-pmevent + SOURCES converterEmeventPmevent.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx new file mode 100644 index 00000000000..9147873fb71 --- /dev/null +++ b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx @@ -0,0 +1,53 @@ +// 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. + +/// \file converterEmeventPmevent.cxx +/// \author Marvin Hemmer +/// \brief converter for EMEvents_004 to PMEvents + +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/PhotonMeson/DataModel/EventTables.h" + +#include +#include +#include + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct ConverterEmeventPmevent { + Produces pmEvents; + + void process(EMEvents_004 const& collisions) + { + for (const auto& collision : collisions) { + pmEvents( + collision.collisionId(), + collision.runNumber(), + collision.globalBC(), + collision.selection_raw(), + collision.rct_raw(), + collision.timestamp(), + collision.posZ(), + collision.numContrib(), + collision.trackOccupancyInTimeRange(), + collision.ft0cOccupancyInTimeRange()); + } // end of collision loop + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +}