@@ -137,7 +137,6 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
137137AxisSpec axisEtaExtended{100 , -5 , 5 , " #eta" , " EtaAxisExtended" };
138138AxisSpec axisPhi{{0 , o2::constants::math::PIQuarter, o2::constants::math::PIHalf, o2::constants::math::PIQuarter * 3 ., o2::constants::math::PI, o2::constants::math::PIQuarter * 5 ., o2::constants::math::PIHalf * 3 ., o2::constants::math::PIQuarter * 7 ., o2::constants::math::TwoPI}, " #phi" , " PhiAxis" };
139139AxisSpec axisPhi2{629 , 0 , o2::constants::math::TwoPI, " #phi" };
140- AxisSpec axisCent{100 , 0 , 100 , " #Cent" };
141140AxisSpec axisTrackType = {kTrackTypeend - 1 , +kTrackTypebegin + 0.5 , +kTrackTypeend - 0.5 , " " , " TrackTypeAxis" };
142141AxisSpec axisGenPtVary = {kGenpTend - 1 , +kGenpTbegin + 0.5 , +kGenpTend - 0.5 , " " , " GenpTVaryAxis" };
143142AxisSpec axisSpecies = {kSpeciesend - 1 , +kSpeciesbegin + 0.5 , +kSpeciesend - 0.5 , " " , " SpeciesAxis" };
@@ -213,6 +212,7 @@ struct HeavyionMultiplicity {
213212 Configurable<bool > isApplyTVX{" isApplyTVX" , false , " Enable TVX trigger sel" };
214213 Configurable<bool > isApplyExtraPhiCut{" isApplyExtraPhiCut" , false , " Enable extra phi cut" };
215214 Configurable<bool > isApplyBestCollIndex{" isApplyBestCollIndex" , true , " " };
215+ Configurable<bool > isApplyGenMult{" isApplyGenMult" , false , " Enable MultMC in ProcessMC for MC closure" };
216216
217217 Configurable<bool > selectCollidingBCs{" selectCollidingBCs" , true , " BC analysis: select colliding BCs" };
218218 Configurable<bool > selectTVX{" selectTVX" , true , " BC analysis: select TVX" };
@@ -252,15 +252,15 @@ struct HeavyionMultiplicity {
252252 if (doprocessData) {
253253 histos.add (" hdcaxy" , " dca to pv in the xy plane" , kTH1D , {dcaAxis}, false );
254254 histos.add (" hdcaz" , " dca to pv in the z axis" , kTH1D , {dcaAxis}, false );
255- histos.add (" CentPercentileHist" , " CentPercentileHist" , kTH1D , {axisCent }, false );
255+ histos.add (" CentPercentileHist" , " CentPercentileHist" , kTH1D , {centAxis }, false );
256256 histos.add (" hdatazvtxcent" , " hdatazvtxcent" , kTH3D , {axisVtxZ, centAxis, axisOccupancy}, false );
257257 histos.add (" PhiVsEtaHist" , " PhiVsEtaHist" , kTH2D , {axisPhi2, axisEta}, false );
258258 histos.add (" hdatadndeta" , " hdatadndeta" , kTHnSparseD , {axisVtxZ, centAxis, axisOccupancy, axisEta, axisPhi, axisTrackType}, false );
259259 histos.add (" hdatadndetaMB" , " hdatadndetaMB" , kTHnSparseD , {axisVtxZ, axisEta, axisPhi}, false );
260260 }
261261
262262 if (doprocessMonteCarlo || doprocessMCcheckFakeTracks) {
263- histos.add (" CentPercentileMCRecHist" , " CentPercentileMCRecHist" , kTH1D , {axisCent }, false );
263+ histos.add (" CentPercentileMCRecHist" , " CentPercentileMCRecHist" , kTH1D , {centAxis }, false );
264264 histos.add (" hmczvtxcent" , " hmczvtxcent" , kTH3D , {axisVtxZ, centAxis, axisOccupancy}, false );
265265 }
266266
@@ -328,24 +328,24 @@ struct HeavyionMultiplicity {
328328 histos.add (" hMultEta05GenwithNoreco" , " multiplicity in eta<0.5 of generated MC events, with no recoevent" , kTH1F , {multAxis});
329329 histos.add (" hMultEta05Gen" , " multiplicity in eta<0.5 of generated MC events" , kTH1F , {multAxis});
330330 histos.add (" hMultEta05Rec" , " multiplicity in eta<0.5 of selected MC events" , kTH1F , {multAxis});
331- histos.add (" hMultEta05vsCentrRec" , " multiplicity in eta<0.5 of selected MC events vs centrality" , kTH2F , {axisCent , multAxis});
331+ histos.add (" hMultEta05vsCentrRec" , " multiplicity in eta<0.5 of selected MC events vs centrality" , kTH2F , {centAxis , multAxis});
332332 histos.add (" hgendndetaVsMultEta05BeforeEvtSel" , " hgendndetaBeforeEvtSel vs multiplicity in eta<0.5" , kTH2F , {axisEta, multAxis});
333333 histos.add (" hgendndetaVsMultEta05AfterEvtSel" , " hgendndetaAfterEvtSel vs multiplicity in eta<0.5" , kTH2F , {axisEta, multAxis});
334334 histos.add (" hImpactParameterSplit" , " Impact parameter of selected and split MC events" , kTH1F , {impactParAxis});
335335 histos.add (" hMultEta05Split" , " multiplicity in eta<0.5 of selected and split MC events" , kTH1F , {multAxis});
336336 histos.add (" hMultSplit" , " multiplicity of selected and split MC events" , kTH1F , {axisFt0cMult});
337- histos.add (" hMultvsCentrSplit" , " multiplicity of selected and split MC events vs centrality " , kTH2F , {axisCent , axisFt0cMult});
337+ histos.add (" hMultvsCentrSplit" , " multiplicity of selected and split MC events vs centrality " , kTH2F , {centAxis , axisFt0cMult});
338338
339339 histos.add (" hMultGen" , " multiplicity of generated MC events" , kTH1F , {axisFt0cMult});
340340 histos.add (" hMultRec" , " multiplicity of selected MC events" , kTH1F , {axisFt0cMult});
341- histos.add (" hMultvsCentrRec" , " multiplicity of selected MC events vs centrality" , kTH2F , {axisCent , axisFt0cMult});
341+ histos.add (" hMultvsCentrRec" , " multiplicity of selected MC events vs centrality" , kTH2F , {centAxis , axisFt0cMult});
342342 histos.add (" hgendndetaVsMultBeforeEvtSel" , " hgendndetaBeforeEvtSel vs multiplicity" , kTH2F , {axisEta, axisFt0cMult});
343343 histos.add (" hgendndetaVsMultAfterEvtSel" , " hgendndetaAfterEvtSel vs multiplicity" , kTH2F , {axisEta, axisFt0cMult});
344344
345345 histos.add (" hImpactParameterGenwithNoreco" , " Impact parameter of generated MC events, with no recoevent" , kTH1F , {impactParAxis});
346346 histos.add (" hImpactParameterGen" , " Impact parameter of generated MC events" , kTH1F , {impactParAxis});
347347 histos.add (" hImpactParameterRec" , " Impact parameter of selected MC events" , kTH1F , {impactParAxis});
348- histos.add (" hImpactParvsCentrRec" , " Impact parameter of selected MC events vs centrality" , kTH2F , {axisCent , impactParAxis});
348+ histos.add (" hImpactParvsCentrRec" , " Impact parameter of selected MC events vs centrality" , kTH2F , {centAxis , impactParAxis});
349349 histos.add (" hgendndetaBeforeEvtSel" , " Eta of all generated particles" , kTH1F , {axisEta});
350350 histos.add (" hgendndetaAfterEvtSel" , " Eta of generated particles after EvtSel" , kTH1F , {axisEta});
351351 histos.add (" hgendndetaVscentBeforeEvtSel" , " hgendndetaBeforeEvtSel vs centrality" , kTH2F , {axisEta, impactParAxis});
@@ -362,8 +362,8 @@ struct HeavyionMultiplicity {
362362
363363 histos.add (" hRecMCvertexZ" , " hRecMCvertexZ" , kTH1D , {axisVtxZ}, false );
364364 histos.add (" hRecMCvtxzcent" , " hRecMCvtxzcent" , kTH3D , {axisVtxZ, centAxis, axisOccupancy}, false );
365- histos.add (" hRecMCcentrality" , " hRecMCcentrality" , kTH1D , {axisCent }, false );
366- histos.add (" MCCentrality_vs_FT0C" , " MCCentrality_vs_FT0C" , kTH2F , {axisCent , axisFt0cMult}, true );
365+ histos.add (" hRecMCcentrality" , " hRecMCcentrality" , kTH1D , {centAxis }, false );
366+ histos.add (" MCCentrality_vs_FT0C" , " MCCentrality_vs_FT0C" , kTH2F , {centAxis , axisFt0cMult}, true );
367367 histos.add (" hRecMCphivseta" , " hRecMCphivseta" , kTH2D , {axisPhi2, axisEta}, false );
368368 histos.add (" hRecMCdndeta" , " hRecMCdndeta" , kTHnSparseD , {axisVtxZ, centAxis, axisOccupancy, axisEta, axisPhi, axisRecTrkType}, false );
369369 histos.add (" etaResolution" , " etaResolution" , kTH2D , {axisEta, axisDeltaEta});
@@ -377,8 +377,10 @@ struct HeavyionMultiplicity {
377377 x->SetBinLabel (2 , " Colliding BCs" );
378378 x->SetBinLabel (3 , " TVX" );
379379 x->SetBinLabel (4 , " FV0OrA" );
380- histos.add (" BcCentFT0CHist" , " BcCentFT0CHist" , kTH1D , {axisCent}, false );
381- histos.add (" BcCentFT0MHist" , " BcCentFT0MHist" , kTH1D , {axisCent}, false );
380+ x->SetBinLabel (5 , " VtxZ" );
381+ histos.add (" BcCentFT0CHist" , " BcCentFT0CHist" , kTH1D , {centAxis}, false );
382+ histos.add (" BcCentFT0MHist" , " BcCentFT0MHist" , kTH1D , {centAxis}, false );
383+ histos.add (" VtxZHistBC" , " VtxZHistBC" , kTH1D , {axisVtxZ}, false );
382384 }
383385 }
384386
@@ -577,7 +579,7 @@ struct HeavyionMultiplicity {
577579 histos.fill (HIST (" NPVtracks_vs_GlobalMult" ), cols.multNTracksPV (), nchTracks);
578580 }
579581
580- void processMonteCarlo (soa::Join<CollisionMCTrueTable, aod::McCollsExtra>::iterator const & mcCollision, CollisionMCRecTable const & RecCols, TrackMCTrueTable const & GenParticles, FilTrackMCRecTable const & RecTracks)
582+ void processMonteCarlo (soa::Join<CollisionMCTrueTable, aod::McCollsExtra, aod::MultMCExtras >::iterator const & mcCollision, CollisionMCRecTable const & RecCols, TrackMCTrueTable const & GenParticles, FilTrackMCRecTable const & RecTracks)
581583 {
582584 for (const auto & RecCol : RecCols) {
583585 if (!isEventSelected (RecCol)) {
@@ -586,17 +588,23 @@ struct HeavyionMultiplicity {
586588 if (RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
587589 continue ;
588590 }
591+ auto centrality = 0 ;
592+ if (isApplyGenMult)
593+ centrality = selColMultMC (mcCollision);
594+ else
595+ centrality = selColCent (RecCol);
596+
589597 histos.fill (HIST (" VtxZHist" ), RecCol.posZ ());
590- histos.fill (HIST (" CentPercentileMCRecHist" ), selColCent (RecCol) );
591- histos.fill (HIST (" hmczvtxcent" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol));
598+ histos.fill (HIST (" CentPercentileMCRecHist" ), centrality );
599+ histos.fill (HIST (" hmczvtxcent" ), RecCol.posZ (), centrality , selColOccu (RecCol));
592600 auto recTracksPart = RecTracks.sliceBy (perCollision, RecCol.globalIndex ());
593601 std::vector<int > mclabels;
594602 for (const auto & Rectrack : recTracksPart) {
595603 if (!isTrackSelected (Rectrack)) {
596604 continue ;
597605 }
598606 if (!Rectrack.has_mcParticle ()) {
599- histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kBkg ), kGlobalplusITS );
607+ histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), centrality , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kBkg ), kGlobalplusITS );
600608 histos.fill (HIST (" hmcrecdndetaMB" ), RecCol.posZ (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kBkg ));
601609 continue ;
602610 }
@@ -607,12 +615,12 @@ struct HeavyionMultiplicity {
607615 histos.fill (HIST (" hmcdcaxy" ), Rectrack.dcaXY ());
608616 histos.fill (HIST (" hmcdcaz" ), Rectrack.dcaZ ());
609617 histos.fill (HIST (" MCrecPhiVsEtaHist" ), Rectrack.phi (), Rectrack.eta ());
610- histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalplusITS );
618+ histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), centrality , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalplusITS );
611619 histos.fill (HIST (" hmcrecdndetaMB" ), RecCol.posZ (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ));
612620 if (Rectrack.hasTPC ()) {
613- histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalonly );
621+ histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), centrality , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kGlobalonly );
614622 } else {
615- histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kITSonly );
623+ histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), centrality , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kSpAll ), kITSonly );
616624 }
617625
618626 int pid = kFake ;
@@ -644,22 +652,22 @@ struct HeavyionMultiplicity {
644652 pid = kFake ;
645653 }
646654 mclabels.push_back (Rectrack.mcParticleId ());
647- histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), selColCent (RecCol) , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(pid), kGlobalplusITS );
655+ histos.fill (HIST (" hmcrecdndeta" ), RecCol.posZ (), centrality , selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(pid), kGlobalplusITS );
648656 histos.fill (HIST (" hmcrecdndetaMB" ), RecCol.posZ (), Rectrack.eta (), Rectrack.phi (), static_cast <double >(pid));
649657 } // track (mcrec) loop
650658
651659 for (const auto & particle : GenParticles) {
652660 if (!isGenTrackSelected (particle)) {
653661 continue ;
654662 }
655- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kNoGenpTVar );
663+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kNoGenpTVar );
656664 histos.fill (HIST (" hmcgendndetaMB" ), RecCol.posZ (), particle.eta (), particle.phi (), static_cast <double >(kSpAll ));
657665 if (particle.pt () < KminPtCut) {
658- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup , -10.0 * particle.pt () + 2 );
659- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown , 5.0 * particle.pt () + 0.5 );
666+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup , -10.0 * particle.pt () + 2 );
667+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown , 5.0 * particle.pt () + 0.5 );
660668 } else {
661- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup );
662- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown );
669+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTup );
670+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(kSpAll ), kGenpTdown );
663671 }
664672 int pid = 0 ;
665673 switch (std::abs (particle.pdgCode ())) {
@@ -676,7 +684,7 @@ struct HeavyionMultiplicity {
676684 pid = kSpOther ;
677685 break ;
678686 }
679- histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), selColCent (RecCol) , particle.eta (), particle.phi (), static_cast <double >(pid), kNoGenpTVar );
687+ histos.fill (HIST (" hmcgendndeta" ), RecCol.posZ (), centrality , particle.eta (), particle.phi (), static_cast <double >(pid), kNoGenpTVar );
680688 histos.fill (HIST (" hmcgendndetaMB" ), RecCol.posZ (), particle.eta (), particle.phi (), static_cast <double >(pid));
681689 } // track (mcgen) loop
682690 } // collision loop
@@ -1011,6 +1019,15 @@ struct HeavyionMultiplicity {
10111019 if (selectFV0OrA && !multbc.multFV0OrA ())
10121020 return ;
10131021 histos.fill (HIST (" BcHist" ), 4 ); // FV0OrA
1022+ if (vtxRange < 100 .0f ) {
1023+ if (!multbc.multFT0PosZValid ())
1024+ return ;
1025+ if (TMath::Abs (multbc.multFT0PosZ ()) > vtxRange)
1026+ return ;
1027+ histos.fill (HIST (" VtxZHistBC" ), multbc.multFT0PosZ ());
1028+ }
1029+ histos.fill (HIST (" BcHist" ), 5 ); // FT0PosZ
1030+
10141031 histos.fill (HIST (" BcCentFT0CHist" ), multbc.centFT0C ());
10151032 histos.fill (HIST (" BcCentFT0MHist" ), multbc.centFT0M ());
10161033 }
0 commit comments