Skip to content

Commit

Permalink
Merge branch 'jgalan_radial_good' of github.com:rest-for-physics/fram…
Browse files Browse the repository at this point in the history
…ework into jgalan_radial_good
  • Loading branch information
jgalan committed Jun 14, 2024
2 parents 4e4d07b + 43c1e26 commit a59b044
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
7 changes: 3 additions & 4 deletions examples/masks.rml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
<parameter name="stripsThickness" value="1.2mm"/>
</TRestStrippedMask>
<TRestRadialStrippedMask name="radialStrips" verboseLevel="warning">
<parameter name="maskRadius" value="30cm" />
<parameter name="maskInternalRadius" value="10cm"/>
<parameter name="maskRadius" value="19.4cm" />
<parameter name="offset" value="(0,0)cm" />
<parameter name="rotationAngle" value="0degrees" />
<parameter name="rotationAngle" value="30degrees" />

<parameter name="initialRadius" value="10cm" />
<parameter name="internalRegionRadius" value="7.5cm" />

<parameter name="stripsAngle" value="60degrees" />
<parameter name="stripsThickness" value="2.5cm" />
<parameter name="stripsThickness" value="0.7cm" />
</TRestRadialStrippedMask>
<TRestRingsMask name="rings" verboseLevel="warning">
<parameter name="maskRadius" value="9cm"/>
Expand Down
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
4 changes: 2 additions & 2 deletions source/framework/masks/src/TRestPatternMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ TCanvas* TRestPatternMask::DrawMonteCarlo(Int_t nSamples) {
}

gridGraphs[0]->GetXaxis()->SetLimits(-1.25 * fMaskRadius, 1.25 * fMaskRadius);
gridGraphs[0]->GetHistogram()->SetMaximum(1.25 * fMaskRadius );
gridGraphs[0]->GetHistogram()->SetMinimum(-1.25 * fMaskRadius );
gridGraphs[0]->GetHistogram()->SetMaximum(1.25 * fMaskRadius);
gridGraphs[0]->GetHistogram()->SetMinimum(-1.25 * fMaskRadius);

gridGraphs[0]->GetXaxis()->SetTitle("X [mm]");
gridGraphs[0]->GetXaxis()->SetTitleSize(0.04);
Expand Down
19 changes: 9 additions & 10 deletions source/framework/masks/src/TRestRadialStrippedMask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,15 @@ Int_t TRestRadialStrippedMask::GetRegion(Double_t& x, Double_t& y) {
Int_t region = (Int_t) (phi/fStripsAngle);
region = 2 + 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;
}
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

0 comments on commit a59b044

Please sign in to comment.