Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Response
float inclandbfield(float thetawire, float betagamma, float bx) const;

private:
Station mStation{}; ///< Station type
MathiesonOriginal mMathieson{}; ///< Mathieson function
float mPitch = 0.f; ///< anode-cathode pitch (cm)
float mChargeSlope = 0.f; ///< charge slope used in E to charge conversion
Expand Down
8 changes: 4 additions & 4 deletions Detectors/MUON/MCH/Simulation/src/Response.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
using namespace o2::mch;

//_____________________________________________________________________
Response::Response(Station station)
Response::Response(Station station) : mStation(station)
{
if (station == Station::Type1) {
mMathieson.setPitch(ResponseParam::Instance().pitchSt1);
Expand Down Expand Up @@ -68,9 +68,9 @@ float Response::etocharge(float edepos) const
//_____________________________________________________________________
float Response::getAnod(float x) const
{
int n = int(x / mPitch);
float wire = (x > 0) ? n + 0.5 : n - 0.5;
return wire * mPitch;
return (mStation == Station::Type1)
? std::round(x / mPitch) * mPitch
: (std::floor(x / mPitch) + 0.5f) * mPitch;
}

//_____________________________________________________________________
Expand Down