Skip to content

Commit

Permalink
Merge branch 'jgalan_radial_mask' of github.com:rest-for-physics/fram…
Browse files Browse the repository at this point in the history
…ework into jgalan_radial_mask
  • Loading branch information
jgalan committed Jun 13, 2024
2 parents dca987d + ad9c3ca commit 60617db
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion source/framework/masks/inc/TRestRadialStrippedMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; //<
Expand Down
33 changes: 16 additions & 17 deletions source/framework/masks/src/TRestRadialStrippedMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions source/framework/sensitivity/inc/TRestSensitivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; //!
Expand Down Expand Up @@ -69,7 +69,7 @@ class TRestSensitivity : public TRestMetadata {
std::vector<Double_t> GetAveragedCurve();
std::vector<std::vector<Double_t>> GetLevelCurves(const std::vector<Double_t>& 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);
Expand Down
2 changes: 1 addition & 1 deletion source/framework/tools/src/TRestStringHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ string REST_StringHelper::ReplaceMathematicalExpressions(string buffer, Int_t pr
// we split the unit part and the expression part
size_t 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);
Expand Down

0 comments on commit 60617db

Please sign in to comment.