From ff0c879cac61898481216849cd857c088ef0b3b9 Mon Sep 17 00:00:00 2001 From: iravasen Date: Fri, 22 Mar 2024 14:47:29 +0100 Subject: [PATCH 1/4] memory improvements and new normalization for distribution of number of clusters per track --- Modules/ITS/include/ITS/ITSClusterTask.h | 11 +- Modules/ITS/include/ITS/ITSTrackTask.h | 54 +++--- Modules/ITS/src/ITSClusterCheck.cxx | 8 +- Modules/ITS/src/ITSClusterTask.cxx | 227 +++++++++++------------ Modules/ITS/src/ITSTrackCheck.cxx | 48 ++--- Modules/ITS/src/ITSTrackTask.cxx | 200 +++++++++----------- 6 files changed, 252 insertions(+), 296 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSClusterTask.h b/Modules/ITS/include/ITS/ITSClusterTask.h index f2f223dc4f..81e1177671 100644 --- a/Modules/ITS/include/ITS/ITSClusterTask.h +++ b/Modules/ITS/include/ITS/ITSClusterTask.h @@ -84,8 +84,6 @@ class ITSClusterTask : public TaskInterface std::shared_ptr hAverageClusterOccupancySummaryIB[NLayer]; std::shared_ptr hAverageClusterSizeSummaryIB[NLayer]; - int mClusterOccupancyIB[NLayer][48][9] = { { { 0 } } }; - // Outer barrel TH1F* hGroupedClusterSizeSummaryOB[NLayer][48] = { { nullptr } }; TH1F* hClusterSizeSummaryOB[NLayer][48] = { { nullptr } }; @@ -94,9 +92,6 @@ class ITSClusterTask : public TaskInterface std::shared_ptr hAverageClusterOccupancySummaryOB[NLayer]; std::shared_ptr hAverageClusterSizeSummaryOB[NLayer]; - int mClusterOccupancyOB[NLayer][48][28] = { { { 0 } } }; - int mNLaneEmpty[4] = { 0 }; // IB, ML, OL, TOTAL empty lane - // Layer synnary TH1F* hClusterSizeLayerSummary[NLayer] = { nullptr }; TH1F* hClusterTopologyLayerSummary[NLayer] = { nullptr }; @@ -114,10 +109,7 @@ class ITSClusterTask : public TaskInterface std::shared_ptr hAverageClusterOccupancySummaryZPhi[NLayer]; std::shared_ptr hAverageClusterSizeSummaryZPhi[NLayer]; - TH1D* hEmptyLaneFractionGlobal; - - int mClusterSize[NLayer][48][28] = { { { 0 } } }; //[#layers][max staves][max lanes / chips] - int nClusters[NLayer][48][28] = { { { 0 } } }; + TH1F* hEmptyLaneFractionGlobal; // Edges of space binning within chips (local frame coordinates) std::vector vRphiBinsIB; @@ -135,7 +127,6 @@ class ITSClusterTask : public TaskInterface const int mNLanes[4] = { 432, 864, 2520, 3816 }; // IB, ML, OL, TOTAL lane int mDoPublish1DSummary = 0; int mNThreads = 1; - int mNRofs = 0; int nBCbins = 103; long int mTimestamp = -1; TString xLabel; diff --git a/Modules/ITS/include/ITS/ITSTrackTask.h b/Modules/ITS/include/ITS/ITSTrackTask.h index a6d674fc4d..fa988307aa 100644 --- a/Modules/ITS/include/ITS/ITSTrackTask.h +++ b/Modules/ITS/include/ITS/ITSTrackTask.h @@ -70,38 +70,38 @@ class ITSTrackTask : public TaskInterface const int ChipBoundary[NLayer + 1] = { 0, 108, 252, 432, 3120, 6480, 14712, 24120 }; std::vector mPublishedObjects; - TH1D* hNClusters; - TH2D* hNClustersPt; - std::unique_ptr hTrackEta; - std::unique_ptr hTrackPhi; - TH1D* hVerticesRof; - std::unique_ptr hAngularDistribution; - TH2D* hVertexCoordinates; - TH2D* hVertexRvsZ; - TH1D* hVertexZ; - TH1D* hVertexContributors; - TH1D* hAssociatedClusterFraction; - TH1D* hNtracks; - std::unique_ptr hNClustersPerTrackEta; - std::unique_ptr hNClustersPerTrackPhi; - std::unique_ptr hNClustersPerTrackPt; - std::unique_ptr hHitFirstLayerPhiAll; - std::unique_ptr hHitFirstLayerPhi4cls; - std::unique_ptr hHitFirstLayerPhi5cls; - std::unique_ptr hHitFirstLayerPhi6cls; - std::unique_ptr hHitFirstLayerPhi7cls; - TH2D* hClusterVsBunchCrossing; - TH2D* hNClusterVsChipITS; + std::unique_ptr hNClusters; + std::unique_ptr hTrackEta; + std::unique_ptr hTrackPhi; + TH1F* hVerticesRof; + std::unique_ptr hAngularDistribution; + TH2F* hVertexCoordinates; + TH2F* hVertexRvsZ; + TH1F* hVertexZ; + TH1F* hVertexContributors; + TH1F* hAssociatedClusterFraction; + TH1F* hNtracks; + std::unique_ptr hNClustersPerTrackEta; + std::unique_ptr hNClustersPerTrackPhi; + std::unique_ptr hNClustersPerTrackPt; + std::unique_ptr hHitFirstLayerPhiAll; + std::unique_ptr hHitFirstLayerPhi4cls; + std::unique_ptr hHitFirstLayerPhi5cls; + std::unique_ptr hHitFirstLayerPhi6cls; + std::unique_ptr hHitFirstLayerPhi7cls; + TH2F* hClusterVsBunchCrossing; + TH2F* hNClusterVsChipITS; // Histograms for inv mass k0s, lambda - TH1D* hInvMassK0s; - TH1D* hInvMassLambda; - TH1D* hInvMassLambdaBar; - TH2D* hTrackPtVsEta; - TH2D* hTrackPtVsPhi; + TH1F* hInvMassK0s; + TH1F* hInvMassLambda; + TH1F* hInvMassLambdaBar; + TH2F* hTrackPtVsEta; + TH2F* hTrackPtVsPhi; float mPiInvMass = 0.14; float mProtonInvMass = 0.938; Int_t mInvMasses = 0; // switch for the V0 invariant mass computation, 1 (default) - on, 0 - off + int mPublishMore = 1; float mVertexXYsize = 0.5; float mVertexZsize = 15.; float mVertexRsize = 0.8; diff --git a/Modules/ITS/src/ITSClusterCheck.cxx b/Modules/ITS/src/ITSClusterCheck.cxx index f78ac175a6..c9543900b2 100644 --- a/Modules/ITS/src/ITSClusterCheck.cxx +++ b/Modules/ITS/src/ITSClusterCheck.cxx @@ -52,9 +52,9 @@ Quality ITSClusterCheck::check(std::mapsecond->getName().find("EmptyLaneFractionGlobal") != std::string::npos) { - auto* h = dynamic_cast(iter->second->getObject()); + auto* h = dynamic_cast(iter->second->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast EmptyLaneFractionGlobal to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast EmptyLaneFractionGlobal to TH1F*" << ENDM; continue; } result.addMetadata("EmptyLaneFractionGlobal", "good"); @@ -188,9 +188,9 @@ void ITSClusterCheck::beautify(std::shared_ptr mo, Quality checkR } if (mo->getName().find("EmptyLaneFractionGlobal") != std::string::npos) { - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast EmptyLaneFractionGlobal to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast EmptyLaneFractionGlobal to TH1F*" << ENDM; return; } if (checkResult == Quality::Good) { diff --git a/Modules/ITS/src/ITSClusterTask.cxx b/Modules/ITS/src/ITSClusterTask.cxx index 7abf455a34..bc2c46fee5 100644 --- a/Modules/ITS/src/ITSClusterTask.cxx +++ b/Modules/ITS/src/ITSClusterTask.cxx @@ -40,8 +40,8 @@ ITSClusterTask::ITSClusterTask() : TaskInterface() {} ITSClusterTask::~ITSClusterTask() { - delete hClusterVsBunchCrossing; delete hEmptyLaneFractionGlobal; + delete hClusterVsBunchCrossing; for (int iLayer = 0; iLayer < NLayer; iLayer++) { if (!mEnableLayers[iLayer]) @@ -51,22 +51,23 @@ ITSClusterTask::~ITSClusterTask() delete hClusterTopologyLayerSummary[iLayer]; delete hGroupedClusterSizeLayerSummary[iLayer]; - if (iLayer < NLayerIB) { - - for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { - for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { + if (mDoPublish1DSummary == 1) { + if (iLayer < NLayerIB) { + for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { + for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { - delete hClusterTopologySummaryIB[iLayer][iStave][iChip]; - delete hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]; + delete hClusterTopologySummaryIB[iLayer][iStave][iChip]; + delete hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]; + } } - } - } else { + } else { - for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { + for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { - delete hClusterSizeSummaryOB[iLayer][iStave]; - delete hClusterTopologySummaryOB[iLayer][iStave]; - delete hGroupedClusterSizeSummaryOB[iLayer][iStave]; + delete hClusterSizeSummaryOB[iLayer][iStave]; + delete hClusterTopologySummaryOB[iLayer][iStave]; + delete hGroupedClusterSizeSummaryOB[iLayer][iStave]; + } } } } @@ -90,7 +91,6 @@ void ITSClusterTask::initialize(o2::framework::InitContext& /*ctx*/) addObject(mGeneralOccupancy.get()); mGeneralOccupancy->SetStats(0); - mGeneralOccupancy->SetBit(TH1::kIsAverage); for (int iy = 1; iy <= mGeneralOccupancy->GetNbinsY(); iy++) { mGeneralOccupancy->GetYaxis()->SetBinLabel(iy, mYlabels[iy - 1].c_str()); } @@ -139,6 +139,9 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) int ChipIDprev = -1; + // Reset this histo to have the latest picture + hEmptyLaneFractionGlobal->Reset("ICES"); + #ifdef WITH_OPENMP omp_set_num_threads(mNThreads); #pragma omp parallel for schedule(dynamic) @@ -168,6 +171,8 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) o2::math_utils::Point3D locC; // local coordinates + ////////////////////////// OK + if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID && !mDict->isGroup(ClusterID)) { // Normal (frequent) cluster shapes npix = mDict->getNpixels(ClusterID); isGrouped = 0; @@ -176,38 +181,46 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) npix = patt.getNPixels(); isGrouped = 1; } - - locC = mDict->getClusterCoordinates(cluster); - - if (npix > 2) + // if(ClusterID == 2047) continue; + if (mDoPublishDetailedSummary == 1) { + locC = mDict->getClusterCoordinates(cluster); + } + // ILOG(Info,Support) << "HELLO 1.1" << ENDM; + if (npix > 2) { nClustersForBunchCrossing++; + } if (lay < NLayerIB) { - mClusterOccupancyIB[lay][sta][chip]++; - - mClusterSize[lay][sta][chip] += npix; - nClusters[lay][sta][chip]++; - hClusterTopologySummaryIB[lay][sta][chip]->Fill(ClusterID); + hAverageClusterOccupancySummaryIB[lay]->getNum()->Fill(chip, sta); + hAverageClusterSizeSummaryIB[lay]->getNum()->Fill(chip, sta, (double)npix); + hAverageClusterSizeSummaryIB[lay]->getDen()->Fill(chip, sta, 1.); + if (mDoPublish1DSummary == 1) { + hClusterTopologySummaryIB[lay][sta][chip]->Fill(ClusterID); + } hClusterSizeLayerSummary[lay]->Fill(npix); hClusterTopologyLayerSummary[lay]->Fill(ClusterID); if (isGrouped) { - hGroupedClusterSizeSummaryIB[lay][sta][chip]->Fill(npix); + if (mDoPublish1DSummary == 1) { + hGroupedClusterSizeSummaryIB[lay][sta][chip]->Fill(npix); + } hGroupedClusterSizeLayerSummary[lay]->Fill(npix); } } else { - mClusterOccupancyOB[lay][sta][lane]++; - - mClusterSize[lay][sta][lane] += npix; - nClusters[lay][sta][lane]++; - - hClusterTopologySummaryOB[lay][sta]->Fill(ClusterID); - hClusterSizeSummaryOB[lay][sta]->Fill(npix); + hAverageClusterOccupancySummaryOB[lay]->getNum()->Fill(lane, sta, 1. / (mNChipsPerHic[lay] / mNLanePerHic[lay])); // 14 To have occupation per chip -> 7 because we're considering lanes + hAverageClusterSizeSummaryOB[lay]->getNum()->Fill(lane, sta, (double)npix); + hAverageClusterSizeSummaryOB[lay]->getDen()->Fill(lane, sta, 1); + if (mDoPublish1DSummary == 1) { + hClusterTopologySummaryOB[lay][sta]->Fill(ClusterID); + hClusterSizeSummaryOB[lay][sta]->Fill(npix); + } hClusterSizeLayerSummary[lay]->Fill(npix); hClusterTopologyLayerSummary[lay]->Fill(ClusterID); if (isGrouped) { - hGroupedClusterSizeSummaryOB[lay][sta]->Fill(npix); + if (mDoPublish1DSummary == 1) { + hGroupedClusterSizeSummaryOB[lay][sta]->Fill(npix); + } hGroupedClusterSizeLayerSummary[lay]->Fill(npix); } } @@ -228,76 +241,71 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) hClusterVsBunchCrossing->Fill(bcdata.bc, nClustersForBunchCrossing); // we count only the number of clusters, not their sizes } - mNRofs += clusRofArr.size(); // USED to calculate occupancy for the whole run - std::fill(&mNLaneEmpty[0], &mNLaneEmpty[0] + 4, 0); - if (mNRofs > 0) { + if ((int)clusRofArr.size() > 0) { + + mGeneralOccupancy->getDen()->Fill(0., 0., (double)(clusRofArr.size())); + for (int iLayer = 0; iLayer < NLayer; iLayer++) { - if (!mEnableLayers[iLayer]) + if (!mEnableLayers[iLayer]) { continue; + } + + if (iLayer < NLayerIB) { + hAverageClusterOccupancySummaryIB[iLayer]->getDen()->Fill(0., 0., (double)(clusRofArr.size())); + } else { + hAverageClusterOccupancySummaryOB[iLayer]->getDen()->Fill(0., 0., (double)(clusRofArr.size())); + } + for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { if (iLayer < NLayerIB) { + float max = -1.; for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { - - hAverageClusterOccupancySummaryIB[iLayer]->getNum()->SetBinContent(iChip + 1, iStave + 1, 1. * mClusterOccupancyIB[iLayer][iStave][iChip]); - hAverageClusterSizeSummaryIB[iLayer]->getNum()->SetBinContent(iChip + 1, iStave + 1, (double)mClusterSize[iLayer][iStave][iChip]); - hAverageClusterSizeSummaryIB[iLayer]->getDen()->SetBinContent(iChip + 1, iStave + 1, nClusters[iLayer][iStave][iChip]); - if (!mClusterOccupancyIB[iLayer][iStave][iChip]) { - mNLaneEmpty[0]++; - mNLaneEmpty[3]++; + // find the chip with the max occupancy stave by stave + if (hAverageClusterOccupancySummaryIB[iLayer]->getNum()->GetBinContent(iChip + 1, iStave + 1) > max) { + max = hAverageClusterOccupancySummaryIB[iLayer]->getNum()->GetBinContent(iChip + 1, iStave + 1); + } + if (hAverageClusterOccupancySummaryIB[iLayer]->getNum()->GetBinContent(iChip + 1, iStave + 1) < 1e-10) { + hEmptyLaneFractionGlobal->Fill(0., 1. / mNLanes[0]); + hEmptyLaneFractionGlobal->Fill(3., 1. / mNLanes[3]); } } - hAverageClusterOccupancySummaryIB[iLayer]->getDen()->SetBinContent(1, 1, mNRofs); int ybin = iStave < (mNStaves[iLayer] / 2) ? 7 + iLayer + 1 : 7 - iLayer; int xbin = 12 - mNStaves[iLayer] / 4 + 1 + (iStave % (mNStaves[iLayer] / 2)); - mGeneralOccupancy->getNum()->SetBinContent(xbin, ybin, (float)(*(std::max_element(mClusterOccupancyIB[iLayer][iStave], mClusterOccupancyIB[iLayer][iStave] + mNChipsPerHic[iLayer])))); + mGeneralOccupancy->getNum()->SetBinContent(xbin, ybin, max); } else { - + float max = -1.; for (int iLane = 0; iLane < mNLanePerHic[iLayer] * mNHicPerStave[iLayer]; iLane++) { - - hAverageClusterOccupancySummaryOB[iLayer]->getNum()->SetBinContent(iLane + 1, iStave + 1, 1. * mClusterOccupancyOB[iLayer][iStave][iLane] / (mNChipsPerHic[iLayer] / mNLanePerHic[iLayer])); // 14 To have occupation per chip -> 7 because we're considering lanes - hAverageClusterSizeSummaryOB[iLayer]->getNum()->SetBinContent(iLane + 1, iStave + 1, (double)mClusterSize[iLayer][iStave][iLane]); - hAverageClusterSizeSummaryOB[iLayer]->getDen()->SetBinContent(iLane + 1, iStave + 1, nClusters[iLayer][iStave][iLane]); - if (iLayer < 5) { - if (!mClusterOccupancyOB[iLayer][iStave][iLane]) { - mNLaneEmpty[1]++; - mNLaneEmpty[3]++; - } - } else { - if (!mClusterOccupancyOB[iLayer][iStave][iLane]) { - mNLaneEmpty[2]++; - mNLaneEmpty[3]++; - } + if (hAverageClusterOccupancySummaryOB[iLayer]->getNum()->GetBinContent(iLane + 1, iStave + 1) > max) { + max = hAverageClusterOccupancySummaryOB[iLayer]->getNum()->GetBinContent(iLane + 1, iStave + 1); + } + if (hAverageClusterOccupancySummaryOB[iLayer]->getNum()->GetBinContent(iLane + 1, iStave + 1) < 1e-10) { + hEmptyLaneFractionGlobal->Fill((iLayer < 5 ? 1. : 2.), (1. / mNLanes[iLayer < 5 ? 1 : 2])); + hEmptyLaneFractionGlobal->Fill(3., (1. / mNLanes[3])); } } - hAverageClusterOccupancySummaryOB[iLayer]->getDen()->SetBinContent(1, 1, mNRofs); int ybin = iStave < (mNStaves[iLayer] / 2) ? 7 + iLayer + 1 : 7 - iLayer; int xbin = 12 - mNStaves[iLayer] / 4 + 1 + (iStave % (mNStaves[iLayer] / 2)); - mGeneralOccupancy->getNum()->SetBinContent(xbin, ybin, (float)(*(std::max_element(mClusterOccupancyOB[iLayer][iStave], mClusterOccupancyOB[iLayer][iStave] + mNHicPerStave[iLayer] * mNLanePerHic[iLayer]))) / (mNChipsPerHic[iLayer] / mNLanePerHic[iLayer])); + mGeneralOccupancy->getNum()->SetBinContent(xbin, ybin, max); } } - mGeneralOccupancy->getDen()->SetBinContent(1, 1, (float)(mNRofs)); + if (mDoPublishDetailedSummary == 1) { for (int ix = 1; ix <= hAverageClusterSizeSummaryZPhi[iLayer]->GetNbinsX(); ix++) for (int iy = 1; iy <= hAverageClusterSizeSummaryZPhi[iLayer]->GetNbinsY(); iy++) { hAverageClusterSizeSummaryZPhi[iLayer]->getDen()->SetBinContent(ix, iy, hAverageClusterOccupancySummaryZPhi[iLayer]->getNum()->GetBinContent(ix, iy)); } - hAverageClusterOccupancySummaryZPhi[iLayer]->getDen()->SetBinContent(1, 1, mNRofs); + hAverageClusterOccupancySummaryZPhi[iLayer]->getDen()->Fill(0., 0., (double)(clusRofArr.size())); for (int ix = 1; ix <= hAverageClusterSizeSummaryFine[iLayer]->GetNbinsX(); ix++) for (int iy = 1; iy <= hAverageClusterSizeSummaryFine[iLayer]->GetNbinsY(); iy++) { hAverageClusterSizeSummaryFine[iLayer]->getDen()->SetBinContent(ix, iy, hAverageClusterOccupancySummaryFine[iLayer]->getNum()->GetBinContent(ix, iy)); } - hAverageClusterOccupancySummaryFine[iLayer]->getDen()->SetBinContent(1, 1, mNRofs); - - // Setting errors + hAverageClusterOccupancySummaryFine[iLayer]->getDen()->Fill(0., 0., (double)(clusRofArr.size())); } } - for (int iflag = 0; iflag < NFlags; iflag++) { - hEmptyLaneFractionGlobal->SetBinContent(iflag + 1, 1. * mNLaneEmpty[iflag] / mNLanes[iflag]); - } } end = std::chrono::high_resolution_clock::now(); @@ -348,18 +356,23 @@ void ITSClusterTask::reset() if (iLayer < NLayerIB) { hAverageClusterOccupancySummaryIB[iLayer]->Reset(); hAverageClusterSizeSummaryIB[iLayer]->Reset(); - for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { - for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { - hClusterTopologySummaryIB[iLayer][iStave][iChip]->Reset(); - hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]->Reset(); + if (mDoPublish1DSummary == 1) { + for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { + for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { + hClusterTopologySummaryIB[iLayer][iStave][iChip]->Reset(); + hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]->Reset(); + } } } } else { hAverageClusterOccupancySummaryOB[iLayer]->Reset(); hAverageClusterSizeSummaryOB[iLayer]->Reset(); - for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { - hClusterTopologySummaryOB[iLayer][iStave]->Reset(); - hGroupedClusterSizeSummaryOB[iLayer][iStave]->Reset(); + if (mDoPublish1DSummary == 1) { + for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { + hClusterTopologySummaryOB[iLayer][iStave]->Reset(); + hGroupedClusterSizeSummaryOB[iLayer][iStave]->Reset(); + hClusterSizeSummaryOB[iLayer][iStave]->Reset(); + } } } if (mDoPublishDetailedSummary == 1) { @@ -369,11 +382,6 @@ void ITSClusterTask::reset() hAverageClusterSizeSummaryFine[iLayer]->Reset(); } } - std::fill(&mClusterSize[0][0][0], &mClusterSize[0][0][0] + 7 * 48 * 28, 0); - std::fill(&nClusters[0][0][0], &nClusters[0][0][0] + 7 * 48 * 28, 0); - std::fill(&mClusterOccupancyIB[0][0][0], &mClusterOccupancyIB[0][0][0] + 7 * 48 * 9, 0); - std::fill(&mClusterOccupancyOB[0][0][0], &mClusterOccupancyOB[0][0][0] + 7 * 48 * 28, 0); - mNRofs = 0; } void ITSClusterTask::createAllHistos() @@ -384,9 +392,8 @@ void ITSClusterTask::createAllHistos() formatAxes(hClusterVsBunchCrossing, "Bunch Crossing ID", "Number of clusters with npix > 2 in ROF", 1, 1.10); hClusterVsBunchCrossing->SetStats(0); - hEmptyLaneFractionGlobal = new TH1D("EmptyLaneFractionGlobal", "Empty Lane Fraction Global", 4, 0, 4); + hEmptyLaneFractionGlobal = new TH1F("EmptyLaneFractionGlobal", "Empty Lane Fraction Global", 4, 0, 4); hEmptyLaneFractionGlobal->SetTitle("Empty Lane /All Lane "); - hEmptyLaneFractionGlobal->SetBit(TH1::kIsAverage); addObject(hEmptyLaneFractionGlobal); formatAxes(hEmptyLaneFractionGlobal, "", "Fraction of empty lane", 1, 1.10); for (int i = 0; i < NFlags; i++) { @@ -395,6 +402,7 @@ void ITSClusterTask::createAllHistos() hEmptyLaneFractionGlobal->GetXaxis()->CenterLabels(); hEmptyLaneFractionGlobal->SetMaximum(1); hEmptyLaneFractionGlobal->SetMinimum(0); + hEmptyLaneFractionGlobal->SetBit(TH1::kIsAverage); hEmptyLaneFractionGlobal->SetStats(0); for (int iLayer = 0; iLayer < NLayer; iLayer++) { @@ -422,7 +430,6 @@ void ITSClusterTask::createAllHistos() if (mDoPublishDetailedSummary == 1) { hAverageClusterOccupancySummaryZPhi[iLayer] = std::make_shared(Form("Layer%d/ClusterOccupancyZPhi", iLayer), Form("Cluster occupancy on Layer %d;z (cm);#phi (degree);", iLayer), 2 * (int)mLength[iLayer], -1 * mLength[iLayer], mLength[iLayer], 360, -180., 180., true); hAverageClusterOccupancySummaryZPhi[iLayer]->SetStats(0); - hAverageClusterOccupancySummaryZPhi[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterOccupancySummaryZPhi[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterOccupancySummaryZPhi[iLayer]->GetXaxis()->SetLabelSize(0.02); @@ -430,7 +437,6 @@ void ITSClusterTask::createAllHistos() hAverageClusterSizeSummaryZPhi[iLayer] = std::make_shared(Form("Layer%d/ClusterSizeZPhi", iLayer), Form("Cluster size on Layer %d;z (cm);#phi (degree);", iLayer), 2 * (int)mLength[iLayer], -1 * mLength[iLayer], mLength[iLayer], 360, -180., 180., false); hAverageClusterSizeSummaryZPhi[iLayer]->SetStats(0); - hAverageClusterSizeSummaryZPhi[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterSizeSummaryZPhi[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterSizeSummaryZPhi[iLayer]->GetXaxis()->SetLabelSize(0.02); addObject(hAverageClusterSizeSummaryZPhi[iLayer].get()); @@ -442,7 +448,6 @@ void ITSClusterTask::createAllHistos() addObject(hAverageClusterOccupancySummaryIB[iLayer].get()); formatAxes(hAverageClusterOccupancySummaryIB[iLayer].get(), "Chip Number", "Stave Number", 1, 1.10); hAverageClusterOccupancySummaryIB[iLayer]->SetStats(0); - hAverageClusterOccupancySummaryIB[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterOccupancySummaryIB[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterOccupancySummaryIB[iLayer]->GetXaxis()->SetLabelSize(0.02); @@ -451,19 +456,16 @@ void ITSClusterTask::createAllHistos() addObject(hAverageClusterSizeSummaryIB[iLayer].get()); formatAxes(hAverageClusterSizeSummaryIB[iLayer].get(), "Chip Number", "Stave Number", 1, 1.10); hAverageClusterSizeSummaryIB[iLayer]->SetStats(0); - hAverageClusterSizeSummaryIB[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterSizeSummaryIB[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterSizeSummaryIB[iLayer]->GetXaxis()->SetLabelSize(0.02); // Fine check if (mDoPublishDetailedSummary == 1) { hAverageClusterOccupancySummaryFine[iLayer] = std::make_shared(Form("Layer%d/ClusterOccupancyFine", iLayer), Form("Cluster occupancy on Layer %d; Pixel group (column direction); Pixel group (row direction)", iLayer), mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsIB, -0.5, (mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsIB) - 0.5, mNStaves[iLayer] * nRphiBinsIB, -0.5, mNStaves[iLayer] * nRphiBinsIB - 0.5, true); hAverageClusterOccupancySummaryFine[iLayer]->SetStats(0); - hAverageClusterOccupancySummaryFine[iLayer]->SetBit(TH1::kIsAverage); addObject(hAverageClusterOccupancySummaryFine[iLayer].get()); hAverageClusterSizeSummaryFine[iLayer] = std::make_shared(Form("Layer%d/ClusterSizeFine", iLayer), Form("Cluster size on Layer %d; Pixel group (column direction); Pixel group (row direction)", iLayer), mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsIB, -0.5, (mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsIB) - 0.5, mNStaves[iLayer] * nRphiBinsIB, -0.5, mNStaves[iLayer] * nRphiBinsIB - 0.5, false); hAverageClusterSizeSummaryFine[iLayer]->SetStats(0); - hAverageClusterSizeSummaryFine[iLayer]->SetBit(TH1::kIsAverage); addObject(hAverageClusterSizeSummaryFine[iLayer].get()); } @@ -474,17 +476,18 @@ void ITSClusterTask::createAllHistos() hAverageClusterOccupancySummaryIB[iLayer]->GetYaxis()->SetBinLabel(iStave + 1, Form("Stave %i", iStave)); for (int iChip = 0; iChip < mNChipsPerHic[iLayer]; iChip++) { - hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip] = new TH1F(Form("Layer%d/Stave%d/CHIP%d/ClusterSizeGrouped", iLayer, iStave, iChip), Form("Layer%dStave%dCHIP%dClusterSizeGroped", iLayer, iStave, iChip), 100, 0, 100); - hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]->SetTitle(Form("Cluster Size for grouped topologies on Layer %d Stave %d Chip %d", iLayer, iStave, iChip)); - if (mDoPublish1DSummary == 1) + + if (mDoPublish1DSummary == 1) { + hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip] = new TH1F(Form("Layer%d/Stave%d/CHIP%d/ClusterSizeGrouped", iLayer, iStave, iChip), Form("Layer%dStave%dCHIP%dClusterSizeGroped", iLayer, iStave, iChip), 100, 0, 100); + hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]->SetTitle(Form("Cluster Size for grouped topologies on Layer %d Stave %d Chip %d", iLayer, iStave, iChip)); addObject(hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip]); - formatAxes(hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip], "Cluster size (Pixel)", "Counts", 1, 1.10); + formatAxes(hGroupedClusterSizeSummaryIB[iLayer][iStave][iChip], "Cluster size (Pixel)", "Counts", 1, 1.10); - hClusterTopologySummaryIB[iLayer][iStave][iChip] = new TH1F(Form("Layer%d/Stave%d/CHIP%d/ClusterTopology", iLayer, iStave, iChip), Form("Layer%dStave%dCHIP%dClusterTopology", iLayer, iStave, iChip), 300, 0, 300); - hClusterTopologySummaryIB[iLayer][iStave][iChip]->SetTitle(Form("Cluster Topology on Layer %d Stave %d Chip %d", iLayer, iStave, iChip)); - if (mDoPublish1DSummary == 1) + hClusterTopologySummaryIB[iLayer][iStave][iChip] = new TH1F(Form("Layer%d/Stave%d/CHIP%d/ClusterTopology", iLayer, iStave, iChip), Form("Layer%dStave%dCHIP%dClusterTopology", iLayer, iStave, iChip), 300, 0, 300); + hClusterTopologySummaryIB[iLayer][iStave][iChip]->SetTitle(Form("Cluster Topology on Layer %d Stave %d Chip %d", iLayer, iStave, iChip)); addObject(hClusterTopologySummaryIB[iLayer][iStave][iChip]); - formatAxes(hClusterTopologySummaryIB[iLayer][iStave][iChip], "Cluster topology (ID)", "Counts", 1, 1.10); + formatAxes(hClusterTopologySummaryIB[iLayer][iStave][iChip], "Cluster topology (ID)", "Counts", 1, 1.10); + } hAverageClusterSizeSummaryIB[iLayer]->GetXaxis()->SetBinLabel(iChip + 1, Form("Chip %i", iChip)); hAverageClusterSizeSummaryIB[iLayer]->getDen()->GetXaxis()->SetBinLabel(iChip + 1, Form("Chip %i", iChip)); @@ -498,7 +501,6 @@ void ITSClusterTask::createAllHistos() addObject(hAverageClusterOccupancySummaryOB[iLayer].get()); formatAxes(hAverageClusterOccupancySummaryOB[iLayer].get(), "", "Stave Number", 1, 1.10); hAverageClusterOccupancySummaryOB[iLayer]->SetStats(0); - hAverageClusterOccupancySummaryOB[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterOccupancySummaryOB[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterOccupancySummaryOB[iLayer]->GetXaxis()->SetLabelSize(0.02); hAverageClusterOccupancySummaryOB[iLayer]->GetXaxis()->SetTitleOffset(1.2); @@ -509,7 +511,6 @@ void ITSClusterTask::createAllHistos() formatAxes(hAverageClusterSizeSummaryOB[iLayer].get(), "", "Stave Number", 1, 1.10); hAverageClusterSizeSummaryOB[iLayer]->SetStats(0); hAverageClusterSizeSummaryOB[iLayer]->SetOption("colz"); - hAverageClusterSizeSummaryOB[iLayer]->SetBit(TH1::kIsAverage); hAverageClusterSizeSummaryOB[iLayer]->GetYaxis()->SetLabelSize(0.02); hAverageClusterSizeSummaryOB[iLayer]->GetXaxis()->SetLabelSize(0.02); hAverageClusterSizeSummaryOB[iLayer]->GetXaxis()->SetTitleOffset(1.2); @@ -518,34 +519,30 @@ void ITSClusterTask::createAllHistos() if (mDoPublishDetailedSummary == 1) { hAverageClusterOccupancySummaryFine[iLayer] = std::make_shared(Form("Layer%d/ClusterOccupancyFine", iLayer), Form("Cluster occupancy on Layer %d; Pixel group (column direction); Pixel group (row direction)", iLayer), mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsOB, -0.5, (mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsOB) - 0.5, mNStaves[iLayer] * nRphiBinsOB, -0.5, mNStaves[iLayer] * nRphiBinsOB - 0.5, true); hAverageClusterOccupancySummaryFine[iLayer]->SetStats(0); - hAverageClusterOccupancySummaryFine[iLayer]->SetBit(TH1::kIsAverage); addObject(hAverageClusterOccupancySummaryFine[iLayer].get()); hAverageClusterSizeSummaryFine[iLayer] = std::make_shared(Form("Layer%d/ClusterSizeFine", iLayer), Form("Cluster size on Layer %d; Pixel group (column direction); Pixel group (row direction)", iLayer), mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsOB, -0.5, (mNChipsPerHic[iLayer] * mNHicPerStave[iLayer] * nZBinsOB) - 0.5, mNStaves[iLayer] * nRphiBinsOB, -0.5, mNStaves[iLayer] * nRphiBinsOB - 0.5, false); hAverageClusterSizeSummaryFine[iLayer]->SetStats(0); - hAverageClusterSizeSummaryFine[iLayer]->SetBit(TH1::kIsAverage); addObject(hAverageClusterSizeSummaryFine[iLayer].get()); } for (int iStave = 0; iStave < mNStaves[iLayer]; iStave++) { - - hClusterSizeSummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/ClusterSize", iLayer, iStave), Form("Layer%dStave%dClusterSize", iLayer, iStave), 100, 0, 100); - hClusterSizeSummaryOB[iLayer][iStave]->SetTitle(Form("Cluster Size summary for Layer %d Stave %d", iLayer, iStave)); - if (mDoPublish1DSummary == 1) + if (mDoPublish1DSummary == 1) { + hClusterSizeSummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/ClusterSize", iLayer, iStave), Form("Layer%dStave%dClusterSize", iLayer, iStave), 100, 0, 100); + hClusterSizeSummaryOB[iLayer][iStave]->SetTitle(Form("Cluster Size summary for Layer %d Stave %d", iLayer, iStave)); addObject(hClusterSizeSummaryOB[iLayer][iStave]); - formatAxes(hClusterSizeSummaryOB[iLayer][iStave], "Cluster size (Pixel)", "Counts", 1, 1.10); + formatAxes(hClusterSizeSummaryOB[iLayer][iStave], "Cluster size (Pixel)", "Counts", 1, 1.10); - hGroupedClusterSizeSummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/GroupedClusterSize", iLayer, iStave), Form("Layer%dStave%dGroupedClusterSize", iLayer, iStave), 100, 0, 100); - hGroupedClusterSizeSummaryOB[iLayer][iStave]->SetTitle(Form("Grouped Cluster Size summary for Layer %d Stave %d", iLayer, iStave)); - if (mDoPublish1DSummary == 1) + hGroupedClusterSizeSummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/GroupedClusterSize", iLayer, iStave), Form("Layer%dStave%dGroupedClusterSize", iLayer, iStave), 100, 0, 100); + hGroupedClusterSizeSummaryOB[iLayer][iStave]->SetTitle(Form("Grouped Cluster Size summary for Layer %d Stave %d", iLayer, iStave)); addObject(hGroupedClusterSizeSummaryOB[iLayer][iStave]); - formatAxes(hGroupedClusterSizeSummaryOB[iLayer][iStave], "Cluster size (Pixel)", "Counts", 1, 1.10); + formatAxes(hGroupedClusterSizeSummaryOB[iLayer][iStave], "Cluster size (Pixel)", "Counts", 1, 1.10); - hClusterTopologySummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/ClusterTopology", iLayer, iStave), Form("Layer%dStave%dClusterTopology", iLayer, iStave), 300, 0, 300); - hClusterTopologySummaryOB[iLayer][iStave]->SetTitle(Form("Cluster Toplogy summary for Layer %d Stave %d", iLayer, iStave)); - if (mDoPublish1DSummary == 1) + hClusterTopologySummaryOB[iLayer][iStave] = new TH1F(Form("Layer%d/Stave%d/ClusterTopology", iLayer, iStave), Form("Layer%dStave%dClusterTopology", iLayer, iStave), 300, 0, 300); + hClusterTopologySummaryOB[iLayer][iStave]->SetTitle(Form("Cluster Toplogy summary for Layer %d Stave %d", iLayer, iStave)); addObject(hClusterTopologySummaryOB[iLayer][iStave]); - formatAxes(hClusterTopologySummaryOB[iLayer][iStave], "Cluster toplogy (ID)", "Counts", 1, 1.10); + formatAxes(hClusterTopologySummaryOB[iLayer][iStave], "Cluster toplogy (ID)", "Counts", 1, 1.10); + } hAverageClusterSizeSummaryOB[iLayer]->GetYaxis()->SetBinLabel(iStave + 1, Form("Stave %i", iStave)); hAverageClusterSizeSummaryOB[iLayer]->getDen()->GetYaxis()->SetBinLabel(iStave + 1, Form("Stave %i", iStave)); diff --git a/Modules/ITS/src/ITSTrackCheck.cxx b/Modules/ITS/src/ITSTrackCheck.cxx index 854cfe2b31..3021076efd 100644 --- a/Modules/ITS/src/ITSTrackCheck.cxx +++ b/Modules/ITS/src/ITSTrackCheck.cxx @@ -38,9 +38,9 @@ Quality ITSTrackCheck::check(std::mapbegin(); iter != moMap->end(); ++iter) { if (iter->second->getName() == "NClusters") { - auto* h = dynamic_cast(iter->second->getObject()); + auto* h = dynamic_cast(iter->second->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast NClusters to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast NClusters to TH1F*" << ENDM; continue; } result.set(Quality::Good); @@ -84,18 +84,18 @@ Quality ITSTrackCheck::check(std::mapsecond->getName() == "AngularDistribution") { - auto* hAngular = dynamic_cast(iter->second->getObject()); + auto* hAngular = dynamic_cast(iter->second->getObject()); if (hAngular == nullptr) { - ILOG(Error, Support) << "could not cast AngularDistribution to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast AngularDistribution to TH2F*" << ENDM; continue; } result.set(Quality::Good); result.addMetadata("CheckAngEmpty", "good"); result.addMetadata("CheckAsymmEta", "good"); result.addMetadata("CheckAsymmPhi", "good"); - TH1D* projectEta = hAngular->ProjectionX(); + TH1F* projectEta = (TH1F*)hAngular->ProjectionX(); Double_t ratioEta = abs(1. - (projectEta->Integral(1, projectEta->FindBin(0)) / projectEta->Integral(projectEta->FindBin(0), projectEta->GetNbinsX()))); - TH1D* projectPhi = hAngular->ProjectionY(); + TH1F* projectPhi = (TH1F*)hAngular->ProjectionY(); Double_t ratioPhi = abs(projectPhi->Integral(projectPhi->FindBin(0), projectPhi->FindBin(TMath::Pi())) / projectPhi->Integral(projectPhi->FindBin(TMath::Pi()), projectPhi->FindBin(TMath::TwoPi())) - 1); if (hAngular->GetEntries() < 1e-15) { result.updateMetadata("CheckAngEmpty", "bad"); @@ -115,9 +115,9 @@ Quality ITSTrackCheck::check(std::mapsecond->getName() == "VertexCoordinates") { - auto* h = dynamic_cast(iter->second->getObject()); + auto* h = dynamic_cast(iter->second->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast VertexCoordinates to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast VertexCoordinates to TH2F*" << ENDM; continue; } result.set(Quality::Good); @@ -149,14 +149,14 @@ Quality ITSTrackCheck::check(std::mapsecond->getName() == "VertexRvsZ") { - auto* h = dynamic_cast(iter->second->getObject()); + auto* h = dynamic_cast(iter->second->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast VertexRvsZ to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast VertexRvsZ to TH2F*" << ENDM; continue; } result.set(Quality::Good); result.addMetadata("CheckRZVertexZDisplacedBad", "good"); - TH1D* projectZ = h->ProjectionY(); + TH1F* projectZ = (TH1F*)h->ProjectionY(); if ((projectZ->Integral(1, projectZ->FindBin(-10)) > 0) || (projectZ->Integral(projectZ->FindBin(10), projectZ->GetNbinsX()) > 0)) { result.updateMetadata("CheckRZVertexZDisplacedBad", "bad"); result.set(Quality::Bad); @@ -164,9 +164,9 @@ Quality ITSTrackCheck::check(std::mapsecond->getName() == "VertexZ") { - auto* h = dynamic_cast(iter->second->getObject()); + auto* h = dynamic_cast(iter->second->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast VertexZ to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast VertexZ to TH1F*" << ENDM; continue; } result.set(Quality::Good); @@ -195,7 +195,7 @@ Quality ITSTrackCheck::check(std::map mo, Quality checkResult) { @@ -220,9 +220,9 @@ void ITSTrackCheck::beautify(std::shared_ptr mo, Quality checkRes int textColor; if (mo->getName() == "NClusters") { - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast NClusters to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast NClusters to TH1F*" << ENDM; return; } if (checkResult == Quality::Good) { @@ -300,9 +300,9 @@ void ITSTrackCheck::beautify(std::shared_ptr mo, Quality checkRes } if (mo->getName() == "AngularDistribution") { - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast AngularDistribution to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast AngularDistribution to TH2F*" << ENDM; return; } if (checkResult == Quality::Good) { @@ -349,10 +349,10 @@ void ITSTrackCheck::beautify(std::shared_ptr mo, Quality checkRes if (mo->getName() == "VertexCoordinates") { Double_t positionX, positionY; - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast TVertexCoordinates to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast TVertexCoordinates to TH2F*" << ENDM; return; } if (checkResult == Quality::Good) { @@ -423,9 +423,9 @@ void ITSTrackCheck::beautify(std::shared_ptr mo, Quality checkRes } if (mo->getName() == "VertexRvsZ") { - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast VertexRvsZ to TH2D*" << ENDM; + ILOG(Error, Support) << "could not cast VertexRvsZ to TH2F*" << ENDM; return; } if (checkResult == Quality::Good) { @@ -455,9 +455,9 @@ void ITSTrackCheck::beautify(std::shared_ptr mo, Quality checkRes } if (mo->getName() == "VertexZ") { - auto* h = dynamic_cast(mo->getObject()); + auto* h = dynamic_cast(mo->getObject()); if (h == nullptr) { - ILOG(Error, Support) << "could not cast VertexZ to TH1D*" << ENDM; + ILOG(Error, Support) << "could not cast VertexZ to TH1F*" << ENDM; return; } if (checkResult == Quality::Good) { diff --git a/Modules/ITS/src/ITSTrackTask.cxx b/Modules/ITS/src/ITSTrackTask.cxx index 836dbcab44..c3cdc294b3 100644 --- a/Modules/ITS/src/ITSTrackTask.cxx +++ b/Modules/ITS/src/ITSTrackTask.cxx @@ -43,8 +43,6 @@ ITSTrackTask::ITSTrackTask() : TaskInterface() ITSTrackTask::~ITSTrackTask() // make_shared objects will be delete automatically { - delete hNClusters; - delete hNClustersPt; delete hVertexCoordinates; delete hVertexRvsZ; delete hVertexZ; @@ -67,6 +65,7 @@ void ITSTrackTask::initialize(o2::framework::InitContext& /*ctx*/) nBCbins = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "nBCbins", nBCbins); mDoNorm = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "doNorm", mDoNorm); mInvMasses = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "InvMasses", mInvMasses); + mPublishMore = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "publishMore", mPublishMore); // pt bins definition: 20 MeV/c width up to 1 GeV/c, 100 MeV/c afterwards ptBins[0] = 0.; @@ -76,12 +75,6 @@ void ITSTrackTask::initialize(o2::framework::InitContext& /*ctx*/) createAllHistos(); publishHistos(); - - // NClusterVsChip Full Detector distinguishable - for (int l = 0; l < NLayer + 1; l++) { - auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 10); - hNClusterVsChipITS->GetListOfFunctions()->Add(line); - } } void ITSTrackTask::startOfActivity(const Activity& /*activity*/) @@ -121,18 +114,20 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) auto pattIt = clusPatternArr.begin(); // Multiply cos(lambda) plot before refilling - for (int ix = 1; ix <= hNClusterVsChipITS->GetNbinsX(); ix++) { - double integral = hNClusterVsChipITS->Integral(ix, ix, 0, -1); - if (integral < 1e-15) { - continue; - } - for (int iy = 1; iy <= hNClusterVsChipITS->GetNbinsY(); iy++) { - double binc = hNClusterVsChipITS->GetBinContent(ix, iy); - if (binc < 1e-15) { + if (mPublishMore) { + for (int ix = 1; ix <= hNClusterVsChipITS->GetNbinsX(); ix++) { + double integral = hNClusterVsChipITS->Integral(ix, ix, 0, -1); + if (integral < 1e-15) { continue; } - hNClusterVsChipITS->SetBinContent(ix, iy, binc * integral); - hNClusterVsChipITS->SetBinError(ix, iy, std::sqrt(binc * integral)); + for (int iy = 1; iy <= hNClusterVsChipITS->GetNbinsY(); iy++) { + double binc = hNClusterVsChipITS->GetBinContent(ix, iy); + if (binc < 1e-15) { + continue; + } + hNClusterVsChipITS->SetBinContent(ix, iy, binc * integral); + hNClusterVsChipITS->SetBinError(ix, iy, std::sqrt(binc * integral)); + } } } @@ -206,8 +201,7 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) hTrackEta->getNum()->Fill(Eta); hTrackPhi->getNum()->Fill(out.getPhi()); hAngularDistribution->getNum()->Fill(Eta, out.getPhi()); - hNClusters->Fill(track.getNumberOfClusters()); - hNClustersPt->Fill(track.getPt(), track.getNumberOfClusters()); + hNClusters->getNum()->Fill(track.getNumberOfClusters()); hTrackPtVsEta->Fill(out.getPt(), Eta); hTrackPtVsPhi->Fill(out.getPt(), out.getPhi()); @@ -243,7 +237,9 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) layer--; double clusterSizeWithCorrection = (double)clSize[index] * (std::cos(std::atan(out.getTgl()))); - hNClusterVsChipITS->Fill(ChipID + 1, clusterSizeWithCorrection); + if (mPublishMore) { + hNClusterVsChipITS->Fill(ChipID + 1, clusterSizeWithCorrection); + } } // Find V0s @@ -356,6 +352,7 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) hAngularDistribution->getDen()->SetBinContent(1, 1, normalization); hTrackEta->getDen()->SetBinContent(1, normalization); hTrackPhi->getDen()->SetBinContent(1, normalization); + hNClusters->getDen()->SetBinContent(1, normalization); hNClustersPerTrackEta->getDen()->SetBinContent(1, 1, normalization); hNClustersPerTrackPhi->getDen()->SetBinContent(1, 1, normalization); hNClustersPerTrackPt->getDen()->SetBinContent(1, 1, normalization); @@ -364,20 +361,22 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx) hHitFirstLayerPhi5cls->getDen()->SetBinContent(1, 1, normalization); hHitFirstLayerPhi6cls->getDen()->SetBinContent(1, 1, normalization); hHitFirstLayerPhi7cls->getDen()->SetBinContent(1, 1, normalization); - // Normalize hNClusterVsChipITS to the clusters per chip - for (int ix = 1; ix <= hNClusterVsChipITS->GetNbinsX(); ix++) { - double integral = hNClusterVsChipITS->Integral(ix, ix, 0, -1); - if (integral < 1e-15) { - continue; - } - for (int iy = 1; iy <= hNClusterVsChipITS->GetNbinsY(); iy++) { - double binc = hNClusterVsChipITS->GetBinContent(ix, iy); - if (binc < 1e-15) { + if (mPublishMore) { + // Normalize hNClusterVsChipITS to the clusters per chip + for (int ix = 1; ix <= hNClusterVsChipITS->GetNbinsX(); ix++) { + double integral = hNClusterVsChipITS->Integral(ix, ix, 0, -1); + if (integral < 1e-15) { continue; } - double bine = hNClusterVsChipITS->GetBinError(ix, iy); - hNClusterVsChipITS->SetBinContent(ix, iy, binc / integral); - hNClusterVsChipITS->SetBinError(ix, iy, (binc / integral) * std::sqrt((bine / binc) * (bine / binc) + (std::sqrt(integral) / integral) * (std::sqrt(integral) / integral))); + for (int iy = 1; iy <= hNClusterVsChipITS->GetNbinsY(); iy++) { + double binc = hNClusterVsChipITS->GetBinContent(ix, iy); + if (binc < 1e-15) { + continue; + } + double bine = hNClusterVsChipITS->GetBinError(ix, iy); + hNClusterVsChipITS->SetBinContent(ix, iy, binc / integral); + hNClusterVsChipITS->SetBinError(ix, iy, (binc / integral) * std::sqrt((bine / binc) * (bine / binc) + (std::sqrt(integral) / integral) * (std::sqrt(integral) / integral))); + } } } } @@ -389,6 +388,7 @@ void ITSTrackTask::endOfCycle() hAngularDistribution->update(); hTrackEta->update(); hTrackPhi->update(); + hNClusters->update(); hNClustersPerTrackEta->update(); hNClustersPerTrackPhi->update(); hNClustersPerTrackPt->update(); @@ -410,7 +410,6 @@ void ITSTrackTask::reset() ILOG(Debug, Devel) << "Resetting the histograms" << ENDM; hAngularDistribution->Reset(); hNClusters->Reset(); - hNClustersPt->Reset(); hTrackPhi->Reset(); hTrackEta->Reset(); hVerticesRof->Reset(); @@ -432,7 +431,9 @@ void ITSTrackTask::reset() hHitFirstLayerPhi6cls->Reset(); hHitFirstLayerPhi7cls->Reset(); hClusterVsBunchCrossing->Reset(); - hNClusterVsChipITS->Reset(); + if (mPublishMore) { + hNClusterVsChipITS->Reset(); + } hInvMassK0s->Reset(); hInvMassLambda->Reset(); @@ -444,159 +445,124 @@ void ITSTrackTask::reset() void ITSTrackTask::createAllHistos() { - hAngularDistribution = std::make_unique("AngularDistribution", "AngularDistribution", 40, -2.0, 2.0, 60, 0, TMath::TwoPi(), true); - if (mDoNorm) { - hAngularDistribution->SetBit(TH1::kIsAverage); - } + std::string titleNorm = mDoNorm == 1 ? "/ n_vertices" : mDoNorm == 2 ? "/ n_rofs" + : ""; + hAngularDistribution = std::make_unique("AngularDistribution", "AngularDistribution", 40, -2.0, 2.0, 60, 0, TMath::TwoPi(), true); hAngularDistribution->SetTitle("AngularDistribution"); addObject(hAngularDistribution.get()); formatAxes(hAngularDistribution.get(), "#eta", "#phi", 1, 1.10); hAngularDistribution->SetStats(0); - hNClusters = new TH1D("NClusters", "NClusters", 15, -0.5, 14.5); + hNClusters = std::make_unique("NClusters", "NClusters", 15, -0.5, 14.5, true); hNClusters->SetTitle("hNClusters"); - addObject(hNClusters); - formatAxes(hNClusters, "Number of clusters per Track", "Counts", 1, 1.10); + addObject(hNClusters.get()); + formatAxes(hNClusters.get(), "Number of clusters per Track", Form("Counts %s", titleNorm.c_str()), 1, 1.10); hNClusters->SetStats(0); + hNClusters->SetOption("HIST"); - hNClustersPt = new TH2D("NClustersPt", "NClustersPt;#it{p}_{T} (GeV/#it{c}); Number of clusters per Track", 140, ptBins, 4, 3.5, 7.5); - addObject(hNClustersPt); - formatAxes(hNClustersPt, "#it{p}_{T} (GeV/#it{c})", "Number of clusters per Track", 1, 1.10); - hNClustersPt->SetStats(0); - - hTrackEta = std::make_unique("EtaDistribution", "EtaDistribution", 40, -2.0, 2.0, true); - if (mDoNorm) { - hTrackEta->SetBit(TH1::kIsAverage); - } - hTrackEta->SetTitle("Eta Distribution of tracks / n_vertices with at least 3 contrib"); + hTrackEta = std::make_unique("EtaDistribution", "EtaDistribution", 40, -2.0, 2.0, true); + hTrackEta->SetTitle(Form("Eta Distribution of tracks %s ", titleNorm.c_str())); hTrackEta->SetMinimum(0); addObject(hTrackEta.get()); - formatAxes(hTrackEta.get(), "#eta", "Counts / n_vertices", 1, 1.10); + formatAxes(hTrackEta.get(), "#eta", Form("Counts %s", titleNorm.c_str()), 1, 1.10); hTrackEta->SetStats(0); - hTrackPhi = std::make_unique("PhiDistribution", "PhiDistribution", 65, -0.1, TMath::TwoPi(), true); - if (mDoNorm) { - hTrackPhi->SetBit(TH1::kIsAverage); - } - hTrackPhi->SetTitle("Phi Distribution of tracks / n_vertices with at least 3 contrib"); + hTrackPhi = std::make_unique("PhiDistribution", "PhiDistribution", 65, -0.1, TMath::TwoPi(), true); + hTrackPhi->SetTitle(Form("Phi Distribution of tracks %s", titleNorm.c_str())); hTrackPhi->SetMinimum(0); addObject(hTrackPhi.get()); - formatAxes(hTrackPhi.get(), "#phi", "Counts / n_vertices", 1, 1.10); + formatAxes(hTrackPhi.get(), "#phi", Form("Counts %s", titleNorm.c_str()), 1, 1.10); hTrackPhi->SetStats(0); - hVerticesRof = new TH1D("VerticesRof", "VerticesRof", 101, -0.5, 100.5); + hVerticesRof = new TH1F("VerticesRof", "VerticesRof", 101, -0.5, 100.5); hVerticesRof->SetTitle("Distribution n_vertices / ROF"); addObject(hVerticesRof); formatAxes(hVerticesRof, "vertices / ROF", "Counts", 1, 1.10); - hVertexCoordinates = new TH2D("VertexCoordinates", "VertexCoordinates", (int)(mVertexXYsize * 2 / 0.01), -1. * mVertexXYsize, mVertexXYsize, (int)(mVertexXYsize * 2 / 0.01), -1 * mVertexXYsize, mVertexXYsize); + hVertexCoordinates = new TH2F("VertexCoordinates", "VertexCoordinates", (int)(mVertexXYsize * 2 / 0.01), -1. * mVertexXYsize, mVertexXYsize, (int)(mVertexXYsize * 2 / 0.01), -1 * mVertexXYsize, mVertexXYsize); hVertexCoordinates->SetTitle("Coordinates of track vertex"); addObject(hVertexCoordinates); formatAxes(hVertexCoordinates, "X coordinate (cm)", "Y coordinate (cm)", 1, 1.10); hVertexCoordinates->SetStats(0); - hVertexRvsZ = new TH2D("VertexRvsZ", "VertexRvsZ", (int)(mVertexZsize * 2 / 0.01), -mVertexZsize, mVertexZsize, (int)(mVertexRsize / 0.01), 0, mVertexRsize); + hVertexRvsZ = new TH2F("VertexRvsZ", "VertexRvsZ", (int)(mVertexZsize * 2 / 0.01), -mVertexZsize, mVertexZsize, (int)(mVertexRsize / 0.01), 0, mVertexRsize); hVertexRvsZ->SetTitle("Distance to primary vertex vs Z"); addObject(hVertexRvsZ); formatAxes(hVertexRvsZ, "Z coordinate (cm)", "R (cm)", 1, 1.10); - hVertexZ = new TH1D("VertexZ", "VertexZ", (int)(mVertexZsize * 2 / 0.01), -mVertexZsize, mVertexZsize); + hVertexZ = new TH1F("VertexZ", "VertexZ", (int)(mVertexZsize * 2 / 0.01), -mVertexZsize, mVertexZsize); hVertexZ->SetTitle("Z coordinate of vertex"); addObject(hVertexZ); formatAxes(hVertexZ, "Z coordinate (cm)", "counts", 1, 1.10); hVertexZ->SetStats(0); - hVertexContributors = new TH1D("NVertexContributors", "NVertexContributors", 500, 0, 500); + hVertexContributors = new TH1F("NVertexContributors", "NVertexContributors", 500, 0, 500); hVertexContributors->SetTitle("NVertexContributors"); addObject(hVertexContributors); formatAxes(hVertexContributors, "Number of contributors for vertex", "Counts", 1, 1.10); hVertexContributors->SetStats(0); - hAssociatedClusterFraction = new TH1D("AssociatedClusterFraction", "AssociatedClusterFraction", 100, 0, 1); + hAssociatedClusterFraction = new TH1F("AssociatedClusterFraction", "AssociatedClusterFraction", 100, 0, 1); hAssociatedClusterFraction->SetTitle("The fraction of clusters into tracks event by event"); addObject(hAssociatedClusterFraction); formatAxes(hAssociatedClusterFraction, "Clusters in tracks / All clusters", "Counts", 1, 1.10); hAssociatedClusterFraction->SetStats(0); - hNtracks = new TH1D("Ntracks", "Ntracks", (int)mNtracksMAX, 0, mNtracksMAX); + hNtracks = new TH1F("Ntracks", "Ntracks", (int)mNtracksMAX, 0, mNtracksMAX); hNtracks->SetTitle("The number of tracks event by event"); addObject(hNtracks); formatAxes(hNtracks, "# tracks", "Counts", 1, 1.10); hNtracks->SetStats(0); - hNClustersPerTrackEta = std::make_unique("NClustersPerTrackEta", "NClustersPerTrackEta", 400, -2.0, 2.0, 15, -0.5, 14.5, true); - if (mDoNorm) { - hNClustersPerTrackEta->SetBit(TH1::kIsAverage); - } + hNClustersPerTrackEta = std::make_unique("NClustersPerTrackEta", "NClustersPerTrackEta", 400, -2.0, 2.0, 15, -0.5, 14.5, true); hNClustersPerTrackEta->SetTitle("Eta vs NClusters Per Track"); addObject(hNClustersPerTrackEta.get()); formatAxes(hNClustersPerTrackEta.get(), "#eta", "# of Clusters per Track", 1, 1.10); hNClustersPerTrackEta->SetStats(0); - hNClustersPerTrackPhi = std::make_unique("NClustersPerTrackPhi", "NClustersPerTrackPhi", 65, 0, TMath::TwoPi(), 15, -0.5, 14.5, true); - if (mDoNorm) { - hNClustersPerTrackPhi->SetBit(TH1::kIsAverage); - } + hNClustersPerTrackPhi = std::make_unique("NClustersPerTrackPhi", "NClustersPerTrackPhi", 65, 0, TMath::TwoPi(), 15, -0.5, 14.5, true); hNClustersPerTrackPhi->SetTitle("Phi vs NClusters Per Track"); addObject(hNClustersPerTrackPhi.get()); formatAxes(hNClustersPerTrackPhi.get(), "#phi", "# of Clusters per Track", 1, 1.10); hNClustersPerTrackPhi->SetStats(0); - hNClustersPerTrackPt = std::make_unique("NClustersPerTrackPt", "NClustersPerTrackPt", 150, 0, 15, 15, -0.5, 14.5, true); - if (mDoNorm) { - hNClustersPerTrackPt->SetBit(TH1::kIsAverage); - } + hNClustersPerTrackPt = std::make_unique("NClustersPerTrackPt", "NClustersPerTrackPt", 150, 0, 10, 15, -0.5, 14.5, true); hNClustersPerTrackPt->SetTitle("#it{p_{T}} vs NClusters Per Track"); addObject(hNClustersPerTrackPt.get()); formatAxes(hNClustersPerTrackPt.get(), "#it{p_{T}} (GeV/c)", "# of Clusters per Track", 1, 1.10); hNClustersPerTrackPt->SetStats(0); - hHitFirstLayerPhiAll = std::make_unique("HitFirstLayerAll", "HitFirstLayerPhiAll", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); - if (mDoNorm) { - hHitFirstLayerPhiAll->SetBit(TH1::kIsAverage); - } + hHitFirstLayerPhiAll = std::make_unique("HitFirstLayerAll", "HitFirstLayerPhiAll", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); hHitFirstLayerPhiAll->SetTitle("Layer with 1st track hit vs Phi - all tracks"); addObject(hHitFirstLayerPhiAll.get()); formatAxes(hHitFirstLayerPhiAll.get(), "#phi", "Layer with 1st hit", 1, 1.10); hHitFirstLayerPhiAll->SetStats(0); - hHitFirstLayerPhi4cls = std::make_unique("HitFirstLayer4cls", "HitFirstLayerPhi4cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); - if (mDoNorm) { - hHitFirstLayerPhi4cls->SetBit(TH1::kIsAverage); - } + hHitFirstLayerPhi4cls = std::make_unique("HitFirstLayer4cls", "HitFirstLayerPhi4cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); hHitFirstLayerPhi4cls->SetTitle("Layer with 1st track hit vs Phi - 4 cls tracks"); addObject(hHitFirstLayerPhi4cls.get()); formatAxes(hHitFirstLayerPhi4cls.get(), "#phi", "Layer with 1st hit", 1, 1.10); hHitFirstLayerPhi4cls->SetStats(0); - hHitFirstLayerPhi5cls = std::make_unique("HitFirstLayer5cls", "HitFirstLayerPhi5cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); - if (mDoNorm) { - hHitFirstLayerPhi5cls->SetBit(TH1::kIsAverage); - } + hHitFirstLayerPhi5cls = std::make_unique("HitFirstLayer5cls", "HitFirstLayerPhi5cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); hHitFirstLayerPhi5cls->SetTitle("Layer with 1st track hit vs Phi - 5 cls tracks"); addObject(hHitFirstLayerPhi5cls.get()); formatAxes(hHitFirstLayerPhi5cls.get(), "#phi", "Layer with 1st hit", 1, 1.10); hHitFirstLayerPhi5cls->SetStats(0); - hHitFirstLayerPhi6cls = std::make_unique("HitFirstLayer6cls", "HitFirstLayerPhi6cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); - if (mDoNorm) { - hHitFirstLayerPhi6cls->SetBit(TH1::kIsAverage); - } + hHitFirstLayerPhi6cls = std::make_unique("HitFirstLayer6cls", "HitFirstLayerPhi6cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); hHitFirstLayerPhi6cls->SetTitle("Layer with 1st track hit vs Phi - 6 cls tracks"); addObject(hHitFirstLayerPhi6cls.get()); formatAxes(hHitFirstLayerPhi6cls.get(), "#phi", "Layer with 1st hit", 1, 1.10); hHitFirstLayerPhi6cls->SetStats(0); - hHitFirstLayerPhi7cls = std::make_unique("HitFirstLayer7cls", "HitFirstLayerPhi7cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); - if (mDoNorm) { - hHitFirstLayerPhi7cls->SetBit(TH1::kIsAverage); - } + hHitFirstLayerPhi7cls = std::make_unique("HitFirstLayer7cls", "HitFirstLayerPhi7cls", 65, -0.1, TMath::TwoPi(), 4, -0.5, 3.5, true); hHitFirstLayerPhi7cls->SetTitle("Layer with 1st track hit vs Phi - 7 cls tracks"); addObject(hHitFirstLayerPhi7cls.get()); formatAxes(hHitFirstLayerPhi7cls.get(), "#phi", "Layer with 1st hit", 1, 1.10); hHitFirstLayerPhi7cls->SetStats(0); - hClusterVsBunchCrossing = new TH2D("BunchCrossingIDvsClusterRatio", "BunchCrossingIDvsClusterRatio", nBCbins, 0, 4095, 100, 0, 1); + hClusterVsBunchCrossing = new TH2F("BunchCrossingIDvsClusterRatio", "BunchCrossingIDvsClusterRatio", nBCbins, 0, 4095, 100, 0, 1); hClusterVsBunchCrossing->SetTitle("Bunch Crossing ID vs Cluster Ratio"); addObject(hClusterVsBunchCrossing); formatAxes(hClusterVsBunchCrossing, "Bunch Crossing ID", "Fraction of clusters in tracks", 1, 1.10); @@ -618,45 +584,47 @@ void ITSTrackTask::createAllHistos() } } - hNClusterVsChipITS = new TH2D(Form("NClusterVsChipITS"), Form("NClusterVsChipITS"), 2124, mChipBins, 24, mCoslBins); - hNClusterVsChipITS->SetTitle(Form("Corrected cluster size for track clusters vs Chip Full Detector")); - hNClusterVsChipITS->SetBit(TH1::kIsAverage); - addObject(hNClusterVsChipITS); - formatAxes(hNClusterVsChipITS, "ChipID + 1", "(Cluster size x cos(#lambda)) / n_clusters", 1, 1.10); - hNClusterVsChipITS->SetStats(0); - hNClusterVsChipITS->SetMaximum(1); - - // NClusterVsChip Full Detector distinguishable - for (int l = 0; l < NLayer + 1; l++) { - auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 15); - hNClusterVsChipITS->GetListOfFunctions()->Add(line); + if (mPublishMore) { + hNClusterVsChipITS = new TH2F(Form("NClusterVsChipITS"), Form("NClusterVsChipITS"), 2124, mChipBins, 24, mCoslBins); + hNClusterVsChipITS->SetTitle(Form("Corrected cluster size for track clusters vs Chip Full Detector")); + hNClusterVsChipITS->SetBit(TH1::kIsAverage); + addObject(hNClusterVsChipITS); + formatAxes(hNClusterVsChipITS, "ChipID + 1", "(Cluster size x cos(#lambda)) / n_clusters", 1, 1.10); + hNClusterVsChipITS->SetStats(0); + hNClusterVsChipITS->SetMaximum(1); + + // NClusterVsChip Full Detector distinguishable + for (int l = 0; l < NLayer + 1; l++) { + auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 15); + hNClusterVsChipITS->GetListOfFunctions()->Add(line); + } } // Invariant mass K0s, Lambda, LambdaBar - hInvMassK0s = new TH1D("hInvMassK0s", "K0s invariant mass", 160, 0.0, 1.0); + hInvMassK0s = new TH1F("hInvMassK0s", "K0s invariant mass", 160, 0.0, 1.0); hInvMassK0s->SetTitle(Form("Invariant mass of K0s")); addObject(hInvMassK0s); formatAxes(hInvMassK0s, "m_{inv} (Gev/c)", "Counts", 1, 1.10); hInvMassK0s->SetStats(0); - hInvMassLambda = new TH1D("hInvMassLambda", "Lambda invariant mass", 400, 1.0, 2.0); + hInvMassLambda = new TH1F("hInvMassLambda", "Lambda invariant mass", 400, 1.0, 2.0); hInvMassLambda->SetTitle(Form("Invariant mass of Lambda")); addObject(hInvMassLambda); formatAxes(hInvMassLambda, "m_{inv} (Gev/c)", "Counts", 1, 1.10); hInvMassLambda->SetStats(0); - hInvMassLambdaBar = new TH1D("hInvMassLambdaBar", "LambdaBar invariant mass", 400, 1.0, 2.0); + hInvMassLambdaBar = new TH1F("hInvMassLambdaBar", "LambdaBar invariant mass", 400, 1.0, 2.0); hInvMassLambdaBar->SetTitle(Form("Invariant mass of LambdaBar")); addObject(hInvMassLambdaBar); formatAxes(hInvMassLambdaBar, "m_{inv} (Gev/c)", "Counts", 1, 1.10); hInvMassLambdaBar->SetStats(0); - hTrackPtVsEta = new TH2D("hTrackPtVsEta", "Track #it{p}_{T} Vs #eta", 150, 0, 15, 40, -2.0, 2.0); + hTrackPtVsEta = new TH2F("hTrackPtVsEta", "Track #it{p}_{T} Vs #eta", 150, 0, 15, 40, -2.0, 2.0); addObject(hTrackPtVsEta); formatAxes(hTrackPtVsEta, "#it{p}_{T} (GeV/#it{c})", "#eta", 1, 1.10); hTrackPtVsEta->SetStats(0); - hTrackPtVsPhi = new TH2D("hTrackPtVsPhi", "Track #it{p}_{T} Vs #phi", 150, 0, 15, 65, 0, TMath::TwoPi()); + hTrackPtVsPhi = new TH2F("hTrackPtVsPhi", "Track #it{p}_{T} Vs #phi", 150, 0, 15, 65, 0, TMath::TwoPi()); addObject(hTrackPtVsPhi); formatAxes(hTrackPtVsPhi, "#it{p}_{T} (GeV/#it{c})", "#phi", 1, 1.10); hTrackPtVsPhi->SetStats(0); From 8c1ee9a38da7a88d77bb4e8198b336ab02689364 Mon Sep 17 00:00:00 2001 From: iravasen Date: Fri, 22 Mar 2024 15:08:16 +0100 Subject: [PATCH 2/4] removed debug comments --- Modules/ITS/src/ITSClusterTask.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Modules/ITS/src/ITSClusterTask.cxx b/Modules/ITS/src/ITSClusterTask.cxx index bc2c46fee5..15ab32d618 100644 --- a/Modules/ITS/src/ITSClusterTask.cxx +++ b/Modules/ITS/src/ITSClusterTask.cxx @@ -171,8 +171,6 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) o2::math_utils::Point3D locC; // local coordinates - ////////////////////////// OK - if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID && !mDict->isGroup(ClusterID)) { // Normal (frequent) cluster shapes npix = mDict->getNpixels(ClusterID); isGrouped = 0; @@ -181,11 +179,11 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) npix = patt.getNPixels(); isGrouped = 1; } - // if(ClusterID == 2047) continue; + if (mDoPublishDetailedSummary == 1) { locC = mDict->getClusterCoordinates(cluster); } - // ILOG(Info,Support) << "HELLO 1.1" << ENDM; + if (npix > 2) { nClustersForBunchCrossing++; } From a1e6fa55f8b117a5dbe3fe857ec9245c639c4326 Mon Sep 17 00:00:00 2001 From: iravasen Date: Fri, 22 Mar 2024 19:37:03 +0100 Subject: [PATCH 3/4] fixed bug with getClusterCoordinates: wrongly used was producing crashes with cluster id 2047 which is an InvalidPattern --- Modules/ITS/src/ITSClusterTask.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Modules/ITS/src/ITSClusterTask.cxx b/Modules/ITS/src/ITSClusterTask.cxx index 15ab32d618..d235e7f70a 100644 --- a/Modules/ITS/src/ITSClusterTask.cxx +++ b/Modules/ITS/src/ITSClusterTask.cxx @@ -171,17 +171,23 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) o2::math_utils::Point3D locC; // local coordinates - if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID && !mDict->isGroup(ClusterID)) { // Normal (frequent) cluster shapes - npix = mDict->getNpixels(ClusterID); - isGrouped = 0; - } else { + if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID) { // Normal (frequent) cluster shapes + if (!mDict->isGroup(ClusterID)) { + npix = mDict->getNpixels(ClusterID); + locC = mDict->getClusterCoordinates(cluster); + isGrouped = 0; + } else { + o2::itsmft::ClusterPattern patt(pattIt); + npix = patt.getNPixels(); + locC = mDict->getClusterCoordinates(cluster, patt, true); + isGrouped = 1; + } + + } else { // invalid pattern o2::itsmft::ClusterPattern patt(pattIt); npix = patt.getNPixels(); - isGrouped = 1; - } - - if (mDoPublishDetailedSummary == 1) { - locC = mDict->getClusterCoordinates(cluster); + isGrouped = 0; + locC = mDict->getClusterCoordinates(cluster, patt, false); } if (npix > 2) { From 7e56fcff2c71b1fd2afe3c64ca449aec410d95ad Mon Sep 17 00:00:00 2001 From: iravasen Date: Fri, 22 Mar 2024 19:57:39 +0100 Subject: [PATCH 4/4] get locC only if needed --- Modules/ITS/src/ITSClusterTask.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Modules/ITS/src/ITSClusterTask.cxx b/Modules/ITS/src/ITSClusterTask.cxx index d235e7f70a..a35f7865dc 100644 --- a/Modules/ITS/src/ITSClusterTask.cxx +++ b/Modules/ITS/src/ITSClusterTask.cxx @@ -174,12 +174,16 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) if (ClusterID != o2::itsmft::CompCluster::InvalidPatternID) { // Normal (frequent) cluster shapes if (!mDict->isGroup(ClusterID)) { npix = mDict->getNpixels(ClusterID); - locC = mDict->getClusterCoordinates(cluster); + if (mDoPublishDetailedSummary == 1) { + locC = mDict->getClusterCoordinates(cluster); + } isGrouped = 0; } else { o2::itsmft::ClusterPattern patt(pattIt); npix = patt.getNPixels(); - locC = mDict->getClusterCoordinates(cluster, patt, true); + if (mDoPublishDetailedSummary == 1) { + locC = mDict->getClusterCoordinates(cluster, patt, true); + } isGrouped = 1; } @@ -187,7 +191,9 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx) o2::itsmft::ClusterPattern patt(pattIt); npix = patt.getNPixels(); isGrouped = 0; - locC = mDict->getClusterCoordinates(cluster, patt, false); + if (mDoPublishDetailedSummary == 1) { + locC = mDict->getClusterCoordinates(cluster, patt, false); + } } if (npix > 2) {