Skip to content
Merged
14 changes: 11 additions & 3 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions PWGDQ/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 52 additions & 0 deletions PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx
Original file line number Diff line number Diff line change
@@ -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 <THashList.h>
#include <TList.h>
#include <TString.h>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::aod;

struct reducedMCeventConverter000_001 {
Produces<aod::ReducedMCEvents_001> 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<reducedMCeventConverter000_001>(cfgc)};
}