Skip to content

Commit 5e31f7e

Browse files
authored
Please consider the following formatting changes (#437)
1 parent 636e20d commit 5e31f7e

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

Common/TableProducer/timestampTester.cxx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@
1616
/// \brief A task to fill the timestamp table from run number.
1717
/// Uses headers from CCDB
1818
///
19-
#include <vector>
20-
#include <map>
21-
#include "Framework/runDataProcessing.h"
22-
#include "Framework/AnalysisTask.h"
19+
#include "MetadataHelper.h"
20+
21+
#include "Common/Tools/timestampModule.h"
22+
2323
#include "CCDB/BasicCCDBManager.h"
2424
#include "CommonDataFormat/InteractionRecord.h"
2525
#include "DetectorsRaw/HBFUtils.h"
26-
#include "MetadataHelper.h"
27-
#include "Common/Tools/timestampModule.h"
26+
#include "Framework/AnalysisTask.h"
27+
#include "Framework/runDataProcessing.h"
28+
29+
#include <map>
30+
#include <vector>
2831

2932
using namespace o2::framework;
3033
using namespace o2::header;
@@ -33,9 +36,9 @@ using namespace o2;
3336
MetadataHelper metadataInfo; // Metadata helper
3437

3538
struct TimestampTask {
36-
Produces<aod::Timestamps> timestampTable; /// Table with SOR timestamps produced by the task
37-
Service<o2::ccdb::BasicCCDBManager> ccdb; /// CCDB manager to access orbit-reset timestamp
38-
o2::ccdb::CcdbApi ccdb_api; /// API to access CCDB headers
39+
Produces<aod::Timestamps> timestampTable; /// Table with SOR timestamps produced by the task
40+
Service<o2::ccdb::BasicCCDBManager> ccdb; /// CCDB manager to access orbit-reset timestamp
41+
o2::ccdb::CcdbApi ccdb_api; /// API to access CCDB headers
3942

4043
Configurable<std::string> ccdb_url{"ccdb-url", "http://alice-ccdb.cern.ch", "URL of the CCDB database"};
4144

Common/Tools/timestampModule.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
#ifndef COMMON_TOOLS_TIMESTAMPMODULEH_
1313
#define COMMON_TOOLS_TIMESTAMPMODULEH_
1414

15-
#include <cstdlib>
16-
#include <cmath>
17-
#include <array>
1815
#include "Framework/AnalysisDataModel.h"
1916

17+
#include <array>
18+
#include <cmath>
19+
#include <cstdlib>
20+
2021
namespace o2
2122
{
2223
namespace common
@@ -31,13 +32,13 @@ struct timestampConfigurables : o2::framework::ConfigurableGroup {
3132
o2::framework::Configurable<bool> fatalOnInvalidTimestamp{"fatalOnInvalidTimestamp", false, "Generate fatal error for invalid timestamps"};
3233
o2::framework::Configurable<std::string> rct_path{"rct-path", "RCT/Info/RunInformation", "path to the ccdb RCT objects for the SOR timestamps"};
3334
o2::framework::Configurable<std::string> orbit_reset_path{"orbit-reset-path", "CTP/Calib/OrbitReset", "path to the ccdb orbit-reset objects"};
34-
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)
35+
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)
3536
};
3637

3738
//__________________________________________
3839
// time stamp module
39-
//
40-
// class to acquire time stamps to be used in
40+
//
41+
// class to acquire time stamps to be used in
4142
// modular (plugin) fashion
4243

4344
class TimestampModule
@@ -53,14 +54,15 @@ class TimestampModule
5354
o2::common::timestamp::timestampConfigurables timestampOpts;
5455

5556
// objects necessary during processing
56-
std::map<int, int64_t> mapRunToOrbitReset; /// Cache of orbit reset timestamps
57+
std::map<int, int64_t> mapRunToOrbitReset; /// Cache of orbit reset timestamps
5758
std::map<int, std::pair<int64_t, int64_t>> mapRunToRunDuration; /// Cache of run duration timestamps
58-
int lastRunNumber; /// Last run number processed
59-
int64_t orbitResetTimestamp; /// Orbit-reset timestamp in us
60-
std::pair<int64_t, int64_t> runDuration; /// Pair of SOR and EOR timestamps
59+
int lastRunNumber; /// Last run number processed
60+
int64_t orbitResetTimestamp; /// Orbit-reset timestamp in us
61+
std::pair<int64_t, int64_t> runDuration; /// Pair of SOR and EOR timestamps
6162

6263
template <typename TTimestampOpts, typename TMetadatahelper>
63-
void init(TTimestampOpts const& external_timestampOpts, TMetadatahelper const& metadataInfo ){
64+
void init(TTimestampOpts const& external_timestampOpts, TMetadatahelper const& metadataInfo)
65+
{
6466
timestampOpts = external_timestampOpts;
6567

6668
if (timestampOpts.isRun2MC.value == -1) {
@@ -74,9 +76,10 @@ class TimestampModule
7476
}
7577

7678
template <typename TBCs, typename Tccdb, typename TTimestampBuffer, typename TCursor>
77-
void process(TBCs const& bcs, Tccdb const& ccdb, TTimestampBuffer& timestampbuffer, TCursor& timestampTable){
79+
void process(TBCs const& bcs, Tccdb const& ccdb, TTimestampBuffer& timestampbuffer, TCursor& timestampTable)
80+
{
7881
timestampbuffer.clear();
79-
for(auto const& bc : bcs){
82+
for (auto const& bc : bcs) {
8083
int runNumber = bc.runNumber();
8184
// We need to set the orbit-reset timestamp for the run number.
8285
// This is done with caching if the run number was already processed before.
@@ -141,4 +144,4 @@ class TimestampModule
141144
} // namespace common
142145
} // namespace o2
143146

144-
#endif // COMMON_TOOLS_TIMESTAMPMODULEH_
147+
#endif // COMMON_TOOLS_TIMESTAMPMODULEH_

0 commit comments

Comments
 (0)