Skip to content

Commit e80e0cd

Browse files
authored
[PWGCF] Update lambdaR2Correlation.cxx (#11055)
1 parent 2ea0b7d commit e80e0cd

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ struct LambdaTableProducer {
257257
Configurable<float> cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"};
258258
Configurable<float> cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"};
259259
Configurable<bool> cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"};
260+
Configurable<bool> cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"};
261+
Configurable<int> cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"};
262+
Configurable<bool> cGenProcessFlag{"cGenProcessFlag", true, "Generater Level Table Selection"};
260263

261264
// V0s MC
262265
Configurable<bool> cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"};
@@ -390,7 +393,7 @@ struct LambdaTableProducer {
390393
histos.addClone("McRec/Lambda/", "McRec/AntiLambda/");
391394

392395
// MC Generated Histograms
393-
if (doprocessMCRun3 || doprocessMCRun2) {
396+
if (doprocessMCRun3 || doprocessMCRun2 || doprocessRecoGen) {
394397
// McReco Histos
395398
histos.add("Tracks/h2f_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt});
396399
histos.add("Tracks/h2f_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt});
@@ -982,6 +985,11 @@ struct LambdaTableProducer {
982985
continue;
983986
}
984987

988+
// Select V0 Type Selection
989+
if (cV0TypeSelFlag && v0.v0Type() != cV0TypeSelection) {
990+
continue;
991+
}
992+
985993
histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed);
986994

987995
// we have v0 as lambda
@@ -1213,6 +1221,60 @@ struct LambdaTableProducer {
12131221
}
12141222

12151223
PROCESS_SWITCH(LambdaTableProducer, processMCRun2, "Process for Run2 MC RecoGen", false);
1224+
1225+
void processRecoGen(soa::Join<CollisionsRun3, aod::McCollisionLabels>::iterator const& collision,
1226+
soa::Join<aod::McCollisions, aod::McCentFT0Ms> const&,
1227+
McV0Tracks const& V0s, TracksMC const& tracks,
1228+
aod::McParticles const& mcParticles)
1229+
{
1230+
// Select Collision
1231+
if (!selCollision<kRun3>(collision) || !collision.has_mcCollision()) {
1232+
return;
1233+
}
1234+
1235+
// Fill Reco Table
1236+
fillLambdaRecoTables<kRun3, kMC>(collision, V0s, tracks);
1237+
1238+
// Get Generator Level Collision and Particles
1239+
auto mcCollision = collision.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1240+
auto mcGenParticles = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache);
1241+
1242+
if (cGenProcessFlag) {
1243+
fillLambdaMcGenTables<kRun3>(mcCollision, mcGenParticles);
1244+
return;
1245+
}
1246+
1247+
// Fill Gen Table
1248+
lambdaMCGenCollisionTable(mcCollision.centFT0M(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ());
1249+
1250+
// initialize track objects
1251+
ParticleType v0Type = kLambda;
1252+
for (auto const& mcpart : mcGenParticles) {
1253+
if (!mcpart.isPhysicalPrimary()) {
1254+
continue;
1255+
}
1256+
1257+
if (std::abs(mcpart.y()) > cMaxV0Rap) {
1258+
continue;
1259+
}
1260+
1261+
// check for Lambda first
1262+
if (mcpart.pdgCode() == kLambda0) {
1263+
v0Type = kLambda;
1264+
} else if (mcpart.pdgCode() == kLambda0Bar) {
1265+
v0Type = kAntiLambda;
1266+
} else {
1267+
continue;
1268+
}
1269+
1270+
// Fill Lambda McGen Table
1271+
lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(),
1272+
mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()),
1273+
99., -97., (int8_t)v0Type, -999., -999., 1.);
1274+
}
1275+
}
1276+
1277+
PROCESS_SWITCH(LambdaTableProducer, processRecoGen, "Process for MC RecoGen", false);
12161278
};
12171279

12181280
struct LambdaTracksExtProducer {

0 commit comments

Comments
 (0)