|
| 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 stradautrackstofpidconverter4.cxx |
| 13 | +/// \brief Converts DauTrackTOFPID_002 into DauTrackTOFPID_003 |
| 14 | +/// |
| 15 | +/// \author David Dobrigkeit Chinellato <david.dobrigkeit.chinellato@cern.ch>, Austrian Academy of Sciences & MBI |
| 16 | +/// \author Romain Schotter <romain.schotter@cern.ch>, Austrian Academy of Sciences & MBI |
| 17 | + |
| 18 | +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" |
| 19 | +#include "PWGLF/DataModel/LFStrangenessTables.h" |
| 20 | + |
| 21 | +#include <Framework/AnalysisDataModel.h> |
| 22 | +#include <Framework/AnalysisTask.h> |
| 23 | +#include <Framework/runDataProcessing.h> |
| 24 | + |
| 25 | +using namespace o2; |
| 26 | +using namespace o2::framework; |
| 27 | + |
| 28 | +// converts DauTrackTOFPIDs_002 to _003 |
| 29 | +struct stradautrackstofpidconverter4 { |
| 30 | + Produces<aod::DauTrackTOFPIDs_003> dautracktofpids; |
| 31 | + |
| 32 | + void process(aod::DauTrackTOFPIDs_002 const& dauTracks, soa::Join<aod::StraCollisions, aod::StraStamps> const& collisions) |
| 33 | + { |
| 34 | + // create new TOFPIDs |
| 35 | + dautracktofpids.reserve(dauTracks.size()); |
| 36 | + for (const auto& dauTrack : dauTracks) { |
| 37 | + uint64_t bc = 0; |
| 38 | + if (dauTrack.straCollisionId() >= 0) { |
| 39 | + auto collision = collisions.rawIteratorAt(dauTrack.straCollisionId()); |
| 40 | + bc = collision.globalBC(); |
| 41 | + } |
| 42 | + dautracktofpids( |
| 43 | + bc, |
| 44 | + dauTrack.dauTrackExtraId(), |
| 45 | + dauTrack.tofSignal(), |
| 46 | + dauTrack.tofEvTime(), |
| 47 | + dauTrack.tofEvTimeErr(), |
| 48 | + dauTrack.length(), |
| 49 | + dauTrack.tofExpMom()); |
| 50 | + } |
| 51 | + } |
| 52 | +}; |
| 53 | + |
| 54 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 55 | +{ |
| 56 | + return WorkflowSpec{ |
| 57 | + adaptAnalysisTask<stradautrackstofpidconverter4>(cfgc)}; |
| 58 | +} |
0 commit comments