ATLAS Offline Software
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 
13 namespace 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 
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
MuonCalib::MuonCalibSLPropagator::propagateToPerigee
Amg::Vector3D propagateToPerigee(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Propagator track parameters to the perigee.
Definition: MuonCalibSLPropagator.cxx:48
MuonCalib::MuonCalibSLPropagator::propagate
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.
Definition: MuonCalibSLPropagator.cxx:64
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonCalib::MuonCalibCylinder::radius
double radius
Definition: MuonCalibSimpleGeometry.h:30
MuonCalib::MuonCalibSurface
Definition: MuonCalibSimpleGeometry.h:12
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonCalib::MuonCalibSLPropagator::propagateToPlane
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.
Definition: MuonCalibSLPropagator.cxx:15
MuonCalib::MuonCalibDisk
Definition: MuonCalibSimpleGeometry.h:18
MuonCalib::MuonCalibSLPropagator::propagateToStraightLine
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.
Definition: MuonCalibSLPropagator.cxx:41
MuonCalib::MuonCalibCylinder
Definition: MuonCalibSimpleGeometry.h:26
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib::MuonCalibSLPropagator::propagateToCylinder
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....
Definition: MuonCalibSLPropagator.cxx:31
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
compute_lumi.denom
denom
Definition: compute_lumi.py:76
beamspotman.dir
string dir
Definition: beamspotman.py:623
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonCalibSLPropagator.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonCalib::MuonCalibDisk::zPos
double zPos
Definition: MuonCalibSimpleGeometry.h:22
MuonCalibSimpleGeometry.h