|
| 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 | +#include <limits> |
| 12 | + |
| 13 | +#include "Framework/runDataProcessing.h" |
| 14 | +#include "Framework/AnalysisTask.h" |
| 15 | +#include "Framework/AnalysisDataModel.h" |
| 16 | + |
| 17 | +using namespace o2; |
| 18 | +using namespace o2::framework; |
| 19 | + |
| 20 | +struct TrackQAConverter002 { |
| 21 | + Produces<aod::TracksQA_002> tracksQA_002; |
| 22 | + |
| 23 | + void process000(aod::TracksQA_000 const& tracksQA_002) |
| 24 | + { |
| 25 | + for (const auto& trackQA : tracksQA_000) { |
| 26 | + tracksQA_002( |
| 27 | + trackQA.trackId(), |
| 28 | + trackQA.tpcTime0(), |
| 29 | + trackQA.tpcdcaR(), |
| 30 | + trackQA.tpcdcaZ(), |
| 31 | + trackQA.tpcClusterByteMask(), |
| 32 | + trackQA.tpcdEdxMax0R(), |
| 33 | + trackQA.tpcdEdxMax1R(), |
| 34 | + trackQA.tpcdEdxMax2R(), |
| 35 | + trackQA.tpcdEdxMax3R(), |
| 36 | + trackQA.tpcdEdxTot0R(), |
| 37 | + trackQA.tpcdEdxTot1R(), |
| 38 | + trackQA.tpcdEdxTot2R(), |
| 39 | + trackQA.tpcdEdxTot3R(), |
| 40 | + // dummy values, not available in _000 |
| 41 | + std::numeric_limits<int8_t>::min(), // deltaRefContParamY |
| 42 | + std::numeric_limits<int8_t>::min(), // deltaRefContParamZ |
| 43 | + std::numeric_limits<int8_t>::min(), // deltaRefContParamSnp |
| 44 | + std::numeric_limits<int8_t>::min(), // deltaRefContParamTgl |
| 45 | + std::numeric_limits<int8_t>::min(), // deltaRefContParamQ2Pt |
| 46 | + std::numeric_limits<int8_t>::min(), // deltaRefGloParamY |
| 47 | + std::numeric_limits<int8_t>::min(), // deltaRefGloParamZ |
| 48 | + std::numeric_limits<int8_t>::min(), // deltaRefGloParamSnp |
| 49 | + std::numeric_limits<int8_t>::min(), // deltaRefGloParamTgl |
| 50 | + std::numeric_limits<int8_t>::min(), // deltaRefGloParamQ2Pt |
| 51 | + std::numeric_limits<int8_t>::min(), // dTofdX |
| 52 | + std::numeric_limits<int8_t>::min()); // dTofdY |
| 53 | + } |
| 54 | + } |
| 55 | + PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false); |
| 56 | + |
| 57 | + void process001(aod::TracksQA_001 const& tracksQA_002) |
| 58 | + { |
| 59 | + for (const auto& trackQA : tracksQA_001) { |
| 60 | + tracksQA_002( |
| 61 | + trackQA.trackId(), |
| 62 | + trackQA.tpcTime0(), |
| 63 | + trackQA.tpcdcaR(), |
| 64 | + trackQA.tpcdcaZ(), |
| 65 | + trackQA.tpcClusterByteMask(), |
| 66 | + trackQA.tpcdEdxMax0R(), |
| 67 | + trackQA.tpcdEdxMax1R(), |
| 68 | + trackQA.tpcdEdxMax2R(), |
| 69 | + trackQA.tpcdEdxMax3R(), |
| 70 | + trackQA.tpcdEdxTot0R(), |
| 71 | + trackQA.tpcdEdxTot1R(), |
| 72 | + trackQA.tpcdEdxTot2R(), |
| 73 | + trackQA.tpcdEdxTot3R(), |
| 74 | + trackQA.deltaRefContParamY(), |
| 75 | + trackQA.deltaRefITSParamZ(), |
| 76 | + trackQA.deltaRefContParamSnp(), |
| 77 | + trackQA.deltaRefContParamTgl(), |
| 78 | + trackQA.deltaRefContParamQ2Pt(), |
| 79 | + trackQA.deltaRefGloParamY(), |
| 80 | + trackQA.deltaRefGloParamZ(), |
| 81 | + trackQA.deltaRefGloParamSnp(), |
| 82 | + trackQA.deltaRefGloParamTgl(), |
| 83 | + trackQA.deltaRefGloParamQ2Pt(), |
| 84 | + // dummy values, not available in _001 |
| 85 | + std::numeric_limits<int8_t>::min(), // dTofdX |
| 86 | + std::numeric_limits<int8_t>::min()); // dTofdY |
| 87 | + } |
| 88 | + } |
| 89 | + PROCESS_SWITCH(TrackQAConverter002, process001, "process v001-to-v002 conversion", false); |
| 90 | +}; |
| 91 | + |
| 92 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 93 | +{ |
| 94 | + return WorkflowSpec{ |
| 95 | + adaptAnalysisTask<TrackQAConverter002>(cfgc), |
| 96 | + }; |
| 97 | +} |
0 commit comments