Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Common/Tools/timestampModule.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
#ifndef COMMON_TOOLS_TIMESTAMPMODULEH_
#define COMMON_TOOLS_TIMESTAMPMODULEH_

Expand All @@ -26,12 +26,12 @@
{

// timestamp configurables
struct timestampConfigurables : o2::framework::ConfigurableGroup {

Check failure on line 29 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
std::string prefix = "timestamp";
o2::framework::Configurable<bool> verbose{"verbose", false, "verbose mode"};
o2::framework::Configurable<bool> fatalOnInvalidTimestamp{"fatalOnInvalidTimestamp", false, "Generate fatal error for invalid timestamps"};
o2::framework::Configurable<std::string> rct_path{"rct-path", "RCT/Info/RunInformation", "path to the ccdb RCT objects for the SOR timestamps"};

Check failure on line 33 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)

Check failure on line 33 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
o2::framework::Configurable<std::string> orbit_reset_path{"orbit-reset-path", "CTP/Calib/OrbitReset", "path to the ccdb orbit-reset objects"};

Check failure on line 34 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
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)
};

Expand Down Expand Up @@ -100,20 +100,20 @@
// FIXME this should not have been a problem, to be investigated
ccdb->clearCache(timestampOpts.orbit_reset_path.value.data());

const bool isUnanchoredRun3MC = runNumber >= 300000 && runNumber < 500000;

Check failure on line 103 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (timestampOpts.isRun2MC.value == 1 || isUnanchoredRun3MC) {
// isRun2MC: bc/orbit distributions are not simulated in Run2 MC. All bcs are set to 0.
// isUnanchoredRun3MC: assuming orbit-reset is done in the beginning of each run
// Setting orbit-reset timestamp to start-of-run timestamp
orbitResetTimestamp = sorTimestamp * 1000; // from ms to us
} else if (runNumber < 300000) { // Run 2

Check failure on line 109 in Common/Tools/timestampModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGF(debug, "Getting orbit-reset timestamp using start-of-run timestamp from CCDB");
auto ctp = ccdb->template getForTimeStamp<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), sorTimestamp);
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), sorTimestamp);
orbitResetTimestamp = (*ctp)[0];
} else {
// sometimes orbit is reset after SOR. Using EOR timestamps for orbitReset query is more reliable
LOGF(debug, "Getting orbit-reset timestamp using end-of-run timestamp from CCDB");
auto ctp = ccdb->template getForTimeStamp<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), eorTimestamp / 2 + sorTimestamp / 2);
auto ctp = ccdb->template getSpecific<std::vector<int64_t>>(timestampOpts.orbit_reset_path.value.data(), eorTimestamp / 2 + sorTimestamp / 2);
orbitResetTimestamp = (*ctp)[0];
}

Expand Down
Loading