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
27 changes: 12 additions & 15 deletions PWGUD/Tasks/upcTrackVertexingQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
/// \author Andrea Tavira Garcia a.tavira@cern.ch
/// \author Andrea Giovanni Riffero andrea.giovanni.riffero@cern.ch

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include <CCDB/BasicCCDBManager.h>
#include <CommonConstants/LHCConstants.h>
#include <CommonConstants/PhysicsConstants.h>
#include <DataFormatsParameters/AggregatedRunInfo.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/HistogramRegistry.h>
Expand All @@ -30,10 +31,9 @@
#include <Framework/Logger.h>
#include <Framework/runDataProcessing.h>

#include <Math/Vector4D.h>
#include <TH1.h>
#include <TH2.h>
#include <TPDGCode.h>
#include <Math/GenVector/LorentzVector.h>
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
#include <Math/Vector4Dfwd.h>
Comment thread
vkucera marked this conversation as resolved.

#include <array>
#include <cmath>
Expand Down Expand Up @@ -72,7 +72,7 @@ struct UpcTrackVertexingQA {
HistogramRegistry registry{"registry"};

// services
Service<o2::ccdb::BasicCCDBManager> ccdb; // access to database
Service<o2::ccdb::BasicCCDBManager> ccdb{}; // access to database

// variables to store run info
int runNumberBc = 0; // run number used to process BCs
Expand All @@ -85,8 +85,8 @@ struct UpcTrackVertexingQA {
int64_t nTF = 0; // number of time frames in run

// constants
const unsigned int twoTracks = 2;
const int unassignedDCA = 999;
static constexpr unsigned int TwoTracks = 2;
static constexpr int UnassignedDCA = 999;

static constexpr float MassPion = o2::constants::physics::MassPionCharged;
static constexpr float MassMuon = o2::constants::physics::MassMuon;
Expand Down Expand Up @@ -221,7 +221,7 @@ struct UpcTrackVertexingQA {
if (track.pt() < ptTrackMin || std::abs(track.eta()) > etaTrackMax) {
return false;
}
if (std::abs(track.dcaZ()) >= unassignedDCA || std::abs(track.dcaXY()) >= unassignedDCA) {
if (std::abs(track.dcaZ()) >= UnassignedDCA || std::abs(track.dcaXY()) >= UnassignedDCA) {
return false;
}
return true;
Expand Down Expand Up @@ -329,7 +329,7 @@ struct UpcTrackVertexingQA {
registry.fill(HIST("TrkColl/hTrackSizePerEvent"), goodTracks.size());

// build UPC candidates using events with exactly two opposite sign good tracks
if (goodTracks.size() != twoTracks) {
if (goodTracks.size() != TwoTracks) {
return;
}
auto const& track0 = goodTracks[0];
Expand Down Expand Up @@ -386,10 +386,7 @@ struct UpcTrackVertexingQA {
registry.fill(HIST("McGen/Part/hTrackSizePerEvent"), goodMcGenParticles.size());

// consider only j/psi->mumu and rho->pipi events
auto genId = mcCollision.getGeneratorId();
LOGF(info, "Gen Id: {%d}", genId);
auto sourceId = mcCollision.getSourceId();
LOGF(info, "Source Id: {%d}", sourceId);

if constexpr (isEmbedded) {
if (!sourceId) {
Expand All @@ -402,7 +399,7 @@ struct UpcTrackVertexingQA {
}
}

if (goodMcGenParticles.size() != twoTracks) {
if (goodMcGenParticles.size() != TwoTracks) {
return;
}

Expand All @@ -413,7 +410,7 @@ struct UpcTrackVertexingQA {
LOGF(fatal, "Selected particle has no mother: pdgCode=%d", goodMcGenParticles[0].pdgCode());
return;
}
auto motherPart = mothers[0];
auto const& motherPart = mothers[0];

registry.fill(HIST("McGen/MotherPart/hMotherPdg"), std::abs(motherPart.pdgCode()));
registry.fill(HIST("McGen/MotherPart/hPt"), motherPart.pt());
Expand Down
Loading