Skip to content

Commit c6115c4

Browse files
HauenderPhilipdavidrohr
authored andcommitted
[WIP] Implemented a setValue function for CalDet objects.
1 parent 29705b6 commit c6115c4

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • Detectors/TPC/base/include/TPCBase

Detectors/TPC/base/include/TPCBase/CalDet.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class CalDet
6464
///
6565
///
6666
const T getValue(const int sec, const int globalPadInSector) const;
67+
void setValue(const int sec, const int globalPadInSector, const T value);
6768

6869
/// \todo return value of T& not possible if a default value should be returned, e.g. T{}:
6970
/// warning: returning reference to temporary
@@ -182,6 +183,20 @@ inline const T CalDet<T>::getValue(const CRU cru, const size_t row, const size_t
182183
return T{};
183184
}
184185

186+
template <class T>
187+
inline void CalDet<T>::setValue(const int sec, const int globalPadInSector, const T value)
188+
{
189+
assert(mPadSubset == PadSubset::ROC);
190+
int roc = sec;
191+
int padInROC = globalPadInSector;
192+
const int padsInIROC = Mapper::getPadsInIROC();
193+
if (globalPadInSector >= padsInIROC) {
194+
roc += Mapper::getNumberOfIROCs();
195+
padInROC -= padsInIROC;
196+
}
197+
mData[roc].setValue(padInROC, value);
198+
}
199+
185200
#ifndef GPUCA_ALIGPUCODE // hide from GPU standalone compilation
186201

187202
//______________________________________________________________________________

0 commit comments

Comments
 (0)