24#include "GaudiKernel/PhysicalConstants.h"
27 constexpr double SIG_VEL = 4.80000;
28 constexpr double C_VEL = 1./ Gaudi::Units::c_light;
37 return StatusCode::SUCCESS;
62 double positionAlongStrip{0};
63 double positionAlongZ{0};
70 ATH_MSG_WARNING(
"Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
74 positionAlongZ = lpos.z();
95 mat(0, 0) = fixedError * fixedError;
103 double timeAlongStrip = 0;
105 timeAlongStrip =
re->distanceToEtaReadout(GP) / 1000. * SIG_VEL;
107 timeAlongStrip =
re->distanceToPhiReadout(GP) / 1000. * SIG_VEL;
109 if (positionAlongZ) timeAlongStrip = 0;
112 double assignedTimFromPrd = 0;
114 assignedTimFromPrd =
re->distanceToEtaReadout(clusPos) / 1000. * SIG_VEL;
116 assignedTimFromPrd =
re->distanceToPhiReadout(clusPos) / 1000. * SIG_VEL;
120 double real_TOF_onRPCgap = GP.mag() / 1000. * C_VEL;
121 double nominal_TOF_onRPCgap = clusPos.mag() / 1000. * C_VEL;
124 double correct_time_tot = real_TOF_onRPCgap
125 - nominal_TOF_onRPCgap
127 - assignedTimFromPrd;
130 positionAlongStrip, MClus->
time() - correct_time_tot);
132 ATH_MSG_DEBUG(
" correct_time_along_strip " << timeAlongStrip <<
" assignedTimFromPrd "
133 << assignedTimFromPrd <<
" real_TOF_onRPCgap " << real_TOF_onRPCgap
134 <<
" nominal_TOF_onRPCgap " << nominal_TOF_onRPCgap <<
" MClus->time() "
135 << MClus->
time() <<
" correct_time_tot " << correct_time_tot);
161 double phistereo = lStripDir.phi() - 90.*Gaudi::Units::deg;
162 double Sn = std::sin(phistereo);
163 double Sn2 = Sn * Sn;
164 double Cs2 = 1. - Sn2;
166 double V0 = stripWidth * stripWidth / 12;
168 double V1 = stripLength * stripLength / 12;
169 mat(0, 0) = (Cs2 * V0 + Sn2 * V1);
170 mat.fillSymmetric(1, 0, (Sn * std::sqrt(Cs2) * (V0 - V1)));
171 mat(1, 1) = (Sn2 * V0 + Cs2 * V1);
209 std::move(loce), positionAlongStrip);
218 positionAlongStrip, {}, {});
260 const EventContext& ctx{Gaudi::Hive::currentContext()};
264 ATH_MSG_WARNING(
"RIO does not have associated detectorElement! Skipping cluster calibration");
278 ATH_MSG_WARNING(
"Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
289 std::vector<NSWCalib::CalibratedStrip> calibratedStrips;
290 StatusCode
sc =
m_calibToolNSW->calibrateClus(ctx, mmPRD, GP, calibratedStrips);
291 if (
sc != StatusCode::SUCCESS) {
292 ATH_MSG_WARNING(
"Could not calibrate the MM Cluster in the RIO on track creator");
302 if (rotAuthor == IMMClusterBuilderTool::RIO_Author::unKnownAuthor) {
303 ATH_MSG_WARNING(
"Could not calibrate the MM Cluster in the RIO on track creator");
318 double a_impact = ld.angleXZ() < 0 ? -M_PI_2 - ld.angleXZ() : M_PI_2 - ld.angleXZ();
319 double x_projected = localposition3D.x() - std::tan(a_impact) * localposition3D.z();
340 ATH_MSG_WARNING(
"RIO does not have associated detectorElement! Skipping cluster calibration");
356 ATH_MSG_WARNING(
"Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
372 double a_impact = ld.angleXZ() < 0 ? -M_PI_2 - ld.angleXZ() : M_PI_2 - ld.angleXZ();
373 double x_projected = localposition3D.x() - std::tan(a_impact) * localposition3D.z();
381 ATH_MSG_VERBOSE(
"generating sTgcClusterOnTrack in MuonClusterBuilder");
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override final
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Amg::Vector3D stripDir(int gasGap, int strip) const
Returns the direction of a strip.
double stripLength() const
Returns the length of each strip which is equal to the height of the chamber.
double stripPitch(int gasGap, int strip) const
Returns the pitch of the given strip in gasGap i.
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override final
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
bool isEtaZero(const Identifier &id, const Amg::Vector2D &localPosition) const
is eta=0 of QL1 or QS1?
Class to represent calibrated clusters formed from TGC strips.
Class to represent MM measurements.
Gaudi::Property< bool > m_doFixedErrorRpcEta
Gaudi::Property< bool > m_doFixedErrorTgcEta
virtual StatusCode initialize() override
Gaudi::Property< bool > m_doFixedErrorRpcPhi
Gaudi::Property< double > m_fixedErrorTgcEta
MuonClusterOnTrack * calibratedClusterMMG(const Trk::PrepRawData &RIO, const Amg::Vector3D &GP, const Amg::Vector3D &GD) const
virtual MuonClusterOnTrack * createRIO_OnTrack(const Trk::PrepRawData &RIO, const Amg::Vector3D &GP) const override
Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a predicted Trk::TrackParameter.
virtual MuonClusterOnTrack * correct(const Trk::PrepRawData &RIO, const Trk::TrackParameters &TP, const EventContext &) const override
Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and the predicted Trk::TrackParameter at ...
Gaudi::Property< bool > m_restrictWarnings
Gaudi::Property< double > m_fixedErrorRpcEta
Gaudi::Property< double > m_fixedErrorRpcPhi
ToolHandle< Muon::INSWCalibTool > m_calibToolNSW
Gaudi::Property< bool > m_doFixedErrorTgcPhi
MuonClusterOnTrack * calibratedClusterSTG(const Trk::PrepRawData &RIO, const Amg::Vector3D &GP, const Amg::Vector3D &GD) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< Muon::IMMClusterBuilderTool > m_clusterBuilderToolMM
Gaudi::Property< double > m_fixedErrorTgcPhi
Base class for Muon cluster RIO_OnTracks.
Class to represent calibrated clusters formed from RPC strips.
Class to represent RPC measurements.
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
float time() const
Returns the time.
Class to represent calibrated clusters formed from TGC strips.
Class to represent TGC measurements.
virtual const MuonGM::TgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD The pointer will be zero if the det el is not ...
Class to represent calibrated clusters formed from TGC strips.
Class to represent sTgc measurements.
virtual const MuonGM::sTgcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
bool measuresPhi(const Identifier &id) const override
represents the three-dimensional global direction with respect to a planar surface frame.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Abstract Base Class for tracking surfaces.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
This is the base class for all tracking detector elements with read-out relevant information.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
This module defines the arguments passed from the BATCH driver to the BATCH worker.
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Amg::Vector3D toLocal(const Amg::Transform3D &toLocalTrans, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::pair< double, ParamDefs > DefinedParameter
Typedef to of a std::pair<double, ParamDefs> to identify a passed-through double as a specific type o...
ParametersBase< TrackParametersDim, Charged > TrackParameters