Skip to content

Commit c502126

Browse files
committed
Converter implemented for FITbit tables version 000 to 001; bug fix in the new FITbit table
1 parent 5dfb7d7 commit c502126

4 files changed

Lines changed: 78 additions & 2 deletions

File tree

PWGUD/DataModel/UDTables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ DECLARE_SOA_TABLE(UDCollisionFITBits_000, "AOD", "UDCOLLFITBITS",
436436
udcollfitbits::Thr2W3 /// 2 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47
437437
);
438438

439-
DECLARE_SOA_TABLE_VERSIONED(UDCollisionFITBits_001, "AOD", "UDCOLLFITBITS", 1
439+
DECLARE_SOA_TABLE_VERSIONED(UDCollisionFITBits_001, "AOD", "UDCOLLFITBITS", 1,
440440
o2::soa::Index<>,
441441
udcollfitbits::UDCollisionId, /// Link to the UDCOLLISION table <---- EXTRA
442442
udcollfitbits::Thr1W0, /// 1 MIP thresholds for FT0A ch 0 - ch 63

PWGUD/TableProducer/Converters/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ o2physics_add_dpl_workflow(collisionselextras-converter-v003
3434
SOURCES UDCollisionSelExtrasV003Converter.cxx
3535
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3636
COMPONENT_NAME Analysis)
37+
38+
o2physics_add_dpl_workflow(fit-bits-converter
39+
SOURCES UDFITbitConverter.cxx
40+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
41+
COMPONENT_NAME Analysis)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
};
63+
}

PWGUD/Tasks/upcFITMultiplicity.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ struct UpcTestFITBitMapping {
9999
{"map/hEtaC_ntracks", "FT0C #eta with >2 tracks;#eta;counts", {HistType::kTH1F, {{5, -3.1, -2.1}}}},
100100
{"map/hEtaPhiC_ntracks", "FT0C #eta vs #varphi with >2 tracks;#eta;#varphi", {HistType::kTH2F, {{5, -3.1, -2.1}, {9, 0, 2 * M_PI}}}},
101101

102+
{"mult/hPnFT0A_raw", "P(n): FT0A fired-channel multiplicity;N_{fired}^{FT0A};events", {HistType::kTH1F, {{97, -0.5, 96.5}}}},
103+
{"mult/hPnFT0C_raw", "P(n): FT0C fired-channel multiplicity;N_{fired}^{FT0C};events", {HistType::kTH1F, {{50, -0.5, 49.5}}}},
104+
{"mult/hPnFV0A_raw", "P(n): FV0A fired-channel multiplicity;N_{fired}^{FV0A};events", {HistType::kTH1F, {{49, -0.5, 48.5}}}},
102105
{"mult/hPnFT0A", "P(n): FT0A fired-channel multiplicity;N_{fired}^{FT0A};events", {HistType::kTH1F, {{97, -0.5, 96.5}}}},
103106
{"mult/hPnFT0C", "P(n): FT0C fired-channel multiplicity;N_{fired}^{FT0C};events", {HistType::kTH1F, {{50, -0.5, 49.5}}}},
104107
{"mult/hPnFV0A", "P(n): FV0A fired-channel multiplicity;N_{fired}^{FV0A};events", {HistType::kTH1F, {{49, -0.5, 48.5}}}},
@@ -338,11 +341,16 @@ struct UpcTestFITBitMapping {
338341
const float ft0TimeC = collision.timeFT0C();
339342
const float ft0AmpA = collision.totalFT0AmplitudeA();
340343
const float ft0AmpC = collision.totalFT0AmplitudeC();
344+
const float fv0AmpA = collision.totalFV0AmplitudeA();
345+
346+
registry.fill(HIST("mult/hPnFT0A_raw"), ft0AmpA);
347+
registry.fill(HIST("mult/hPnFT0C_raw"), ft0AmpC);
348+
registry.fill(HIST("mult/hPnFV0A_raw"), fv0AmpA);
341349

342350
registry.fill(HIST("qaBeforeCuts/hFT0AAmplitudeVsTime"), ft0TimeA, ft0AmpA);
343351
registry.fill(HIST("qaBeforeCuts/hFT0CAmplitudeVsTime"), ft0TimeC, ft0AmpC);
344352
registry.fill(HIST("qaBeforeCuts/hZNEnergy"), collision.energyCommonZNA(), collision.energyCommonZNC());
345-
353+
346354
/* Checking collision level cuts */
347355
if (!collisionPassesCuts(collision)) {
348356
return;

0 commit comments

Comments
 (0)