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
24 changes: 17 additions & 7 deletions PWGLF/TableProducer/Common/zdcvector.cxx
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 PWGLF/TableProducer/Common/zdcvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -113,7 +113,6 @@
Configurable<bool> storeZdcTime{"storeZdcTime", true, "Store timestamp and time from first event of run"};

RCTFlagsChecker rctChecker;
std::unordered_map<int, uint64_t> runStartTime;

void init(o2::framework::InitContext&)
{
Expand Down Expand Up @@ -155,17 +154,17 @@
{
if (!(candidate.isGlobalTrack() &&
candidate.isPVContributor() &&
candidate.itsNCls() > 3 &&

Check failure on line 157 in PWGLF/TableProducer/Common/zdcvector.cxx

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.
candidate.tpcNClsFound() > 50.0 &&

Check failure on line 158 in PWGLF/TableProducer/Common/zdcvector.cxx

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.
candidate.itsNClsInnerBarrel() >= 1)) {
return false;
}

if (std::abs(candidate.dcaXY()) >= 0.1) {

Check failure on line 163 in PWGLF/TableProducer/Common/zdcvector.cxx

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.
return false;
}

if (std::abs(candidate.dcaZ()) >= 0.1) {

Check failure on line 167 in PWGLF/TableProducer/Common/zdcvector.cxx

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.
return false;
}

Expand All @@ -177,6 +176,8 @@
TH2D* gainprofile = nullptr;
TProfile* gainprofilevxy = nullptr;

int runNumberForSOR = -1;
uint64_t sorTimestamp = 0;
// int lastRunNumberTimeRec = -999;
// for time since start of run
// int runForStartTime = -999;
Expand Down Expand Up @@ -230,14 +231,23 @@
auto bc = collision.foundBC_as<BCsRun3>();
const uint64_t timestampzdc = bc.timestamp(); // in milliseconds

if (currentRunNumber != runNumberForSOR) {

auto runDuration = ccdb->getRunDuration(currentRunNumber, true);
sorTimestamp = static_cast<uint64_t>(runDuration.first);
runNumberForSOR = currentRunNumber;

LOGF(info,
"Run %d: SOR timestamp = %llu ms",
currentRunNumber,
static_cast<unsigned long long>(sorTimestamp));
}

float timeInMinutes = 0.f;

auto itStart = runStartTime.find(currentRunNumber);
if (itStart == runStartTime.end()) {
runStartTime[currentRunNumber] = timestampzdc;
timeInMinutes = 0.f;
} else {
timeInMinutes = static_cast<float>(timestampzdc - itStart->second) / 60000.f;
if (timestampzdc >= sorTimestamp && sorTimestamp > 0) {
timeInMinutes =
static_cast<float>(timestampzdc - sorTimestamp) / 60000.f;
}

// Helper to keep your early-return structure unchanged.
Expand Down Expand Up @@ -379,7 +389,7 @@
gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5));
}

if (iChA < 4) {

Check failure on line 392 in PWGLF/TableProducer/Common/zdcvector.cxx

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 (znaEnergy[iChA] <= 0.0) {
triggerevent = false;
Expand Down Expand Up @@ -439,7 +449,7 @@
qyZDCC = cZNC * (qyZDCC / sumC);
}

if (sumA <= 1e-4 || sumC <= 1e-4) {

Check failure on line 452 in PWGLF/TableProducer/Common/zdcvector.cxx

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.
qxZDCA = 0.0;
qxZDCC = 0.0;
qyZDCA = 0.0;
Expand Down
Loading