From a27006d21b36457be6f811a591dbbc4c5ea5e681 Mon Sep 17 00:00:00 2001 From: sgorbuno <se.gorbunov@gsi.de> Date: Wed, 30 Jun 2021 18:54:33 +0000 Subject: [PATCH] cosmetics --- reco/L1/CbmL1.cxx | 2 +- reco/L1/CbmL1ReadEvent.cxx | 2 +- reco/L1/L1Algo/L1Algo.cxx | 50 ++++++---------------------- reco/L1/L1Algo/L1Algo.h | 42 +++++++++++------------ reco/L1/L1Algo/L1Branch.h | 53 ++++++++---------------------- reco/L1/L1Algo/L1CATrackFinder.cxx | 17 +++++----- reco/L1/L1Algo/L1Triplet.h | 2 +- reco/L1/L1Algo/L1Vector.h | 6 ++-- reco/L1/L1AlgoInputData.h | 5 +-- 9 files changed, 63 insertions(+), 116 deletions(-) diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 4d73329cc7..63003bb6e6 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1320,7 +1320,7 @@ void CbmL1::Reconstruct(CbmEvent* event) fData->ReadHitsFromFile(fSTAPDataDir.Data(), 1, fVerbose); algo->SetData(fData->GetStsHits(), fData->GetNStsStrips(), fData->GetStsZPos(), fData->GetSFlag(), - fData->GetStsHitsStartIndex(), fData->GetStsHitsStopIndex(), listStsHits->GetEntriesFast()); + fData->GetStsHitsStartIndex(), fData->GetStsHitsStopIndex()); } else ReadEvent(fData, TsStart, TsLength, TsOverlap, FstHitinTs, newTS, event); diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx index ffda23f659..cd2df4e03f 100644 --- a/reco/L1/CbmL1ReadEvent.cxx +++ b/reco/L1/CbmL1ReadEvent.cxx @@ -1121,7 +1121,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, if (fVerbose >= 10) cout << "ReadEvent: z-pos are saved." << endl; algo->SetData(fData_->GetStsHits(), fData_->GetNStsStrips(), fData_->GetStsZPos(), fData_->GetSFlag(), - fData_->GetStsHitsStartIndex(), fData_->GetStsHitsStopIndex(), max(nEntSts, nHits)); + fData_->GetStsHitsStartIndex(), fData_->GetStsHitsStopIndex()); if (fPerformance) { diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index e54f650198..1a91e18324 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -8,36 +8,18 @@ #include "L1HitPoint.h" L1Algo::L1Algo(int nThreads, int ExpectedHits) - : fDupletPortionSize("L1Algo::fDupletPortionSize") - , fMergerTrackFirstStation("L1Algo::fMergerTrackFirstStation") - , fMergerTrackLastStation("L1Algo::fMergerTrackLastStation") - , fMergerTrackFirstHit("L1Algo::fMergerTrackFirstHit") - , fMergerTrackLastHit("L1Algo::fMergerTrackLastHit") - , fMergerTrackNeighbour("L1Algo::fMergerTrackNeighbour") - , fMergerTrackChi2("L1Algo::fMergerTrackChi2") - , fMergerTrackIsStored("L1Algo::fMergerTrackIsStored") - , fMergerTrackIsDownstreamNeighbour("L1Algo::fMergerTrackIsDownstreamNeighbour") - , fMergerTracksNew("L1Algo::fMergerTracksNew") - , fMergerRecoHitsNew("L1Algo::fMergerRecoHitsNew") - , NStations(0) - , // number of all detector stations - NMvdStations(0) - , // number of mvd stations - NStsStations(0) + : NStations(0) // number of all detector stations + , NMvdStations(0) // number of mvd stations + , NStsStations(0) , NFStations(0) , fRadThick() , NStsStrips(0) // strips positions created from hits , vStsZPos(0) - , // all possible z-positions of hits - vStsHits(0) // hits as a combination of front-, backstrips and z-position - , fStripFlag(0) // information of hits station & using hits in tracks(), - , CATime(0) - , // time of trackfinding - fTracks("L1Algo::fTracks") - , // reconstructed tracks - fRecoHits("L1Algo::fRecoHits") - , // packed hits of reconstructed tracks - StsHitsStartIndex(nullptr) + , // all possible z-positions of hits + vStsHits(nullptr) // hits as a combination of front-, backstrips and z-position + , fStripFlag(nullptr) // information of hits station & using hits in tracks(), + , CATime(0) // time of trackfinding + , StsHitsStartIndex(nullptr) , StsHitsStopIndex(nullptr) , NHitsIsecAll(0) , vStsDontUsedHits_A(ExpectedHits) @@ -49,18 +31,7 @@ L1Algo::L1Algo(int nThreads, int ExpectedHits) , RealIHit_v(ExpectedHits) , RealIHit_v_buf(ExpectedHits) , RealIHit_v_buf2(ExpectedHits) - , - -#ifdef _OPENMP - fHitToBestTrackF("L1Algo::fHitToBestTrackF") - , fHitToBestTrackB("L1Algo::fHitToBestTrackB") - , -#endif - fStripToTrack("L1Algo::fStripToTrack") - , fStripToTrackB("L1Algo::fStripToTrackB") - , - //sh (), - fNThreads(nThreads) + , fNThreads(nThreads) , fUseHitErrors(0) , fmCBMmode(0) , fGlobal(0) @@ -346,8 +317,7 @@ void L1Algo::Init(const vector<fscal>& geo, const bool UseHitErrors, const bool void L1Algo::SetData(vector<L1StsHit>& StsHits_, int nStsStrips_, const vector<fscal>& StsZPos_, - L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_, - const int NhitsGlobal) + L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_) { vStsHits = &StsHits_; diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index ef0cd8d234..170c608c7a 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -108,24 +108,26 @@ public: // The candidates may share any amount of hits. L1Vector<L1Branch> fTrackCandidates[nTh]; - Tindex fDupletPortionStopIndex[nSta]; // end of the duplet portions for the station - L1Vector<Tindex> fDupletPortionSize; // N duplets in a portion + Tindex fDupletPortionStopIndex[nSta]; // end of the duplet portions for the station + L1Vector<Tindex> fDupletPortionSize {"L1Algo::fDupletPortionSize"}; // N duplets in a portion // // Temporary vectors used by the clone merger // // vectors that are parallel to fTracks - L1Vector<unsigned short> fMergerTrackFirstStation; // first station of a track - L1Vector<unsigned short> fMergerTrackLastStation; // last station of a track - L1Vector<THitI> fMergerTrackFirstHit; // index of the first tracks hit - L1Vector<THitI> fMergerTrackLastHit; // index of the last tracks hit - L1Vector<unsigned short> fMergerTrackNeighbour; // track that can be merged with the given track - L1Vector<float> fMergerTrackChi2; // chi2 of the merge - L1Vector<char> fMergerTrackIsStored; // is the track already stored to the output - L1Vector<char> fMergerTrackIsDownstreamNeighbour; // is the track a downstream neighbor of another track + L1Vector<unsigned short> fMergerTrackFirstStation {"L1Algo::fMergerTrackFirstStation"}; // first station of a track + L1Vector<unsigned short> fMergerTrackLastStation {"L1Algo::fMergerTrackLastStation"}; // last station of a track + L1Vector<THitI> fMergerTrackFirstHit {"L1Algo::fMergerTrackFirstHit"}; // index of the first tracks hit + L1Vector<THitI> fMergerTrackLastHit {"L1Algo::fMergerTrackLastHit"}; // index of the last tracks hit + L1Vector<unsigned short> fMergerTrackNeighbour { + "L1Algo::fMergerTrackNeighbour"}; // track that can be merged with the given track + L1Vector<float> fMergerTrackChi2 {"L1Algo::fMergerTrackChi2"}; // chi2 of the merge + L1Vector<char> fMergerTrackIsStored {"L1Algo::fMergerTrackIsStored"}; // is the track already stored to the output + L1Vector<char> fMergerTrackIsDownstreamNeighbour { + "L1Algo::fMergerTrackIsDownstreamNeighbour"}; // is the track a downstream neighbor of another track // other vectors - L1Vector<L1Track> fMergerTracksNew; // vector of tracks after the merge - L1Vector<THitI> fMergerRecoHitsNew; // vector of track hits after the merge + L1Vector<L1Track> fMergerTracksNew {"L1Algo::fMergerTracksNew"}; // vector of tracks after the merge + L1Vector<THitI> fMergerRecoHitsNew {"L1Algo::fMergerRecoHitsNew"}; // vector of track hits after the merge #ifdef DRAW @@ -137,10 +139,8 @@ public: void Init(const vector<fscal>& geo, const bool UseHitErrors, const bool mCBMmode); void SetData(vector<L1StsHit>& StsHits_, int nStsStrips_, const vector<fscal>& StsZPos_, - L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_, - const int NhitsGlobal + L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_); - ); void PrintHits(); /// The main procedure - find tracks. @@ -178,8 +178,8 @@ public: double CATime; // time of trackfinding - L1Vector<L1Track> fTracks; - L1Vector<THitI> fRecoHits; + L1Vector<L1Track> fTracks {"L1Algo::fTracks"}; // reconstructed tracks + L1Vector<THitI> fRecoHits {"L1Algo::fRecoHits"}; // packed hits of reconstructed tracks const THitI *StsHitsStartIndex, *StsHitsStopIndex; // station-bounders in vStsHits array @@ -202,12 +202,12 @@ public: vector<THitI> RealIHit_v_buf2; #ifdef _OPENMP - L1Vector<omp_lock_t> fHitToBestTrackF; - L1Vector<omp_lock_t> fHitToBestTrackB; + L1Vector<omp_lock_t> fHitToBestTrackF {"L1Algo::fHitToBestTrackF"}; + L1Vector<omp_lock_t> fHitToBestTrackB {"L1Algo::fHitToBestTrackB"}; #endif - L1Vector<int> fStripToTrack; // front strip to track pointers - L1Vector<int> fStripToTrackB; // back strip to track pointers + L1Vector<int> fStripToTrack {"L1Algo::fStripToTrack"}; // front strip to track pointers + L1Vector<int> fStripToTrackB {"L1Algo::fStripToTrackB"}; // back strip to track pointers int fNThreads; bool fUseHitErrors; diff --git a/reco/L1/L1Algo/L1Branch.h b/reco/L1/L1Algo/L1Branch.h index 62c05882d4..8a0b103656 100644 --- a/reco/L1/L1Algo/L1Branch.h +++ b/reco/L1/L1Algo/L1Branch.h @@ -2,55 +2,30 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Ivan Kisel, Sergey Gorbunov [committer], Maksym Zyzak, Valentina Akishina */ -/* - *==================================================================== - * - * CBM Level 1 Reconstruction - * - * Authors: I.Kisel, S.Gorbunov - * - * e-mail : ikisel@kip.uni-heidelberg.de - * - *==================================================================== - * - * L1 branch class - * - *==================================================================== - */ +/// @file L1Branch.h +/// @author Sergey Gorbunov #ifndef L1Branch_h #define L1Branch_h #include "CbmL1Def.h" -#include <vector> - #include "L1StsHit.h" #include "L1Vector.h" +/// +/// L1Branch class describes a search branch of the CA tracker +/// struct L1Branch { - L1Branch() - : //Quality(0), - ista(0) - , Momentum(0) - , NHits(0) - , chi2(0) - , CandIndex(0) - , fStsHits("L1Branch::fStsHits") - { - // L1Branch():Momentum(0),chi2(0),NHits(0),Lengtha(0),ista(0) , StsHits(){ - fStsHits.reserve(25); - } - - // unsigned short int Quality; - unsigned char ista; - // fscal Quality; - // unsigned char iN; // iStation(3b) + nHits(5b) - char Momentum, NHits; - // char Lengtha; - fscal chi2; - int CandIndex; - L1Vector<THitI> fStsHits; + /// default constructor + L1Branch() { fStsHits.reserve(25); } + + unsigned char ista {0}; + char Momentum {0}; + char NHits {0}; + fscal chi2 {0.}; + int CandIndex {0}; + L1Vector<THitI> fStsHits {"L1Branch::fStsHits"}; // static bool compareCand(const L1Branch *a, const L1Branch *b){ // diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index 4cc2d581bc..51ed29b947 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -430,7 +430,8 @@ inline void L1Algo::f20( // input while (true) { if (fGlobal || fmCBMmode) { irm1++; - if (irm1 >= (StsHitsUnusedStopIndex[&stam - vStations] - StsHitsUnusedStartIndex[&stam - vStations])) break; + if ((THitI) irm1 >= (StsHitsUnusedStopIndex[&stam - vStations] - StsHitsUnusedStartIndex[&stam - vStations])) + break; imh = irm1; } else { @@ -720,7 +721,7 @@ inline void L1Algo::f30( // input while (true) { if (fGlobal || fmCBMmode) { irh1++; - if (irh1 >= (StsHitsUnusedStopIndex[istar] - StsHitsUnusedStartIndex[istar])) break; + if ((THitI) irh1 >= (StsHitsUnusedStopIndex[istar] - StsHitsUnusedStartIndex[istar])) break; irh = irh1; } else { @@ -1170,7 +1171,7 @@ inline void L1Algo::f4( // input uint neighTriplet; L1Triplet::UnpackTripletID(neighLocation, neighStation, neighThread, neighTriplet); - if (nNeighbours > 0) { assert(neighStation == istal + 1 || neighStation == istal + 2); } + if (nNeighbours > 0) { assert((int) neighStation == istal + 1 || (int) neighStation == istal + 2); } unsigned char level = 0; for (unsigned int iN = 0; iN < nNeighbours; ++iN, ++neighTriplet, ++neighLocation) { @@ -1222,7 +1223,7 @@ inline void L1Algo::f5( // input } for (Tindex iThread = 0; iThread < fNThreads; ++iThread) { - for (Tindex itrip = 0; itrip < fTriplets[istal][iThread].size(); ++itrip) { + for (Tindex itrip = 0; itrip < (Tindex) fTriplets[istal][iThread].size(); ++itrip) { L1Triplet& trip = fTriplets[istal][iThread][itrip]; if (istam != trip.GetMSta()) continue; if (istar != trip.GetRSta()) continue; @@ -2088,7 +2089,7 @@ void L1Algo::CATrackFinder() ndf) // schedule(dynamic, 10) #endif for (Tindex iThread = 0; iThread < fNThreads; ++iThread) { - for (Tindex itrip = 0; itrip < fTriplets[istaF][iThread].size(); ++itrip) { + for (Tindex itrip = 0; itrip < (Tindex) fTriplets[istaF][iThread].size(); ++itrip) { #ifdef _OPENMP int thread_num = omp_get_thread_num(); @@ -2249,7 +2250,7 @@ void L1Algo::CATrackFinder() #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 10) firstprivate(t) #endif - for (Tindex iCandidate = 0; iCandidate < fTrackCandidates[i].size(); ++iCandidate) { + for (Tindex iCandidate = 0; iCandidate < (Tindex) fTrackCandidates[i].size(); ++iCandidate) { L1Branch& tr = fTrackCandidates[i][iCandidate]; bool check = 1; @@ -2349,10 +2350,10 @@ void L1Algo::CATrackFinder() #pragma omp parallel for #endif for (int i = 0; i < nTh; ++i) { - for (Tindex iC = 0; iC < fTracks_local[i].size(); ++iC) { + for (Tindex iC = 0; iC < (Tindex) fTracks_local[i].size(); ++iC) { fTracks[offset_tracks[i] + iC] = fTracks_local[i][iC]; } - for (Tindex iH = 0; iH < fRecoHits_local[i].size(); ++iH) { + for (Tindex iH = 0; iH < (Tindex) fRecoHits_local[i].size(); ++iH) { fRecoHits[offset_hits[i] + iH] = fRecoHits_local[i][iH]; } } diff --git a/reco/L1/L1Algo/L1Triplet.h b/reco/L1/L1Algo/L1Triplet.h index bd7f95ca32..342ef3129c 100644 --- a/reco/L1/L1Algo/L1Triplet.h +++ b/reco/L1/L1Algo/L1Triplet.h @@ -1,6 +1,6 @@ /* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only - Authors: Florian Uhlig [committer], Valentina Akishina, Sergey Gorbunov */ + Authors: Valentina Akishina, Sergey Gorbunov[committer] */ #ifndef L1Triplet_h #define L1Triplet_h diff --git a/reco/L1/L1Algo/L1Vector.h b/reco/L1/L1Algo/L1Vector.h index 59caf9ecae..99b6bd4884 100644 --- a/reco/L1/L1Algo/L1Vector.h +++ b/reco/L1/L1Algo/L1Vector.h @@ -5,9 +5,9 @@ #ifndef L1Vector_H #define L1Vector_H -// @file L1Vector.h -// @author Sergey Gorbunov -// @date 2021-06-16 +/// @file L1Vector.h +/// @author Sergey Gorbunov +/// @date 2021-06-16 #include "CbmL1Def.h" diff --git a/reco/L1/L1AlgoInputData.h b/reco/L1/L1AlgoInputData.h index 13b6e7057a..2314d133d7 100644 --- a/reco/L1/L1AlgoInputData.h +++ b/reco/L1/L1AlgoInputData.h @@ -20,7 +20,7 @@ using std::vector; class L1AlgoInputData { public: - L1AlgoInputData() : vStsHits(), NStsStrips(0), vStsZPos(), fStripFlag("L1AlgoInputData::fStripFlag") + L1AlgoInputData() : vStsHits(), NStsStrips(0), vStsZPos() // MaxNStations(12) { @@ -84,7 +84,8 @@ public: int NStsStrips; // Number of strips in sts vector<fscal> vStsZPos; // all possible z-positions of hits - L1Vector<unsigned char> fStripFlag; // information of hits station & using hits in tracks; + L1Vector<unsigned char> fStripFlag { + "L1AlgoInputData::fStripFlag"}; // information of hits station & using hits in tracks; THitI StsHitsStartIndex[MaxNStations + 1], StsHitsStopIndex[MaxNStations + 1]; // station-bounders in vStsHits array -- GitLab