Skip to content

Commit 97fc543

Browse files
committed
Linter fixes
1 parent bf0fc61 commit 97fc543

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

Common/TableProducer/eventSelectionService.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Run3MatchedToBCSparse>;
4444
using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra>;
4545
using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra>;
4646

47-
struct eventselectionRun2 {
47+
struct EventselectionRun2 { // o2-linter: disable=name/workflow-file (exception due to metadata-driven topology)
4848
o2::common::timestamp::TimestampConfigurables timestampConfigurables;
4949
o2::common::timestamp::TimestampModule timestampMod;
5050

@@ -103,7 +103,7 @@ struct eventselectionRun2 {
103103
}
104104
};
105105

106-
struct eventselectionRun3 {
106+
struct EventselectionRun3 { // o2-linter: disable=name/workflow-file (exception due to metadata-driven topology)
107107
o2::common::timestamp::TimestampConfigurables timestampConfigurables;
108108
o2::common::timestamp::TimestampModule timestampMod;
109109

@@ -167,7 +167,7 @@ struct eventselectionRun3 {
167167
}
168168
};
169169

170-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
170+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) // o2-linter: disable=o2-workflow-options (metadata-driven topology selection)
171171
{
172172
// Parse the metadata for later too
173173
metadataInfo.initMetadata(cfgc);
@@ -185,18 +185,18 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
185185
LOGF(warn, "Metadata info missing or incomplete. Make sure --aod-file is provided at the end of the last workflow and that the AO2D has metadata stored.");
186186
LOGF(warn, "Initializing with Run 3 data as default. Please note you will not be able to change settings manually.");
187187
LOGF(warn, "You should instead make sure the metadata is read in correctly.");
188-
return WorkflowSpec{adaptAnalysisTask<eventselectionRun3>(cfgc)};
188+
return WorkflowSpec{adaptAnalysisTask<EventselectionRun3>(cfgc)};
189189
} else {
190190
LOGF(info, "Metadata successfully read in. Is this Run 3? %i - will self-configure.", isRun3);
191191
if (isRun3) {
192-
return WorkflowSpec{adaptAnalysisTask<eventselectionRun3>(cfgc)};
192+
return WorkflowSpec{adaptAnalysisTask<EventselectionRun3>(cfgc)};
193193
} else {
194194
LOGF(warn, "******************************************************************");
195195
LOGF(warn, " Event selection service self-configuring for Run 2.");
196196
LOGF(warn, " WARNING: THIS HAS NOT BEEN VALIDATED YET, USE WITH CAUTION");
197197
LOGF(warn, " If this fails, please use event-selection-service-run2 instead.");
198198
LOGF(warn, "******************************************************************");
199-
return WorkflowSpec{adaptAnalysisTask<eventselectionRun2>(cfgc)};
199+
return WorkflowSpec{adaptAnalysisTask<EventselectionRun2>(cfgc)};
200200
}
201201
}
202202
throw std::runtime_error("Unsupported run type / problem when configuring event selection!");

Common/TableProducer/eventSelectionServiceRun2.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Run3MatchedToBCSparse>;
4343
using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra>;
4444
using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra>;
4545

46-
struct eventselectionRun2 {
46+
struct EventselectionRun2 {
4747
o2::common::timestamp::TimestampConfigurables timestampConfigurables;
4848
o2::common::timestamp::TimestampModule timestampMod;
4949

@@ -102,7 +102,7 @@ struct eventselectionRun2 {
102102
}
103103
};
104104

105-
struct eventselectionRun3 {
105+
struct EventselectionRun3 {
106106
o2::common::timestamp::TimestampConfigurables timestampConfigurables;
107107
o2::common::timestamp::TimestampModule timestampMod;
108108

@@ -175,5 +175,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
175175
LOGF(info, "To be improved once metadata enabling in defineDataProcessing is worked out.");
176176

177177
// force Run 2 mode
178-
return WorkflowSpec{adaptAnalysisTask<eventselectionRun2>(cfgc)};
178+
return WorkflowSpec{adaptAnalysisTask<EventselectionRun2>(cfgc)};
179179
}

Common/Tools/EventSelectionModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file EventSelectionModule.h
13-
/// \brief Event selection modeule
13+
/// \brief Event selection module
1414
/// \author ALICE
1515

1616
#ifndef COMMON_TOOLS_EVENTSELECTIONMODULE_H_

Common/Tools/timestampModule.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
/// \file timestampModule.h
13+
/// \brief Timestamp module
14+
/// \author ALICE
15+
1216
#ifndef COMMON_TOOLS_TIMESTAMPMODULE_H_
1317
#define COMMON_TOOLS_TIMESTAMPMODULE_H_
1418

@@ -36,8 +40,7 @@ struct TimestampConfigurables : o2::framework::ConfigurableGroup {
3640
std::string prefix = "timestamp";
3741
o2::framework::Configurable<bool> verbose{"verbose", false, "verbose mode"};
3842
o2::framework::Configurable<bool> fatalOnInvalidTimestamp{"fatalOnInvalidTimestamp", false, "Generate fatal error for invalid timestamps"};
39-
o2::framework::Configurable<std::string> rct_path{"rct-path", "RCT/Info/RunInformation", "path to the ccdb RCT objects for the SOR timestamps"};
40-
o2::framework::Configurable<std::string> orbit_reset_path{"orbit-reset-path", "CTP/Calib/OrbitReset", "path to the ccdb orbit-reset objects"};
43+
o2::framework::Configurable<std::string> orbitResetPath{"orbit-reset-path", "CTP/Calib/OrbitReset", "path to the ccdb orbit-reset objects"}; // o2-linter: disable=name/configurable (temporary fix)
4144
o2::framework::Configurable<int> isRun2MC{"isRun2MC", -1, "Running mode: enable only for Run 2 MC. Timestamps are set to SOR timestamp. Default: -1 (autoset from metadata) 0 (Standard) 1 (Run 2 MC)"}; // o2-linter: disable=name/configurable (temporary fix)
4245
};
4346

@@ -104,22 +107,24 @@ class TimestampModule
104107

105108
// clear cache to prevent interference with orbit reset queries from other code
106109
// FIXME this should not have been a problem, to be investigated
107-
ccdb->clearCache(timestampOpts.orbit_reset_path.value.data());
110+
ccdb->clearCache(timestampOpts.orbitResetPath.value.data());
108111

109-
const bool isUnanchoredRun3MC = runNumber >= 300000 && runNumber < 500000;
112+
constexpr int maxRunNumberUnanchored = 499999;
113+
constexpr int minRunNumberUnanchored = 300000;
114+
const bool isUnanchoredRun3MC = runNumber >= minRunNumberUnanchored && runNumber < maxRunNumberUnanchored;
110115
if (timestampOpts.isRun2MC.value == 1 || isUnanchoredRun3MC) {
111116
// isRun2MC: bc/orbit distributions are not simulated in Run2 MC. All bcs are set to 0.
112117
// isUnanchoredRun3MC: assuming orbit-reset is done in the beginning of each run
113118
// Setting orbit-reset timestamp to start-of-run timestamp
114-
orbitResetTimestamp = sorTimestamp * 1000; // from ms to us
115-
} else if (runNumber < 300000) { // Run 2
119+
orbitResetTimestamp = sorTimestamp * 1000; // from ms to us
120+
} else if (runNumber < minRunNumberUnanchored) { // Run 2
116121
LOGF(debug, "Getting orbit-reset timestamp using start-of-run timestamp from CCDB");
117-
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), sorTimestamp);
122+
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbitResetPath.value.data(), sorTimestamp);
118123
orbitResetTimestamp = (*ctp)[0];
119124
} else {
120125
// sometimes orbit is reset after SOR. Using EOR timestamps for orbitReset query is more reliable
121126
LOGF(debug, "Getting orbit-reset timestamp using end-of-run timestamp from CCDB");
122-
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), eorTimestamp / 2 + sorTimestamp / 2);
127+
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbitResetPath.value.data(), eorTimestamp / 2 + sorTimestamp / 2);
123128
orbitResetTimestamp = (*ctp)[0];
124129
}
125130

@@ -136,7 +141,7 @@ class TimestampModule
136141
if (timestampOpts.verbose) {
137142
LOGF(info, "Orbit-reset timestamp for run number %i found: %llu us", runNumber, orbitResetTimestamp);
138143
}
139-
int64_t timestamp{(orbitResetTimestamp + int64_t(bc.globalBC() * o2::constants::lhc::LHCBunchSpacingNS * 1e-3)) / 1000}; // us -> ms
144+
int64_t timestamp{(orbitResetTimestamp + static_cast<int64_t>(bc.globalBC() * o2::constants::lhc::LHCBunchSpacingNS * 1e-3)) / 1000}; // us -> ms
140145
if (timestamp < runDuration.first || timestamp > runDuration.second) {
141146
if (timestampOpts.fatalOnInvalidTimestamp.value) {
142147
LOGF(fatal, "Timestamp %llu us is out of run duration [%llu, %llu] ms", timestamp, runDuration.first, runDuration.second);

0 commit comments

Comments
 (0)