Skip to content

Commit 8ff6738

Browse files
authored
Merge pull request #65 from preghenella/master
Allow RICH to be a forward detector
2 parents 43a0f6e + 8bf43e8 commit 8ff6738

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/RICHdetector.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ RICHdetector::hasRICH(const Track &track) const
2828
auto y = track.YOuter * 0.1; // [cm]
2929
auto z = track.ZOuter * 0.1; // [cm]
3030
/** check if hit **/
31-
bool ishit = (fabs(hypot(x, y) - mRadius) < 0.001 && fabs(z) < mLength);
31+
bool ishit = false;
32+
if (mType == kBarrel) {
33+
auto r = hypot(x, y);
34+
ishit = (fabs(r - mRadius) < 0.001 && fabs(z) < mLength);
35+
}
36+
if (mType == kForward) {
37+
auto r = hypot(x, y);
38+
ishit = (r > mRadiusIn) && (r < mRadius) && (fabs(fabs(z) - mLength) < 0.001);
39+
}
3240
if (!ishit) return false;
3341
/** check if above threshold **/
3442
auto particle = (GenParticle *)track.Particle.GetObject();

src/RICHdetector.hh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class RICHdetector {
1616
public:
1717
RICHdetector() = default;
1818
~RICHdetector() = default;
19+
20+
enum { kBarrel, kForward }; // type of RICH detector
1921

2022
void setup(float radius, float length);
2123
bool hasRICH(const Track &track) const;
@@ -25,6 +27,9 @@ public:
2527
void setEfficiency(float val) { mEfficiency = val; };
2628
void setSigma(float val) { mSigma = val; };
2729
void setMinPhotons(int val) { mMinPhotons = val; };
30+
31+
void setType(int val) { mType = val; };
32+
void setRadiusIn(float val) { mRadiusIn = val; };
2833

2934
void makePID(const Track &track, std::array<float, 5> &deltaangle, std::array<float, 5> &nsigma) const;
3035
std::pair<float, float> getMeasuredAngle(const Track &track) const;
@@ -42,8 +47,10 @@ public:
4247
return mSigma / sqrt(numberOfDetectedPhotons(cherenkovAngle(p, m))); }
4348

4449
protected:
45-
50+
51+
int mType = kBarrel;
4652
float mRadius = 100.; // [cm]
53+
float mRadiusIn = 10.; // [cm]
4754
float mLength = 200.; // [cm]
4855

4956
float mIndex = 1.03;

0 commit comments

Comments
 (0)