Skip to content

Commit 753b84c

Browse files
committed
Converter implemented for FITbit tables version 000 to 001; bug fix in the new FITbit table; formatting issues fixed
1 parent c502126 commit 753b84c

4 files changed

Lines changed: 564 additions & 566 deletions

File tree

PWGUD/Core/UDHelpers.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <CommonConstants/LHCConstants.h>
2626
#include <DataFormatsFIT/Triggers.h>
27-
#include "DataFormatsFT0/Digit.h"
27+
#include <DataFormatsFT0/Digit.h>
2828
#include <Framework/AnalysisDataModel.h>
2929
#include <Framework/Logger.h>
3030
#include <Framework/SliceCache.h>
@@ -544,12 +544,12 @@ bool FITveto(T const& bc, DGCutparHolder const& diffCuts)
544544

545545
inline void setBit(uint64_t w[4], int bit, bool val)
546546
{
547-
if (!val) {
548-
return;
549-
}
550-
const int word = bit >> 6;
551-
const int offs = bit & 63;
552-
w[word] |= (static_cast<uint64_t>(1) << offs);
547+
if (!val) {
548+
return;
549+
}
550+
const int word = bit >> 6;
551+
const int offs = bit & 63;
552+
w[word] |= (static_cast<uint64_t>(1) << offs);
553553
}
554554

555555
template <typename TFT0, typename TFV0A>

PWGUD/DataModel/UDTables.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ DECLARE_SOA_TABLE(UDTracksLabels, "AOD", "UDTRACKLABEL",
410410

411411
namespace udcollfitbits
412412
{
413-
414413
DECLARE_SOA_INDEX_COLUMN(UDCollision, udCollision); /// Link to the UDCOLLISION table, only in version 1
415414

416415
DECLARE_SOA_COLUMN(Thr1W0, thr1W0, uint64_t); /// 1 MIP thresholds for FT0A ch 0 - ch 63
@@ -425,15 +424,15 @@ DECLARE_SOA_COLUMN(Thr2W3, thr2W3, uint64_t); /// 2 MIP thresholds for FT0C ch 9
425424
} // namespace udcollfitbits
426425

427426
DECLARE_SOA_TABLE(UDCollisionFITBits_000, "AOD", "UDCOLLFITBITS",
428-
o2::soa::Index<>,
429-
udcollfitbits::Thr1W0, /// 1 MIP thresholds for FT0A ch 0 - ch 63
430-
udcollfitbits::Thr1W1, /// 1 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31
431-
udcollfitbits::Thr1W2, /// 1 MIP thresholds for FT0C ch 32 - ch 96
432-
udcollfitbits::Thr1W3, /// 1 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47
433-
udcollfitbits::Thr2W0, /// 2 MIP thresholds for FT0A ch 0 - ch 63
434-
udcollfitbits::Thr2W1, /// 2 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31
435-
udcollfitbits::Thr2W2, /// 2 MIP thresholds for FT0C ch 32 - ch 96
436-
udcollfitbits::Thr2W3 /// 2 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47
427+
o2::soa::Index<>,
428+
udcollfitbits::Thr1W0, /// 1 MIP thresholds for FT0A ch 0 - ch 63
429+
udcollfitbits::Thr1W1, /// 1 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31
430+
udcollfitbits::Thr1W2, /// 1 MIP thresholds for FT0C ch 32 - ch 96
431+
udcollfitbits::Thr1W3, /// 1 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47
432+
udcollfitbits::Thr2W0, /// 2 MIP thresholds for FT0A ch 0 - ch 63
433+
udcollfitbits::Thr2W1, /// 2 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31
434+
udcollfitbits::Thr2W2, /// 2 MIP thresholds for FT0C ch 32 - ch 96
435+
udcollfitbits::Thr2W3 /// 2 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47
437436
);
438437

439438
DECLARE_SOA_TABLE_VERSIONED(UDCollisionFITBits_001, "AOD", "UDCOLLFITBITS", 1,
Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,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-
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

Comments
 (0)