Skip to content

Commit dd3aee9

Browse files
committed
Fix O2 linter findings for lumi vertex workflow
1 parent 18b6a93 commit dd3aee9

2 files changed

Lines changed: 27 additions & 24 deletions

File tree

PWGMM/Lumi/Tasks/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ o2physics_add_dpl_workflow(lumi
1717
O2::DetectorsCommonDataFormats
1818
O2::DetectorsVertexing
1919
COMPONENT_NAME Analysis)
20-
o2physics_add_dpl_workflow(lumivertex
20+
o2physics_add_dpl_workflow(lumi-vertex
2121
SOURCES lumiVertex.cxx
2222
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCCDB O2Physics::AnalysisCore
2323
O2::ReconstructionDataFormats
2424
O2::DetectorsBase
2525
O2::DetectorsCommonDataFormats
2626
O2::DetectorsVertexing
2727
COMPONENT_NAME Analysis)
28-
o2physics_add_dpl_workflow(lumifddft0
28+
o2physics_add_dpl_workflow(lumifddft0 # o2-linter: disable=name/o2-workflow (legacy workflow keeps its existing file name)
2929
SOURCES LumiFDDFT0.cxx
3030
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3131
O2::ReconstructionDataFormats
@@ -34,7 +34,7 @@ o2physics_add_dpl_workflow(lumifddft0
3434
O2::DetectorsVertexing
3535
COMPONENT_NAME Analysis)
3636

37-
o2physics_add_dpl_workflow(fitvdm
37+
o2physics_add_dpl_workflow(fit-lumi
3838
SOURCES fitLumi.cxx
3939
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4040
O2::ReconstructionDataFormats
@@ -43,7 +43,7 @@ o2physics_add_dpl_workflow(fitvdm
4343
O2::DetectorsVertexing
4444
COMPONENT_NAME Analysis)
4545

46-
o2physics_add_dpl_workflow(lumistab
46+
o2physics_add_dpl_workflow(lumi-stability
4747
SOURCES lumiStability.cxx
4848
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4949
O2::ReconstructionDataFormats

PWGMM/Lumi/Tasks/lumiVertex.cxx

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
//
12+
/// \file lumiVertex.cxx
13+
/// \brief Codes for the vdM scan analysis based on the Primary Vertex reconstruction. The code is based on the lumiTask in O2Physics/PWGMM/Lumi/Tasks/lumi.cxx.
14+
///
1115
/// \author Minjae Kim <minjae.kim@cern.ch>
12-
/// \brief Codes for the vdM scan analysis based on the Primary Vertex reconstruction. The code is based on the lumiTask in O2Physics/PWGMM/Lumi/Tasks/lumi.cxx
1316
/// \since Aug.06. 2026
1417

1518
#include "Common/CCDB/EventSelectionParams.h"
@@ -60,7 +63,7 @@ DECLARE_SOA_COLUMN(VertexXY, vertexXY, double);
6063

6164
DECLARE_SOA_COLUMN(VertexChi2, vertexChi2, double);
6265
DECLARE_SOA_COLUMN(NContrib, nContrib, int);
63-
DECLARE_SOA_COLUMN(BCID, bcid, int32_t);
66+
DECLARE_SOA_COLUMN(Bcid, bcid, int32_t);
6467
DECLARE_SOA_COLUMN(RunNumber, runNumber, int32_t);
6568
DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t);
6669
DECLARE_SOA_COLUMN(LocalBC, localBC, int32_t);
@@ -71,35 +74,35 @@ DECLARE_SOA_COLUMN(HasFT0TVX, hasFT0TVX, bool);
7174
DECLARE_SOA_COLUMN(IsCollisionTVX, isCollisionTVX, bool);
7275
DECLARE_SOA_COLUMN(HasAnyFT0Trigger, hasAnyFT0Trigger, bool);
7376
DECLARE_SOA_COLUMN(HasFT0AC, hasFT0AC, bool);
74-
DECLARE_SOA_COLUMN(FT0TriggerMask, ft0TriggerMask, uint8_t);
75-
DECLARE_SOA_COLUMN(FT0Rate, ft0Rate, float);
77+
DECLARE_SOA_COLUMN(Ft0TriggerMask, ft0TriggerMask, uint8_t);
78+
DECLARE_SOA_COLUMN(Ft0Rate, ft0Rate, float);
7679
DECLARE_SOA_COLUMN(NCollisions, nCollisions, int32_t);
7780
DECLARE_SOA_COLUMN(NSelectedCollisions, nSelectedCollisions, int32_t);
7881
DECLARE_SOA_COLUMN(IsCollidingBC, isCollidingBC, bool);
7982
DECLARE_SOA_COLUMN(IsFT0SuperLeading, isFT0SuperLeading, bool);
8083
DECLARE_SOA_COLUMN(HasPreviousFT0Activity, hasPreviousFT0Activity, bool); //! Whether a preceding FT0 CTP activity was observed
81-
DECLARE_SOA_COLUMN(BCsSinceLastFT0Activity, bcsSinceLastFT0Activity, int64_t); //! -1 when the preceding activity is unknown
82-
DECLARE_SOA_COLUMN(PVRefitValid, pvRefitValid, bool);
84+
DECLARE_SOA_COLUMN(BcsSinceLastFT0Activity, bcsSinceLastFT0Activity, int64_t); //! -1 when the preceding activity is unknown
85+
DECLARE_SOA_COLUMN(PvRefitValid, pvRefitValid, bool);
8386
} // namespace full
8487
DECLARE_SOA_TABLE(EventInfo, "AOD", "EventInfo", full::TimeStamp, full::VertexX,
8588
full::VertexY, full::VertexZ,
8689

8790
full::VertexXX, full::VertexYY, full::VertexXY,
8891

89-
full::VertexChi2, full::NContrib, full::BCID, full::RunNumber,
92+
full::VertexChi2, full::NContrib, full::Bcid, full::RunNumber,
9093
full::GlobalBC, full::HasFT0TVX, full::IsCollisionTVX,
9194
full::HasAnyFT0Trigger,
9295
full::IsCollidingBC, full::IsFT0SuperLeading,
93-
full::HasPreviousFT0Activity, full::BCsSinceLastFT0Activity,
94-
full::PVRefitValid);
96+
full::HasPreviousFT0Activity, full::BcsSinceLastFT0Activity,
97+
full::PvRefitValid);
9598
DECLARE_SOA_TABLE(EventInfoBC, "AOD", "EventInfoBC", full::RunNumber,
9699
full::TimeStamp, full::GlobalBC, full::LocalBC,
97100
full::InputMask, full::HasFT0, full::HasFoundFT0,
98101
full::HasFT0TVX, full::HasAnyFT0Trigger, full::HasFT0AC,
99-
full::FT0TriggerMask, full::FT0Rate, full::NCollisions,
102+
full::Ft0TriggerMask, full::Ft0Rate, full::NCollisions,
100103
full::NSelectedCollisions, full::IsCollidingBC,
101104
full::IsFT0SuperLeading, full::HasPreviousFT0Activity,
102-
full::BCsSinceLastFT0Activity);
105+
full::BcsSinceLastFT0Activity);
103106
} // namespace o2::aod
104107

105108
using namespace o2;
@@ -110,12 +113,12 @@ using MyBCs = soa::Join<aod::BCs, aod::BcSels, aod::Timestamps, aod::Run3Matched
110113
using CollisionsWithEvSels = soa::Join<aod::Collisions, aod::EvSels>;
111114
using UnfilteredTracks = soa::Join<aod::Tracks, aod::TracksCov, aod::TracksExtra>;
112115

113-
struct lumiTask {
116+
struct LumiVertex {
114117
Produces<o2::aod::EventInfo> rowEventInfo;
115118
Produces<o2::aod::EventInfoBC> rowEventInfoBC;
116119
Service<o2::ccdb::BasicCCDBManager> ccdb;
117-
const char* ccdbpath_grp = "GLO/Config/GRPMagField";
118-
const char* ccdbpath_lut = "GLO/Param/MatLUT";
120+
const char* ccdbPathGrp = "GLO/Config/GRPMagField";
121+
const char* ccdbPathLut = "GLO/Param/MatLUT";
119122
const char* ccdburl = "http://alice-ccdb.cern.ch";
120123
int mFieldRunNumber = -1;
121124
o2::base::MatLayerCylSet* mMatLUT = nullptr;
@@ -273,7 +276,7 @@ struct lumiTask {
273276
"Mean refitted vertex y in TVX non-super-leading BCs;BC ID in orbit;#LT y_{refit} #GT (cm)",
274277
{HistType::kTProfile, {{o2::constants::lhc::LHCMaxBunches, -0.5, o2::constants::lhc::LHCMaxBunches - 0.5, "BC ID in orbit"}}}}}};
275278
// CTP input 3 is MTVX; std::bitset uses a zero-based bit index.
276-
static constexpr uint8_t kFT0TVXInputBit = 2;
279+
static constexpr uint8_t FT0TVXInputBit = 2;
277280

278281
static bool hasFT0ACCoincidence(uint8_t triggerMask)
279282
{
@@ -284,7 +287,7 @@ struct lumiTask {
284287
static bool hasAnyFT0Trigger(const std::bitset<64>& ctpInputMask)
285288
{
286289
return ctpInputMask.test(0) || ctpInputMask.test(1) ||
287-
ctpInputMask.test(kFT0TVXInputBit) || ctpInputMask.test(3) ||
290+
ctpInputMask.test(FT0TVXInputBit) || ctpInputMask.test(3) ||
288291
ctpInputMask.test(4);
289292
}
290293

@@ -365,7 +368,7 @@ struct lumiTask {
365368
FT0SuperLeadingInfo result;
366369
result.isCollidingBC = mCollidingBCPattern.test(localBC);
367370
result.hasFT0Activity = hasAnyFT0Trigger(ctpInputMask);
368-
result.hasFT0TVX = ctpInputMask.test(kFT0TVXInputBit);
371+
result.hasFT0TVX = ctpInputMask.test(FT0TVXInputBit);
369372
result.hasPreviousFT0Activity =
370373
mHasPreviousFT0Activity && globalBC > mGlobalBCOfLastFT0Activity;
371374

@@ -399,7 +402,7 @@ struct lumiTask {
399402
}
400403

401404
auto* grpo = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(
402-
ccdbpath_grp, bc.timestamp());
405+
ccdbPathGrp, bc.timestamp());
403406
if (grpo == nullptr) {
404407
LOGF(fatal,
405408
"GRP object is not available in CCDB for run=%d at timestamp=%llu",
@@ -409,7 +412,7 @@ struct lumiTask {
409412

410413
if (basicConfig.useMatCorrLUT) {
411414
auto* rawLUT = ccdb->getForTimeStamp<o2::base::MatLayerCylSet>(
412-
ccdbpath_lut, bc.timestamp());
415+
ccdbPathLut, bc.timestamp());
413416
if (rawLUT == nullptr) {
414417
LOGF(fatal,
415418
"Material LUT is not available in CCDB for run=%d at timestamp=%llu",
@@ -752,6 +755,6 @@ struct lumiTask {
752755

753756
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
754757
{
755-
WorkflowSpec w{adaptAnalysisTask<lumiTask>(cfgc, TaskName{"lumiVertex"})};
758+
WorkflowSpec w{adaptAnalysisTask<LumiVertex>(cfgc)};
756759
return w;
757760
}

0 commit comments

Comments
 (0)