Skip to content

Commit f8ccdf6

Browse files
lietavashahor02
authored andcommitted
ruben's fixes
1 parent 9790a3b commit f8ccdf6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

DataFormats/Detectors/CTP/include/DataFormatsCTP/Scalers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct CTPScalerRaw {
4242
/// Scalers produced from raw scalers corrected for overflow
4343
struct CTPScalerO2 {
4444
CTPScalerO2() = default;
45-
void createCTPScalerO2FromRaw(CTPScalerRaw raw, std::array<uint32_t, 6>& overfow);
45+
void createCTPScalerO2FromRaw(const CTPScalerRaw& raw, const std::array<uint32_t, 6>& overfow);
4646
uint32_t classIndex;
4747
uint64_t lmBefore;
4848
uint64_t lmAfter;
@@ -93,7 +93,7 @@ class CTPRunScalers
9393
std::bitset<CTP_NCLASSES> mClassMask;
9494
std::vector<CTPScalerRecordRaw> mScalerRecordRaw;
9595
std::vector<CTPScalerRecordO2> mScalerRecordO2;
96-
int processScalerLine(std::string& line, int& level, int& nclasses);
96+
int processScalerLine(const std::string& line, int& level, int& nclasses);
9797
int copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows);
9898
int updateOverflows(const CTPScalerRecordRaw& rec0, const CTPScalerRecordRaw& rec1, overflows_t& classesoverflows) const;
9999
int updateOverflows(const CTPScalerRaw& scal0, const CTPScalerRaw& scal1, std::array<uint32_t, 6>& overflow) const;

DataFormats/Detectors/CTP/src/Scalers.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void CTPScalerRaw::printStream(std::ostream& stream) const
2828
stream << " L1B:" << std::setw(10) << l1Before << " L1A:" << std::setw(10) << l1After << std::endl;
2929
}
3030
//
31-
void CTPScalerO2::createCTPScalerO2FromRaw(CTPScalerRaw raw, std::array<uint32_t, 6>& overflow)
31+
void CTPScalerO2::createCTPScalerO2FromRaw(const CTPScalerRaw& raw, const std::array<uint32_t, 6>& overflow)
3232
{
3333
classIndex = raw.classIndex;
3434
lmBefore = (uint64_t)(raw.lmBefore) + 0xffffffffull * (uint64_t)(overflow[0]);
@@ -124,7 +124,7 @@ int CTPRunScalers::readScalers(const std::string& rawscalers)
124124
}
125125
return 0;
126126
}
127-
int CTPRunScalers::processScalerLine(std::string& line, int& level, int& nclasses)
127+
int CTPRunScalers::processScalerLine(const std::string& line, int& level, int& nclasses)
128128
{
129129
//std::cout << "Processing line" << std::endl;
130130
if (line.size() == 0) {
@@ -228,7 +228,7 @@ int CTPRunScalers::convertRawToO2()
228228
CTPScalerRecordO2 o2rec;
229229
copyRawToO2ScalerRecord(mScalerRecordRaw[0], o2rec, overflows);
230230
mScalerRecordO2.push_back(o2rec);
231-
for (int i = 1; i < mScalerRecordRaw.size(); i++) {
231+
for (uint32_t i = 1; i < mScalerRecordRaw.size(); i++) {
232232
//update overflows
233233
updateOverflows(mScalerRecordRaw[i - 1], mScalerRecordRaw[i], overflows);
234234
//
@@ -250,7 +250,7 @@ int CTPRunScalers::copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTP
250250
o2rec.intRecord = rawrec.intRecord;
251251
o2rec.seconds = rawrec.seconds;
252252
o2rec.microSeconds = rawrec.microSeconds;
253-
for (int i = 0; i < rawrec.scalers.size(); i++) {
253+
for (uint32_t i = 0; i < rawrec.scalers.size(); i++) {
254254
CTPScalerRaw rawscal = rawrec.scalers[i];
255255
CTPScalerO2 o2scal;
256256
int k = (getClassIndexes())[i];

0 commit comments

Comments
 (0)