ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibSLPropagator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <iostream>
8
10#include "GaudiKernel/MsgStream.h"
12
13namespace MuonCalib {
14
16 const Amg::Vector3D& planeNormal) const {
17 double denom = dir.dot(planeNormal);
18 if (std::abs(denom) < 0.00001) denom = 0.00001;
19 double u = (planeNormal.dot(planePos - pos)) / (denom);
20 return pos + u * dir;
21 }
22
23 Amg::Vector3D MuonCalibSLPropagator::propagateToPlane(const Amg::Vector3D& pos, const Amg::Vector3D& dir, double zPosPlane) const {
24 // calculate intersect pattern measurement plane
25 Amg::Vector3D planePos(0., 0., zPosPlane);
26 Amg::Vector3D planeNormal(0., 0., 1.);
27
28 return propagateToPlane(pos, dir, planePos, planeNormal);
29 }
30
32 double radiusCylinder) const {
33 double sinThsqinv = 1. / dir.perp2();
34 double stepLength = (-pos.x() * dir.x() - pos.y() * dir.y()) * sinThsqinv;
35 double deltaRSq = (radiusCylinder * radiusCylinder - pos.perp2()) * sinThsqinv + stepLength * stepLength;
36 if (deltaRSq > 0.) stepLength += std::sqrt(deltaRSq);
37
38 return pos + dir * stepLength;
39 }
40
42 const Amg::Vector3D& posLine, const Amg::Vector3D& dirLine) const {
43 double cosAngle = dirLine.dot(dir);
44 double stepLength = (posLine - pos).dot(dir - dirLine * cosAngle) / (1. - cosAngle * cosAngle);
45 return pos + stepLength * dir;
46 }
47
49 // calculate distance to perigee
50 Amg::Vector3D dirLine(0., 0., 1.);
51 Amg::Vector3D posLine(0., 0., 0.);
52 return propagateToStraightLine(pos, dir, posLine, dirLine);
53 }
54
56 return propagateToPlane(pos, dir, disk.zPos);
57 }
58
60 const MuonCalibCylinder& cylinder) const {
61 return propagateToCylinder(pos, dir, cylinder.radius);
62 }
63
65 const MuonCalibDisk* disk = dynamic_cast<const MuonCalibDisk*>(&surf);
66 if (disk) return propagate(pos, dir, *disk);
67
68 const MuonCalibCylinder* cylinder = dynamic_cast<const MuonCalibCylinder*>(&surf);
69 if (cylinder) return propagate(pos, dir, *cylinder);
70 MsgStream log(Athena::getMessageSvc(), "MuonCalibSLPropagator");
71 log << MSG::WARNING << "propagation failed, unkown surface type" << endmsg;
72 return Amg::Vector3D(0., 0., 0.);
73 }
74
75} // namespace MuonCalib
#define endmsg
Amg::Vector3D propagateToStraightLine(const Amg::Vector3D &pos, const Amg::Vector3D &dir, const Amg::Vector3D &posLine, const Amg::Vector3D &dirLine) const
Propagator track parameters to a straight line.
Amg::Vector3D propagateToPerigee(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Propagator track parameters to the perigee.
Amg::Vector3D propagateToPlane(const Amg::Vector3D &pos, const Amg::Vector3D &dir, const Amg::Vector3D &planePos, const Amg::Vector3D &planeNormal) const
Propagator track parameters to a plane.
Amg::Vector3D propagateToCylinder(const Amg::Vector3D &pos, const Amg::Vector3D &dir, double radiusCylinder) const
Propagator track parameters to a cylinder paralel to the z-axis, centered at (0.,0....
Amg::Vector3D propagate(const Amg::Vector3D &pos, const Amg::Vector3D &dir, const MuonCalibSurface &surf) const
Propagator track parameters to a plane paralel to the xy plane.
singleton-like access to IMessageSvc via open function and helper
Eigen::Matrix< double, 3, 1 > Vector3D
IMessageSvc * getMessageSvc(bool quiet=false)
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition dot.py:1