Skip to content

Commit 4c9c697

Browse files
authored
remove duplicates before uploading (#14003)
1 parent ac44112 commit 4c9c697

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

DataFormats/Detectors/MUON/MCH/include/DataFormatsMCH/DsChannelId.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,13 @@ class DsChannelId
6161

6262
ClassDefNV(DsChannelId, 1); // class for MCH readout channel
6363
};
64+
65+
inline bool operator==(const DsChannelId& a, const DsChannelId& b) { return a.value() == b.value(); }
66+
inline bool operator!=(const DsChannelId& a, const DsChannelId& b) { return !(a == b); }
67+
inline bool operator<(const DsChannelId& a, const DsChannelId& b) { return a.value() < b.value(); }
68+
inline bool operator>(const DsChannelId& a, const DsChannelId& b) { return b < a; }
69+
inline bool operator<=(const DsChannelId& a, const DsChannelId& b) { return !(a > b); }
70+
inline bool operator>=(const DsChannelId& a, const DsChannelId& b) { return !(a < b); }
71+
6472
} // namespace o2::mch
6573
#endif

Detectors/MUON/MCH/Conditions/src/bad-channels-ccdb.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include <boost/program_options.hpp>
13+
#include <algorithm>
1314
#include <ctime>
1415
#include <fstream>
1516
#include <iterator>
@@ -209,9 +210,12 @@ void uploadBadChannels(const std::string ccdbUrl,
209210
const std::string badChannelType,
210211
uint64_t startTimestamp,
211212
uint64_t endTimestamp,
212-
const BadChannelsVector& bv,
213+
BadChannelsVector& bv,
213214
bool makeDefault)
214215
{
216+
std::sort(bv.begin(), bv.end());
217+
bv.erase(std::unique(bv.begin(), bv.end()), bv.end());
218+
215219
std::cout << std::endl;
216220
o2::ccdb::CcdbApi api;
217221
api.init(ccdbUrl);

0 commit comments

Comments
 (0)