Skip to content

Commit fdccc51

Browse files
committed
Added histograms for purity testing
1 parent 514fd94 commit fdccc51

File tree

2 files changed

+92
-7
lines changed

2 files changed

+92
-7
lines changed

PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,11 @@ void fillNSigmaHistos(TrackObject const& track)
14091409
fhNSigmaCombo[kIdBfProton]->Fill(sqrtf(track.tofNSigmaPr() * track.tofNSigmaPr() + actualTPCNSigmaPr * actualTPCNSigmaPr), track.tpcInnerParam());
14101410
}
14111411

1412+
1413+
/// \brief Identifies the passed track with TPC and TOF data
1414+
/// \param track the track of interest
1415+
/// \return the internal track id, -1 if not accepted
1416+
14121417
template <typename TrackObject>
14131418
inline MatchRecoGenSpecies IdentifiedBfFilterTracks::identifyTrack(TrackObject const& track)
14141419
{
@@ -1518,10 +1523,7 @@ inline MatchRecoGenSpecies IdentifiedBfFilterTracks::identifyTrack(TrackObject c
15181523
/// \brief Accepts or not the passed track
15191524
/// \param track the track of interest
15201525
/// \return the internal track id, -1 if not accepted
1521-
/// TODO: the PID implementation
1522-
/// For the time being we keep the convention
1523-
/// - positive track pid even
1524-
/// - negative track pid odd
1526+
15251527
template <typename TrackObject>
15261528
inline int8_t IdentifiedBfFilterTracks::acceptTrack(TrackObject const& track)
15271529
{

PWGCF/TwoParticleCorrelations/Tasks/identifiedbf.cxx

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ struct IdentifiedBfCorrelationsTask {
8989
std::vector<TH2F*> fhN1_vsEtaPhi{nch, nullptr}; //!<! weighted single particle distribution vs \f$\eta,\;\phi\f$, for the different species
9090
std::vector<TH2F*> fhSum1Pt_vsEtaPhi{nch, nullptr}; //!<! accumulated sum of weighted \f$p_T\f$ vs \f$\eta,\;\phi\f$, for the different species
9191
std::vector<TH3F*> fhN1_vsZEtaPhiPt{nch, nullptr}; //!<! single particle distribution vs \f$\mbox{vtx}_z,\; \eta,\;\phi,\;p_T\f$, for the different species
92+
std::vector<TH3F*> fhN1_vsZEtaPhiPtPrimary{nch, nullptr}; //!<! single particle distribution of primary particles vs \f$\mbox{vtx}_z,\; \eta,\;\phi,\;p_T\f$, for the different species
93+
std::vector<TH3F*> fhN1_vsZEtaPhiPtSecondary{nch, nullptr}; //!<! single particle distribution of primary particles vs \f$\mbox{vtx}_z,\; \eta,\;\phi,\;p_T\f$, for the different species
9294
std::vector<TH3F*> fhSum1Pt_vsZEtaPhiPt{nch, nullptr}; //!<! accumulated sum of weighted \f$p_T\f$ vs \f$\mbox{vtx}_z,\; \eta,\;\phi,\;p_T\f$, for the different species
9395
std::vector<TH3*> fhNuaNue_vsZEtaPhiPt{nch, nullptr}; //!<! NUA+NUE correction vs \f$\mbox{vtx}_z,\; \eta,\;\phi,\;p_T\f$, for the differents species
9496
std::vector<TH2*> fhPtAvg_vsEtaPhi{nch, nullptr}; //!<! average \f$p_T\f$ vs \f$\eta,\;\phi\f$, for the different species
@@ -261,6 +263,31 @@ struct IdentifiedBfCorrelationsTask {
261263
return ptavg;
262264
}
263265

266+
267+
/// \brief checks whether MC track is a physical primary or secondary
268+
/// \param track passed MC track converted to MCParticle
269+
template <typename TrackObject>
270+
void trackPrimaryCheck(TrackObject const& track, float zvtx, float corr)
271+
{
272+
if constexpr (framework::has_type_v<aod::mctracklabel::McParticleId, typename TrackObject::all_columns>) {
273+
if(isPrimaryCheck(track.template mcParticle_as<aod::McParticles>())){
274+
fhN1_vsZEtaPhiPtPrimary[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), corr);
275+
}
276+
else{
277+
fhN1_vsZEtaPhiPtSecondary[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), corr);
278+
}
279+
}
280+
}
281+
282+
/// \brief checks whether MC track is a physical primary or secondary
283+
/// \param particle passed MC track converted to MCParticle
284+
template <typename ParticleObject>
285+
bool isPrimaryCheck(ParticleObject const& particle)
286+
{
287+
return particle.isPhysicalPrimary();
288+
}
289+
290+
264291
/// \brief fills the singles histograms in singles execution mode
265292
/// \param passedtracks filtered table with the tracks associated to the passed index
266293
/// \param tix index, in the singles histogram bank, for the passed filetered track table
@@ -277,6 +304,7 @@ struct IdentifiedBfCorrelationsTask {
277304
} else {
278305
fhN1_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), corr);
279306
fhSum1Pt_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), track.pt() * corr);
307+
trackPrimaryCheck(track, zvtx, corr);
280308
}
281309
index++;
282310
}
@@ -515,6 +543,41 @@ struct IdentifiedBfCorrelationsTask {
515543
ptbins,
516544
ptlow,
517545
ptup);
546+
547+
fhN1_vsZEtaPhiPtPrimary[i] = new TH3F(
548+
TString::Format("n1_%s_Primary_vsZ_vsEtaPhi_vsPt", tname[i].c_str()).Data(),
549+
TString::Format("#LT n_{1} Primary #GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)",
550+
tname[i].c_str(),
551+
tname[i].c_str(),
552+
tname[i].c_str())
553+
.Data(),
554+
zvtxbins,
555+
zvtxlow,
556+
zvtxup,
557+
etabins * phibins,
558+
0.0,
559+
static_cast<double>(etabins * phibins),
560+
ptbins,
561+
ptlow,
562+
ptup);
563+
564+
fhN1_vsZEtaPhiPtSecondary[i] = new TH3F(
565+
TString::Format("n1_%s_Secondary_vsZ_vsEtaPhi_vsPt", tname[i].c_str()).Data(),
566+
TString::Format("#LT n_{1} Secondary #GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)",
567+
tname[i].c_str(),
568+
tname[i].c_str(),
569+
tname[i].c_str())
570+
.Data(),
571+
zvtxbins,
572+
zvtxlow,
573+
zvtxup,
574+
etabins * phibins,
575+
0.0,
576+
static_cast<double>(etabins * phibins),
577+
ptbins,
578+
ptlow,
579+
ptup);
580+
518581
fhSum1Pt_vsZEtaPhiPt[i] = new TH3F(
519582
TString::Format("sumPt1_%s_vsZ_vsEtaPhi_vsPt", tname[i].c_str()).Data(),
520583
TString::Format(
@@ -546,6 +609,10 @@ struct IdentifiedBfCorrelationsTask {
546609
} else {
547610
fhN1_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW);
548611
fhN1_vsZEtaPhiPt[i]->Sumw2(false);
612+
fhN1_vsZEtaPhiPtPrimary[i]->SetBit(TH1::kIsNotW);
613+
fhN1_vsZEtaPhiPtPrimary[i]->Sumw2(false);
614+
fhN1_vsZEtaPhiPtSecondary[i]->SetBit(TH1::kIsNotW);
615+
fhN1_vsZEtaPhiPtSecondary[i]->Sumw2(false);
549616
fhSum1Pt_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW);
550617
fhSum1Pt_vsZEtaPhiPt[i]->Sumw2(false);
551618
}
@@ -558,6 +625,8 @@ struct IdentifiedBfCorrelationsTask {
558625
fOutputList->Add(fhSum1Pt_vsEtaPhi[i]);
559626
} else {
560627
fOutputList->Add(fhN1_vsZEtaPhiPt[i]);
628+
fOutputList->Add(fhN1_vsZEtaPhiPtPrimary[i]);
629+
fOutputList->Add(fhN1_vsZEtaPhiPtSecondary[i]);
561630
fOutputList->Add(fhSum1Pt_vsZEtaPhiPt[i]);
562631
}
563632
}
@@ -1059,13 +1128,13 @@ struct IdentifiedBfCorrelationsTask {
10591128
Filter onlyacceptedcollisions = (aod::identifiedbffilter::collisionaccepted == uint8_t(true));
10601129
Filter onlyacceptedtracks = (aod::identifiedbffilter::trackacceptedid >= int8_t(0));
10611130

1062-
void processRecLevel(soa::Filtered<aod::IdentifiedBfCFAcceptedCollisions>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered<aod::ScannedTracks>& tracks)
1131+
void processRecLevel(soa::Filtered<aod::IdentifiedBfCFAcceptedCollisions>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered<aod::ScannedTracks>& tracks, aod::McParticles const&)
10631132
{
10641133
processSame<false>(collision, tracks, collision.bc_as<aod::BCsWithTimestamps>().timestamp());
10651134
}
10661135
PROCESS_SWITCH(IdentifiedBfCorrelationsTask, processRecLevel, "Process reco level correlations", false);
10671136

1068-
void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks& tracks)
1137+
void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks& tracks, aod::McParticles const&)
10691138
{
10701139
int nAssignedTracks = 0;
10711140
int nNotAssignedTracks = 0;
@@ -1122,7 +1191,8 @@ struct IdentifiedBfCorrelationsTask {
11221191
void processRecLevelNotStored(
11231192
soa::Filtered<soa::Join<aod::Collisions, aod::IdentifiedBfCFCollisionsInfo>>::iterator const& collision,
11241193
aod::BCsWithTimestamps const&,
1125-
soa::Filtered<soa::Join<aod::Tracks, aod::IdentifiedBfCFTracksInfo>>& tracks)
1194+
soa::Filtered<soa::Join<aod::Tracks, aod::IdentifiedBfCFTracksInfo>>& tracks,
1195+
aod::McParticles const&)
11261196
{
11271197
processSame<false>(collision, tracks, collision.bc_as<aod::BCsWithTimestamps>().timestamp());
11281198
}
@@ -1131,6 +1201,19 @@ struct IdentifiedBfCorrelationsTask {
11311201
"Process reco level correlations for not stored derived data",
11321202
true);
11331203

1204+
void processDetLevelNotStored(
1205+
soa::Filtered<soa::Join<aod::Collisions, aod::IdentifiedBfCFCollisionsInfo>>::iterator const& collision,
1206+
aod::BCsWithTimestamps const&,
1207+
soa::Filtered<soa::Join<aod::Tracks, aod::McTrackLabels, aod::IdentifiedBfCFTracksInfo>>& tracks,
1208+
aod::McParticles const&)
1209+
{
1210+
processSame<false>(collision, tracks, collision.bc_as<aod::BCsWithTimestamps>().timestamp());
1211+
}
1212+
PROCESS_SWITCH(IdentifiedBfCorrelationsTask,
1213+
processDetLevelNotStored,
1214+
"Process detecotr level correlations for not stored derived data",
1215+
true);
1216+
11341217
void processGenLevel(
11351218
soa::Filtered<aod::IdentifiedBfCFAcceptedTrueCollisions>::iterator const& collision,
11361219
soa::Filtered<soa::Join<aod::McParticles, aod::IdentifiedBfCFGenTracksInfo>>& tracks)

0 commit comments

Comments
 (0)