Skip to content

Commit bd6899a

Browse files
zjxiongOvOypwangg
andauthored
[PWGDQ] fix bug in dqefficiency_withassoc, and redefined some signal (#13692)
Co-authored-by: ypwangg <ypwangg@mail.ustc.edu.cn>
1 parent 85dc65b commit bd6899a

File tree

5 files changed

+181
-73
lines changed

5 files changed

+181
-73
lines changed

PWGDQ/Core/CutsLibrary.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4304,6 +4304,22 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName)
43044304
// -----------------------------------------------
43054305
// Barrel track quality cuts
43064306

4307+
// ---------------------------------------------------
4308+
// MC generated particle acceptance cuts
4309+
4310+
if (!nameStr.compare("rapidity08")) {
4311+
cut->AddCut(VarManager::kMCY, -0.8, 0.8);
4312+
return cut;
4313+
}
4314+
4315+
if (!nameStr.compare("rapidity09")) {
4316+
cut->AddCut(VarManager::kMCY, -0.9, 0.9);
4317+
return cut;
4318+
}
4319+
4320+
// ---------------------------------------------------
4321+
// MC generated particle acceptance cuts
4322+
43074323
// Run 2 only
43084324

43094325
if (!nameStr.compare("highPtHadron")) {

PWGDQ/Core/HistogramsLibrary.cxx

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
//
1212
// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no
1313
//
14-
#include <vector>
15-
#include <algorithm>
1614
#include "PWGDQ/Core/HistogramsLibrary.h"
15+
1716
#include "VarManager.h"
17+
1818
#include "CommonConstants/MathConstants.h"
1919

20+
#include <algorithm>
21+
#include <vector>
22+
2023
void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName)
2124
{
2225
//
@@ -923,23 +926,22 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
923926
hm->AddHistogram(histClass, "Rapidity", "", false, 400, -5.0, 5.0, VarManager::kRap);
924927
}
925928
if (!groupStr.CompareTo("mctruth_pair")) {
926-
hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 15.0, VarManager::kMass, 40, 0.0, 20.0, VarManager::kPt);
927-
hm->AddHistogram(histClass, "Pt", "", false, 200, 0.0, 20.0, VarManager::kPt);
929+
hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 15.0, VarManager::kMCMass, 40, 0.0, 20.0, VarManager::kMCPt);
930+
hm->AddHistogram(histClass, "Pt", "", false, 200, 0.0, 20.0, VarManager::kMCPt);
928931
hm->AddHistogram(histClass, "Pt_Dilepton", "", false, 200, 0.0, 20.0, VarManager::kPairPtDau);
929-
hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1);
930-
hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2);
931-
hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 15.0, VarManager::kMass);
932-
hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt);
933-
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);
934-
int varspTHE[3] = {VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCPhiHE};
935-
int varspTCS[3] = {VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCPhiCS};
936-
int varspTPP[3] = {VarManager::kMCPt, VarManager::kMCCosThetaPP, VarManager::kMCPhiPP};
937-
int binspT[3] = {40, 20, 20};
938-
double xminpT[3] = {0., -1., -3.14};
939-
double xmaxpT[3] = {20., 1., +3.14};
940-
hm->AddHistogram(histClass, "Pt_cosThetaHE_phiHE", "", 3, varspTHE, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
941-
hm->AddHistogram(histClass, "Pt_cosThetaCS_phiCS", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
942-
hm->AddHistogram(histClass, "Pt_cosThetaPP_phiPP", "", 3, varspTPP, binspT, xminpT, xmaxpT, 0, -1, kFALSE);
932+
hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 15.0, VarManager::kMCMass);
933+
hm->AddHistogram(histClass, "Rapidity", "", false, 100, -5.0, 5.0, VarManager::kMCY);
934+
hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kMCEta, 200, 0.0, 20.0, VarManager::kMCPt);
935+
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);
936+
if (subGroupStr.Contains("polarization")) {
937+
int varspTHE[4] = {VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCPhiHE, VarManager::kMCPhiTildeHE};
938+
int varspTCS[4] = {VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCPhiCS, VarManager::kMCPhiTildeCS};
939+
int bins[4] = {20, 20, 20, 20};
940+
double xmin[4] = {0., -1., 0., 0.};
941+
double xmax[4] = {20., 1., 2. * o2::constants::math::PI, 2. * o2::constants::math::PI};
942+
hm->AddHistogram(histClass, "Pt_cosThetaHE_phiHE_phiTildeHE", "", 4, varspTHE, bins, xmin, xmax, 0, -1, kFALSE);
943+
hm->AddHistogram(histClass, "Pt_cosThetaCS_phiCS_phiTildeCS", "", 4, varspTCS, bins, xmin, xmax, 0, -1, kFALSE);
944+
}
943945
}
944946
if (!groupStr.CompareTo("mctruth_quad")) {
945947
hm->AddHistogram(histClass, "hMass_defaultDileptonMass", "", false, 1000, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass);
@@ -1034,31 +1036,21 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
10341036
}
10351037
if (subGroupStr.Contains("polarization")) {
10361038
if (subGroupStr.Contains("helicity")) {
1037-
hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE);
1038-
hm->AddHistogram(histClass, "phiHE", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiHE);
1039-
hm->AddHistogram(histClass, "phitildeHE", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildeHE);
10401039
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);
10411040
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);
10421041
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);
10431042
}
10441043
if (subGroupStr.Contains("collins-soper")) {
1045-
hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS);
1046-
hm->AddHistogram(histClass, "phiCS", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiCS);
1047-
hm->AddHistogram(histClass, "phitildeCS", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildeCS);
10481044
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);
10491045
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);
10501046
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);
10511047
}
10521048
if (subGroupStr.Contains("production")) {
1053-
hm->AddHistogram(histClass, "cosThetaPP", "", false, 100, -1., 1., VarManager::kCosThetaPP);
1054-
hm->AddHistogram(histClass, "phiPP", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiPP);
1055-
hm->AddHistogram(histClass, "phitildePP", "", false, 100, 0, 2 * o2::constants::math::PI, VarManager::kPhiTildePP);
10561049
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);
10571050
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);
10581051
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);
10591052
}
10601053
if (subGroupStr.Contains("random")) {
1061-
hm->AddHistogram(histClass, "cosThetaRM", "", false, 100, -1., 1., VarManager::kCosThetaRM);
10621054
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);
10631055
}
10641056
}

PWGDQ/Core/MCSignalLibrary.cxx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
#include <vector>
1616
// #include <iostream>
1717

18-
#include <TPDGCode.h>
19-
#include "CommonConstants/PhysicsConstants.h"
2018
#include "PWGDQ/Core/MCSignalLibrary.h"
19+
20+
#include "CommonConstants/PhysicsConstants.h"
2121
#include "Framework/Logger.h"
2222

23+
#include <TPDGCode.h>
24+
2325
using namespace o2::constants::physics;
2426
// using std::cout;
2527
// using std::endl;
@@ -152,6 +154,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
152154
signal = new MCSignal(name, "Electrons from prompt jpsi decays", {prong}, {-1});
153155
return signal;
154156
}
157+
if (!nameStr.compare("ePrimaryFromNonpromptJpsi")) {
158+
MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {503}, {false});
159+
prong.SetSourceBit(0, MCProng::kPhysicalPrimary);
160+
signal = new MCSignal(name, "Electrons from non-prompt jpsi decays with beauty in decay chain", {prong}, {-1});
161+
return signal;
162+
}
155163
if (!nameStr.compare("Jpsi")) {
156164
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false});
157165
signal = new MCSignal(name, "Inclusive jpsi", {prong}, {-1});
@@ -174,14 +182,30 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
174182
signal = new MCSignal(name, "Helium3FromTransport", {prong}, {-1});
175183
return signal;
176184
}
185+
if (!nameStr.compare("promptJpsi")) {
186+
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {true});
187+
signal = new MCSignal(name, "Prompt jpsi (not from beauty)", {prong}, {-1});
188+
return signal;
189+
}
177190
if (!nameStr.compare("nonPromptJpsi")) {
191+
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {false});
192+
signal = new MCSignal(name, "Non-prompt jpsi (from beauty)", {prong}, {-1});
193+
return signal;
194+
}
195+
if (!nameStr.compare("nonPromptJpsiFromBeauty")) {
178196
MCProng prong(2, {443, 503}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false});
179-
signal = new MCSignal(name, "Non-prompt jpsi", {prong}, {-1});
197+
signal = new MCSignal(name, "Non-prompt jpsi directly from beauty", {prong}, {-1});
180198
return signal;
181199
}
182-
if (!nameStr.compare("promptJpsi")) {
183-
MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {503}, {true});
184-
signal = new MCSignal(name, "Prompt jpsi (not from beauty)", {prong}, {-1});
200+
if (!nameStr.compare("nonPromptJpsiNotDirectlyFromBeauty")) {
201+
MCProng prong(2, {443, 503}, {true, true}, {false, true}, {0, 0}, {0, 0}, {false, false}, false, {503}, {false});
202+
signal = new MCSignal(name, "Non-prompt jpsi from other but with beauty in decay chain", {prong}, {-1});
203+
return signal;
204+
}
205+
if (!nameStr.compare("AnythingDecayToJpsi")) {
206+
MCProng prong(2, {MCProng::kPDGCodeNotAssigned, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false});
207+
prong.SetSignalInTime(true);
208+
signal = new MCSignal(name, "Decay of anything into J/psi", {prong}, {-1});
185209
return signal;
186210
}
187211
if (!nameStr.compare("eeFromNonpromptPsi2S")) {

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,10 +1216,6 @@ struct TableMakerMC {
12161216
eventMC.reserve(mcCollisions.size());
12171217
skimMCCollisions(mcCollisions);
12181218

1219-
// select MC particles to be written using the specified MC signals
1220-
// NOTE: tables are not written at this point, only label maps are being created
1221-
skimMCParticles(mcParticles, mcCollisions);
1222-
12231219
// skim collisions
12241220
event.reserve(collisions.size());
12251221
eventExtended.reserve(collisions.size());
@@ -1231,6 +1227,12 @@ struct TableMakerMC {
12311227
return;
12321228
}
12331229

1230+
// select MC particles to be written using the specified MC signals
1231+
// NOTE: tables are not written at this point, only label maps are being created
1232+
// Only skim MC particles when the MC collision is reconstructed
1233+
// Because in the first five DFs of each run, the MC collisions are not reconstructed
1234+
skimMCParticles(mcParticles, mcCollisions);
1235+
12341236
// Clear index map and reserve memory for barrel tables
12351237
if constexpr (static_cast<bool>(TTrackFillMap)) {
12361238
fTrackIndexMap.clear();

0 commit comments

Comments
 (0)