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 UDCollisionFITBitsConverter.cxx
13- // / \brief Converts UDCollisionFITBits table from version 000 to 001
14- // /
15- // / This task converts the UDCollisionFITBits table from version 000,
16- // / without an explicit UDCollisionId link, to version 001, which includes
17- // / the UDCollisionId column.
18- // /
19- // / The conversion assumes the version-000 table has one row per UDCollision
20- // / and follows the same ordering as the UDCollisions table.
21- // /
22- // / executable name o2-analysis-ud-fit-bits-converter
23- // /
24- // / \author Sandor Lokos <sandor.lokos@cern.ch>
25-
26- #include " PWGUD/DataModel/UDTables.h"
27-
28- #include < Framework/AnalysisDataModel.h>
29- #include < Framework/AnalysisHelpers.h>
30- #include < Framework/AnalysisTask.h>
31- #include < Framework/runDataProcessing.h>
32-
33- using namespace o2 ;
34- using namespace o2 ::framework;
35-
36- // Converts UDCollisionFITBits from version 000 to 001
37- struct UDCollisionFITBitsConverter {
38- Produces<o2::aod::UDCollisionFITBits_001> udCollisionFITBits_001;
39-
40- void process (o2::aod::UDCollisionFITBits_000 const & fitBits)
41- {
42- udCollisionFITBits_001.reserve (fitBits.size ());
43-
44- for (const auto & fitBit : fitBits) {
45- udCollisionFITBits_001 (fitBit.globalIndex (), // UDCollisionId; version 000 has no explicit link
46- fitBit.thr1W0 (),
47- fitBit.thr1W1 (),
48- fitBit.thr1W2 (),
49- fitBit.thr1W3 (),
50- fitBit.thr2W0 (),
51- fitBit.thr2W1 (),
52- fitBit.thr2W2 (),
53- fitBit.thr2W3 ());
54- }
55- }
56- };
57-
58- WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
59- {
60- return WorkflowSpec{
61- adaptAnalysisTask<UDCollisionFITBitsConverter>(cfgc),
62- };
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 UDCollisionFITBitsConverter.cxx
13+ // / \brief Converts UDCollisionFITBits table from version 000 to 001
14+ // /
15+ // / This task converts the UDCollisionFITBits table from version 000,
16+ // / without an explicit UDCollisionId link, to version 001, which includes
17+ // / the UDCollisionId column.
18+ // /
19+ // / The conversion assumes the version-000 table has one row per UDCollision
20+ // / and follows the same ordering as the UDCollisions table.
21+ // /
22+ // / executable name o2-analysis-ud-fit-bits-converter
23+ // /
24+ // / \author Sandor Lokos <sandor.lokos@cern.ch>
25+
26+ #include < PWGUD/DataModel/UDTables.h>
27+ #include < Framework/AnalysisDataModel.h>
28+ #include < Framework/AnalysisHelpers.h>
29+ #include < Framework/AnalysisTask.h>
30+ #include < Framework/runDataProcessing.h>
31+
32+ using namespace o2 ;
33+ using namespace o2 ::framework;
34+
35+ // Converts UDCollisionFITBits from version 000 to 001
36+ struct UDCollisionFITBitsConverter {
37+ Produces<o2::aod::UDCollisionFITBits_001> udCollisionFITBits_001;
38+
39+ void process (o2::aod::UDCollisionFITBits_000 const & fitBits)
40+ {
41+ udCollisionFITBits_001.reserve (fitBits.size ());
42+
43+ for (const auto & fitBit : fitBits) {
44+ udCollisionFITBits_001 (fitBit.globalIndex (), // UDCollisionId; version 000 has no explicit link
45+ fitBit.thr1W0 (),
46+ fitBit.thr1W1 (),
47+ fitBit.thr1W2 (),
48+ fitBit.thr1W3 (),
49+ fitBit.thr2W0 (),
50+ fitBit.thr2W1 (),
51+ fitBit.thr2W2 (),
52+ fitBit.thr2W3 ());
53+ }
54+ }
55+ };
56+
57+ WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
58+ {
59+ return WorkflowSpec{
60+ adaptAnalysisTask<UDCollisionFITBitsConverter>(cfgc),
61+ };
6362}
0 commit comments