From 31a0838f617019f9bc765ee57c41c00d15568c83 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 10:35:20 +0200 Subject: [PATCH 01/12] const ref --- inc/TRestDetectorReadoutPlane.h | 2 +- src/TRestDetectorReadoutPlane.cxx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index 09f6f0f6..ee6ff1a2 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -147,7 +147,7 @@ class TRestDetectorReadoutPlane : public TObject { Bool_t isDaqIDInside(Int_t daqId); - Int_t GetModuleIDFromPosition(TVector3 pos); + Int_t GetModuleIDFromPosition(const TVector3& position); Int_t GetModuleIDFromPosition(Double_t x, Double_t y, Double_t z); diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 6fc4fb3b..712f6a94 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -342,14 +342,17 @@ Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition(Double_t x, Double_t y, /// \return the module *id* where the hit is found. If no module *id* is found /// it returns -1. /// -Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition(TVector3 pos) { - TVector3 posNew = TVector3(pos.X() - fPosition.X(), pos.Y() - fPosition.Y(), pos.Z()); +Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition(const TVector3& position) { + TVector3 posNew = TVector3(position.X() - fPosition.X(), position.Y() - fPosition.Y(), position.Z()); Double_t distance = GetDistanceTo(posNew); if (distance > 0 && distance < fTotalDriftDistance) { - for (int m = 0; m < GetNumberOfModules(); m++) - if (fReadoutModules[m].isInside(posNew.X(), posNew.Y())) return fReadoutModules[m].GetModuleID(); + for (auto& module : fReadoutModules) { + if (module.isInside(posNew.X(), posNew.Y())) { + return module.GetModuleID(); + } + } } return -1; From 2ac9a86541e954bd72f4d3347e55cf8121e82b5a Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 10:36:17 +0200 Subject: [PATCH 02/12] english typos --- inc/TRestDetectorReadoutPlane.h | 6 +++--- src/TRestDetectorReadout.cxx | 2 +- src/TRestDetectorReadoutModule.cxx | 6 +++--- src/TRestDetectorReadoutPixel.cxx | 2 +- src/TRestDetectorReadoutPlane.cxx | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index ee6ff1a2..7a75124c 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -42,11 +42,11 @@ class TRestDetectorReadoutPlane : public TObject { TVector3 fPosition; ///< The position of the readout plane. The relative position ///< of the modules will be shifted by this value. - TVector3 fPlaneVector; ///< The plane std::vector definning the plane orientation + TVector3 fPlaneVector; ///< The plane std::vector defining the plane orientation ///< and the side of the active volume. - TVector3 fCathodePosition; ///< The cathode position which delimites the active + TVector3 fCathodePosition; ///< The cathode position which delimits the active ///< volume together with the readout plane. - Double_t fChargeCollection; ///< A parameter between 0 and 1 definning how + Double_t fChargeCollection; ///< A parameter between 0 and 1 defining how ///< much charge should be collected from a ///< charge hit. It might be used to distribute ///< the charge between different readout planes. diff --git a/src/TRestDetectorReadout.cxx b/src/TRestDetectorReadout.cxx index 3f3ec4fe..0af6aac0 100644 --- a/src/TRestDetectorReadout.cxx +++ b/src/TRestDetectorReadout.cxx @@ -146,7 +146,7 @@ /// and the daq channel number defined at the acquisition system. /// If *no decoding* file is defined the relation between daq and readout /// channel is assigned *one to one*. -/// The decoding file must be a text file definning two columns with as +/// The decoding file must be a text file defining two columns with as /// many columns as the number of channels defined in the readout module. /// The first column is the daq channel number, and the second column is /// the readout channel defined in the RML file. diff --git a/src/TRestDetectorReadoutModule.cxx b/src/TRestDetectorReadoutModule.cxx index 920e0bc6..b83359f0 100644 --- a/src/TRestDetectorReadoutModule.cxx +++ b/src/TRestDetectorReadoutModule.cxx @@ -408,7 +408,7 @@ TVector2 TRestDetectorReadoutModule::GetPixelOrigin(Int_t channel, Int_t pixel) /// \brief Returns any of the pixel vertex position for a given *channel* and /// *pixel* indexes. /// -/// \param vertex A value between 0-3 definning the vertex position to be +/// \param vertex A value between 0-3 defining the vertex position to be /// returned /// TVector2 TRestDetectorReadoutModule::GetPixelVertex(Int_t channel, Int_t pixel, Int_t vertex) { @@ -423,7 +423,7 @@ TVector2 TRestDetectorReadoutModule::GetPixelVertex(Int_t channel, Int_t pixel, /// \brief Returns the center pixel position for a given *channel* and /// *pixel* indexes. /// -/// \param vertex A value between 0-3 definning the vertex position to be +/// \param vertex A value between 0-3 defining the vertex position to be /// returned /// TVector2 TRestDetectorReadoutModule::GetPixelCenter(Int_t channel, Int_t pixel) { @@ -474,7 +474,7 @@ Bool_t TRestDetectorReadoutModule::GetPixelTriangle(TRestDetectorReadoutPixel* p /// physical coordinates relative to the readout plane are returned, including /// rotation. /// -/// \param n A value between 0-3 definning the vertex position to be returned +/// \param n A value between 0-3 defining the vertex position to be returned /// TVector2 TRestDetectorReadoutModule::GetVertex(int n) const { TVector2 vertex(0, 0); diff --git a/src/TRestDetectorReadoutPixel.cxx b/src/TRestDetectorReadoutPixel.cxx index 591f55e3..a0421633 100644 --- a/src/TRestDetectorReadoutPixel.cxx +++ b/src/TRestDetectorReadoutPixel.cxx @@ -81,7 +81,7 @@ TVector2 TRestDetectorReadoutPixel::GetCenter() const { /////////////////////////////////////////////// /// \brief Returns the specified pixel vertex position /// -/// \param n A value between 0-3 definning the vertex position to be returned. +/// \param n A value between 0-3 defining the vertex position to be returned. /// TVector2 TRestDetectorReadoutPixel::GetVertex(int n) const { TVector2 vertex(0, 0); diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 712f6a94..e8bf14d7 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -155,7 +155,7 @@ Double_t TRestDetectorReadoutPlane::GetX(Int_t modID, Int_t chID) { if (deltaY < deltaX) x = rModule->GetPixelCenter(chID, 0).X(); } } else { - // we choose to ouput x only when deltaY > deltaX under non-90 deg rotation + // we choose to output x only when deltaY > deltaX under non-90 deg rotation // otherwise it is a y channel and should return nan if (deltaY > deltaX) x = rModule->GetPixelCenter(chID, 0).X(); } @@ -225,7 +225,7 @@ Double_t TRestDetectorReadoutPlane::GetY(Int_t modID, Int_t chID) { if (deltaY > deltaX) y = rModule->GetPixelCenter(chID, 0).Y(); } } else { - // we choose to ouput y only when deltaY < deltaX under non-90 deg rotation + // we choose to output y only when deltaY < deltaX under non-90 deg rotation // otherwise it is a x channel and should return nan if (deltaY < deltaX) y = rModule->GetPixelCenter(chID, 0).Y(); } @@ -300,7 +300,7 @@ Bool_t TRestDetectorReadoutPlane::isDaqIDInside(Int_t daqId) { /// \brief This method determines if the z-coordinate is inside the drift volume /// for this readout plane. /// -/// \param pos A TVector3 definning the position. +/// \param pos A TVector3 defining the position. /// /// \return 1 if the Z-position is found inside the drift volume definition. 0 /// otherwise @@ -321,7 +321,7 @@ Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume(TVector3 pos) { /// the readout plane. The *x* and *y* values must be found inside one of the /// readout modules defined inside the readout plane. /// -/// \param x,y,z Three Double_t definning the position. +/// \param x,y,z Three Double_t defining the position. /// /// \return the module *id* where the hit is found. If no module *id* is found /// it returns -1. @@ -337,7 +337,7 @@ Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition(Double_t x, Double_t y, /// the cathode and the readout plane. The *x* and *y* values must be found /// inside one of the readout modules defined inside the readout plane. /// -/// \param pos A TVector3 definning the position. +/// \param position A TVector3 defining the position. /// /// \return the module *id* where the hit is found. If no module *id* is found /// it returns -1. From 541c5569f6c49c277d2b252b2e8c0b7cf5c37aae Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 13:40:59 +0200 Subject: [PATCH 03/12] made some const refs --- inc/TRestDetectorReadout.h | 4 ++-- inc/TRestDetectorReadoutModule.h | 3 ++- inc/TRestDetectorReadoutPlane.h | 14 ++++++-------- src/TRestDetectorHitsToSignalProcess.cxx | 2 +- src/TRestDetectorReadout.cxx | 12 ++---------- src/TRestDetectorReadoutModule.cxx | 13 +++++++++---- src/TRestDetectorReadoutPlane.cxx | 10 +++------- 7 files changed, 25 insertions(+), 33 deletions(-) diff --git a/inc/TRestDetectorReadout.h b/inc/TRestDetectorReadout.h index 78855fc5..1947405b 100644 --- a/inc/TRestDetectorReadout.h +++ b/inc/TRestDetectorReadout.h @@ -74,8 +74,8 @@ class TRestDetectorReadout : public TRestMetadata { ///////////////////////////////////// TRestDetectorReadoutModule* ParseModuleDefinition(TiXmlElement* moduleDefinition); void GetPlaneModuleChannel(Int_t daqID, Int_t& planeID, Int_t& moduleID, Int_t& channelID); - Int_t GetHitsDaqChannel(const TVector3& hitPosition, Int_t& planeID, Int_t& moduleID, Int_t& channelID); - Int_t GetHitsDaqChannelAtReadoutPlane(const TVector3& hitPosition, Int_t& moduleID, Int_t& channelID, + Int_t GetHitsDaqChannel(const TVector3& position, Int_t& planeID, Int_t& moduleID, Int_t& channelID); + Int_t GetHitsDaqChannelAtReadoutPlane(const TVector3& position, Int_t& moduleID, Int_t& channelID, Int_t planeId = 0); Double_t GetX(Int_t signalID); Double_t GetY(Int_t signalID); diff --git a/inc/TRestDetectorReadoutModule.h b/inc/TRestDetectorReadoutModule.h index 0a49d646..d5350145 100644 --- a/inc/TRestDetectorReadoutModule.h +++ b/inc/TRestDetectorReadoutModule.h @@ -217,6 +217,7 @@ class TRestDetectorReadoutModule : public TObject { /// plane are inside this readout module. /// inline Bool_t isInside(Double_t x, Double_t y) { return isInside({x, y}); } + inline Bool_t isInside(const TVector3& position) const; Bool_t isInsideChannel(Int_t channel, Double_t x, Double_t y); Bool_t isInsideChannel(Int_t channel, const TVector2& position); @@ -225,7 +226,7 @@ class TRestDetectorReadoutModule : public TObject { Bool_t isInsidePixel(Int_t channel, Int_t pixel, const TVector2& position); Bool_t isDaqIDInside(Int_t daqID); - Int_t FindChannel(Double_t x, Double_t y); + Int_t FindChannel(const TVector2& position); TVector2 GetDistanceToModule(const TVector2& position); TVector2 GetPixelOrigin(Int_t channel, Int_t pixel); diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index 7a75124c..d77d6285 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -68,15 +68,15 @@ class TRestDetectorReadoutPlane : public TObject { void SetID(int id) { fPlaneID = id; } /// Sets the readout plane position - void SetPosition(TVector3 pos) { fPosition = pos; } + void SetPosition(const TVector3& pos) { fPosition = pos; } /// Sets the cathode plane position. By default is parallel to the readout /// plane. - void SetCathodePosition(TVector3 pos) { fCathodePosition = pos; } + void SetCathodePosition(const TVector3& pos) { fCathodePosition = pos; } /// Sets the orientation of the readout plane, and defines the side of the /// active volume. - void SetPlaneVector(TVector3 vect) { fPlaneVector = vect.Unit(); } + void SetPlaneVector(const TVector3& vect) { fPlaneVector = vect.Unit(); } /// Sets the value for the charge collection. void SetChargeCollection(Double_t charge) { fChargeCollection = charge; } @@ -105,7 +105,7 @@ class TRestDetectorReadoutPlane : public TObject { /// Returns the perpendicular distance to the readout plane from a given /// position *pos*. - Double_t GetDistanceTo(TVector3 pos); + Double_t GetDistanceTo(const TVector3& pos); /// Returns the perpendicular distance to the readout plane from a given /// position *x*, *y*, *z*. @@ -113,7 +113,7 @@ class TRestDetectorReadoutPlane : public TObject { /// Returns a TVector2 oriented as the shortest distance of a given position /// *pos* on the plane to a specific module with id *mod* - TVector2 GetDistanceToModule(Int_t mod, TVector2 pos) { + TVector2 GetDistanceToModule(Int_t mod, const TVector2& pos) { return GetModuleByID(mod)->GetDistanceToModule(pos); } @@ -143,14 +143,12 @@ class TRestDetectorReadoutPlane : public TObject { Int_t isZInsideDriftVolume(Double_t z); - Int_t isZInsideDriftVolume(TVector3 pos); + Int_t isZInsideDriftVolume(const TVector3& pos); Bool_t isDaqIDInside(Int_t daqId); Int_t GetModuleIDFromPosition(const TVector3& position); - Int_t GetModuleIDFromPosition(Double_t x, Double_t y, Double_t z); - void SetDriftDistance(); void Draw(); diff --git a/src/TRestDetectorHitsToSignalProcess.cxx b/src/TRestDetectorHitsToSignalProcess.cxx index 9179c865..5a3a3406 100644 --- a/src/TRestDetectorHitsToSignalProcess.cxx +++ b/src/TRestDetectorHitsToSignalProcess.cxx @@ -230,7 +230,7 @@ TRestEvent* TRestDetectorHitsToSignalProcess::ProcessEvent(TRestEvent* inputEven for (int p = 0; p < fReadout->GetNumberOfReadoutPlanes(); p++) { Int_t daqId = - fReadout->GetHitsDaqChannelAtReadoutPlane(TVector3(x, y, z), moduleId, channelId, p); + fReadout->GetHitsDaqChannelAtReadoutPlane({x, y, z}, moduleId, channelId, p); TRestDetectorReadoutPlane* plane = fReadout->GetReadoutPlaneWithID(p); diff --git a/src/TRestDetectorReadout.cxx b/src/TRestDetectorReadout.cxx index 0af6aac0..ffb94f02 100644 --- a/src/TRestDetectorReadout.cxx +++ b/src/TRestDetectorReadout.cxx @@ -752,17 +752,9 @@ Int_t TRestDetectorReadout::GetHitsDaqChannel(const TVector3& hitpos, Int_t& pla Int_t& channelID) { for (int p = 0; p < GetNumberOfReadoutPlanes(); p++) { TRestDetectorReadoutPlane* plane = &fReadoutPlanes[p]; - int m = plane->GetModuleIDFromPosition(hitpos.X(), hitpos.Y(), hitpos.Z()); + int m = plane->GetModuleIDFromPosition(position); if (m >= 0) { - // TRestDetectorReadoutModule* mod = plane->GetModuleByID(m); - TRestDetectorReadoutModule* mod = plane->GetModuleByID(m); - Int_t readoutChannel = mod->FindChannel(hitpos.X(), hitpos.Y()); - if (readoutChannel >= 0) { - planeID = plane->GetID(); - moduleID = mod->GetModuleID(); - channelID = readoutChannel; - return mod->GetChannel(readoutChannel)->GetDaqID(); - } + return GetHitsDaqChannelAtReadoutPlane(position, moduleID, channelID, p); } } return -1; diff --git a/src/TRestDetectorReadoutModule.cxx b/src/TRestDetectorReadoutModule.cxx index b83359f0..268c3b7b 100644 --- a/src/TRestDetectorReadoutModule.cxx +++ b/src/TRestDetectorReadoutModule.cxx @@ -231,7 +231,10 @@ Bool_t TRestDetectorReadoutModule::isDaqIDInside(Int_t daqID) { /// The readout mapping (see TRestDetectorReadoutMapping) is used to help finding /// the pixel where coordinates absX and absY fall in. /// -Int_t TRestDetectorReadoutModule::FindChannel(Double_t absX, Double_t absY) { +Int_t TRestDetectorReadoutModule::FindChannel(const TVector2& position) { + const auto& absX = position.X(); + const auto& absY = position.Y(); + if (!isInside(absX, absY)) return -1; Double_t x = TransformToModuleCoordinates(absX, absY).X(); @@ -325,9 +328,11 @@ Int_t TRestDetectorReadoutModule::FindChannel(Double_t absX, Double_t absY) { Bool_t TRestDetectorReadoutModule::isInside(const TVector2& position) { TVector2 rotPos = TransformToModuleCoordinates(position); - if (rotPos.X() >= 0 && rotPos.X() < fModuleSizeX) - if (rotPos.Y() >= 0 && rotPos.Y() < fModuleSizeY) return true; - + if (rotPos.X() >= 0 && rotPos.X() < fModuleSizeX) { + if (rotPos.Y() >= 0 && rotPos.Y() < fModuleSizeY) { + return true; + } + } return false; } diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index e8bf14d7..86b6e14d 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -250,7 +250,7 @@ Int_t TRestDetectorReadoutPlane::FindChannel(Int_t module, Double_t absX, Double // FindChannel will take a long time to search for the channel if it is not // there. It will be faster - return fReadoutModules[module].FindChannel(modX, modY); + return fReadoutModules[module].FindChannel({modX, modY}); } /////////////////////////////////////////////// @@ -265,7 +265,7 @@ Double_t TRestDetectorReadoutPlane::GetDistanceTo(Double_t x, Double_t y, Double /// \brief Returns the perpendicular distance to the readout plane of a given /// TVector3 position /// -Double_t TRestDetectorReadoutPlane::GetDistanceTo(TVector3 pos) { +Double_t TRestDetectorReadoutPlane::GetDistanceTo(const TVector3& pos) { return (pos - GetPosition()).Dot(GetPlaneVector()); } @@ -305,7 +305,7 @@ Bool_t TRestDetectorReadoutPlane::isDaqIDInside(Int_t daqId) { /// \return 1 if the Z-position is found inside the drift volume definition. 0 /// otherwise /// -Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume(TVector3 pos) { +Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume(const TVector3& pos) { TVector3 posNew = TVector3(pos.X() - fPosition.X(), pos.Y() - fPosition.Y(), pos.Z()); Double_t distance = GetDistanceTo(posNew); @@ -326,11 +326,7 @@ Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume(TVector3 pos) { /// \return the module *id* where the hit is found. If no module *id* is found /// it returns -1. /// -Int_t TRestDetectorReadoutPlane::GetModuleIDFromPosition(Double_t x, Double_t y, Double_t z) { - TVector3 pos = TVector3(x, y, z); - return GetModuleIDFromPosition(pos); -} /////////////////////////////////////////////// /// \brief This method returns the module id where *pos* is found. /// The z-coordinate must be found in between From 3f7b89579d1a005392065d9b5ae3cbaad4135421 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 13:41:13 +0200 Subject: [PATCH 04/12] add TRestDetectorReadoutPlane::GetRelativePosition --- inc/TRestDetectorReadoutPlane.h | 2 ++ src/TRestDetectorReadout.cxx | 9 +++++---- src/TRestDetectorReadoutPlane.cxx | 11 +++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index d77d6285..a045eb96 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -117,6 +117,8 @@ class TRestDetectorReadoutPlane : public TObject { return GetModuleByID(mod)->GetDistanceToModule(pos); } + TVector2 GetRelativePosition(const TVector3& pos) const; + TRestDetectorReadoutModule& operator[](int mod) { return fReadoutModules[mod]; } /// Returns a pointer to a readout module using its std::vector index diff --git a/src/TRestDetectorReadout.cxx b/src/TRestDetectorReadout.cxx index ffb94f02..fd248347 100644 --- a/src/TRestDetectorReadout.cxx +++ b/src/TRestDetectorReadout.cxx @@ -748,7 +748,7 @@ void TRestDetectorReadout::GetPlaneModuleChannel(Int_t signalID, Int_t& planeID, } } -Int_t TRestDetectorReadout::GetHitsDaqChannel(const TVector3& hitpos, Int_t& planeID, Int_t& moduleID, +Int_t TRestDetectorReadout::GetHitsDaqChannel(const TVector3& position, Int_t& planeID, Int_t& moduleID, Int_t& channelID) { for (int p = 0; p < GetNumberOfReadoutPlanes(); p++) { TRestDetectorReadoutPlane* plane = &fReadoutPlanes[p]; @@ -773,7 +773,7 @@ Int_t TRestDetectorReadout::GetHitsDaqChannel(const TVector3& hitpos, Int_t& pla /// \return the value of the daq id corresponding to the readout channel // /// -Int_t TRestDetectorReadout::GetHitsDaqChannelAtReadoutPlane(const TVector3& hitpos, Int_t& moduleID, +Int_t TRestDetectorReadout::GetHitsDaqChannelAtReadoutPlane(const TVector3& position, Int_t& moduleID, Int_t& channelID, Int_t planeId) { if (planeId > GetNumberOfReadoutPlanes()) { RESTWarning << "TRestDetectorReadout. Fail trying to retrieve planeId : " << planeId << RESTendl; @@ -782,10 +782,11 @@ Int_t TRestDetectorReadout::GetHitsDaqChannelAtReadoutPlane(const TVector3& hitp } TRestDetectorReadoutPlane* plane = &fReadoutPlanes[planeId]; - int m = plane->GetModuleIDFromPosition(hitpos.X(), hitpos.Y(), hitpos.Z()); + int m = plane->GetModuleIDFromPosition(position); if (m >= 0) { TRestDetectorReadoutModule* mod = plane->GetModuleByID(m); - Int_t readoutChannel = mod->FindChannel(hitpos.X(), hitpos.Y()); + const TVector2 relativePosition = plane->GetRelativePosition(position); + Int_t readoutChannel = mod->FindChannel(relativePosition); if (readoutChannel >= 0) { moduleID = mod->GetModuleID(); channelID = readoutChannel; diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 86b6e14d..1d629b12 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -446,3 +446,14 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double } } } + + +/////////////////////////////////////////////// +/// \brief Rotates the point with the direction of the readout plane. +/// +TVector2 TRestDetectorReadoutPlane::GetRelativePosition(const TVector3& position) const { + TVector3 rotated = position; + rotated.RotateUz(fPlaneVector); + + return {rotated.X(), rotated.Y()}; +} From 7586389343db83627ebee262a704f0b7382f9992 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 11:43:48 +0000 Subject: [PATCH 05/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestDetectorHitsToSignalProcess.cxx | 3 +-- src/TRestDetectorReadoutPlane.cxx | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/TRestDetectorHitsToSignalProcess.cxx b/src/TRestDetectorHitsToSignalProcess.cxx index 5a3a3406..3fd3c30c 100644 --- a/src/TRestDetectorHitsToSignalProcess.cxx +++ b/src/TRestDetectorHitsToSignalProcess.cxx @@ -229,8 +229,7 @@ TRestEvent* TRestDetectorHitsToSignalProcess::ProcessEvent(TRestEvent* inputEven Int_t channelId = -1; for (int p = 0; p < fReadout->GetNumberOfReadoutPlanes(); p++) { - Int_t daqId = - fReadout->GetHitsDaqChannelAtReadoutPlane({x, y, z}, moduleId, channelId, p); + Int_t daqId = fReadout->GetHitsDaqChannelAtReadoutPlane({x, y, z}, moduleId, channelId, p); TRestDetectorReadoutPlane* plane = fReadout->GetReadoutPlaneWithID(p); diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 1d629b12..ebb47500 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -447,7 +447,6 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double } } - /////////////////////////////////////////////// /// \brief Rotates the point with the direction of the readout plane. /// From 3a0fbc7bc074bbe591b1e238ea08acdb7e99808a Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 14:45:21 +0200 Subject: [PATCH 06/12] attempt to understand pipeline failure --- src/TRestDetectorReadoutPlane.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index ebb47500..68a5fcdb 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -451,6 +451,7 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double /// \brief Rotates the point with the direction of the readout plane. /// TVector2 TRestDetectorReadoutPlane::GetRelativePosition(const TVector3& position) const { + return {position.X(), position.Y()}; // debug TVector3 rotated = position; rotated.RotateUz(fPlaneVector); From 4707aaaa0b38f7f0f2733de5c16bc74d8167e504 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 15:35:49 +0200 Subject: [PATCH 07/12] plane vector defaults to (0,0,1) --- inc/TRestDetectorReadoutPlane.h | 2 +- src/TRestDetectorReadoutPlane.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index a045eb96..f103adc9 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -76,7 +76,7 @@ class TRestDetectorReadoutPlane : public TObject { /// Sets the orientation of the readout plane, and defines the side of the /// active volume. - void SetPlaneVector(const TVector3& vect) { fPlaneVector = vect.Unit(); } + void SetPlaneVector(const TVector3& v) { fPlaneVector = v.Unit(); } /// Sets the value for the charge collection. void SetChargeCollection(Double_t charge) { fChargeCollection = charge; } diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 68a5fcdb..117fb6f6 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -63,7 +63,7 @@ TRestDetectorReadoutPlane::~TRestDetectorReadoutPlane() {} void TRestDetectorReadoutPlane::Initialize() { fCathodePosition = TVector3(0, 0, 0); fPosition = TVector3(0, 0, 0); - fPlaneVector = TVector3(0, 0, 0); + fPlaneVector = TVector3(0, 0, 1); fNModules = 0; fReadoutModules.clear(); From b19a902afbf373639a452f6dacd803eb2eb54665 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Wed, 31 May 2023 17:50:41 +0200 Subject: [PATCH 08/12] rotate vector in plane direction --- src/TRestDetectorReadoutPlane.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 117fb6f6..fb57c0be 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -451,7 +451,6 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double /// \brief Rotates the point with the direction of the readout plane. /// TVector2 TRestDetectorReadoutPlane::GetRelativePosition(const TVector3& position) const { - return {position.X(), position.Y()}; // debug TVector3 rotated = position; rotated.RotateUz(fPlaneVector); From 3a00904b5aa1766c051401a297fdba37b7914364 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 1 Jun 2023 10:44:27 +0200 Subject: [PATCH 09/12] defined local coordinates for the readout plane --- inc/TRestDetectorReadoutPlane.h | 28 +++++++++++++------- src/TRestDetectorReadout.cxx | 2 +- src/TRestDetectorReadoutPlane.cxx | 43 ++++++++++++++++++++++++------- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index f103adc9..000cc3c0 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -40,10 +40,18 @@ class TRestDetectorReadoutPlane : public TObject { Int_t fPlaneID; ///< The readout plane id. The id number is imposed by the ///< order of creation. Being the first id=0. - TVector3 fPosition; ///< The position of the readout plane. The relative position - ///< of the modules will be shifted by this value. - TVector3 fPlaneVector; ///< The plane std::vector defining the plane orientation - ///< and the side of the active volume. + TVector3 fPosition; ///< The position of the readout plane. The relative position + ///< of the modules will be shifted by this value. + TVector3 fPlaneVector; ///< The plane std::vector defining the plane orientation + ///< and the side of the active volume. + TVector3 fPlaneAxisX; ///< The first coordinate vector of the plane in absolute coordinates. + /// < This vector is contained in the plane and corresponds to the first local + /// coordinate (1,0) + TVector3 fPlaneAxisY; ///< The first coordinate vector of the plane in absolute coordinates. + /// < This vector is contained in the plane and corresponds to the second local + /// coordinate (0,1) + Double_t fPlaneRotationAngle; ///< The angle of rotation of the plane around the planeVector + ///< axis. This rotates the planeAxisX and planeAxisY vectors. TVector3 fCathodePosition; ///< The cathode position which delimits the active ///< volume together with the readout plane. Double_t fChargeCollection; ///< A parameter between 0 and 1 defining how @@ -74,9 +82,11 @@ class TRestDetectorReadoutPlane : public TObject { /// plane. void SetCathodePosition(const TVector3& pos) { fCathodePosition = pos; } - /// Sets the orientation of the readout plane, and defines the side of the - /// active volume. - void SetPlaneVector(const TVector3& v) { fPlaneVector = v.Unit(); } + /// Sets the orientation of the readout plane, and defines the side of the active volume. + void SetPlaneVector(const TVector3& v); + + /// Sets the orientation of the readout plane, and defines the side of the active volume. + void SetPlaneRotation(Double_t rotationAngle); /// Sets the value for the charge collection. void SetChargeCollection(Double_t charge) { fChargeCollection = charge; } @@ -117,7 +127,7 @@ class TRestDetectorReadoutPlane : public TObject { return GetModuleByID(mod)->GetDistanceToModule(pos); } - TVector2 GetRelativePosition(const TVector3& pos) const; + TVector2 GetPositionInReadoutPlane(const TVector3& position) const; TRestDetectorReadoutModule& operator[](int mod) { return fReadoutModules[mod]; } @@ -170,6 +180,6 @@ class TRestDetectorReadoutPlane : public TObject { // Destructor virtual ~TRestDetectorReadoutPlane(); - ClassDef(TRestDetectorReadoutPlane, 1); + ClassDef(TRestDetectorReadoutPlane, 2); }; #endif diff --git a/src/TRestDetectorReadout.cxx b/src/TRestDetectorReadout.cxx index fd248347..a12acbdb 100644 --- a/src/TRestDetectorReadout.cxx +++ b/src/TRestDetectorReadout.cxx @@ -785,7 +785,7 @@ Int_t TRestDetectorReadout::GetHitsDaqChannelAtReadoutPlane(const TVector3& posi int m = plane->GetModuleIDFromPosition(position); if (m >= 0) { TRestDetectorReadoutModule* mod = plane->GetModuleByID(m); - const TVector2 relativePosition = plane->GetRelativePosition(position); + const TVector2 relativePosition = plane->GetPositionInReadoutPlane(position); Int_t readoutChannel = mod->FindChannel(relativePosition); if (readoutChannel >= 0) { moduleID = mod->GetModuleID(); diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index fb57c0be..df6d53e9 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -61,9 +61,13 @@ TRestDetectorReadoutPlane::~TRestDetectorReadoutPlane() {} /// \brief TRestDetectorReadoutPlane initialization /// void TRestDetectorReadoutPlane::Initialize() { - fCathodePosition = TVector3(0, 0, 0); - fPosition = TVector3(0, 0, 0); - fPlaneVector = TVector3(0, 0, 1); + fCathodePosition = {0, 0, 0}; + fPosition = {0, 0, 0}; + fPlaneVector = {0, 0, 1}; + + fPlaneAxisX = {1, 0, 0}; + fPlaneAxisY = {0, 1, 0}; + fPlaneRotationAngle = 0; fNModules = 0; fReadoutModules.clear(); @@ -86,6 +90,22 @@ void TRestDetectorReadoutPlane::SetDriftDistance() { this->SetTotalDriftDistance(tDriftDistance); } +void TRestDetectorReadoutPlane::SetPlaneVector(const TVector3& v) { + fPlaneVector = v; + fPlaneVector = fPlaneVector.Unit(); + + // rotate the axis X and Y of the plane + + fPlaneAxisX.RotateUz(fPlaneVector); + fPlaneAxisY.RotateUz(fPlaneVector); +} + +void TRestDetectorReadoutPlane::SetPlaneRotation(Double_t rotationAngle) { + // rotate the axis X and Y of the plane + fPlaneAxisX.Rotate(rotationAngle, fPlaneVector); + fPlaneAxisY.Rotate(rotationAngle, fPlaneVector); +} + /////////////////////////////////////////////// /// \brief Returns a pointer to a module using its internal module id /// @@ -369,13 +389,19 @@ void TRestDetectorReadoutPlane::Print(Int_t DetailLevel) { RESTMetadata << "-- Cathode Position : X = " << fCathodePosition.X() << " mm, " << " Y : " << fCathodePosition.Y() << " mm, Z : " << fCathodePosition.Z() << " mm" << RESTendl; + RESTMetadata << "-- Local X axis vector (1,0) in 3d space : X = " << fPlaneAxisX.X() + << " mm, Y : " << fPlaneAxisX.Y() << " mm, Z : " << fPlaneAxisX.Z() << " mm" << RESTendl; + RESTMetadata << "-- Local Y axis vector (0,1) in 3d space : X = " << fPlaneAxisY.X() + << " mm, Y : " << fPlaneAxisY.Y() << " mm, Z : " << fPlaneAxisY.Z() << " mm" << RESTendl; RESTMetadata << "-- Total drift distance : " << fTotalDriftDistance << " mm" << RESTendl; RESTMetadata << "-- Charge collection : " << fChargeCollection << RESTendl; RESTMetadata << "-- Total modules : " << GetNumberOfModules() << RESTendl; RESTMetadata << "-- Total channels : " << GetNumberOfChannels() << RESTendl; RESTMetadata << "----------------------------------------------------------------" << RESTendl; - for (int i = 0; i < GetNumberOfModules(); i++) fReadoutModules[i].Print(DetailLevel - 1); + for (int i = 0; i < GetNumberOfModules(); i++) { + fReadoutModules[i].Print(DetailLevel - 1); + } } } @@ -448,11 +474,8 @@ void TRestDetectorReadoutPlane::GetBoundaries(double& xmin, double& xmax, double } /////////////////////////////////////////////// -/// \brief Rotates the point with the direction of the readout plane. +/// \brief Returns the position of the point in the local coordinates of the plane /// -TVector2 TRestDetectorReadoutPlane::GetRelativePosition(const TVector3& position) const { - TVector3 rotated = position; - rotated.RotateUz(fPlaneVector); - - return {rotated.X(), rotated.Y()}; +TVector2 TRestDetectorReadoutPlane::GetPositionInReadoutPlane(const TVector3& position) const { + return {position.Dot(fPlaneAxisX), fPosition.Dot(fPlaneAxisX)}; } From 5ced2bc5a2feed65f8ad9f3ed5c0c83becce28f4 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 1 Jun 2023 10:46:38 +0200 Subject: [PATCH 10/12] plane normal vector will always point from anode to cathode --- src/TRestDetectorReadoutPlane.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index df6d53e9..29e853ab 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -90,10 +90,18 @@ void TRestDetectorReadoutPlane::SetDriftDistance() { this->SetTotalDriftDistance(tDriftDistance); } -void TRestDetectorReadoutPlane::SetPlaneVector(const TVector3& v) { - fPlaneVector = v; +void TRestDetectorReadoutPlane::SetPlaneVector(const TVector3& planeVector) { + fPlaneVector = planeVector; fPlaneVector = fPlaneVector.Unit(); + // if the plane vector does not have the correct direction: from anode to cathode, we flip it + + const TVector3 direction = fCathodePosition - fPosition; + if (fPlaneVector.Dot(direction) < 0) { + fPlaneVector *= -1; + RESTWarning << "Plane vector was flipped to point from anode to cathode" << RESTendl; + } + // rotate the axis X and Y of the plane fPlaneAxisX.RotateUz(fPlaneVector); From b912f4ccc14f26f055ae1dc2a5dde5c64356ed48 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 1 Jun 2023 11:11:30 +0200 Subject: [PATCH 11/12] corrected rotation to be idempotent --- inc/TRestDetectorReadoutPlane.h | 5 ++++- src/TRestDetectorReadoutPlane.cxx | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/inc/TRestDetectorReadoutPlane.h b/inc/TRestDetectorReadoutPlane.h index 000cc3c0..7aefe27d 100644 --- a/inc/TRestDetectorReadoutPlane.h +++ b/inc/TRestDetectorReadoutPlane.h @@ -51,7 +51,7 @@ class TRestDetectorReadoutPlane : public TObject { /// < This vector is contained in the plane and corresponds to the second local /// coordinate (0,1) Double_t fPlaneRotationAngle; ///< The angle of rotation of the plane around the planeVector - ///< axis. This rotates the planeAxisX and planeAxisY vectors. + ///< axis. This rotates the planeAxisX and planeAxisY vectors. (degrees) TVector3 fCathodePosition; ///< The cathode position which delimits the active ///< volume together with the readout plane. Double_t fChargeCollection; ///< A parameter between 0 and 1 defining how @@ -107,6 +107,9 @@ class TRestDetectorReadoutPlane : public TObject { /// Returns a TVector3 with a std::vector normal to the readout plane inline TVector3 GetPlaneVector() const { return fPlaneVector; } + /// Returns the plane rotation angle in degrees + inline Double_t GetPlaneRotationAngle() const { return fPlaneRotationAngle; } + /// Returns the charge collection ratio at this readout plane inline Double_t GetChargeCollection() const { return fChargeCollection; } diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 29e853ab..98312c73 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -108,10 +108,17 @@ void TRestDetectorReadoutPlane::SetPlaneVector(const TVector3& planeVector) { fPlaneAxisY.RotateUz(fPlaneVector); } +/////////////////////////////////////////////// +/// \brief Sets the plane rotation in degrees +/// void TRestDetectorReadoutPlane::SetPlaneRotation(Double_t rotationAngle) { + fPlaneRotationAngle = rotationAngle; // in degrees // rotate the axis X and Y of the plane - fPlaneAxisX.Rotate(rotationAngle, fPlaneVector); - fPlaneAxisY.Rotate(rotationAngle, fPlaneVector); + fPlaneAxisX = {1, 0, 0}; + fPlaneAxisY = {0, 1, 0}; + + fPlaneAxisX.Rotate(fPlaneRotationAngle * TMath::DegToRad(), fPlaneVector); + fPlaneAxisY.Rotate(fPlaneRotationAngle * TMath::DegToRad(), fPlaneVector); } /////////////////////////////////////////////// From 29a879bad44bdda0bdf87d8d43966cee2df56874 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 1 Jun 2023 11:24:38 +0200 Subject: [PATCH 12/12] simplified module coordinates --- inc/TRestDetectorReadoutModule.h | 24 ++++-------------------- src/TRestDetectorReadoutModule.cxx | 12 ++++++------ src/TRestDetectorReadoutPlane.cxx | 4 +++- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/inc/TRestDetectorReadoutModule.h b/inc/TRestDetectorReadoutModule.h index d5350145..8f0e1e8e 100644 --- a/inc/TRestDetectorReadoutModule.h +++ b/inc/TRestDetectorReadoutModule.h @@ -77,27 +77,13 @@ class TRestDetectorReadoutModule : public TObject { /// Converts the coordinates given by TVector2 in the readout plane reference /// system to the readout module reference system. inline TVector2 TransformToModuleCoordinates(const TVector2& p) { - return TransformToModuleCoordinates(p.X(), p.Y()); - } - - /// Converts the coordinates (xPhys,yPhys) in the readout plane reference - /// system to the readout module reference system. - inline TVector2 TransformToModuleCoordinates(Double_t xPhys, Double_t yPhys) { - TVector2 coords(xPhys - fModuleOriginX, yPhys - fModuleOriginY); - TVector2 rot = coords.Rotate(-fModuleRotation * TMath::Pi() / 180.); - - return rot; + return p - TVector2(fModuleOriginX, fModuleOriginY); } /// Converts the coordinates (xMod,yMod) in the readout module reference /// system to the readout plane reference system. - inline TVector2 TransformToPhysicalCoordinates(Double_t xMod, Double_t yMod) { - TVector2 coords(xMod, yMod); - - coords = coords.Rotate(fModuleRotation * TMath::Pi() / 180.); - coords = coords + TVector2(fModuleOriginX, fModuleOriginY); - - return coords; + inline TVector2 TransformToReadoutCoordinates(const TVector2& p) { + return p + TVector2(fModuleOriginX, fModuleOriginY); } protected: @@ -181,9 +167,7 @@ class TRestDetectorReadoutModule : public TObject { /// Converts the coordinates given by TVector2 in the readout module reference /// system to the readout plane reference system. - TVector2 GetPhysicalCoordinates(const TVector2& p) { - return TransformToPhysicalCoordinates(p.X(), p.Y()); - } + TVector2 GetPhysicalCoordinates(const TVector2& p) { return TransformToReadoutCoordinates(p); } /// Returns the module name inline const char* GetName() const override { return fModuleName.Data(); } diff --git a/src/TRestDetectorReadoutModule.cxx b/src/TRestDetectorReadoutModule.cxx index 268c3b7b..d78d38d8 100644 --- a/src/TRestDetectorReadoutModule.cxx +++ b/src/TRestDetectorReadoutModule.cxx @@ -172,8 +172,8 @@ void TRestDetectorReadoutModule::DoReadoutMapping(Int_t nodes) { for (int j = 0; j < nodes; j++) { Double_t x = fMapping.GetX(i); Double_t y = fMapping.GetY(j); - Double_t xAbs = TransformToPhysicalCoordinates(x, y).X(); - Double_t yAbs = TransformToPhysicalCoordinates(x, y).Y(); + Double_t xAbs = TransformToReadoutCoordinates({x, y}).X(); + Double_t yAbs = TransformToReadoutCoordinates({x, y}).Y(); if (!fMapping.isNodeSet(i, j)) { for (int ch = 0; ch < GetNumberOfChannels() && !fMapping.isNodeSet(i, j); ch++) { @@ -198,8 +198,8 @@ void TRestDetectorReadoutModule::DoReadoutMapping(Int_t nodes) { if (!fMapping.isNodeSet(i, j)) { Double_t x = fMapping.GetX(i); Double_t y = fMapping.GetY(j); - Double_t xAbs = TransformToPhysicalCoordinates(x, y).X(); - Double_t yAbs = TransformToPhysicalCoordinates(x, y).Y(); + Double_t xAbs = TransformToReadoutCoordinates({x, y}).X(); + Double_t yAbs = TransformToReadoutCoordinates({x, y}).Y(); cout << "Node NOT SET : " << i << " , " << j << " Mapping x : " << x << " y : " << y << endl; for (int ch = 0; ch < GetNumberOfChannels(); ch++) { @@ -237,8 +237,8 @@ Int_t TRestDetectorReadoutModule::FindChannel(const TVector2& position) { if (!isInside(absX, absY)) return -1; - Double_t x = TransformToModuleCoordinates(absX, absY).X(); - Double_t y = TransformToModuleCoordinates(absX, absY).Y(); + Double_t x = TransformToModuleCoordinates({absX, absY}).X(); + Double_t y = TransformToModuleCoordinates({absX, absY}).Y(); Int_t nodeX = fMapping.GetNodeX(x); Int_t nodeY = fMapping.GetNodeY(y); diff --git a/src/TRestDetectorReadoutPlane.cxx b/src/TRestDetectorReadoutPlane.cxx index 98312c73..1cc60818 100644 --- a/src/TRestDetectorReadoutPlane.cxx +++ b/src/TRestDetectorReadoutPlane.cxx @@ -326,7 +326,9 @@ Int_t TRestDetectorReadoutPlane::isZInsideDriftVolume(Double_t z) { /// Bool_t TRestDetectorReadoutPlane::isDaqIDInside(Int_t daqId) { for (int m = 0; m < GetNumberOfModules(); m++) - if (fReadoutModules[m].isDaqIDInside(daqId)) return true; + if (fReadoutModules[m].isDaqIDInside(daqId)) { + return true; + } return false; }