diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt index 488e129c6c5b8d4263abebde9ac5f2880865b0fc..59838e54fd4cdfea66901b60a2faead797ca4143 100644 --- a/reco/L1/CMakeLists.txt +++ b/reco/L1/CMakeLists.txt @@ -2,11 +2,11 @@ #the array. #The extension is already found.Any number of sources could be listed here. -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +# extra warnings to examine the code +#ADD_DEFINITIONS(-Wall -Wextra -Wshadow -Weffc++) -Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Weffc++ -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual") -#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-padded -Wno-global-constructors") -#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast") +# L1 defines +ADD_DEFINITIONS(-DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) IF (SSE_FOUND) ADD_DEFINITIONS(-DHAVE_SSE) @@ -175,7 +175,7 @@ L1Algo/L1Def.h If(APPLE) - ADD_DEFINITIONS(-Wall -Wsign-promo -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root. + ADD_DEFINITIONS(-Wall -Wsign-promo -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wno-parentheses) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root. #-- - Check for compiler flags CHECK_CXX_COMPILER_FLAG("-Wno-pmf-conversions" HAS_PMF) If(HAS_PMF) @@ -193,7 +193,7 @@ If(APPLE) Else() - ADD_DEFINITIONS(-Wall -Wsign-promo -Wno-pmf-conversions -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wstrict-null-sentinel -Wno-non-template-friend -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root. + ADD_DEFINITIONS(-Wall -Wsign-promo -Wno-pmf-conversions -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wstrict-null-sentinel -Wno-non-template-friend -Wno-parentheses) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root. EndIf() diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 0687c0be7bced5b2fa5b850b8360cbcb1359cce2..ac33323ee72de9d56ff0ba2849daa744e56d273e 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1351,7 +1351,7 @@ void CbmL1::Reconstruct(CbmEvent* event) continue; ///Discard tracks from overlap region /// set strips as unused - for (int i = 0; i < StsHitsLocal.size(); i++) { + for (unsigned int i = 0; i < StsHitsLocal.size(); i++) { algo->SetFUnUsed(const_cast<unsigned char&>((*algo->fStripFlag)[vStsHits[StsHitsLocal[i]].f])); algo->SetFUnUsed(const_cast<unsigned char&>((*algo->fStripFlag)[vStsHits[StsHitsLocal[i]].b])); } diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index ee530ed33ea7fe576c423783f335921a35378b94..5641dac75474f7a9e9d5f7589bd7bd824bc01225 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -1087,9 +1087,9 @@ inline void L1Algo::f4( // input /// Select good triplets and save them into fTriplets. Find neighbouring triplets at the next station. #ifdef _OPENMP - uint Thread = omp_get_thread_num(); + unsigned int Thread = omp_get_thread_num(); #else - uint Thread = 0; + unsigned int Thread = 0; #endif THitI ihitl_priv = 0; @@ -1110,7 +1110,7 @@ inline void L1Algo::f4( // input L1_ASSERT(ihitm < StsHitsUnusedStopIndex[istam], ihitm << " < " << StsHitsUnusedStopIndex[istam]); L1_ASSERT(ihitr < StsHitsUnusedStopIndex[istar], ihitr << " < " << StsHitsUnusedStopIndex[istar]); - uint Location = L1Triplet::PackTripletID(istal, Thread, fTriplets[istal][Thread].size()); + unsigned int Location = L1Triplet::PackTripletID(istal, Thread, fTriplets[istal][Thread].size()); if (ihitl_priv == 0 || ihitl_priv != hitsl_3[i3]) { TripForHit[0][ihitl] = Location; @@ -1159,10 +1159,10 @@ inline void L1Algo::f4( // input unsigned int nNeighbours = TripForHit[1][ihitm] - TripForHit[0][ihitm]; - uint neighLocation = TripForHit[0][ihitm]; - uint neighStation; - uint neighThread; - uint neighTriplet; + unsigned int neighLocation = TripForHit[0][ihitm]; + unsigned int neighStation; + unsigned int neighThread; + unsigned int neighTriplet; L1Triplet::UnpackTripletID(neighLocation, neighStation, neighThread, neighTriplet); if (nNeighbours > 0) { assert((int) neighStation == istal + 1 || (int) neighStation == istal + 2); } @@ -1237,10 +1237,10 @@ inline void L1Algo::f5( // input unsigned int nNeighbours = TripForHit[1][ihitm] - TripForHit[0][ihitm]; - uint neighLocation = TripForHit[0][ihitm]; - uint neighStation; - uint neighThread; - uint neighTriplet; + unsigned int neighLocation = TripForHit[0][ihitm]; + unsigned int neighStation; + unsigned int neighThread; + unsigned int neighTriplet; L1Triplet::UnpackTripletID(neighLocation, neighStation, neighThread, neighTriplet); for (unsigned int iN = 0; iN < nNeighbours; ++iN, ++neighTriplet, ++neighLocation) { diff --git a/reco/L1/L1Algo/L1Triplet.h b/reco/L1/L1Algo/L1Triplet.h index 5c31f8e7140471b077ef9abe27f282eea8ff0941..4f629cecc976cceb1e3ba43e5dd9d5492d4601db 100644 --- a/reco/L1/L1Algo/L1Triplet.h +++ b/reco/L1/L1Algo/L1Triplet.h @@ -73,13 +73,13 @@ public: fscal GetCty() const { return fCty; } /// pack station, thread and triplet indices to an unique triplet ID - static uint PackTripletID(uint Station, uint Thread, uint Triplet) + static unsigned int PackTripletID(unsigned int Station, unsigned int Thread, unsigned int Triplet) { return Station * 100000000 + Thread * 1000000 + Triplet; } /// unpack the triplet ID to its station, thread, triplet index - static void UnpackTripletID(uint ID, uint& Station, uint& Thread, uint& Triplet) + static void UnpackTripletID(unsigned int ID, unsigned int& Station, unsigned int& Thread, unsigned int& Triplet) { Station = ID / 100000000; Thread = (ID - Station * 100000000) / 1000000; diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx index d01901bcef4caef08fa6124ed2e0cf433d63ef81..40fa018e2d90cb80e0424c4ca912ed447868b9af 100644 --- a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx +++ b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx @@ -69,7 +69,7 @@ void L1AlgoDraw::InitL1Draw(L1Algo* algo_) algo = algo_; vStsHits.reserve(algo->vStsHits->size()); - for (int i = 0; i < algo->vStsHits->size(); i++) { + for (unsigned int i = 0; i < algo->vStsHits->size(); i++) { vStsHits.push_back((*algo->vStsHits)[i]); } NStations = algo->NStations; @@ -130,7 +130,7 @@ void L1AlgoDraw::DrawMCTracks() if (fVerbose >= 4) { cout << "hits = "; - for (int ih = 0; ih < T.StsHits.size(); ih++) + for (unsigned int ih = 0; ih < T.StsHits.size(); ih++) cout << T.StsHits[ih] << " "; cout << endl; } @@ -297,7 +297,7 @@ void L1AlgoDraw::DrawRecoTracks() void L1AlgoDraw::DrawTriplets(vector<L1Triplet>& triplets, const THitI* realIHit) { // vector <L1Triplet> triplets = algo->vTriplets; - for (int iTrip = 0; iTrip < triplets.size(); iTrip++) { + for (unsigned int iTrip = 0; iTrip < triplets.size(); iTrip++) { L1Triplet& trip = triplets[iTrip]; unsigned int iLHit = trip.GetLHit(); @@ -358,7 +358,7 @@ void L1AlgoDraw::DrawTriplet(int il, int im, int ir) marker.DrawMarker(lx[nHits - 1], ly[nHits - 1]); } -void L1AlgoDraw::DrawDoublets(vector<THitI>* Duplets_hits, map<THitI, THitI>* Duplets_start, const int MaxArrSize, +void L1AlgoDraw::DrawDoublets(vector<THitI>* Duplets_hits, map<THitI, THitI>* Duplets_start, const int /*MaxArrSize*/, THitI* StsRestHitsStartIndex, unsigned int* realIHit) { for (int iSta = 0; iSta < NStations - 1; iSta++) { @@ -681,7 +681,7 @@ void L1AlgoDraw::DrawRestHits(THitI* StsRestHitsStartIndex, THitI* StsRestHitsSt L1Station& st = vStations[ista]; Int_t n_poly = 0; Int_t n_poly_fake = 0; - for (int iRestHit = StsRestHitsStartIndex[ista]; iRestHit < StsRestHitsStopIndex[ista]; iRestHit++) { + for (THitI iRestHit = StsRestHitsStartIndex[ista]; iRestHit < StsRestHitsStopIndex[ista]; iRestHit++) { int ih = realIHit[iRestHit]; L1Hit& h = vStsHits[ih]; int iMC = CbmL1::Instance()->vHitMCRef[ih]; diff --git a/reco/L1/L1Algo/utils/L1AlgoPulls.cxx b/reco/L1/L1Algo/utils/L1AlgoPulls.cxx index 258c820b919ca8f53c668b3d96e853ee631e7fe8..39a19f0348116fe678cc0feed389b7bebfeff5ba 100644 --- a/reco/L1/L1Algo/utils/L1AlgoPulls.cxx +++ b/reco/L1/L1Algo/utils/L1AlgoPulls.cxx @@ -150,7 +150,7 @@ void L1AlgoPulls::Print() cout << "All pulls: " << fNAllPulls << endl; cout << "Correct pulls: " << fGPulls.size() << endl; cout << "x y tx ty qp" << endl; - for (int i = 0; i < fGPulls.size(); i++) { + for (unsigned int i = 0; i < fGPulls.size(); i++) { TL1TrackParameters& pull = fGPulls[i]; pull.Print(); } @@ -160,7 +160,7 @@ void L1AlgoPulls::Build(bool draw) { // --- fill histograms --- // global pulls - for (int i = 0; i < fGPulls.size(); i++) { + for (unsigned int i = 0; i < fGPulls.size(); i++) { TL1TrackParameters& pull = fGPulls[i]; for (int ih = 0; ih < TL1TrackParameters::NParameters; ih++) { if (TailCut > fabs(pull[ih])) histoPull[ih]->Fill(pull[ih]); @@ -180,7 +180,7 @@ void L1AlgoPulls::Build(bool draw) #endif // BUILD_HISTO_FOR_EACH_STANTION // global residuals - for (int i = 0; i < fGRes.size(); i++) { + for (unsigned int i = 0; i < fGRes.size(); i++) { TL1TrackParameters& res = fGRes[i]; for (int ih = 0; ih < TL1TrackParameters::NParameters; ih++) { if (TailCut > fabs(res[ih])) histoRes[ih]->Fill(res[ih]);