From ad9c3ca25a535afa9c97dcba7b2774b8919550fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:06:04 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../masks/inc/TRestRadialStrippedMask.h | 2 +- .../masks/src/TRestRadialStrippedMask.cxx | 33 +++++++++---------- .../sensitivity/inc/TRestSensitivity.h | 4 +-- .../framework/tools/src/TRestStringHelper.cxx | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/source/framework/masks/inc/TRestRadialStrippedMask.h b/source/framework/masks/inc/TRestRadialStrippedMask.h index 40c90462f..05a371917 100644 --- a/source/framework/masks/inc/TRestRadialStrippedMask.h +++ b/source/framework/masks/inc/TRestRadialStrippedMask.h @@ -31,7 +31,7 @@ class TRestRadialStrippedMask : public TRestPatternMask { void Initialize() override; /// The periodity of the stripped structure in radians - Double_t fStripsAngle = TMath::Pi()/3; //< + Double_t fStripsAngle = TMath::Pi() / 3; //< /// The width of the stripped structure in mm Double_t fStripsThickness = 0.5; //< diff --git a/source/framework/masks/src/TRestRadialStrippedMask.cxx b/source/framework/masks/src/TRestRadialStrippedMask.cxx index 6c47b0e11..e43e8c46a 100644 --- a/source/framework/masks/src/TRestRadialStrippedMask.cxx +++ b/source/framework/masks/src/TRestRadialStrippedMask.cxx @@ -163,23 +163,22 @@ void TRestRadialStrippedMask::Initialize() { Int_t TRestRadialStrippedMask::GetRegion(Double_t& x, Double_t& y) { if (TRestPatternMask::GetRegion(x, y)) return 0; - TVector2 point(x, y); - Double_t phi = point.Phi(); - - /// phi determines the region where the point is found - Int_t region = (Int_t) (phi/fStripsAngle); - region = 1 + region%fMaxRegions; - - Double_t angle = 0; - /// Checking if we hit an arm - while( angle < 2*TMath::Pi() ) - { - if( point.Y() < fStripsThickness/2. && point.Y() > -fStripsThickness/2. && point.X() >= 0 ) - return 0; - - point = point.Rotate(fStripsAngle); - angle += fStripsAngle; - } + TVector2 point(x, y); + Double_t phi = point.Phi(); + + /// phi determines the region where the point is found + Int_t region = (Int_t)(phi / fStripsAngle); + region = 1 + region % fMaxRegions; + + Double_t angle = 0; + /// Checking if we hit an arm + while (angle < 2 * TMath::Pi()) { + if (point.Y() < fStripsThickness / 2. && point.Y() > -fStripsThickness / 2. && point.X() >= 0) + return 0; + + point = point.Rotate(fStripsAngle); + angle += fStripsAngle; + } return 1 + region % fModulus; } diff --git a/source/framework/sensitivity/inc/TRestSensitivity.h b/source/framework/sensitivity/inc/TRestSensitivity.h index f4e6e9deb..c60350f9e 100644 --- a/source/framework/sensitivity/inc/TRestSensitivity.h +++ b/source/framework/sensitivity/inc/TRestSensitivity.h @@ -41,7 +41,7 @@ class TRestSensitivity : public TRestMetadata { Bool_t fFrozen = false; //< Only needed if we add experiments by other means than RML /// It is used to generate a histogram with the signal distribution produced with different signal samples - TH1D* fSignalTest = nullptr; //< + TH1D* fSignalTest = nullptr; //< /// A canvas to draw TCanvas* fCanvas = nullptr; //! @@ -69,7 +69,7 @@ class TRestSensitivity : public TRestMetadata { std::vector GetAveragedCurve(); std::vector> GetLevelCurves(const std::vector& levels); - void ExportCurve(std::string fname, Double_t factor = 1.e-10, Double_t power = 0.25, int n = 0); + void ExportCurve(std::string fname, Double_t factor = 1.e-10, Double_t power = 0.25, int n = 0); void ExportAveragedCurve(std::string fname, Double_t factor = 1.e-10, Double_t power = 0.25); TH1D* SignalStatisticalTest(Double_t node, Int_t N); diff --git a/source/framework/tools/src/TRestStringHelper.cxx b/source/framework/tools/src/TRestStringHelper.cxx index 10fdffeb5..b717a5d54 100644 --- a/source/framework/tools/src/TRestStringHelper.cxx +++ b/source/framework/tools/src/TRestStringHelper.cxx @@ -121,7 +121,7 @@ string REST_StringHelper::ReplaceMathematicalExpressions(string buffer, Int_t pr // we split the unit part and the expression part int pos = buffer.find_first_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "); - if( pos == string::npos ) pos = 0; + if (pos == string::npos) pos = 0; string unit = buffer.substr(pos, -1); string temp = buffer.substr(0, pos);