diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index c9db466cb9b75ffd03edd4d3d29eec3a7d925e16..9b08602aab7aeb37bb5c41bb9a90181656b0ad5b 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -609,6 +609,11 @@ InitStatus CbmL1::Init() } } + // ** Order stations in Z + { + std::sort(vStations.begin(), vStations.end()); + } + // **************************************** // ** ** // ** Initialize material maps ** @@ -651,8 +656,6 @@ InitStatus CbmL1::Init() << " cm." << " Material is collected between z = " << zLast << " and z = " << zNew; - fInitManager.AddStation(station); - zLast = zNew; } @@ -661,6 +664,13 @@ InitStatus CbmL1::Init() LOG(info) << "- Generating material maps tooks " << materialGenerationTime << " seconds"; } + // ** Put stations to the init manager + + for (unsigned int ist = 0; ist < vStations.size(); ist++) { + auto& station = vStations[ist]; + fInitManager.AddStation(station); + } + // **************************************** // ** ** // ** TRACKING ITERATIONS INITIALIZATION ** diff --git a/reco/L1/L1Algo/L1BaseStationInfo.h b/reco/L1/L1Algo/L1BaseStationInfo.h index 7eb6b37106c89ada22be1d47392d41ae6ecfbaf6..316c590d823011bc84cc3af03d10ae4935a05478 100644 --- a/reco/L1/L1Algo/L1BaseStationInfo.h +++ b/reco/L1/L1Algo/L1BaseStationInfo.h @@ -87,11 +87,14 @@ public: /// Move assignment operator L1BaseStationInfo& operator=(L1BaseStationInfo&& other) noexcept; - /// Less operator for L1BaseStationInfo object to perform sorts. Sorting is carried out first by fDetectorID, - /// and then by fStationID. The detectorID must be defined in L1DetectorID enum class + /// Less operator for L1BaseStationInfo object to sort stations in Z bool operator<(const L1BaseStationInfo& right) const { - return fDetectorID != right.fDetectorID ? fDetectorID < right.fDetectorID : fStationID < right.fStationID; + return (GetZdouble() < right.GetZdouble()); + + /// This way sorting is carried out first by fDetectorID, + /// and then by fStationID. The detectorID must be defined in L1DetectorID enum class + // return fDetectorID != right.fDetectorID ? fDetectorID < right.fDetectorID : fStationID < right.fStationID; } /// Gets detector ID