Skip to content

Commit

Permalink
Common: extra centrality study histos
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobrigk committed May 2, 2024
1 parent 1b5db5b commit b0658b4
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion Common/Tasks/centralityStudy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "TH1F.h"
Expand Down Expand Up @@ -57,6 +58,10 @@ struct centralityStudy {
ConfigurableAxis axisMultITSOnly{"axisMultITSOnly", {200, 0, 6000}, "Number of ITS only tracks"};
ConfigurableAxis axisMultITSTPC{"axisMultITSTPC", {200, 0, 6000}, "Number of ITSTPC matched tracks"};

// For centrality studies if requested
ConfigurableAxis axisCentrality{"axisCentrality", {100, 0, 100}, "FT0C percentile"};
ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"};

void init(InitContext&)
{
if (doprocessCollisions) {
Expand Down Expand Up @@ -86,10 +91,22 @@ struct centralityStudy {
histos.add("hFT0CvsNContribs", "hFT0CvsNContribs", kTH2F, {axisMultPVContributors, axisMultFT0C});
histos.add("hMatchedVsITSOnly", "hMatchedVsITSOnly", kTH2F, {axisMultITSOnly, axisMultITSTPC});
}

if (doprocessCollisionsWithCentrality) {
// in case requested: do vs centrality debugging
histos.add("hNContribsVsCentrality", "hNContribsVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors});
histos.add("hNITSTPCTracksVsCentrality", "hNITSTPCTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors});
histos.add("hNITSOnlyTracksVsCentrality", "hNITSOnlyTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors});
histos.add("hNGlobalTracksVsCentrality", "hNGlobalTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors});
histos.add("hPVChi2VsCentrality", "hPVChi2VsCentrality", kTH2F, {axisCentrality, axisPVChi2});
}
}

void processCollisions(soa::Join<aod::Mults, aod::MultsExtra, aod::MultSelections>::iterator const& collision)
template <typename TCollision>
void genericProcessCollision(TCollision collision)
// process this collisions
{

histos.fill(HIST("hCollisionSelection"), 0); // all collisions
if (applySel8 && !collision.multSel8())
return;
Expand Down Expand Up @@ -143,6 +160,27 @@ struct centralityStudy {
histos.fill(HIST("hFT0CvsNContribs"), collision.multNTracksPV(), collision.multFT0C());
histos.fill(HIST("hMatchedVsITSOnly"), collision.multNTracksITSOnly(), collision.multNTracksITSTPC());
}

// if the table has centrality information
if constexpr (requires { collision.centFT0C(); }) {
// process FT0C centrality plots
histos.fill(HIST("hNContribsVsCentrality"), collision.centFT0C(), collision.multPVTotalContributors());
histos.fill(HIST("hNITSTPCTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSOnly());
histos.fill(HIST("hNITSOnlyTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSOnly());
histos.fill(HIST("hNGlobalTracksVsCentrality"), collision.centFT0C(), collision.multNTracksGlobal());
histos.fill(HIST("hPVChi2VsCentrality"), collision.centFT0C(), collision.multPVChi2());

}
}

void processCollisions(soa::Join<aod::Mults, aod::MultsExtra, aod::MultSelections>::iterator const& collision)
{
genericProcessCollision(collision);
}

void processCollisionsWithCentrality(soa::Join<aod::Mults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal>::iterator const& collision)
{
genericProcessCollision(collision);
}

void processBCs(aod::MultsBC::iterator const& multbc)
Expand All @@ -165,6 +203,7 @@ struct centralityStudy {
}

PROCESS_SWITCH(centralityStudy, processCollisions, "per-collision analysis", true);
PROCESS_SWITCH(centralityStudy, processCollisionsWithCentrality, "per-collision analysis", true);
PROCESS_SWITCH(centralityStudy, processBCs, "per-BC analysis", true);
};

Expand Down

0 comments on commit b0658b4

Please sign in to comment.