diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index c491a49a7..8918eb2e2 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1389,8 +1389,8 @@ void Module::setInjectChannel(const int offsetChannel, sendToDetector(F_SET_INJECT_CHANNEL, args, nullptr); } -void Module::sendVetoPhoton(const int chipIndex, std::vector gainIndices, - std::vector values) { +void Module::sendVetoPhoton(const int chipIndex, const std::vector& gainIndices, + const std::vector& values) { const int nch = gainIndices.size(); if (gainIndices.size() != values.size()) { throw RuntimeError("Number of Gain Indices and values do not match! " @@ -1406,6 +1406,8 @@ void Module::sendVetoPhoton(const int chipIndex, std::vector gainIndices, auto client = DetectorSocket(shm()->hostname, shm()->controlPort); client.Send(&fnum, sizeof(fnum)); client.Send(args, sizeof(args)); + client.Send(gainIndices.data(), sizeof(decltype(gainIndices[0])) * nch); + client.Send(values.data(), sizeof(decltype(values[0])) * nch); client.Send(gainIndices.data(), sizeof(int) * nch); client.Send(values.data(), sizeof(int) * nch); client.Receive(&ret, sizeof(ret)); diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 509af81ea..fecb590cd 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -371,8 +371,8 @@ class Module : public virtual slsDetectorDefs { void setBurstPeriod(int64_t value); std::array getInjectChannel() const; void setInjectChannel(const int offsetChannel, const int incrementChannel); - void sendVetoPhoton(const int chipIndex, std::vector gainIndices, - std::vector values); + void sendVetoPhoton(const int chipIndex, const std::vector& gainIndices, + const std::vector& values); void getVetoPhoton(const int chipIndex, const std::string &fname) const; void setVetoPhoton(const int chipIndex, const int numPhotons, const int energy, const std::string &fname);