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
16 changes: 16 additions & 0 deletions PWGDQ/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <RtypesCore.h>

#include <iostream>

Check failure on line 23 in PWGDQ/Core/CutsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <set>
#include <string>
#include <vector>
Expand Down Expand Up @@ -1169,7 +1169,7 @@
return cut;
}

for (int iCut = 0; iCut < 10; iCut++) {

Check failure on line 1172 in PWGDQ/Core/CutsLibrary.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 (!nameStr.compare(Form("jpsiEleSel%d_ionut", iCut))) {
cut->AddCut(GetAnalysisCut("kineJpsiEle_ionut"));
cut->AddCut(GetAnalysisCut("dcaCut1_ionut"));
Expand Down Expand Up @@ -1469,7 +1469,7 @@
return cut;
}

for (int i = 1; i <= 8; i++) {

Check failure on line 1472 in PWGDQ/Core/CutsLibrary.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 (!nameStr.compare(Form("dalitzSelected%d", i))) {
cut->AddCut(GetAnalysisCut(Form("dalitzLeg%d", i)));
return cut;
Expand Down Expand Up @@ -1943,7 +1943,7 @@
return cut;
}

for (unsigned int i = 0; i < 30; i++) {

Check failure on line 1946 in PWGDQ/Core/CutsLibrary.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 (!nameStr.compare(Form("ElSelCutVar%s%i", vecPIDcase.at(icase).Data(), i))) {
cut->AddCut(GetAnalysisCut("lmeeStandardKine"));
cut->AddCut(GetAnalysisCut(Form("lmeeCutVarTrackCuts%i", i)));
Expand Down Expand Up @@ -2713,7 +2713,7 @@
return cut;
}

for (int i = 1; i <= 8; i++) {

Check failure on line 2716 in PWGDQ/Core/CutsLibrary.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 (!nameStr.compare(Form("lmee%s_pp502TeV_PID%s_UsePrefilter%d", vecTypetrackWithPID.at(jcase).Data(), vecPIDcase.at(icase).Data(), i))) {
cut->AddCut(GetAnalysisCut(Form("notDalitzLeg%d", i)));
cut->AddCut(GetAnalysisCut("lmeeStandardKine"));
Expand Down Expand Up @@ -2770,7 +2770,7 @@
return cut;
}

for (int i = 1; i <= 8; i++) {

Check failure on line 2773 in PWGDQ/Core/CutsLibrary.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 (!nameStr.compare(Form("lmee%s_eNSigmaRun3%s_UsePrefilter%d", vecTypetrackWithPID.at(jcase).Data(), vecPIDcase.at(icase).Data(), i))) {
cut->AddCut(GetAnalysisCut(Form("notDalitzLeg%d", i)));
cut->AddCut(GetAnalysisCut("lmeeStandardKine"));
Expand Down Expand Up @@ -4304,6 +4304,22 @@
// -----------------------------------------------
// Barrel track quality cuts

// ---------------------------------------------------
// MC generated particle acceptance cuts

if (!nameStr.compare("rapidity08")) {
cut->AddCut(VarManager::kMCY, -0.8, 0.8);
return cut;
}

if (!nameStr.compare("rapidity09")) {
cut->AddCut(VarManager::kMCY, -0.9, 0.9);
return cut;
}

// ---------------------------------------------------
// MC generated particle acceptance cuts

// Run 2 only

if (!nameStr.compare("highPtHadron")) {
Expand Down Expand Up @@ -4478,7 +4494,7 @@
cut->AddCut(VarManager::kITSncls, 6.5, 7.5);
cut->AddCut(VarManager::kTPCnclsCR, 80.0, 161.);
cut->AddCut(VarManager::kTPCncls, 90.0, 170.);
} else if (icase == 2) {

Check failure on line 4497 in PWGDQ/Core/CutsLibrary.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.
cut->AddCut(VarManager::kIsSPDfirst, 0.5, 1.5);
cut->AddCut(VarManager::kITSchi2, 0.0, 5.0);
cut->AddCut(VarManager::kITSncls, 4.5, 7.5);
Expand Down Expand Up @@ -7222,11 +7238,11 @@
labelsFlatBin.push_back(Form("%s_cent%.0f_%.0f_pt%.1f_%.1f", cent.c_str(), centMin, centMax, ptMin, ptMax));
LOG(info) << "Added cut for " << Form("%s_cent%.0f_%.0f_pt%.1f_%.1f", cent.c_str(), centMin, centMax, ptMin, ptMax) << " with cuts: [";
for (size_t i = 0; i < binCuts.size(); ++i) {
std::cout << binCuts[i];

Check failure on line 7241 in PWGDQ/Core/CutsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
if (i != binCuts.size() - 1)
std::cout << ", ";

Check failure on line 7243 in PWGDQ/Core/CutsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
std::cout << "] and direction: " << (exclude ? "CutGreater" : "CutSmaller") << std::endl;

Check failure on line 7245 in PWGDQ/Core/CutsLibrary.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

Expand Down
48 changes: 20 additions & 28 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
//
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
//
#include <vector>
#include <algorithm>
#include "PWGDQ/Core/HistogramsLibrary.h"

#include "VarManager.h"

#include "CommonConstants/MathConstants.h"

#include <algorithm>
#include <vector>

void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName)
{
//
Expand Down Expand Up @@ -923,23 +926,22 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
hm->AddHistogram(histClass, "Rapidity", "", false, 400, -5.0, 5.0, VarManager::kRap);
}
if (!groupStr.CompareTo("mctruth_pair")) {
hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 15.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt);
hm->AddHistogram(histClass, "Pt", "", false, 200, 0.0, 20.0, VarManager::kPt);
hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 15.0, VarManager::kMCMass, 40, 0.0, 20.0, VarManager::kMCPt);
hm->AddHistogram(histClass, "Pt", "", false, 200, 0.0, 20.0, VarManager::kMCPt);
hm->AddHistogram(histClass, "Pt_Dilepton", "", false, 200, 0.0, 20.0, VarManager::kPairPtDau);
hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1);
hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2);
hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 15.0, VarManager::kMass);
hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt);
hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi);
int varspTHE[3] = {VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCPhiHE};
int varspTCS[3] = {VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCPhiCS};
int varspTPP[3] = {VarManager::kMCPt, VarManager::kMCCosThetaPP, VarManager::kMCPhiPP};
int binspT[3] = {40, 20, 20};
double xminpT[3] = {0., -1., -3.14};
double xmaxpT[3] = {20., 1., +3.14};
hm->AddHistogram(histClass, "Pt_cosThetaHE_phiHE", "", 3, varspTHE, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
hm->AddHistogram(histClass, "Pt_cosThetaCS_phiCS", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
hm->AddHistogram(histClass, "Pt_cosThetaPP_phiPP", "", 3, varspTPP, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 15.0, VarManager::kMCMass);
hm->AddHistogram(histClass, "Rapidity", "", false, 100, -5.0, 5.0, VarManager::kMCY);
hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kMCEta, 200, 0.0, 20.0, VarManager::kMCPt);
hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kMCEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kMCPhi);
if (subGroupStr.Contains("polarization")) {
int varspTHE[4] = {VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCPhiHE, VarManager::kMCPhiTildeHE};
int varspTCS[4] = {VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCPhiCS, VarManager::kMCPhiTildeCS};
int bins[4] = {20, 20, 20, 20};
double xmin[4] = {0., -1., 0., 0.};
double xmax[4] = {20., 1., 2. * o2::constants::math::PI, 2. * o2::constants::math::PI};
hm->AddHistogram(histClass, "Pt_cosThetaHE_phiHE_phiTildeHE", "", 4, varspTHE, bins, xmin, xmax, 0, -1, kFALSE);
hm->AddHistogram(histClass, "Pt_cosThetaCS_phiCS_phiTildeCS", "", 4, varspTCS, bins, xmin, xmax, 0, -1, kFALSE);
}
}
if (!groupStr.CompareTo("mctruth_quad")) {
hm->AddHistogram(histClass, "hMass_defaultDileptonMass", "", false, 1000, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass);
Expand Down Expand Up @@ -1034,31 +1036,21 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
}
if (subGroupStr.Contains("polarization")) {
if (subGroupStr.Contains("helicity")) {
hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE);
hm->AddHistogram(histClass, "phiHE", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiHE);
hm->AddHistogram(histClass, "phitildeHE", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildeHE);
hm->AddHistogram(histClass, "Mass_Pt_CosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, -1., 1., VarManager::kCosThetaHE);
hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiHE);
hm->AddHistogram(histClass, "Mass_Pt_PhiTildeHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiTildeHE);
}
if (subGroupStr.Contains("collins-soper")) {
hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS);
hm->AddHistogram(histClass, "phiCS", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiCS);
hm->AddHistogram(histClass, "phitildeCS", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildeCS);
hm->AddHistogram(histClass, "Mass_Pt_CosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, -1., 1., VarManager::kCosThetaCS);
hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiCS);
hm->AddHistogram(histClass, "Mass_Pt_PhiTildeCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiTildeCS);
}
if (subGroupStr.Contains("production")) {
hm->AddHistogram(histClass, "cosThetaPP", "", false, 100, -1., 1., VarManager::kCosThetaPP);
hm->AddHistogram(histClass, "phiPP", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiPP);
hm->AddHistogram(histClass, "phitildePP", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildePP);
hm->AddHistogram(histClass, "Mass_Pt_CosThetaPP", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, -1., 1., VarManager::kCosThetaPP);
hm->AddHistogram(histClass, "Mass_Pt_PhiPP", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiPP);
hm->AddHistogram(histClass, "Mass_Pt_PhiTildePP", "", false, 100, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, 0., 2 * o2::constants::math::PI, VarManager::kPhiTildePP);
}
if (subGroupStr.Contains("random")) {
hm->AddHistogram(histClass, "cosThetaRM", "", false, 100, -1., 1., VarManager::kCosThetaRM);
hm->AddHistogram(histClass, "Mass_Pt_CosThetaRM", "", false, 200, 1.0, 5.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt, 20, -1., 1., VarManager::kCosThetaRM);
}
}
Expand Down
36 changes: 30 additions & 6 deletions PWGDQ/Core/MCSignalLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
#include <vector>
// #include <iostream>

#include <TPDGCode.h>
#include "CommonConstants/PhysicsConstants.h"
#include "PWGDQ/Core/MCSignalLibrary.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/Logger.h"

#include <TPDGCode.h>

using namespace o2::constants::physics;
// using std::cout;
// using std::endl;
Expand Down Expand Up @@ -152,6 +154,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
signal = new MCSignal(name, "Electrons from prompt jpsi decays", {prong}, {-1});
return signal;
}
if (!nameStr.compare("ePrimaryFromNonpromptJpsi")) {
MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {503}, {false});
prong.SetSourceBit(0, MCProng::kPhysicalPrimary);
signal = new MCSignal(name, "Electrons from non-prompt jpsi decays with beauty in decay chain", {prong}, {-1});
return signal;
}
if (!nameStr.compare("Jpsi")) {
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false});
signal = new MCSignal(name, "Inclusive jpsi", {prong}, {-1});
Expand All @@ -174,14 +182,30 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
signal = new MCSignal(name, "Helium3FromTransport", {prong}, {-1});
return signal;
}
if (!nameStr.compare("promptJpsi")) {
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {true});
signal = new MCSignal(name, "Prompt jpsi (not from beauty)", {prong}, {-1});
return signal;
}
if (!nameStr.compare("nonPromptJpsi")) {
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {false});
signal = new MCSignal(name, "Non-prompt jpsi (from beauty)", {prong}, {-1});
return signal;
}
if (!nameStr.compare("nonPromptJpsiFromBeauty")) {
MCProng prong(2, {443, 503}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false});
signal = new MCSignal(name, "Non-prompt jpsi", {prong}, {-1});
signal = new MCSignal(name, "Non-prompt jpsi directly from beauty", {prong}, {-1});
return signal;
}
if (!nameStr.compare("promptJpsi")) {
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {true});
signal = new MCSignal(name, "Prompt jpsi (not from beauty)", {prong}, {-1});
if (!nameStr.compare("nonPromptJpsiNotDirectlyFromBeauty")) {
MCProng prong(2, {443, 503}, {true, true}, {false, true}, {0, 0}, {0, 0}, {false, false}, false, {503}, {false});
signal = new MCSignal(name, "Non-prompt jpsi from other but with beauty in decay chain", {prong}, {-1});
return signal;
}
if (!nameStr.compare("AnythingDecayToJpsi")) {
MCProng prong(2, {MCProng::kPDGCodeNotAssigned, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false});
prong.SetSignalInTime(true);
signal = new MCSignal(name, "Decay of anything into J/psi", {prong}, {-1});
return signal;
}
if (!nameStr.compare("eeFromNonpromptPsi2S")) {
Expand Down
10 changes: 6 additions & 4 deletions PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,6 @@ struct TableMakerMC {
eventMC.reserve(mcCollisions.size());
skimMCCollisions(mcCollisions);

// select MC particles to be written using the specified MC signals
// NOTE: tables are not written at this point, only label maps are being created
skimMCParticles(mcParticles, mcCollisions);

// skim collisions
event.reserve(collisions.size());
eventExtended.reserve(collisions.size());
Expand All @@ -1230,6 +1226,12 @@ struct TableMakerMC {
return;
}

// select MC particles to be written using the specified MC signals
// NOTE: tables are not written at this point, only label maps are being created
// Only skim MC particles when the MC collision is reconstructed
// Because in the first five DFs of each run, the MC collisions are not reconstructed
skimMCParticles(mcParticles, mcCollisions);

// Clear index map and reserve memory for barrel tables
if constexpr (static_cast<bool>(TTrackFillMap)) {
fTrackIndexMap.clear();
Expand Down
Loading
Loading