Skip to content

Commit 08c9ef0

Browse files
committed
Allow to switch off the cross-talk parameter in the MID response
1 parent d9ae510 commit 08c9ef0

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Detectors/MUON/MID/Simulation/include/MIDSimulation/ChamberResponse.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,22 @@ class ChamberResponse
4444
/// @param distance Distance between the hit and the current strip
4545
/// @param cathode Anode or cathode
4646
/// @param deId Detection element ID
47+
/// @param hasCrossTalk If false, allows the function to go to 0 at infinity (default: true)
4748
/// @param theta Particle impact angle
4849
/// @return true if the strip is fired
49-
inline bool isFired(double prob, double distance, int cathode, int deId, double theta = 0.) const
50+
inline bool isFired(double prob, double distance, int cathode, int deId, bool hasCrossTalk = true, double theta = 0.) const
5051
{
51-
return (prob < getFiredProbability(distance, cathode, deId, theta));
52+
return (prob < getFiredProbability(distance, cathode, deId, hasCrossTalk, theta));
5253
}
5354

5455
/// @brief Returns the fired probability
5556
/// @param distance Distance between the hit and the current strip
5657
/// @param cathode Anode or cathode
5758
/// @param deId Detection element ID
59+
/// @param hasCrossTalk If false, allows the function to go to 0 at infinity (default: true)
5860
/// @param theta Particle impact angle
5961
/// @return The probability that the strip is fired
60-
double getFiredProbability(double distance, int cathode, int deId, double theta = 0.) const;
62+
double getFiredProbability(double distance, int cathode, int deId, bool hasCrossTalk = true, double theta = 0.) const;
6163

6264
/// @brief Fired probability distribution
6365
/// @param var Pointer with function variables

Detectors/MUON/MID/Simulation/src/ChamberResponse.cxx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,22 @@ ChamberResponse::ChamberResponse(const ChamberResponseParams& params, const Cham
3838
}
3939

4040
//______________________________________________________________________________
41-
double ChamberResponse::getFiredProbability(double distance, int cathode, int deId, double theta) const
41+
double ChamberResponse::getFiredProbability(double distance, int cathode, int deId, bool hasCrossTalk, double theta) const
4242
{
4343
/// Get fired probability
4444

4545
// Need to convert the distance from cm to mm
4646
double distMM = distance * 10.;
47-
double parA = mParams.getParA(mHV.getHV(deId));
47+
double hv = mHV.getHV(deId);
48+
double parA = mParams.getParA(hv);
4849
double parB = mParams.getParB(cathode, deId);
49-
double parC = mParams.getParC(mHV.getHV(deId));
5050
double costheta = std::cos(theta);
51-
return (parC + parA / (parA + costheta * std::pow(distMM, parB))) / (1 + parC);
51+
double core = parA / (parA + costheta * std::pow(distMM, parB));
52+
if (hasCrossTalk) {
53+
double parC = mParams.getParC(hv);
54+
return (parC + core) / (1 + parC);
55+
}
56+
return core;
5257
}
5358

5459
//______________________________________________________________________________
@@ -76,7 +81,7 @@ double ChamberResponse::firedProbabilityFunction(double* var, double* par)
7681
mParams.setParA(par[4], par[5]);
7782
mParams.setParC(par[6], par[7]);
7883

79-
return getFiredProbability(var[0], cathode, deId, par[2]);
84+
return getFiredProbability(var[0], cathode, deId, true, par[2]);
8085
}
8186

8287
//______________________________________________________________________________

0 commit comments

Comments
 (0)