From 245db43754aada76f3602b5166d203e840ac691e Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 14 Nov 2021 20:32:29 +0100 Subject: [PATCH 1/2] Centrality estimation using SPD tracklets --- Common/TableProducer/centralityTable.cxx | 72 +++++++++++++++--------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/Common/TableProducer/centralityTable.cxx b/Common/TableProducer/centralityTable.cxx index 6f79be6c44b..a807c70f189 100644 --- a/Common/TableProducer/centralityTable.cxx +++ b/Common/TableProducer/centralityTable.cxx @@ -37,12 +37,20 @@ struct CentralityTable { Configurable estRun2CL1{"estRun2CL1", -1, {"Produces Run2 centrality percentiles using CL1 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; int mRunNumber; - bool mV0MCalibrationStored; - TH1* mhVtxAmpCorrV0A; - TH1* mhVtxAmpCorrV0C; - TH1* mhMultSelCalibV0M; + struct tagV0MCalibration { + bool mV0MCalibrationStored = false; + TH1* mhVtxAmpCorrV0A = nullptr; + TH1* mhVtxAmpCorrV0C = nullptr; + TH1* mhMultSelCalibV0M = nullptr; + } V0MInfo; + struct tagSPDTrackletsCalibration { + bool mSPDCalibrationStored = false; + TH1* mhVtxAmpCorrSPD = nullptr; + TH1* mhMultSelCalibSPD = nullptr; + } SPDInfo; - void init(InitContext& context) + void + init(InitContext& context) { /* Checking the tables which are requested in the workflow and enabling them */ auto& workflows = context.services().get(); @@ -72,10 +80,6 @@ struct CentralityTable { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); mRunNumber = 0; - mV0MCalibrationStored = false; - mhVtxAmpCorrV0A = nullptr; - mhVtxAmpCorrV0C = nullptr; - mhMultSelCalibV0M = nullptr; } void process(soa::Join::iterator const& collision, aod::BCsWithTimestamps const&, aod::Tracks const& tracks) @@ -86,6 +90,8 @@ struct CentralityTable { LOGF(debug, "timestamp=%llu", bc.timestamp()); TList* callst = ccdb->getForTimeStamp("Centrality/Estimators", bc.timestamp()); + V0MInfo.mV0MCalibrationStored = false; + SPDInfo.mSPDCalibrationStored = false; if (callst != nullptr) { auto getccdb = [callst](const char* ccdbhname) { TH1* h = (TH1*)callst->FindObject(ccdbhname); @@ -93,17 +99,24 @@ struct CentralityTable { }; if (estV0M == 1) { LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); - mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized"); - mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized"); - mhMultSelCalibV0M = getccdb("hMultSelCalib_V0M"); - if ((mhVtxAmpCorrV0A != nullptr) and (mhVtxAmpCorrV0C != nullptr) and (mhMultSelCalibV0M != nullptr)) { - mV0MCalibrationStored = true; + V0MInfo.mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized"); + V0MInfo.mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized"); + V0MInfo.mhMultSelCalibV0M = getccdb("hMultSelCalib_V0M"); + if ((V0MInfo.mhVtxAmpCorrV0A != nullptr) and (V0MInfo.mhVtxAmpCorrV0C != nullptr) and (V0MInfo.mhMultSelCalibV0M != nullptr)) { + V0MInfo.mV0MCalibrationStored = true; } else { - LOGF(fatal, "Calibration information from V0M for run %d corrupted"); + LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); } } if (estRun2SPD == 1) { - LOGF(fatal, "Run2 calibration information estimated from SPD tracklets still not available"); + LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); + SPDInfo.mhVtxAmpCorrSPD = getccdb("hVtx_fnTracklets_Normalized"); + SPDInfo.mhMultSelCalibSPD = getccdb("hMultSelCalib_SPDTracklets"); + if ((SPDInfo.mhVtxAmpCorrSPD != nullptr) and (SPDInfo.mhMultSelCalibSPD != nullptr)) { + SPDInfo.mSPDCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from SPD tracklets for run %d corrupted", bc.runNumber()); + } } if (estRun2CL0 == 1) { LOGF(fatal, "Run2 calibration information estimated from CL0 still not available"); @@ -111,25 +124,32 @@ struct CentralityTable { if (estRun2CL1 == 1) { LOGF(fatal, "Run2 calibration information estimated from CL1 still not available"); } - if (mV0MCalibrationStored) { + if (V0MInfo.mV0MCalibrationStored or SPDInfo.mSPDCalibrationStored) { mRunNumber = bc.runNumber(); } } else { - /* we dont change the run number to keep trying */ - mV0MCalibrationStored = false; LOGF(fatal, "Centrality calibration is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } } if (estV0M == 1) { - float centV0M = 105.0f; - if (mV0MCalibrationStored) { - float v0m = collision.multV0A() * mhVtxAmpCorrV0A->GetBinContent(mhVtxAmpCorrV0A->FindFixBin(collision.posZ())) + - collision.multV0C() * mhVtxAmpCorrV0C->GetBinContent(mhVtxAmpCorrV0C->FindFixBin(collision.posZ())); - centV0M = mhMultSelCalibV0M->GetBinContent(mhMultSelCalibV0M->FindFixBin(v0m)); + float cV0M = 105.0f; + if (V0MInfo.mV0MCalibrationStored) { + float v0m = collision.multV0A() * V0MInfo.mhVtxAmpCorrV0A->GetBinContent(V0MInfo.mhVtxAmpCorrV0A->FindFixBin(collision.posZ())) + + collision.multV0C() * V0MInfo.mhVtxAmpCorrV0C->GetBinContent(V0MInfo.mhVtxAmpCorrV0C->FindFixBin(collision.posZ())); + cV0M = V0MInfo.mhMultSelCalibV0M->GetBinContent(V0MInfo.mhMultSelCalibV0M->FindFixBin(v0m)); } - LOGF(debug, "centV0M=%.0f", centV0M); + LOGF(debug, "centV0M=%.0f", cV0M); // fill centrality columns - centVOM(centV0M); + centVOM(cV0M); + } + if (estRun2SPD == 1) { + float cSPD = 105.0f; + if (SPDInfo.mSPDCalibrationStored) { + float spdm = collision.multTracklets() * SPDInfo.mhVtxAmpCorrSPD->GetBinContent(SPDInfo.mhVtxAmpCorrSPD->FindFixBin(collision.posZ())); + cSPD = SPDInfo.mhMultSelCalibSPD->GetBinContent(SPDInfo.mhMultSelCalibSPD->FindFixBin(spdm)); + } + LOGF(debug, "centSPD=%.0f", cSPD); + centRun2SPD(cSPD); } } }; From e9950f9b53be53610b2f4a2001b728e1eb3253b9 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 15 Nov 2021 16:40:22 +0100 Subject: [PATCH 2/2] Implementation of SPD Clusters, CL0 and CL1 estimators --- Common/DataModel/Centrality.h | 13 +- Common/TableProducer/centralityTable.cxx | 145 +++++++++++++++++------ Common/Tasks/centralityQa.cxx | 34 +++++- 3 files changed, 151 insertions(+), 41 deletions(-) diff --git a/Common/DataModel/Centrality.h b/Common/DataModel/Centrality.h index 773cb3c7647..f6a357bd7e9 100644 --- a/Common/DataModel/Centrality.h +++ b/Common/DataModel/Centrality.h @@ -19,15 +19,18 @@ namespace cent { DECLARE_SOA_COLUMN(CentEstV0M, centV0M, float); //! Centrality percentile estimated from V0C+V0A multiplicities DECLARE_SOA_COLUMN(CentEstRun2SPDTracklets, centRun2SPDTracklets, float); //! Run2 centrality percentile estimated from SPD tracklets multiplicity +DECLARE_SOA_COLUMN(CentEstRun2SPDClusters, centRun2SPDClusters, float); //! Run2 centrality percentile estimated from SPD clusters multiplicity DECLARE_SOA_COLUMN(CentEstRun2CL0, centRun2CL0, float); //! Run2 centrality percentile estimated from CL0 multiplicity DECLARE_SOA_COLUMN(CentEstRun2CL1, centRun2CL1, float); //! Run2 centrality percentile estimated from CL1 multiplicity } // namespace cent -DECLARE_SOA_TABLE(CentV0Ms, "AOD", "CENTV0M", cent::CentEstV0M); //! V0M estimated centrality table -DECLARE_SOA_TABLE(CentRun2SPDs, "AOD", "CENTRUN2SPD", cent::CentEstRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table -DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentEstRun2CL0); //! Run2 CL0 estimated centrality table -DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentEstRun2CL1); //! Run2 CL1 estimated centrality table +DECLARE_SOA_TABLE(CentV0Ms, "AOD", "CENTV0M", cent::CentEstV0M); //! V0M estimated centrality table +DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentEstRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table +DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentEstRun2SPDClusters); //! Run2 SPD clusters estimated centrality table +DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentEstRun2CL0); //! Run2 CL0 estimated centrality table +DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentEstRun2CL1); //! Run2 CL1 estimated centrality table using CentV0M = CentV0Ms::iterator; -using CentRun2SPD = CentRun2SPDs::iterator; +using CentRun2SPDTrk = CentRun2SPDTrks::iterator; +using CentRun2SPDCls = CentRun2SPDClss::iterator; using CentRun2CL0 = CentRun2CL0s::iterator; using CentRun2CL1 = CentRun2CL1s::iterator; } // namespace o2::aod diff --git a/Common/TableProducer/centralityTable.cxx b/Common/TableProducer/centralityTable.cxx index a807c70f189..72287d663e2 100644 --- a/Common/TableProducer/centralityTable.cxx +++ b/Common/TableProducer/centralityTable.cxx @@ -26,28 +26,46 @@ using namespace o2::framework; struct CentralityTable { Produces centVOM; - Produces centRun2SPD; - Produces centRun2CL1; - Produces centRun2CL2; + Produces centRun2SPDTracklets; + Produces centRun2SPDClusters; + Produces centRun2CL0; + Produces centRun2CL1; Service ccdb; Configurable estV0M{"estV0M", -1, {"Produces centrality percentiles using V0 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; - Configurable estRun2SPD{"estRun2SPD", -1, {"Produces Run2 centrality percentiles using SPD tracklets multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; + Configurable estRun2SPDTrklets{"estRun2SPDtks", -1, {"Produces Run2 centrality percentiles using SPD tracklets multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; + Configurable estRun2SPDClusters{"estRun2SPDcls", -1, {"Produces Run2 centrality percentiles using SPD clusters multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; Configurable estRun2CL0{"estRun2CL0", -1, {"Produces Run2 centrality percentiles using CL0 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; Configurable estRun2CL1{"estRun2CL1", -1, {"Produces Run2 centrality percentiles using CL1 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}}; int mRunNumber; struct tagV0MCalibration { - bool mV0MCalibrationStored = false; + bool mCalibrationStored = false; TH1* mhVtxAmpCorrV0A = nullptr; TH1* mhVtxAmpCorrV0C = nullptr; - TH1* mhMultSelCalibV0M = nullptr; + TH1* mhMultSelCalib = nullptr; } V0MInfo; struct tagSPDTrackletsCalibration { - bool mSPDCalibrationStored = false; - TH1* mhVtxAmpCorrSPD = nullptr; - TH1* mhMultSelCalibSPD = nullptr; - } SPDInfo; + bool mCalibrationStored = false; + TH1* mhVtxAmpCorr = nullptr; + TH1* mhMultSelCalib = nullptr; + } SPDTksInfo; + struct tagSPDClustersCalibration { + bool mCalibrationStored = false; + TH1* mhVtxAmpCorrCL0 = nullptr; + TH1* mhVtxAmpCorrCL1 = nullptr; + TH1* mhMultSelCalib = nullptr; + } SPDClsInfo; + struct tagCL0Calibration { + bool mCalibrationStored = false; + TH1* mhVtxAmpCorr = nullptr; + TH1* mhMultSelCalib = nullptr; + } CL0Info; + struct tagCL1Calibration { + bool mCalibrationStored = false; + TH1* mhVtxAmpCorr = nullptr; + TH1* mhMultSelCalib = nullptr; + } CL1Info; void init(InitContext& context) @@ -71,7 +89,8 @@ struct CentralityTable { } }; enable("V0M", estV0M); - enable("Run2SPD", estRun2SPD); + enable("Run2SPDTrk", estRun2SPDTrklets); + enable("Run2SPDCls", estRun2SPDClusters); enable("Run2CL0", estRun2CL0); enable("Run2CL1", estRun2CL1); } @@ -82,16 +101,21 @@ struct CentralityTable { mRunNumber = 0; } - void process(soa::Join::iterator const& collision, aod::BCsWithTimestamps const&, aod::Tracks const& tracks) + using BCsWithTimestampsAndRun2Infos = soa::Join; + + void process(soa::Join::iterator const& collision, BCsWithTimestampsAndRun2Infos const&) { /* check the previous run number */ - auto bc = collision.bc_as(); + auto bc = collision.bc_as(); if (bc.runNumber() != mRunNumber) { LOGF(debug, "timestamp=%llu", bc.timestamp()); TList* callst = ccdb->getForTimeStamp("Centrality/Estimators", bc.timestamp()); - V0MInfo.mV0MCalibrationStored = false; - SPDInfo.mSPDCalibrationStored = false; + V0MInfo.mCalibrationStored = false; + SPDTksInfo.mCalibrationStored = false; + SPDClsInfo.mCalibrationStored = false; + CL0Info.mCalibrationStored = false; + CL1Info.mCalibrationStored = false; if (callst != nullptr) { auto getccdb = [callst](const char* ccdbhname) { TH1* h = (TH1*)callst->FindObject(ccdbhname); @@ -101,30 +125,55 @@ struct CentralityTable { LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); V0MInfo.mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized"); V0MInfo.mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized"); - V0MInfo.mhMultSelCalibV0M = getccdb("hMultSelCalib_V0M"); - if ((V0MInfo.mhVtxAmpCorrV0A != nullptr) and (V0MInfo.mhVtxAmpCorrV0C != nullptr) and (V0MInfo.mhMultSelCalibV0M != nullptr)) { - V0MInfo.mV0MCalibrationStored = true; + V0MInfo.mhMultSelCalib = getccdb("hMultSelCalib_V0M"); + if ((V0MInfo.mhVtxAmpCorrV0A != nullptr) and (V0MInfo.mhVtxAmpCorrV0C != nullptr) and (V0MInfo.mhMultSelCalib != nullptr)) { + V0MInfo.mCalibrationStored = true; } else { LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); } } - if (estRun2SPD == 1) { + if (estRun2SPDTrklets == 1) { LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); - SPDInfo.mhVtxAmpCorrSPD = getccdb("hVtx_fnTracklets_Normalized"); - SPDInfo.mhMultSelCalibSPD = getccdb("hMultSelCalib_SPDTracklets"); - if ((SPDInfo.mhVtxAmpCorrSPD != nullptr) and (SPDInfo.mhMultSelCalibSPD != nullptr)) { - SPDInfo.mSPDCalibrationStored = true; + SPDTksInfo.mhVtxAmpCorr = getccdb("hVtx_fnTracklets_Normalized"); + SPDTksInfo.mhMultSelCalib = getccdb("hMultSelCalib_SPDTracklets"); + if ((SPDTksInfo.mhVtxAmpCorr != nullptr) and (SPDTksInfo.mhMultSelCalib != nullptr)) { + SPDTksInfo.mCalibrationStored = true; } else { LOGF(fatal, "Calibration information from SPD tracklets for run %d corrupted", bc.runNumber()); } } + if (estRun2SPDClusters == 1) { + LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); + SPDClsInfo.mhVtxAmpCorrCL0 = getccdb("hVtx_fnSPDClusters0_Normalized"); + SPDClsInfo.mhVtxAmpCorrCL1 = getccdb("hVtx_fnSPDClusters1_Normalized"); + SPDClsInfo.mhMultSelCalib = getccdb("hMultSelCalib_SPDClusters"); + if ((SPDClsInfo.mhVtxAmpCorrCL0 != nullptr) and (SPDClsInfo.mhVtxAmpCorrCL1 != nullptr) and (SPDClsInfo.mhMultSelCalib != nullptr)) { + SPDClsInfo.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from SPD clusters for run %d corrupted", bc.runNumber()); + } + } if (estRun2CL0 == 1) { - LOGF(fatal, "Run2 calibration information estimated from CL0 still not available"); + LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); + CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); + CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); + if ((CL0Info.mhVtxAmpCorr != nullptr) and (CL0Info.mhMultSelCalib != nullptr)) { + CL0Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + } } if (estRun2CL1 == 1) { - LOGF(fatal, "Run2 calibration information estimated from CL1 still not available"); + LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber()); + CL1Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters1_Normalized"); + CL1Info.mhMultSelCalib = getccdb("hMultSelCalib_CL1"); + if ((CL1Info.mhVtxAmpCorr != nullptr) and (CL1Info.mhMultSelCalib != nullptr)) { + CL1Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL1 multiplicity for run %d corrupted", bc.runNumber()); + } } - if (V0MInfo.mV0MCalibrationStored or SPDInfo.mSPDCalibrationStored) { + if (V0MInfo.mCalibrationStored or SPDTksInfo.mCalibrationStored or SPDClsInfo.mCalibrationStored or CL0Info.mCalibrationStored or CL1Info.mCalibrationStored) { mRunNumber = bc.runNumber(); } } else { @@ -133,23 +182,51 @@ struct CentralityTable { } if (estV0M == 1) { float cV0M = 105.0f; - if (V0MInfo.mV0MCalibrationStored) { + if (V0MInfo.mCalibrationStored) { float v0m = collision.multV0A() * V0MInfo.mhVtxAmpCorrV0A->GetBinContent(V0MInfo.mhVtxAmpCorrV0A->FindFixBin(collision.posZ())) + collision.multV0C() * V0MInfo.mhVtxAmpCorrV0C->GetBinContent(V0MInfo.mhVtxAmpCorrV0C->FindFixBin(collision.posZ())); - cV0M = V0MInfo.mhMultSelCalibV0M->GetBinContent(V0MInfo.mhMultSelCalibV0M->FindFixBin(v0m)); + cV0M = V0MInfo.mhMultSelCalib->GetBinContent(V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } LOGF(debug, "centV0M=%.0f", cV0M); // fill centrality columns centVOM(cV0M); } - if (estRun2SPD == 1) { + if (estRun2SPDTrklets == 1) { + float cSPD = 105.0f; + if (SPDTksInfo.mCalibrationStored) { + float spdm = collision.multTracklets() * SPDTksInfo.mhVtxAmpCorr->GetBinContent(SPDTksInfo.mhVtxAmpCorr->FindFixBin(collision.posZ())); + cSPD = SPDTksInfo.mhMultSelCalib->GetBinContent(SPDTksInfo.mhMultSelCalib->FindFixBin(spdm)); + } + LOGF(debug, "centSPDTracklets=%.0f", cSPD); + centRun2SPDTracklets(cSPD); + } + if (estRun2SPDClusters == 1) { float cSPD = 105.0f; - if (SPDInfo.mSPDCalibrationStored) { - float spdm = collision.multTracklets() * SPDInfo.mhVtxAmpCorrSPD->GetBinContent(SPDInfo.mhVtxAmpCorrSPD->FindFixBin(collision.posZ())); - cSPD = SPDInfo.mhMultSelCalibSPD->GetBinContent(SPDInfo.mhMultSelCalibSPD->FindFixBin(spdm)); + if (SPDClsInfo.mCalibrationStored) { + float spdm = bc.spdClustersL0() * SPDClsInfo.mhVtxAmpCorrCL0->GetBinContent(SPDClsInfo.mhVtxAmpCorrCL0->FindFixBin(collision.posZ())) + + bc.spdClustersL1() * SPDClsInfo.mhVtxAmpCorrCL1->GetBinContent(SPDClsInfo.mhVtxAmpCorrCL1->FindFixBin(collision.posZ())); + cSPD = SPDClsInfo.mhMultSelCalib->GetBinContent(SPDClsInfo.mhMultSelCalib->FindFixBin(spdm)); + } + LOGF(debug, "centSPDClusters=%.0f", cSPD); + centRun2SPDClusters(cSPD); + } + if (estRun2CL0 == 1) { + float cCL0 = 105.0f; + if (CL0Info.mCalibrationStored) { + float cl0m = bc.spdClustersL0() * CL0Info.mhVtxAmpCorr->GetBinContent(CL0Info.mhVtxAmpCorr->FindFixBin(collision.posZ())); + cCL0 = CL0Info.mhMultSelCalib->GetBinContent(CL0Info.mhMultSelCalib->FindFixBin(cl0m)); + } + LOGF(debug, "centCL0=%.0f", cCL0); + centRun2CL0(cCL0); + } + if (estRun2CL1 == 1) { + float cCL1 = 105.0f; + if (CL1Info.mCalibrationStored) { + float cl1m = bc.spdClustersL1() * CL1Info.mhVtxAmpCorr->GetBinContent(CL1Info.mhVtxAmpCorr->FindFixBin(collision.posZ())); + cCL1 = CL1Info.mhMultSelCalib->GetBinContent(CL1Info.mhMultSelCalib->FindFixBin(cl1m)); } - LOGF(debug, "centSPD=%.0f", cSPD); - centRun2SPD(cSPD); + LOGF(debug, "centCL1=%.0f", cCL1); + centRun2CL1(cCL1); } } }; diff --git a/Common/Tasks/centralityQa.cxx b/Common/Tasks/centralityQa.cxx index 703b9c24e32..b284fbd4f0d 100644 --- a/Common/Tasks/centralityQa.cxx +++ b/Common/Tasks/centralityQa.cxx @@ -19,8 +19,12 @@ using namespace o2; using namespace o2::framework; struct CentralityQa { - OutputObj hCentV0M{TH1F("hCentV0M", "", 21, 0, 105.)}; - void process(soa::Join::iterator const& col) + OutputObj hCentV0M{TH1F("hCentV0M", "V0M", 21, 0, 105.)}; + OutputObj hCentSPDTks{TH1F("hCentSPDTks", "SPD Tracklets", 21, 0, 105.)}; + OutputObj hCentSPDCls{TH1F("hCentSPDCls", "SPD Clusters", 21, 0, 105.)}; + OutputObj hCentCL0{TH1F("hCentCL0", "CL0", 21, 0, 105.)}; + OutputObj hCentCL1{TH1F("hCentCL1", "CL1", 21, 0, 105.)}; + void processPP(soa::Join::iterator const& col) { if (!col.alias()[kINT7]) { return; @@ -30,9 +34,35 @@ struct CentralityQa { } LOGF(debug, "centV0M=%.0f", col.centV0M()); + LOGF(debug, "centSPDTracklets=%.0f", col.centRun2SPDTracklets()); + LOGF(debug, "centSPDClusters=%.0f", col.centRun2SPDClusters()); // fill centrality histos hCentV0M->Fill(col.centV0M()); + hCentSPDTks->Fill(col.centRun2SPDTracklets()); + hCentSPDCls->Fill(col.centRun2SPDClusters()); } + PROCESS_SWITCH(CentralityQa, processPP, "Process with SPD clusters centrality/multiplicity estimation", false); + + void processPbPb(soa::Join::iterator const& col) + { + if (!col.alias()[kINT7]) { + return; + } + if (!col.sel7()) { + return; + } + + LOGF(debug, "centV0M=%.0f", col.centV0M()); + LOGF(debug, "centSPDTracklets=%.0f", col.centRun2SPDTracklets()); + LOGF(debug, "centCL0=%.0f", col.centRun2CL0()); + LOGF(debug, "centCL1=%.0f", col.centRun2CL1()); + // fill centrality histos + hCentV0M->Fill(col.centV0M()); + hCentSPDTks->Fill(col.centRun2SPDTracklets()); + hCentCL0->Fill(col.centRun2CL0()); + hCentCL1->Fill(col.centRun2CL1()); + } + PROCESS_SWITCH(CentralityQa, processPbPb, "Process with CL0 and CL1 multiplicities centrality/multiplicity estimation", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)