Skip to content

Commit

Permalink
Merge pull request #326 from rest-for-physics/jgalan_axion_field
Browse files Browse the repository at this point in the history
Fixing an issue with masks not rotating
  • Loading branch information
jgalan authored Nov 18, 2022
2 parents 487a301 + 7fa1705 commit 5c5291e
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestCombinedMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TRestCombinedMask : public TRestPatternMask {
return fMasks[0];
}

Int_t GetRegion(Double_t x, Double_t y) override;
Int_t GetRegion(Double_t& x, Double_t& y) override;

void InitFromConfigFile() override;

Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestGridMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TRestGridMask : public TRestPatternMask {
Int_t fModulus = 10; //<

public:
virtual Int_t GetRegion(Double_t x, Double_t y) override;
virtual Int_t GetRegion(Double_t& x, Double_t& y) override;

/// It returns the gap/periodicity of the grid in mm
Double_t GetGridGap() { return fGridGap; }
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestPatternMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class TRestPatternMask : public TRestMetadata {
Bool_t HitsPattern(Double_t x, Double_t y);

/// To be implemented at the inherited class with the pattern and region identification logic
virtual Int_t GetRegion(Double_t x, Double_t y) {
virtual Int_t GetRegion(Double_t& x, Double_t& y) {
if (ApplyCommonMaskTransformation(x, y) == 0) return 1;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestRingsMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TRestRingsMask : public TRestPatternMask {
public:
void GenerateRings();

virtual Int_t GetRegion(Double_t x, Double_t y) override;
virtual Int_t GetRegion(Double_t& x, Double_t& y) override;

/// It returns the gap/periodicity of the rings in mm
Double_t GetRingsGap() { return fRingsGap; }
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestSpiderMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TRestSpiderMask : public TRestPatternMask {
public:
void GenerateSpider();

virtual Int_t GetRegion(Double_t x, Double_t y) override;
virtual Int_t GetRegion(Double_t& x, Double_t& y) override;

/// It returns the gap/periodicity of the spider structure arms in radians
Double_t GetArmsSeparationAngle() { return fArmsSeparationAngle; }
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestStrippedMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TRestStrippedMask : public TRestPatternMask {
Int_t fModulus = 10;

public:
virtual Int_t GetRegion(Double_t x, Double_t y) override;
virtual Int_t GetRegion(Double_t& x, Double_t& y) override;

/// It returns the gap/periodicity of the strips in mm
Double_t GetStripsGap() { return fStripsGap; }
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/src/TRestCombinedMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void TRestCombinedMask::Initialize() {
/// The particle will be counter-rotated to emulate the mask rotation
/// using the method TRestPatternMask::ApplyCommonMaskTransformation
///
Int_t TRestCombinedMask::GetRegion(Double_t x, Double_t y) {
Int_t TRestCombinedMask::GetRegion(Double_t& x, Double_t& y) {
Int_t region = 0;
for (const auto mask : fMasks) {
Int_t id = mask->GetRegion(x, y);
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/src/TRestGridMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void TRestGridMask::Initialize() {
/// The particle will be counter-rotated to emulate the mask offset and
/// rotation using the method TRestPatternMask::ApplyCommonMaskTransformation
///
Int_t TRestGridMask::GetRegion(Double_t x, Double_t y) {
Int_t TRestGridMask::GetRegion(Double_t& x, Double_t& y) {
if (TRestPatternMask::GetRegion(x, y)) return 0;

Double_t xEval = fGridThickness / 2. + x;
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/src/TRestRingsMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void TRestRingsMask::Initialize() {
/// The particle will be counter-rotated to emulate the mask rotation
/// using the method TRestPatternMask::RotateAndTranslate.
///
Int_t TRestRingsMask::GetRegion(Double_t x, Double_t y) {
Int_t TRestRingsMask::GetRegion(Double_t& x, Double_t& y) {
if (TRestPatternMask::GetRegion(x, y)) return 0;

Double_t r = TMath::Sqrt(x * x + y * y);
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/src/TRestSpiderMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void TRestSpiderMask::Initialize() {
/// The particle will be counter-rotated to emulate the mask rotation
/// using the method TRestPatternMask::ApplyCommonMaskTransformation
///
Int_t TRestSpiderMask::GetRegion(Double_t x, Double_t y) {
Int_t TRestSpiderMask::GetRegion(Double_t& x, Double_t& y) {
if (TRestPatternMask::GetRegion(x, y)) return 0;

Double_t d = TMath::Sqrt(x * x + y * y);
Expand Down
2 changes: 1 addition & 1 deletion source/framework/masks/src/TRestStrippedMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void TRestStrippedMask::Initialize() {
/// The particle will be counter-rotated to emulate the mask rotation
/// using the method TRestPatternMask::ApplyCommonMaskTransformation
///
Int_t TRestStrippedMask::GetRegion(Double_t x, Double_t y) {
Int_t TRestStrippedMask::GetRegion(Double_t& x, Double_t& y) {
if (TRestPatternMask::GetRegion(x, y)) return 0;

Double_t xEval = fStripsThickness / 2. + x;
Expand Down

0 comments on commit 5c5291e

Please sign in to comment.