Skip to content
5 changes: 3 additions & 2 deletions Common/CCDB/TriggerAliases.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/CCDB/TriggerAliases.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,14 +8,15 @@
// 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/CCDB/TriggerAliases.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/CCDB/TriggerAliases.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/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

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

#include <Rtypes.h>

#include <cstdint>
#include <map>
#include <string>
#include <Rtypes.h>

enum triggerAliases {
kINT7 = 0,
Expand Down Expand Up @@ -57,17 +58,17 @@
TriggerAliases() = default;
~TriggerAliases() = default;

void AddAlias(uint32_t aliasId, std::string classNames) { mAliasToClassNames[aliasId] = classNames; }
void AddAlias(uint32_t aliasId, std::string const& classNames) { mAliasToClassNames[aliasId] = classNames; }

Check failure on line 61 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void AddClassIdToAlias(uint32_t aliasId, int classId);

Check failure on line 62 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
const std::map<uint32_t, std::string>& GetAliasToClassNamesMap() const { return mAliasToClassNames; }
const std::map<uint32_t, ULong64_t>& GetAliasToTriggerMaskMap() const { return mAliasToTriggerMask; }

Check failure on line 64 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
const std::map<uint32_t, ULong64_t>& GetAliasToTriggerMaskNext50Map() const { return mAliasToTriggerMaskNext50; }

Check failure on line 65 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
void Print();

private:
std::map<uint32_t, std::string> mAliasToClassNames;
std::map<uint32_t, ULong64_t> mAliasToTriggerMask;

Check failure on line 70 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
std::map<uint32_t, ULong64_t> mAliasToTriggerMaskNext50;

Check failure on line 71 in Common/CCDB/TriggerAliases.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
ClassDefNV(TriggerAliases, 8)
};

Expand Down
15 changes: 8 additions & 7 deletions Common/CCDB/ctpRateFetcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@

#include "ctpRateFetcher.h"

#include <CCDB/BasicCCDBManager.h>
#include <CommonConstants/LHCConstants.h>
#include <DataFormatsCTP/Configuration.h>
#include <DataFormatsCTP/Scalers.h>
#include <DataFormatsParameters/GRPLHCIFData.h>

#include <map>
#include <string>
#include <vector>

#include "CommonConstants/LHCConstants.h"
#include "DataFormatsCTP/Configuration.h"
#include "DataFormatsCTP/Scalers.h"
#include "DataFormatsParameters/GRPLHCIFData.h"
#include "CCDB/BasicCCDBManager.h"

namespace o2
{
double ctpRateFetcher::fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, std::string sourceName, bool fCrashOnNull)
double ctpRateFetcher::fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, const std::string& sourceName, bool fCrashOnNull)
{
setupRun(runNumber, ccdb, timeStamp);
if (sourceName.find("ZNC") != std::string::npos) {
Expand Down
6 changes: 3 additions & 3 deletions Common/CCDB/ctpRateFetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#ifndef COMMON_CCDB_CTPRATEFETCHER_H_
#define COMMON_CCDB_CTPRATEFETCHER_H_

#include <string>
#include <CCDB/BasicCCDBManager.h>

#include "CCDB/BasicCCDBManager.h"
#include <string>

namespace o2
{
Expand All @@ -34,7 +34,7 @@ class ctpRateFetcher
{
public:
ctpRateFetcher() = default;
double fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, std::string sourceName, bool fCrashOnNull = true);
double fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, const std::string& sourceName, bool fCrashOnNull = true);

void setManualCleanup(bool manualCleanup = true) { mManualCleanup = manualCleanup; }

Expand Down
50 changes: 25 additions & 25 deletions Common/Core/CollisionAssociation.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#ifndef COMMON_CORE_COLLISIONASSOCIATION_H_
#define COMMON_CORE_COLLISIONASSOCIATION_H_

#include <vector>
#include <CommonConstants/LHCConstants.h>
#include <Framework/ASoAHelpers.h>
#include <Framework/AnalysisDataModel.h>

#include <memory>
#include <utility>

#include "CommonConstants/LHCConstants.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include <vector>

namespace o2::aod
{
Expand Down Expand Up @@ -191,58 +191,58 @@ class CollisionAssociation
for (auto& iterationWindow : trackIterationWindows) {
bool iteratorMoved = false;
const bool isAssignedTrackWindow = (iterationWindow.first != iterationWindow.second) ? iterationWindow.first.has_collision() : false;
for (auto track = iterationWindow.first; track != iterationWindow.second; ++track) {
int64_t trackBC = globalBC[track.filteredIndex()];
for (auto trackInWindow = iterationWindow.first; trackInWindow != iterationWindow.second; ++trackInWindow) {
int64_t trackBC = globalBC[trackInWindow.filteredIndex()];
if (trackBC < 0) {
continue;
}

// Optimization to avoid looping over the full track list each time. This builds on that tracks are sorted by BCs (which they should be because collisions are sorted by BCs)
const int64_t bcOffset = trackBC - (int64_t)collBC;
const int64_t bcOffset = trackBC - static_cast<int64_t>(collBC);
if constexpr (isCentralBarrel) {
// only for blocks with collision association
if (isAssignedTrackWindow) {
constexpr int margin = 200;
if (!iteratorMoved && bcOffset > -bcOffsetMax - margin) {
iterationWindow.first.setCursor(track.filteredIndex());
iterationWindow.first.setCursor(trackInWindow.filteredIndex());
iteratorMoved = true;
LOGP(debug, "Moving iterator begin {}", track.filteredIndex());
LOGP(debug, "Moving iterator begin {}", trackInWindow.filteredIndex());
} else if (bcOffset > bcOffsetMax + margin) {
LOGP(debug, "Stopping iterator {}", track.filteredIndex());
LOGP(debug, "Stopping iterator {}", trackInWindow.filteredIndex());
break;
}
}
}

int64_t bcOffsetWindow = trackBCCache[track.filteredIndex()] - (int64_t)collBC;
int64_t bcOffsetWindow = trackBCCache[trackInWindow.filteredIndex()] - static_cast<int64_t>(collBC);
if (std::abs(bcOffsetWindow) > bcOffsetMax) {
continue;
}

float trackTime = 0;
float trackTimeRes = 0;
if constexpr (isCentralBarrel) {
if (mUsePvAssociation && track.isPVContributor()) {
trackTime = track.collision().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
if (mUsePvAssociation && trackInWindow.isPVContributor()) {
trackTime = trackInWindow.collision().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
} else {
trackTime = track.trackTime();
trackTimeRes = track.trackTimeRes();
trackTime = trackInWindow.trackTime();
trackTimeRes = trackInWindow.trackTimeRes();
}
} else {
trackTime = track.trackTime();
trackTimeRes = track.trackTimeRes();
trackTime = trackInWindow.trackTime();
trackTimeRes = trackInWindow.trackTimeRes();
}

const float deltaTime = trackTime - collTime + bcOffset * o2::constants::lhc::LHCBunchSpacingNS;
float sigmaTimeRes2 = collTimeRes2 + trackTimeRes * trackTimeRes;
LOGP(debug, "collision time={}, collision time res={}, track time={}, track time res={}, bc collision={}, bc track={}, delta time={}", collTime, collision.collisionTimeRes(), track.trackTime(), track.trackTimeRes(), collBC, trackBC, deltaTime);
LOGP(debug, "collision time={}, collision time res={}, track time={}, track time res={}, bc collision={}, bc track={}, delta time={}", collTime, collision.collisionTimeRes(), trackInWindow.trackTime(), trackInWindow.trackTimeRes(), collBC, trackBC, deltaTime);

float thresholdTime = 0.;
if constexpr (isCentralBarrel) {
if (mUsePvAssociation && track.isPVContributor()) {
if (mUsePvAssociation && trackInWindow.isPVContributor()) {
thresholdTime = trackTimeRes;
} else if (TESTBIT(track.flags(), o2::aod::track::TrackTimeResIsRange)) {
} else if (TESTBIT(trackInWindow.flags(), o2::aod::track::TrackTimeResIsRange)) {
// the track time resolution is a range, not a gaussian resolution
thresholdTime = trackTimeRes + mNumSigmaForTimeCompat * std::sqrt(collTimeRes2) + mTimeMargin;
} else {
Expand All @@ -262,7 +262,7 @@ class CollisionAssociation

if (std::abs(deltaTime) < thresholdTime) {
const auto collIdx = collision.globalIndex();
const auto trackIdx = track.globalIndex();
const auto trackIdx = trackInWindow.globalIndex();
LOGP(debug, "Filling track id {} for coll id {}", trackIdx, collIdx);
association(collIdx, trackIdx);
if (mFillTableOfCollIdsPerTrack) {
Expand All @@ -278,9 +278,9 @@ class CollisionAssociation
// create reverse index track to collisions if enabled
if (mFillTableOfCollIdsPerTrack) {
std::vector<int> empty{};
for (const auto& track : tracksUnfiltered) {
for (const auto& trackUnfiltered : tracksUnfiltered) {

const auto trackId = track.globalIndex();
const auto trackId = trackUnfiltered.globalIndex();
if (collsPerTrack[trackId] == nullptr) {
reverseIndices(empty);
} else {
Expand Down
5 changes: 2 additions & 3 deletions Common/Core/CollisionTypeHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

#include "Common/Core/CollisionTypeHelper.h"

#include "DataFormatsParameters/GRPLHCIFData.h"

#include <fairlogger/Logger.h>
#include <DataFormatsParameters/GRPLHCIFData.h>
#include <Framework/Logger.h>

#include <string>

Expand Down
21 changes: 11 additions & 10 deletions Common/Core/EventPlaneHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

#include "Common/Core/EventPlaneHelper.h"

#include <TMath.h>
#include <TVector3.h>

#include <algorithm>
#include <cstdio>
#include <iterator>
#include <vector>
#include <memory>

#include "TMath.h"
#include "TVector3.h"
#include <vector>

double EventPlaneHelper::GetPhiFV0(int chno, o2::fv0::Geometry* fv0geom)
{
Expand All @@ -37,8 +38,8 @@ double EventPlaneHelper::GetPhiFV0(int chno, o2::fv0::Geometry* fv0geom)
float offsetX = 0.;
float offsetY = 0.;

int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27,
32, 40, 33, 41, 34, 42, 35, 43};
const int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27,
32, 40, 33, 41, 34, 42, 35, 43};
bool isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft);

if (isChnoInLeft) {
Expand Down Expand Up @@ -131,10 +132,10 @@ void EventPlaneHelper::DoCorrections(float& qx, float& qy,
qy = (qy - corrections[2] * qx) / (1.0 - corrections[3] * corrections[2]);

// Rescaling of the Qx-Qy into a circle.
if (fabs(corrections[4]) > 1e-8) {
if (std::fabs(corrections[4]) > 1e-8) {
qx /= corrections[4];
}
if (fabs(corrections[5]) > 1e-8) {
if (std::fabs(corrections[5]) > 1e-8) {
qy /= corrections[5];
}
}
Expand All @@ -153,9 +154,9 @@ void EventPlaneHelper::DoTwist(float& qx, float& qy, float lp, float lm)

void EventPlaneHelper::DoRescale(float& qx, float& qy, float ap, float am)
{
if (fabs(ap) > 1e-8)
if (std::fabs(ap) > 1e-8)
qx /= ap;
if (fabs(am) > 1e-8)
if (std::fabs(am) > 1e-8)
qy /= am;
}

Expand Down
8 changes: 4 additions & 4 deletions Common/Core/FFitWeights.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

#include "FFitWeights.h"

#include <string>
#include <TSpline.h>

#include <cstdio>
#include <string>
#include <vector>

#include <TSpline.h>

ClassImp(FFitWeights)

FFitWeights::FFitWeights() : TNamed("", ""),
Expand Down Expand Up @@ -111,7 +111,7 @@ void FFitWeights::addArray(TObjArray* targ, TObjArray* sour)
}
};

void FFitWeights::qSelection(std::vector<int> nhv, std::vector<std::string> stv) /* only execute OFFLINE */
void FFitWeights::qSelection(const std::vector<int>& nhv, const std::vector<std::string>& stv) /* only execute OFFLINE */
{
TObjArray* tar{nullptr};

Expand Down
30 changes: 15 additions & 15 deletions Common/Core/FFitWeights.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
#ifndef COMMON_CORE_FFITWEIGHTS_H_
#define COMMON_CORE_FFITWEIGHTS_H_

#include <vector>
#include <string>
#include <utility>
#include <TCollection.h>
#include <TFile.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TH3D.h>
#include <TMath.h>
#include <TNamed.h>
#include <TObjArray.h>
#include <TString.h>

#include <algorithm>
#include <complex>
#include <memory>

#include "TNamed.h"
#include "TObjArray.h"
#include "TH3D.h"
#include "TH2D.h"
#include "TH1D.h"
#include "TFile.h"
#include "TCollection.h"
#include "TString.h"
#include "TMath.h"
#include <string>
#include <utility>
#include <vector>

class FFitWeights : public TNamed
{
Expand All @@ -53,11 +53,11 @@ class FFitWeights : public TNamed
TAxis* getqVecAx() { return qAxis; }

Long64_t Merge(TCollection* collist);
void qSelection(std::vector<int> nhv, std::vector<std::string> stv);
void qSelection(const std::vector<int>& nhv, const std::vector<std::string>& stv);
float eval(float centr, const float& dqn, const int nh, const char* pf = "");
void setResolution(int res) { nResolution = res; }
int getResolution() const { return nResolution; }
void setQnType(std::vector<std::pair<int, std::string>> qninp) { qnTYPE = qninp; }
void setQnType(const std::vector<std::pair<int, std::string>>& qninp) { qnTYPE = qninp; }

private:
TObjArray* fW_data;
Expand Down
6 changes: 4 additions & 2 deletions Common/Core/MetadataHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

#include "Common/Core/MetadataHelper.h"

#include "Framework/InitContext.h"
#include "Framework/RunningWorkflowInfo.h"
#include <Framework/InitContext.h>
#include <Framework/RunningWorkflowInfo.h>

#include <string>

using namespace o2::common::core;

Expand Down
11 changes: 6 additions & 5 deletions Common/Core/OrbitRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
// Container to store minimum and maximum orbit counter
//

#ifndef OrbitRange_H
#define OrbitRange_H
#ifndef COMMON_CORE_ORBITRANGE_H_
#define COMMON_CORE_ORBITRANGE_H_

#include <TNamed.h>

#include "TNamed.h"
class TCollection;

class OrbitRange : public TNamed
{
public:
OrbitRange(const char* name = "orbitRange") : TNamed(name, name), fRunNumber(0), fMinOrbit(0xFFFFFFFF), fMaxOrbit(0) {}
explicit OrbitRange(const char* name = "orbitRange") : TNamed(name, name), fRunNumber(0), fMinOrbit(0xFFFFFFFF), fMaxOrbit(0) {}
~OrbitRange() {}
void SetRunNumber(uint32_t runNumber) { fRunNumber = runNumber; }
void SetMinOrbit(uint32_t orbit) { fMinOrbit = orbit; }
Expand All @@ -39,4 +40,4 @@ class OrbitRange : public TNamed
ClassDef(OrbitRange, 1)
};

#endif
#endif // COMMON_CORE_ORBITRANGE_H_
Loading
Loading