Skip to content

Commit a898381

Browse files
tklemenzdavidrohr
authored andcommitted
TPCQC: fix merge function for Clusters object
1 parent 3577ad8 commit a898381

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

Detectors/TPC/qc/include/TPCQC/Clusters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Clusters
5555

5656
void reset();
5757

58-
void merge(const Clusters& clusters);
58+
void merge(Clusters& clusters);
5959

6060
void dumpToFile(std::string filename, int type = 0);
6161

Detectors/TPC/qc/src/Clusters.cxx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,17 @@ void Clusters::reset()
134134
}
135135

136136
//______________________________________________________________________________
137-
void Clusters::merge(const Clusters& clusters)
137+
void Clusters::merge(Clusters& clusters)
138138
{
139-
const bool isNormalized = mIsNormalized;
140-
if (isNormalized) {
139+
const bool isThisNormalized = mIsNormalized;
140+
const bool isOtherNormalized = clusters.mIsNormalized;
141+
142+
if (isThisNormalized) {
141143
denormalize();
142144
}
145+
if (isOtherNormalized) {
146+
clusters.denormalize();
147+
}
143148

144149
mNClusters += clusters.mNClusters;
145150
mQMax += clusters.mQMax;
@@ -148,9 +153,12 @@ void Clusters::merge(const Clusters& clusters)
148153
mSigmaPad += clusters.mSigmaPad;
149154
mTimeBin += clusters.mTimeBin;
150155

151-
if (isNormalized) {
156+
if (isThisNormalized) {
152157
normalize();
153158
}
159+
if (isOtherNormalized) {
160+
clusters.normalize();
161+
}
154162
}
155163

156164
//______________________________________________________________________________

0 commit comments

Comments
 (0)