Skip to content

Commit 64504a7

Browse files
authored
Use minimum number of photons to define Cherenkov measurement (#53)
1 parent 977e9fa commit 64504a7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/RICHdetector.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ RICHdetector::getMeasuredAngle(const Track &track) const
5151
auto angle = cherenkovAngle(particle->P, mass);
5252
auto nph_av = numberOfPhotons(angle); // average number of photons
5353
auto nph = gRandom->Poisson(nph_av); // random number of photons
54-
if (nph <= 0) return {0., 0.};
54+
if (nph < mMinPhotons) return {0., 0.};
5555
auto nph_el = 0; // number of photo-electrons
5656
for (int i = 0; i < nph; ++i) {
5757
if (gRandom->Uniform() < mEfficiency) nph_el++;
5858
}
59-
if (nph_el <= 0) return {0., 0.};
59+
if (nph_el < mMinPhotons) return {0., 0.};
6060
auto sigma = mSigma / sqrt(nph_el);
6161
angle = gRandom->Gaus(angle, sigma);
6262
return {angle, sigma};

src/RICHdetector.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public:
2424
void setRadiatorLength(float val) { mRadiatorLength = val; };
2525
void setEfficiency(float val) { mEfficiency = val; };
2626
void setSigma(float val) { mSigma = val; };
27+
void setMinPhotons(int val) { mMinPhotons = val; };
2728

2829
void makePID(const Track &track, std::array<float, 5> &deltaangle, std::array<float, 5> &nsigma) const;
2930
std::pair<float, float> getMeasuredAngle(const Track &track) const;
@@ -49,7 +50,7 @@ protected:
4950
float mRadiatorLength = 2.; // [cm]
5051
float mEfficiency = 0.4;
5152
float mSigma = 7.e-3; // [rad]
52-
float mMinPhotons = 3.;
53+
int mMinPhotons = 3;
5354

5455
};
5556

0 commit comments

Comments
 (0)