Skip to content

Commit 4ed4dde

Browse files
authored
fix wire position on station 1 (#13983)
1 parent 1ed6f51 commit 4ed4dde

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Detectors/MUON/MCH/Simulation/include/MCHSimulation/Response.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class Response
7070
float inclandbfield(float thetawire, float betagamma, float bx) const;
7171

7272
private:
73+
Station mStation{}; ///< Station type
7374
MathiesonOriginal mMathieson{}; ///< Mathieson function
7475
float mPitch = 0.f; ///< anode-cathode pitch (cm)
7576
float mChargeSlope = 0.f; ///< charge slope used in E to charge conversion

Detectors/MUON/MCH/Simulation/src/Response.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
using namespace o2::mch;
2727

2828
//_____________________________________________________________________
29-
Response::Response(Station station)
29+
Response::Response(Station station) : mStation(station)
3030
{
3131
if (station == Station::Type1) {
3232
mMathieson.setPitch(ResponseParam::Instance().pitchSt1);
@@ -68,9 +68,9 @@ float Response::etocharge(float edepos) const
6868
//_____________________________________________________________________
6969
float Response::getAnod(float x) const
7070
{
71-
int n = int(x / mPitch);
72-
float wire = (x > 0) ? n + 0.5 : n - 0.5;
73-
return wire * mPitch;
71+
return (mStation == Station::Type1)
72+
? std::round(x / mPitch) * mPitch
73+
: (std::floor(x / mPitch) + 0.5f) * mPitch;
7474
}
7575

7676
//_____________________________________________________________________

0 commit comments

Comments
 (0)