Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions PWGUD/Core/DGCutparHolder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "DGCutparHolder.h"

#include <vector>

// setter
void DGCutparHolder::SetNDtcoll(int ndtcoll)
{
Expand Down
10 changes: 5 additions & 5 deletions PWGUD/Core/DGPIDSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include <gandiva/projector.h>
#include <vector>
#include <TVector3.h>
#include "TDatabasePDG.h"

Check failure on line 18 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include "TLorentzVector.h"

Check failure on line 19 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include "Framework/Logger.h"

const int numDGPIDCutParameters = 9;
float particleMass(TDatabasePDG* pdg, int pid);

Check failure on line 23 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

// -----------------------------------------------------------------------------
// numPart: Particle number to which the parameters apply
Expand Down Expand Up @@ -235,16 +235,16 @@
public:
DGParticle();
template <typename TTrack>
DGParticle(TDatabasePDG* pdg, DGAnaparHolder anaPars, TTrack const& tracks, std::vector<int> comb)

Check failure on line 238 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
{
// compute invariant mass
TLorentzVector lvtmp;

Check failure on line 241 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
auto pids = anaPars.PIDs();

// loop over tracks and update mIVM
mIVM = TLorentzVector(0., 0., 0., 0.);

Check failure on line 245 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
auto cnt = -1;
for (auto ind : comb) {

Check failure on line 247 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
cnt++;
auto track = tracks.begin() + ind;
lvtmp.SetXYZM(track.px(), track.py(), track.pz(), particleMass(pdg, pids[cnt]));
Expand All @@ -264,7 +264,7 @@

private:
// invariant mass
TLorentzVector mIVM;

Check failure on line 267 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

// indices of tracks included
std::vector<int> mtrkinds;
Expand Down Expand Up @@ -342,16 +342,16 @@

// cut on dcaXY and dcaZ
LOGF(debug, "mAnaPars.maxDCAxyz %f %f", mAnaPars.maxDCAxy(), mAnaPars.maxDCAz());
if (track.dcaXY() < -abs(mAnaPars.maxDCAxy()) || track.dcaXY() > abs(mAnaPars.maxDCAxy())) {
if (track.dcaXY() < -std::abs(mAnaPars.maxDCAxy()) || track.dcaXY() > std::abs(mAnaPars.maxDCAxy())) {
return false;
}
if (track.dcaZ() < -abs(mAnaPars.maxDCAz()) || track.dcaZ() > abs(mAnaPars.maxDCAz())) {
if (track.dcaZ() < -std::abs(mAnaPars.maxDCAz()) || track.dcaZ() > std::abs(mAnaPars.maxDCAz())) {
return false;
}

// loop over all PIDCuts and apply the ones which apply to this track
auto pidcuts = mAnaPars.PIDCuts().Cuts();
for (auto pidcut : pidcuts) {

Check failure on line 354 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

// skip cut if it does not apply to this track
if (pidcut.nPart() != cnt || pidcut.cutApply() <= 0) {
Expand Down Expand Up @@ -379,19 +379,19 @@
if (!track.hasTPC()) {
continue;
}
switch (abs(pidcut.cutType())) {
switch (std::abs(pidcut.cutType())) {
case 1:
detValue = getTPCnSigma(track, pidcut.cutPID());
break;
case 2:
detValue = track.tpcSignal();
}
LOGF(debug, "detValue TPC %f", detValue);
} else if (abs(pidcut.cutDetector()) == 2) {
} else if (std::abs(pidcut.cutDetector()) == 2) {
if (!track.hasTOF()) {
continue;
}
switch (abs(pidcut.cutType())) {
switch (std::abs(pidcut.cutType())) {
case 1:
detValue = getTOFnSigma(track, pidcut.cutPID());
break;
Expand Down Expand Up @@ -508,7 +508,7 @@
std::vector<DGParticle> mLikeIVMs;

// particle properties
TDatabasePDG* fPDG;

Check failure on line 511 in PWGUD/Core/DGPIDSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

// helper functions for computeIVMs
void combinations(int n0, std::vector<int>& pool, int np, std::vector<int>& inds, int n,
Expand Down
2 changes: 2 additions & 0 deletions PWGUD/Core/SGCutParHolder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "SGCutParHolder.h"

#include <vector>

// setter
void SGCutParHolder::SetNDtcoll(int ndtcoll)
{
Expand Down
9 changes: 5 additions & 4 deletions PWGUD/Core/SGSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
#include "Framework/Logger.h"

#include <cmath>
#include <memory>

template <typename BC>
struct SelectionResult {
int value; // The original integer return value
const BC* bc; // Pointer to the BC object
std::shared_ptr<BC> bc; // Pointer to the BC object
};

namespace o2::aod::sgselector
Expand Down Expand Up @@ -66,9 +67,9 @@ class SGSelector
// LOGF(info, "Collision %f", collision.collisionTime());
// LOGF(info, "Number of close BCs: %i", bcRange.size());
SelectionResult<BC> result;
result.bc = &oldbc;
if (collision.numContrib() < diffCuts.minNTracks() || collision.numContrib() > diffCuts.maxNTracks()) {
result.value = o2::aod::sgselector::TrkOutOfRange; // 4
result.bc = std::make_shared<BC>(oldbc);
return result;
}
auto newbc = oldbc;
Expand Down Expand Up @@ -97,6 +98,7 @@ class SGSelector
} // end of loop over bc range
if (!gA && !gC) {
result.value = o2::aod::sgselector::NoUpc; // gap = 3
result.bc = std::make_shared<BC>(oldbc);
return result;
}
if (gA && gC) { // loop once again for so-called DG events to get the most active FT0 BC
Expand All @@ -120,9 +122,8 @@ class SGSelector
}
newbc = newdgabc;
}
result.bc = &newbc;
// LOGF(info, "Old BC: %i, New BC: %i",oldbc.globalBC(), newbc.globalBC());
result.bc = &newbc;
result.bc = std::make_shared<BC>(newbc);
// result.value = gA && gC ? 2 : (gA ? 0 : 1);
result.value = gA && gC ? o2::aod::sgselector::DoubleGap : (gA ? o2::aod::sgselector::SingleGapA : o2::aod::sgselector::SingleGapC);
return result;
Expand Down
8 changes: 6 additions & 2 deletions PWGUD/Core/UDFSParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "Framework/Logger.h"
#include "UDFSParser.h"

#include "CommonConstants/LHCConstants.h"
#include "CommonDataFormat/BunchFilling.h"
#include "UDFSParser.h"
#include "Framework/Logger.h"

#include <string>
#include <vector>

// -----------------------------------------------------------------------------
UDFSParser::UDFSParser(const char* filename)
Expand Down
10 changes: 8 additions & 2 deletions PWGUD/Core/UDGoodRunSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <algorithm>
#include "PWGUD/Core/UDGoodRunSelector.h"

#include "Framework/Logger.h"

#include "rapidjson/document.h"
#include "rapidjson/filereadstream.h"
#include "PWGUD/Core/UDGoodRunSelector.h"

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

class TFile;

Expand Down
2 changes: 2 additions & 0 deletions PWGUD/DataModel/UDIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef PWGUD_DATAMODEL_UDINDEX_H_
#define PWGUD_DATAMODEL_UDINDEX_H_

#include "UDTables.h"

#include "Framework/AnalysisDataModel.h"
namespace o2::aod
{
Expand Down
Loading