diff --git a/Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationSuperAlpide.h b/Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationSuperAlpide.h index 0f48bf84b8438..d8dec1807215d 100644 --- a/Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationSuperAlpide.h +++ b/Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationSuperAlpide.h @@ -53,6 +53,11 @@ class SegmentationSuperAlpide // | | | // x----------------------x public: + virtual ~SegmentationSuperAlpide() = default; + SegmentationSuperAlpide(const SegmentationSuperAlpide&) = default; + SegmentationSuperAlpide(SegmentationSuperAlpide&&) = delete; + SegmentationSuperAlpide& operator=(const SegmentationSuperAlpide&) = delete; + SegmentationSuperAlpide& operator=(SegmentationSuperAlpide&&) = delete; constexpr SegmentationSuperAlpide(int layer) : mLayer{layer} {} static constexpr int mNCols{constants::pixelarray::nCols}; @@ -185,8 +190,8 @@ class SegmentationSuperAlpide template [[nodiscard]] bool isValid(T const row, T const col) const noexcept { - namespace cp = constants::pixelarray; if constexpr (std::is_floating_point_v) { // compares in local coord. + namespace cp = constants::pixelarray; return !static_cast(row <= -cp::width / 2. || cp::width / 2. <= row || col <= -cp::length / 2. || cp::length / 2. <= col); } else { // compares in rows/cols return !static_cast(row < 0 || row >= static_cast(mNRows) || col < 0 || col >= static_cast(mNCols)); diff --git a/Detectors/Upgrades/ITS3/base/src/SegmentationSuperAlpide.cxx b/Detectors/Upgrades/ITS3/base/src/SegmentationSuperAlpide.cxx index 26ca09f351bec..4dadbfb08fd77 100644 --- a/Detectors/Upgrades/ITS3/base/src/SegmentationSuperAlpide.cxx +++ b/Detectors/Upgrades/ITS3/base/src/SegmentationSuperAlpide.cxx @@ -17,4 +17,5 @@ namespace o2::its3 { const std::array SuperSegmentations{0, 1, 2}; + } diff --git a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/Clusterer.h b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/Clusterer.h index 0e549fbc07b7f..20acf07d4f547 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/Clusterer.h +++ b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/Clusterer.h @@ -121,8 +121,8 @@ class Clusterer }; struct ClustererThread { - int id = -1; Clusterer* parent = nullptr; // parent clusterer + int id = -1; // buffers for entries in preClusterIndices in 2 columns, to avoid boundary checks, we reserve // extra elements in the beginning and the end int* column1 = nullptr; diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/BuildTopologyDictionary.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/BuildTopologyDictionary.cxx index e1109ed44dc6c..a6e20c371bc80 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/BuildTopologyDictionary.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/BuildTopologyDictionary.cxx @@ -36,8 +36,6 @@ void BuildTopologyDictionary::accountTopology(const itsmft::ClusterTopology& clu //___________________DEFINING_TOPOLOGY_CHARACTERISTICS__________________ itsmft::TopologyInfo topInf; topInf.mPattern.setPattern(cluster.getPattern().data()); - int& rs = topInf.mSizeX = cluster.getRowSpan(); - int& cs = topInf.mSizeZ = cluster.getColumnSpan(); //__________________COG_Determination_____________ topInf.mNpixels = cluster.getClusterPattern().getCOG(topInf.mCOGx, topInf.mCOGz); if (useDf) { @@ -153,7 +151,7 @@ void BuildTopologyDictionary::groupRareTopologies() LOG(info) << "Number of clusters: " << mTotClusters; double totFreq = 0.; - for (int j = 0; j < mNCommonTopologies; j++) { + for (unsigned int j = 0; j < mNCommonTopologies; j++) { itsmft::GroupStruct gr; gr.mHash = mTopologyFrequency[j].second; gr.mFrequency = ((double)(mTopologyFrequency[j].first)) / mTotClusters; @@ -272,7 +270,7 @@ void BuildTopologyDictionary::groupRareTopologies() std::ostream& operator<<(std::ostream& os, const BuildTopologyDictionary& DB) { - for (int i = 0; i < DB.mNCommonTopologies; i++) { + for (unsigned int i = 0; i < DB.mNCommonTopologies; i++) { const unsigned long& hash = DB.mTopologyFrequency[i].second; os << "Hash: " << hash << '\n'; os << "counts: " << DB.mTopologyMap.find(hash)->second.countsTotal; diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/Clusterer.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/Clusterer.cxx index a6d231e8393d9..34a35897ab477 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/Clusterer.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/Clusterer.cxx @@ -39,7 +39,6 @@ void Clusterer::process(int nThreads, PixelReader& reader, CompClusCont* compClu nThreads = 1; } auto autoDecode = reader.getDecodeNextAuto(); - int rofcount{0}; do { if (autoDecode) { reader.setDecodeNextAuto(false); // internally do not autodecode @@ -79,7 +78,7 @@ void Clusterer::process(int nThreads, PixelReader& reader, CompClusCont* compClu if (nThreads > mThreads.size()) { int oldSz = mThreads.size(); mThreads.resize(nThreads); - for (int i = oldSz; i < nThreads; i++) { + for (size_t i = oldSz; i < nThreads; i++) { mThreads[i] = std::make_unique(this, i); } } @@ -108,10 +107,10 @@ void Clusterer::process(int nThreads, PixelReader& reader, CompClusCont* compClu mTimerMerge.Start(false); #endif size_t nClTot = 0, nPattTot = 0; - int chid = 0, thrStatIdx[nThreads]; + int chid = 0; + std::vector thrStatIdx(nThreads, 0); for (int ith = 0; ith < nThreads; ith++) { std::sort(mThreads[ith]->stats.begin(), mThreads[ith]->stats.end(), [](const ThreadStat& a, const ThreadStat& b) { return a.firstChip < b.firstChip; }); - thrStatIdx[ith] = 0; nClTot += mThreads[ith]->compClusters.size(); nPattTot += mThreads[ith]->patterns.size(); } @@ -129,7 +128,6 @@ void Clusterer::process(int nThreads, PixelReader& reader, CompClusCont* compClu thrStatIdx[ith]++; chid += stat.nChips; // next chip to look const auto clbeg = mThreads[ith]->compClusters.begin() + stat.firstClus; - auto szold = compClus->size(); compClus->insert(compClus->end(), clbeg, clbeg + stat.nClus); if (patterns) { const auto ptbeg = mThreads[ith]->patterns.begin() + stat.firstPatt; @@ -177,7 +175,6 @@ void Clusterer::ClustererThread::process(uint16_t chip, uint16_t nChips, CompClu parent->mMaxRowColDiffToMask != 0 ? curChipData->maskFiredInSample(parent->mChipsOld[chipID], parent->mMaxRowColDiffToMask) : curChipData->maskFiredInSample(parent->mChipsOld[chipID]); } } - auto nclus0 = compClusPtr->size(); auto validPixID = curChipData->getFirstUnmasked(); auto npix = curChipData->getData().size(); LOGP(debug, "ClustererThread: Chip={} npix={} validPixID={} -> valid={} -> singleHit={}", chipID, npix, validPixID, validPixID < npix, validPixID + 1 == npix); @@ -210,7 +207,7 @@ void Clusterer::ClustererThread::finishChip(ChipPixelData* curChipData, CompClus PatternCont* patternsPtr, const ConstMCTruth* labelsDigPtr, MCTruth* labelsClusPtr) { const auto& pixData = curChipData->getData(); - for (int i1 = 0; i1 < preClusterHeads.size(); ++i1) { + for (size_t i1 = 0; i1 < preClusterHeads.size(); ++i1) { auto ci = preClusterIndices[i1]; if (ci < 0) { continue; @@ -234,7 +231,7 @@ void Clusterer::ClustererThread::finishChip(ChipPixelData* curChipData, CompClus next = pixEntry.first; } preClusterIndices[i1] = -1; - for (int i2 = i1 + 1; i2 < preClusterHeads.size(); ++i2) { + for (size_t i2 = i1 + 1; i2 < preClusterHeads.size(); ++i2) { if (preClusterIndices[i2] != ci) { continue; } diff --git a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx index ac9609b4479bf..758c023d26ee6 100644 --- a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx @@ -136,7 +136,7 @@ void Digitizer::fillOutputContainer(uint32_t frameLast) rcROF.setFirstEntry(mDigits->size()); // start of current ROF in digits auto& extra = *(mExtraBuff.front().get()); - for (int iChip{0}; iChip < mChips.size(); ++iChip) { + for (size_t iChip{0}; iChip < mChips.size(); ++iChip) { auto& chip = mChips[iChip]; if (constants::detID::isDetITS3(iChip)) { // Check if this is a chip of ITS3 chip.addNoise(mROFrameMin, mROFrameMin, &mParams, SuperSegmentation::mNRows, SuperSegmentation::mNCols); diff --git a/Detectors/Upgrades/ITS3/simulation/src/ITS3Layer.cxx b/Detectors/Upgrades/ITS3/simulation/src/ITS3Layer.cxx index 885acdac4694b..c384d42c155fc 100644 --- a/Detectors/Upgrades/ITS3/simulation/src/ITS3Layer.cxx +++ b/Detectors/Upgrades/ITS3/simulation/src/ITS3Layer.cxx @@ -215,7 +215,7 @@ void ITS3Layer::createSegment() mSegment = new TGeoVolumeAssembly(its3TGeo::getITS3SegmentPattern(mNLayer)); mSegment->VisibleDaughters(); - for (int i{0}; i < nRSUs; ++i) { + for (size_t i{0}; i < nRSUs; ++i) { auto zMove = new TGeoTranslation(0, 0, +i * constants::rsu::length + constants::rsu::databackbone::length + constants::pixelarray::length / 2.); mSegment->AddNode(mRSU, i, zMove); } @@ -249,7 +249,7 @@ void ITS3Layer::createChip() mChip = new TGeoVolumeAssembly(its3TGeo::getITS3ChipPattern(mNLayer)); mChip->VisibleDaughters(); - for (int i{0}; i < constants::nSegments[mNLayer]; ++i) { + for (unsigned int i{0}; i < constants::nSegments[mNLayer]; ++i) { double phiOffset = constants::segment::width / mR * o2m::Rad2Deg; auto rot = new TGeoRotation("", 0, 0, phiOffset * i); mChip->AddNode(mSegment, i, rot); @@ -285,8 +285,8 @@ void ITS3Layer::createCarbonForm() auto zMoveHringA = new TGeoTranslation(0, 0, -constants::segment::lec::length + HringLength / 2. + constants::segment::length - HringLength); // Longerons are made by same material - auto longeronR = new TGeoTubeSeg(Form("longeronR%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2, phiSta, phiSta + phiLongeronsCover); - auto longeronL = new TGeoTubeSeg(Form("longeronL%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2, phiEnd - phiLongeronsCover, phiEnd); + [[maybe_unused]] auto longeronR = new TGeoTubeSeg(Form("longeronR%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2, phiSta, phiSta + phiLongeronsCover); + [[maybe_unused]] auto longeronL = new TGeoTubeSeg(Form("longeronL%d", mNLayer), mRmax, mRmax + dRadius, longeronsLength / 2, phiEnd - phiLongeronsCover, phiEnd); TString nameLongerons = Form("longeronR%d + longeronL%d", mNLayer, mNLayer); auto longerons = new TGeoCompositeShape(nameLongerons); auto longeronsVol = new TGeoVolume(Form("longerons%d", mNLayer), longerons, mCarbon); @@ -311,7 +311,7 @@ TGeoCompositeShape* ITS3Layer::getHringShape(TGeoTubeSeg* Hring) for (int iHoles = 0; iHoles < nHoles[mNLayer]; iHoles++) { double phiHole = phiHolesSta + stepPhiHoles * iHoles; TString nameHole = Form("hole_%d_%d", iHoles, mNLayer); - auto hole = new TGeoTube(nameHole, 0, radiusHoles[mNLayer], 3 * Hring->GetDz()); + [[maybe_unused]] auto hole = new TGeoTube(nameHole, 0, radiusHoles[mNLayer], 3 * Hring->GetDz()); // move hole to the hring radius auto zMoveHole = new TGeoTranslation(Form("zMoveHole_%d_%d", iHoles, mNLayer), radiusHring * cos(phiHole * o2m::Deg2Rad), radiusHring * sin(phiHole * o2m::Deg2Rad), 0); zMoveHole->RegisterYourself(); diff --git a/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/ClustererSpec.h b/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/ClustererSpec.h index 5e242a68178cd..e6732551c60e2 100644 --- a/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/ClustererSpec.h +++ b/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/ClustererSpec.h @@ -37,12 +37,12 @@ class ClustererDPL : public Task private: void updateTimeDependentParams(ProcessingContext& pc); - int mState = 0; + std::shared_ptr mGGCCDBRequest; bool mUseMC = true; + int mState = 0; int mNThreads = 1; bool mUseClusterDictionary = true; std::unique_ptr mClusterer = nullptr; - std::shared_ptr mGGCCDBRequest; }; /// create a processor spec diff --git a/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/TrackerSpec.h b/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/TrackerSpec.h index 486aef53914d0..525707b77a5f8 100644 --- a/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/TrackerSpec.h +++ b/Detectors/Upgrades/ITS3/workflow/include/ITS3Workflow/TrackerSpec.h @@ -49,14 +49,14 @@ class TrackerDPL : public framework::Task private: void updateTimeDependentParams(framework::ProcessingContext& pc); + std::shared_ptr mGGCCDBRequest{}; bool mIsMC{false}; - bool mRunVertexer{true}; - bool mCosmicsProcessing{false}; int mUseTriggers{0}; std::string mMode{"sync"}; - std::shared_ptr mGGCCDBRequest{}; - o2::its3::TopologyDictionary* mDict{}; std::unique_ptr mRecChain{}; + bool mRunVertexer{true}; + bool mCosmicsProcessing{false}; + o2::its3::TopologyDictionary* mDict{}; std::unique_ptr mChainITS{}; std::unique_ptr mTracker{}; std::unique_ptr mVertexer{}; diff --git a/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx b/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx index cc3476a2b75e4..222dbc77b01a0 100644 --- a/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx +++ b/Detectors/Upgrades/ITS3/workflow/src/TrackerSpec.cxx @@ -46,7 +46,8 @@ namespace its3 { using Vertex = o2::dataformats::Vertex>; -TrackerDPL::TrackerDPL(std::shared_ptr gr, bool isMC, int trgType, const std::string& trModeS, o2::gpu::GPUDataTypes::DeviceType dType) : mGGCCDBRequest(gr), mIsMC{isMC}, mUseTriggers{trgType}, mMode{trModeS}, mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)} +TrackerDPL::TrackerDPL(std::shared_ptr gr, bool isMC, int trgType, const std::string& trModeS, o2::gpu::GPUDataTypes::DeviceType dType) : + mGGCCDBRequest(gr), mIsMC{isMC}, mUseTriggers{trgType}, mMode{trModeS}, mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)} { std::transform(mMode.begin(), mMode.end(), mMode.begin(), [](unsigned char c) { return std::tolower(c); }); } @@ -212,7 +213,7 @@ void TrackerDPL::run(ProcessingContext& pc) vertexerElapsedTime = mVertexer->clustersToVertices(logger); } const auto& multEstConf = FastMultEstConfig::Instance(); // parameters for mult estimation and cuts - for (auto iRof{0}; iRof < rofspan.size(); ++iRof) { + for (size_t iRof{0}; iRof < rofspan.size(); ++iRof) { std::vector vtxVecLoc; auto& vtxROF = vertROFvec.emplace_back(rofspan[iRof]); vtxROF.setFirstEntry(vertices.size()); @@ -220,7 +221,7 @@ void TrackerDPL::run(ProcessingContext& pc) auto vtxSpan = timeFrame->getPrimaryVertices(iRof); vtxROF.setNEntries(vtxSpan.size()); bool selROF = vtxSpan.size() == 0; - for (auto iV{0}; iV < vtxSpan.size(); ++iV) { + for (size_t iV{0}; iV < vtxSpan.size(); ++iV) { auto& v = vtxSpan[iV]; if (multEstConf.isVtxMultCutRequested() && !multEstConf.isPassingVtxMultCut(v.getNContributors())) { continue; // skip vertex of unwanted multiplicity @@ -271,7 +272,6 @@ void TrackerDPL::run(ProcessingContext& pc) trackLabels = timeFrame->getTracksLabel(iROF); auto number{tracks.size()}; auto first{allTracks.size()}; - int offset = -rof.getFirstEntry(); // cluster entry!!! rof.setFirstEntry(first); rof.setNEntries(number); if (processingMask[iROF]) { @@ -283,8 +283,8 @@ void TrackerDPL::run(ProcessingContext& pc) for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) { auto& trc{tracks[iTrk]}; trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices - int ncl = trc.getNumberOfClusters(), nclf = 0; - for (int ic = TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! + int nclf = 0; + for (int ic = TrackITSExt::MaxClusters; (ic--) != 0;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! auto clid = trc.getClusterIndex(ic); if (clid >= 0) { allClusIdx.push_back(clid); diff --git a/Detectors/Upgrades/ITS3/workflow/src/its3-reco-workflow.cxx b/Detectors/Upgrades/ITS3/workflow/src/its3-reco-workflow.cxx index 39b307239ce86..48dfb158a80d9 100644 --- a/Detectors/Upgrades/ITS3/workflow/src/its3-reco-workflow.cxx +++ b/Detectors/Upgrades/ITS3/workflow/src/its3-reco-workflow.cxx @@ -87,5 +87,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) // write the configuration used for the reco workflow o2::conf::ConfigurableParam::writeINI("o2its3recoflow_configuration.ini"); - return std::move(wf); + return wf; } diff --git a/Steer/DigitizerWorkflow/src/ITS3DigitizerSpec.cxx b/Steer/DigitizerWorkflow/src/ITS3DigitizerSpec.cxx index f4759002553ab..6a8bbab76de7b 100644 --- a/Steer/DigitizerWorkflow/src/ITS3DigitizerSpec.cxx +++ b/Steer/DigitizerWorkflow/src/ITS3DigitizerSpec.cxx @@ -102,7 +102,6 @@ class ITS3DPLDigitizerTask : BaseDPLDigitizer if (mDigits.empty()) { return; // no digits were flushed, nothing to accumulate } - static int fixMC2ROF = 0; // 1st entry in mc2rofRecordsAccum to be fixed for ROFRecordID auto ndigAcc = digitsAccum.size(); std::copy(mDigits.begin(), mDigits.end(), std::back_inserter(digitsAccum)); @@ -140,9 +139,9 @@ class ITS3DPLDigitizerTask : BaseDPLDigitizer auto& eventParts = context->getEventParts(withQED); // loop over all composite collisions given from context (aka loop over all the interaction records) - int bcShift = mDigitizer.getParams().getROFrameBiasInBC(); + const int bcShift = mDigitizer.getParams().getROFrameBiasInBC(); // loop over all composite collisions given from context (aka loop over all the interaction records) - for (int collID = 0; collID < timesview.size(); ++collID) { + for (size_t collID = 0; collID < timesview.size(); ++collID) { auto irt = timesview[collID]; if (irt.toLong() < bcShift) { // due to the ROF misalignment the collision would go to negative ROF ID, discard continue; @@ -159,7 +158,7 @@ class ITS3DPLDigitizerTask : BaseDPLDigitizer mHits.clear(); context->retrieveHits(mSimChains, o2::detectors::SimTraits::DETECTORBRANCHNAMES[mID][0].c_str(), part.sourceID, part.entryID, &mHits); - if (mHits.size() > 0) { + if (!mHits.empty()) { LOG(debug) << "For collision " << collID << " eventID " << part.entryID << " found " << mHits.size() << " hits "; mDigitizer.process(&mHits, part.entryID, part.sourceID); // call actual digitization procedure