Skip to content

Commit 00c8b61

Browse files
authored
[PWGCF] lambda r2 correlation MC generator process update (#18454)
1 parent 211828c commit 00c8b61

1 file changed

Lines changed: 100 additions & 14 deletions

File tree

‎PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx‎

Lines changed: 100 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,19 @@ struct LambdaTableProducer {
266266
Configurable<bool> cSelPrimaryParticle{"cSelPrimaryParticle", false, "Select primary particle"};
267267
Configurable<bool> cSelTrueParticle{"cSelTrueParticle", false, "Select MC PDG matched particle"};
268268

269+
// MC Generator
270+
Configurable<int> cFwdMult{"cFwdMult", 500, "Fwd multiplicity axis config"};
271+
Configurable<float> cFT0AEtaMin{"cFT0AEtaMin", 3.5, "FT0A Eta Min"};
272+
Configurable<float> cFT0AEtaMax{"cFT0AEtaMax", 4.9, "FT0A Eta Max"};
273+
Configurable<float> cFT0CEtaMin{"cFT0CEtaMin", -3.3, "FT0C Eta Min"};
274+
Configurable<float> cFT0CEtaMax{"cFT0CEtaMax", -2.1, "FT0C Eta Max"};
275+
Configurable<float> cTPCEtaMin{"cTPCEtaMin", -1., "TPC Eta Min"};
276+
Configurable<float> cTPCEtaMax{"cTPCEtaMax", 1., "TPC Eta Max"};
277+
269278
// CCDB
270279
Configurable<std::string> cUrlCCDB{"cUrlCCDB", "http://alice-ccdb.cern.ch", "ALICE CCDB URL"};
271280
Configurable<std::string> cPathCCDBRecoEff{"cPathCCDBRecoEff", "Users/y/ypatley/LBF/PP/RecoEfficiency", "Path for ccdb-object for reco efficiency"};
281+
Configurable<std::string> cPathCCDBMcCent{"cPathCCDBMcCent", "Users/y/ypatley/LBF/PP/McCent/MultCent", "Path for ccdb-object for MC Gen multiplicity centrality calibration"};
272282
Configurable<int64_t> nolaterthan{"nolaterthan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
273283

274284
// Initialize CCDB Service
@@ -290,14 +300,23 @@ struct LambdaTableProducer {
290300
// Initialize Global Variables
291301
float cent = 0.;
292302
TList* ccdbObjRecoEff = nullptr;
293-
TList* ccdbObjMatchEff = nullptr;
303+
TList* ccdbObjMcCent = nullptr;
304+
TH1F* hMcFwdMult = nullptr;
294305
static constexpr auto SubDir = std::array{"QA/Lambda/", "QA/AntiLambda/"};
295306

296307
void init(InitContext const&)
297308
{
298-
// initialize axis specifications
309+
// CCDB
310+
// Set CCDB url
311+
ccdb->setURL(cUrlCCDB.value);
312+
ccdb->setCaching(true);
313+
ccdb->setLocalObjectValidityChecking();
314+
ccdb->setCreatedNotAfter(nolaterthan.value);
315+
316+
// Initialize axis specifications
299317
const AxisSpec axisCols(5, 0.5, 5.5, "");
300318
const AxisSpec axisTrks(15, 0.5, 15.5, "");
319+
const AxisSpec axisFwdMult(cFwdMult, 0, cFwdMult, "N_{ch}^{FWD}");
301320
const AxisSpec axisEffChecks(3, 0, 3, "");
302321
const AxisSpec axisCent(100, 0, 100, "Centrality(%)");
303322
const AxisSpec axisVarCent(cCentBins, "FT0C%");
@@ -363,7 +382,7 @@ struct LambdaTableProducer {
363382
histos.add("QA/Lambda/DCA/h3f_Dca_vs_pT_cent", "DCA", kTH3F, {axisCent, axisV0Pt, axisDcaLambda});
364383

365384
// MC Generated Histograms
366-
if (doprocessMCRecoGen || doprocessMCReco || doprocessMCGen) {
385+
if (doprocessMCRecoGen || doprocessMCReco) {
367386
// DCA analysis
368387
histos.add("QA/Lambda/DCA/h3f_Prm_Dca_vs_pT_cent", "Primary DCA", kTH3F, {axisCent, axisV0Pt, axisDcaLambda});
369388
histos.add("QA/Lambda/DCA/h3f_Scd_Dca_vs_pT_cent", "Weak Decay DCA", kTH3F, {axisCent, axisV0Pt, axisDcaLambda});
@@ -400,14 +419,17 @@ struct LambdaTableProducer {
400419
histos.get<TH1>(HIST("Tracks/h1f_lambda_info"))->GetXaxis()->SetBinLabel(LambdaLabels::kPassV0TopoSel, "kPassV0TopoSel");
401420
histos.get<TH1>(HIST("Tracks/h1f_lambda_info"))->GetXaxis()->SetBinLabel(LambdaLabels::kAllSelPassed, "kAllSelPassed");
402421

422+
// MC generator histograms
423+
if (doprocessMCGen) {
424+
histos.add("Events/h1f_fwdmult", "Fwd multiplicity", kTH1F, {axisFwdMult});
425+
426+
// MC Gen Mult-Cent Calibration
427+
ccdbObjMcCent = ccdb->getForTimeStamp<TList>(cPathCCDBMcCent.value, nolaterthan.value);
428+
hMcFwdMult = dynamic_cast<TH1F*>(ccdbObjMcCent->FindObject("hFwdMult"));
429+
}
430+
403431
// Load correction factor
404432
if (cGetCorrectionFlag) {
405-
// Set CCDB url
406-
ccdb->setURL(cUrlCCDB.value);
407-
ccdb->setCaching(true);
408-
ccdb->setLocalObjectValidityChecking();
409-
ccdb->setCreatedNotAfter(nolaterthan.value);
410-
411433
// Get CCDB object
412434
ccdbObjRecoEff = ccdb->getForTimeStamp<TList>(cPathCCDBRecoEff.value, nolaterthan.value);
413435

@@ -659,6 +681,59 @@ struct LambdaTableProducer {
659681
return effCorrFact;
660682
}
661683

684+
// MC generator multiplicity estimator and MB event selection
685+
template <typename P>
686+
bool multEstimator(P const& particles, int& fwdMult)
687+
{
688+
int multFT0A = 0, multFT0C = 0, multTPC = 0;
689+
690+
// Select charged particles
691+
for (auto const& particle : particles) {
692+
// Primary
693+
if (!particle.isPhysicalPrimary()) {
694+
continue;
695+
}
696+
697+
// FT0C
698+
if (particle.eta() > cFT0CEtaMin && particle.eta() < cFT0CEtaMax) {
699+
++multFT0C;
700+
}
701+
702+
// FT0A
703+
if (particle.eta() > cFT0AEtaMin && particle.eta() < cFT0AEtaMax) {
704+
++multFT0A;
705+
}
706+
707+
// Central barrel (ITS + TPC)
708+
if (particle.eta() > cTPCEtaMin && particle.eta() < cTPCEtaMax) {
709+
++multTPC;
710+
}
711+
}
712+
713+
int multFT0M = multFT0A + multFT0C;
714+
fwdMult = multFT0M;
715+
716+
// Minimum bias trigger (1 track in A side, 1 track in C side, 1 track in central barrel)
717+
if (multFT0A > 0 && multFT0C > 0 && multTPC > 0) {
718+
return true;
719+
}
720+
721+
return false;
722+
}
723+
724+
// MC generator centrality
725+
float getMcCentrality(int mult)
726+
{
727+
float totalArea = hMcFwdMult->Integral();
728+
float area = 0.;
729+
int nx = hMcFwdMult->GetNbinsX();
730+
int bin = hMcFwdMult->GetXaxis()->FindBin(mult + 0.5);
731+
for (int i = bin; i <= nx; ++i) {
732+
area += hMcFwdMult->GetBinContent(i);
733+
}
734+
return (area / totalArea) * 100.;
735+
}
736+
662737
// Lambda QA
663738
template <ParticleType part, typename C, typename V, typename T>
664739
void fillLambdaQAHistos(C const& col, V const& v0, T const&)
@@ -905,11 +980,7 @@ struct LambdaTableProducer {
905980
void processMCReco(soa::Join<Collisions, aod::McCollisionLabels>::iterator const& collision, aod::McCollisions const&, BCsRun3 const& bc,
906981
McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&)
907982
{
908-
// check collision
909-
if (!selCollision(collision)) {
910-
return;
911-
}
912-
fillLambdaRecoTables<kMC>(collision, bc, V0s, tracks);
983+
fillLambdaRecoTables<kData>(collision, bc, V0s, tracks);
913984
}
914985

915986
PROCESS_SWITCH(LambdaTableProducer, processMCReco, "Process for McReco DATA", false);
@@ -926,6 +997,21 @@ struct LambdaTableProducer {
926997

927998
void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles)
928999
{
1000+
// Multiplicity estimation
1001+
int fwdMult = 0;
1002+
bool eventTrig = multEstimator(mcParticles, fwdMult);
1003+
1004+
// MB event selection
1005+
if (!eventTrig) {
1006+
return;
1007+
}
1008+
1009+
// Fill fwd multiplicity histogram
1010+
histos.fill(HIST("Events/h1f_fwdmult"), fwdMult);
1011+
1012+
// Get centrality
1013+
cent = getMcCentrality(fwdMult);
1014+
9291015
// Fill McGen Collision Table
9301016
lambdaMCGenCollisionTable(cent, mcCollision.posX(), mcCollision.posY(), mcCollision.posZ());
9311017

0 commit comments

Comments
 (0)