Skip to content

Commit a5ea351

Browse files
sigurdnesealibuild
andauthored
[PWGUD] Fix some bug tracker issues (#14085)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 2cd4cab commit a5ea351

File tree

7 files changed

+30
-13
lines changed

7 files changed

+30
-13
lines changed

PWGUD/Core/DGCutparHolder.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "DGCutparHolder.h"
1313

14+
#include <vector>
15+
1416
// setter
1517
void DGCutparHolder::SetNDtcoll(int ndtcoll)
1618
{

PWGUD/Core/DGPIDSelector.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,10 @@ struct DGPIDSelector {
342342

343343
// cut on dcaXY and dcaZ
344344
LOGF(debug, "mAnaPars.maxDCAxyz %f %f", mAnaPars.maxDCAxy(), mAnaPars.maxDCAz());
345-
if (track.dcaXY() < -abs(mAnaPars.maxDCAxy()) || track.dcaXY() > abs(mAnaPars.maxDCAxy())) {
345+
if (track.dcaXY() < -std::abs(mAnaPars.maxDCAxy()) || track.dcaXY() > std::abs(mAnaPars.maxDCAxy())) {
346346
return false;
347347
}
348-
if (track.dcaZ() < -abs(mAnaPars.maxDCAz()) || track.dcaZ() > abs(mAnaPars.maxDCAz())) {
348+
if (track.dcaZ() < -std::abs(mAnaPars.maxDCAz()) || track.dcaZ() > std::abs(mAnaPars.maxDCAz())) {
349349
return false;
350350
}
351351

@@ -379,19 +379,19 @@ struct DGPIDSelector {
379379
if (!track.hasTPC()) {
380380
continue;
381381
}
382-
switch (abs(pidcut.cutType())) {
382+
switch (std::abs(pidcut.cutType())) {
383383
case 1:
384384
detValue = getTPCnSigma(track, pidcut.cutPID());
385385
break;
386386
case 2:
387387
detValue = track.tpcSignal();
388388
}
389389
LOGF(debug, "detValue TPC %f", detValue);
390-
} else if (abs(pidcut.cutDetector()) == 2) {
390+
} else if (std::abs(pidcut.cutDetector()) == 2) {
391391
if (!track.hasTOF()) {
392392
continue;
393393
}
394-
switch (abs(pidcut.cutType())) {
394+
switch (std::abs(pidcut.cutType())) {
395395
case 1:
396396
detValue = getTOFnSigma(track, pidcut.cutPID());
397397
break;

PWGUD/Core/SGCutParHolder.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "SGCutParHolder.h"
1313

14+
#include <vector>
15+
1416
// setter
1517
void SGCutParHolder::SetNDtcoll(int ndtcoll)
1618
{

PWGUD/Core/SGSelector.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@
2828
#include "Framework/Logger.h"
2929

3030
#include <cmath>
31+
#include <memory>
3132

3233
template <typename BC>
3334
struct SelectionResult {
3435
int value; // The original integer return value
35-
const BC* bc; // Pointer to the BC object
36+
std::shared_ptr<BC> bc; // Pointer to the BC object
3637
};
3738

3839
namespace o2::aod::sgselector
@@ -66,9 +67,9 @@ class SGSelector
6667
// LOGF(info, "Collision %f", collision.collisionTime());
6768
// LOGF(info, "Number of close BCs: %i", bcRange.size());
6869
SelectionResult<BC> result;
69-
result.bc = &oldbc;
7070
if (collision.numContrib() < diffCuts.minNTracks() || collision.numContrib() > diffCuts.maxNTracks()) {
7171
result.value = o2::aod::sgselector::TrkOutOfRange; // 4
72+
result.bc = std::make_shared<BC>(oldbc);
7273
return result;
7374
}
7475
auto newbc = oldbc;
@@ -97,6 +98,7 @@ class SGSelector
9798
} // end of loop over bc range
9899
if (!gA && !gC) {
99100
result.value = o2::aod::sgselector::NoUpc; // gap = 3
101+
result.bc = std::make_shared<BC>(oldbc);
100102
return result;
101103
}
102104
if (gA && gC) { // loop once again for so-called DG events to get the most active FT0 BC
@@ -120,9 +122,8 @@ class SGSelector
120122
}
121123
newbc = newdgabc;
122124
}
123-
result.bc = &newbc;
124125
// LOGF(info, "Old BC: %i, New BC: %i",oldbc.globalBC(), newbc.globalBC());
125-
result.bc = &newbc;
126+
result.bc = std::make_shared<BC>(newbc);
126127
// result.value = gA && gC ? 2 : (gA ? 0 : 1);
127128
result.value = gA && gC ? o2::aod::sgselector::DoubleGap : (gA ? o2::aod::sgselector::SingleGapA : o2::aod::sgselector::SingleGapC);
128129
return result;

PWGUD/Core/UDFSParser.cxx

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

12-
#include "Framework/Logger.h"
12+
#include "UDFSParser.h"
13+
1314
#include "CommonConstants/LHCConstants.h"
1415
#include "CommonDataFormat/BunchFilling.h"
15-
#include "UDFSParser.h"
16+
#include "Framework/Logger.h"
17+
18+
#include <string>
19+
#include <vector>
1620

1721
// -----------------------------------------------------------------------------
1822
UDFSParser::UDFSParser(const char* filename)

PWGUD/Core/UDGoodRunSelector.cxx

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

12-
#include <algorithm>
12+
#include "PWGUD/Core/UDGoodRunSelector.h"
13+
1314
#include "Framework/Logger.h"
15+
1416
#include "rapidjson/document.h"
1517
#include "rapidjson/filereadstream.h"
16-
#include "PWGUD/Core/UDGoodRunSelector.h"
18+
19+
#include <algorithm>
20+
#include <cstdio>
21+
#include <string>
22+
#include <vector>
1723

1824
class TFile;
1925

PWGUD/DataModel/UDIndex.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef PWGUD_DATAMODEL_UDINDEX_H_
2020
#define PWGUD_DATAMODEL_UDINDEX_H_
2121

22+
#include "UDTables.h"
23+
2224
#include "Framework/AnalysisDataModel.h"
2325
namespace o2::aod
2426
{

0 commit comments

Comments
 (0)