CMS 3D CMS Logo

List of all members | Public Member Functions
MuonCSCChamberResidual Class Reference

#include <MuonCSCChamberResidual.h>

Inheritance diagram for MuonCSCChamberResidual:
MuonHitsChamberResidual MuonChamberResidual

Public Member Functions

void addResidual (edm::ESHandle< Propagator > prop, const TrajectoryStateOnSurface *tsos, const TrackingRecHit *hit, double, double) override
 
 MuonCSCChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
 
void setSegmentResidual (const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *) override
 
- Public Member Functions inherited from MuonHitsChamberResidual
 MuonHitsChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)
 
void segment_fit ()
 
- Public Member Functions inherited from MuonChamberResidual
AlignableDetOrUnitPtr chamberAlignable () const
 
DetId chamberId () const
 
double Chambl () const
 
double ChambW () const
 
double chi2 () const
 
double global_hitresid (int i) const
 
double global_residual () const
 
double global_resslope () const
 
align::GlobalPoint global_stubpos ()
 
align::GlobalPoint global_trackpos ()
 
int hitlayer (int i) const
 
double hitposition (int i) const
 
double hitresid (int i) const
 
DetId localid (int i) const
 
 MuonChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
 
int ndof () const
 
int numHits () const
 
double residual () const
 
double residual_error () const
 
double resslope () const
 
double resslope_error () const
 
double segdxdz () const
 
double segdydz () const
 
double segx () const
 
double segy () const
 
virtual double signConvention () const
 
double trackdxdz () const
 
double trackdydz () const
 
double trackx () const
 
double tracky () const
 
int type () const
 
virtual ~MuonChamberResidual ()
 

Additional Inherited Members

- Public Types inherited from MuonChamberResidual
enum  { kDT13, kDT2, kCSC }
 
- Protected Attributes inherited from MuonHitsChamberResidual
double m_chamber_length
 
double m_chamber_width
 
double m_hitx_1
 
double m_hitx_x
 
double m_hitx_xx
 
double m_hitx_xy
 
double m_hitx_y
 
double m_hity_1
 
double m_hity_x
 
double m_hity_xx
 
double m_hity_xy
 
double m_hity_y
 
double m_residual_1
 
double m_residual_x
 
double m_residual_xx
 
double m_residual_xy
 
double m_residual_y
 
double m_trackx_1
 
double m_trackx_x
 
double m_trackx_xx
 
double m_trackx_xy
 
double m_trackx_y
 
double m_tracky_1
 
double m_tracky_x
 
double m_tracky_xx
 
double m_tracky_xy
 
double m_tracky_y
 
- Protected Attributes inherited from MuonChamberResidual
AlignableDetOrUnitPtr m_chamberAlignable
 
DetId m_chamberId
 
double m_Chambl
 
double m_ChambW
 
double m_chi2
 
edm::ESHandle< GlobalTrackingGeometrym_globalGeometry
 
std::vector< double > m_individual_weight
 
std::vector< double > m_individual_x
 
std::vector< double > m_individual_y
 
std::vector< DetIdm_localIDs
 
std::vector< double > m_localResids
 
AlignableNavigatorm_navigator
 
int m_ndof
 
int m_numHits
 
double m_residual
 
double m_residual_error
 
double m_resslope
 
double m_resslope_error
 
double m_segdxdz
 
double m_segdydz
 
double m_segx
 
double m_segy
 
double m_sign
 
double m_trackdxdz
 
double m_trackdydz
 
double m_trackx
 
double m_tracky
 
int m_type
 

Detailed Description

Implementation of muon chamber residuals for CSC

Id

Definition at line 14 of file MuonCSCChamberResidual.h.

Constructor & Destructor Documentation

◆ MuonCSCChamberResidual()

MuonCSCChamberResidual::MuonCSCChamberResidual ( edm::ESHandle< GlobalTrackingGeometry globalGeometry,
AlignableNavigator navigator,
DetId  chamberId,
AlignableDetOrUnitPtr  chamberAlignable 
)

Member Function Documentation

◆ addResidual()

void MuonCSCChamberResidual::addResidual ( edm::ESHandle< Propagator prop,
const TrajectoryStateOnSurface tsos,
const TrackingRecHit hit,
double  chamber_width,
double  chamber_length 
)
overridevirtual

Implements MuonChamberResidual.

Definition at line 21 of file MuonCSCChamberResidual.cc.

25  {
26  bool m_debug = false;
27 
28  if (m_debug)
29  std::cout << "MuonCSCChamberResidual::addResidual 1" << std::endl;
30  DetId id = hit->geographicalId();
31  if (m_debug)
32  std::cout << "MuonCSCChamberResidual::addResidual 2" << std::endl;
33  const CSCGeometry *cscGeometry = dynamic_cast<const CSCGeometry *>(m_globalGeometry->slaveGeometry(id));
34  if (m_debug)
35  std::cout << "MuonCSCChamberResidual::addResidual 3" << std::endl;
36  assert(cscGeometry);
37 
38  if (m_debug) {
39  std::cout << " MuonCSCChamberResidual hit->localPosition() x: " << hit->localPosition().x()
40  << " tsos->localPosition() x: " << tsos->localPosition().x() << std::endl;
41  std::cout << " hit->localPosition() y: " << hit->localPosition().y()
42  << " tsos->localPosition() y: " << tsos->localPosition().y() << std::endl;
43  std::cout << " hit->localPosition() z: " << hit->localPosition().z()
44  << " tsos->localPosition() z: " << tsos->localPosition().z() << std::endl;
45  }
46 
47  // hit->localPosition() is coordinate in local system of LAYER. Transfer it to coordiante in local system of chamber
48  align::LocalPoint hitChamberPos =
50  // TSOS->localPosition() is given in local system of CHAMBER (for segment-based reconstruction)
51  // align::LocalPoint tsosChamberPos = tsos->localPosition();
52  align::LocalPoint tsosChamberPos =
54 
55  int strip = cscGeometry->layer(id)->geometry()->nearestStrip(hit->localPosition());
56  double angle = cscGeometry->layer(id)->geometry()->stripAngle(strip) - M_PI / 2.;
57  double sinAngle = sin(angle);
58  double cosAngle = cos(angle);
59 
60  double residual = cosAngle * (tsosChamberPos.x() - hitChamberPos.x()) +
61  sinAngle * (tsosChamberPos.y() - hitChamberPos.y()); // yes, that's +sin()
62 
63  if (m_debug)
64  std::cout << " MuonCSCChamberResidual residual: " << residual << std::endl;
65 
66  double xx = hit->localPositionError().xx();
67  double xy = hit->localPositionError().xy();
68  double yy = hit->localPositionError().yy();
69  double weight = 1. / (xx * cosAngle * cosAngle + 2. * xy * sinAngle * cosAngle + yy * sinAngle * sinAngle);
70 
71  double layerPosition = tsosChamberPos.z(); // the layer's position in the chamber's coordinate system
72  double layerHitPos = hitChamberPos.z();
73 
74  m_numHits++;
75 
76  // "x" is the layerPosition, "y" is the residual (this is a linear fit to residual versus layerPosition)
78  m_residual_x += weight * layerPosition;
80  m_residual_xx += weight * layerPosition * layerPosition;
81  m_residual_xy += weight * layerPosition * residual;
82 
83  // "x" is the layerPosition, "y" is chamberx (this is a linear fit to chamberx versus layerPosition)
84  m_trackx_1 += weight;
85  m_trackx_x += weight * layerPosition;
86  m_trackx_y += weight * tsosChamberPos.x();
87  m_trackx_xx += weight * layerPosition * layerPosition;
88  m_trackx_xy += weight * layerPosition * tsosChamberPos.x();
89 
90  // "x" is the layerPosition, "y" is chambery (this is a linear fit to chambery versus layerPosition)
91  m_tracky_1 += weight;
92  m_tracky_x += weight * layerPosition;
93  m_tracky_y += weight * tsosChamberPos.y();
94  m_tracky_xx += weight * layerPosition * layerPosition;
95  m_tracky_xy += weight * layerPosition * tsosChamberPos.y();
96 
97  m_hitx_1 += weight;
98  m_hitx_x += weight * layerHitPos;
99  m_hitx_y += weight * hitChamberPos.x();
100  m_hitx_xx += weight * layerHitPos * layerHitPos;
101  m_hitx_xy += weight * layerHitPos * hitChamberPos.x();
102 
103  m_hity_1 += weight;
104  m_hity_x += weight * layerHitPos;
105  m_hity_y += weight * hitChamberPos.y();
106  m_hity_xx += weight * layerHitPos * layerHitPos;
107  m_hity_xy += weight * layerHitPos * hitChamberPos.y();
108 
109  m_localIDs.push_back(id);
110  m_localResids.push_back(residual); // FIXME Check if this method is needed
111  m_individual_x.push_back(layerPosition);
112  m_individual_y.push_back(residual);
113  m_individual_weight.push_back(weight);
114 
115  if (m_numHits > 1)
116  segment_fit();
117 }

References angle(), cms::cuda::assert(), funct::cos(), gather_cfg::cout, CSCLayer::geometry(), GlobalTrackingGeometry::idToDet(), CSCGeometry::layer(), TrajectoryStateOnSurface::localPosition(), MuonChamberResidual::m_chamberAlignable, MuonChamberResidual::m_globalGeometry, MuonHitsChamberResidual::m_hitx_1, MuonHitsChamberResidual::m_hitx_x, MuonHitsChamberResidual::m_hitx_xx, MuonHitsChamberResidual::m_hitx_xy, MuonHitsChamberResidual::m_hitx_y, MuonHitsChamberResidual::m_hity_1, MuonHitsChamberResidual::m_hity_x, MuonHitsChamberResidual::m_hity_xx, MuonHitsChamberResidual::m_hity_xy, MuonHitsChamberResidual::m_hity_y, MuonChamberResidual::m_individual_weight, MuonChamberResidual::m_individual_x, MuonChamberResidual::m_individual_y, MuonChamberResidual::m_localIDs, MuonChamberResidual::m_localResids, MuonChamberResidual::m_numHits, M_PI, MuonHitsChamberResidual::m_residual_1, MuonHitsChamberResidual::m_residual_x, MuonHitsChamberResidual::m_residual_xx, MuonHitsChamberResidual::m_residual_xy, MuonHitsChamberResidual::m_residual_y, MuonHitsChamberResidual::m_trackx_1, MuonHitsChamberResidual::m_trackx_x, MuonHitsChamberResidual::m_trackx_xx, MuonHitsChamberResidual::m_trackx_xy, MuonHitsChamberResidual::m_trackx_y, MuonHitsChamberResidual::m_tracky_1, MuonHitsChamberResidual::m_tracky_x, MuonHitsChamberResidual::m_tracky_xx, MuonHitsChamberResidual::m_tracky_xy, MuonHitsChamberResidual::m_tracky_y, CSCLayerGeometry::nearestStrip(), MuonChamberResidual::residual(), MuonHitsChamberResidual::segment_fit(), funct::sin(), GlobalTrackingGeometry::slaveGeometry(), digitizers_cfi::strip, CSCLayerGeometry::stripAngle(), Alignable::surface(), GeomDet::toGlobal(), AlignableSurface::toLocal(), mps_merge::weight, PV3DBase< T, PVType, FrameType >::x(), hit::x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, PV3DBase< T, PVType, FrameType >::y(), hit::y, geometryCSVtoXML::yy, PV3DBase< T, PVType, FrameType >::z(), and hit::z.

◆ setSegmentResidual()

void MuonCSCChamberResidual::setSegmentResidual ( const reco::MuonChamberMatch ,
const reco::MuonSegmentMatch  
)
inlineoverridevirtual

Implements MuonChamberResidual.

Definition at line 30 of file MuonCSCChamberResidual.h.

30 {}
Vector3DBase< Scalar, GlobalTag >
MuonHitsChamberResidual::m_trackx_xx
double m_trackx_xx
Definition: MuonHitsChamberResidual.h:42
MuonChamberResidual::m_chamberId
DetId m_chamberId
Definition: MuonChamberResidual.h:90
MuonHitsChamberResidual::m_trackx_y
double m_trackx_y
Definition: MuonHitsChamberResidual.h:41
MuonHitsChamberResidual::segment_fit
void segment_fit()
Definition: MuonHitsChamberResidual.cc:41
MuonChamberResidual::m_localIDs
std::vector< DetId > m_localIDs
Definition: MuonChamberResidual.h:94
MuonHitsChamberResidual::m_trackx_x
double m_trackx_x
Definition: MuonHitsChamberResidual.h:40
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
HLT_FULL_cff.navigator
navigator
Definition: HLT_FULL_cff.py:13108
MuonHitsChamberResidual::m_hitx_xx
double m_hitx_xx
Definition: MuonHitsChamberResidual.h:52
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
mps_merge.weight
weight
Definition: mps_merge.py:88
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
AlignableSurface::toLocal
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
Definition: AlignableSurface.cc:35
MuonChamberResidual::chamberId
DetId chamberId() const
Definition: MuonChamberResidual.h:48
MuonHitsChamberResidual::m_tracky_x
double m_tracky_x
Definition: MuonHitsChamberResidual.h:45
MuonHitsChamberResidual::m_residual_xx
double m_residual_xx
Definition: MuonHitsChamberResidual.h:37
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
CSCGeometry
Definition: CSCGeometry.h:24
DetId
Definition: DetId.h:17
MuonChamberResidual::residual
double residual() const
Definition: MuonChamberResidual.h:54
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MuonHitsChamberResidual::m_hity_x
double m_hity_x
Definition: MuonHitsChamberResidual.h:55
MuonHitsChamberResidual::m_hitx_1
double m_hitx_1
Definition: MuonHitsChamberResidual.h:49
MuonHitsChamberResidual::m_residual_1
double m_residual_1
Definition: MuonHitsChamberResidual.h:34
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
MuonHitsChamberResidual::m_tracky_1
double m_tracky_1
Definition: MuonHitsChamberResidual.h:44
Point3DBase
Definition: Point3DBase.h:10
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
hit::z
double z
Definition: SiStripHitEffFromCalibTree.cc:91
MuonHitsChamberResidual::m_residual_x
double m_residual_x
Definition: MuonHitsChamberResidual.h:35
CSCLayerGeometry::nearestStrip
int nearestStrip(const LocalPoint &lp) const
Definition: CSCLayerGeometry.h:96
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
MuonChamberResidual::chamberAlignable
AlignableDetOrUnitPtr chamberAlignable() const
Definition: MuonChamberResidual.h:50
MuonHitsChamberResidual::m_hitx_xy
double m_hitx_xy
Definition: MuonHitsChamberResidual.h:53
MuonChamberResidual::m_type
int m_type
Definition: MuonChamberResidual.h:100
MuonHitsChamberResidual::m_hity_xy
double m_hity_xy
Definition: MuonHitsChamberResidual.h:58
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
MuonHitsChamberResidual::MuonHitsChamberResidual
MuonHitsChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)
Definition: MuonHitsChamberResidual.cc:8
MuonHitsChamberResidual::m_tracky_y
double m_tracky_y
Definition: MuonHitsChamberResidual.h:46
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
GlobalTrackingGeometry::slaveGeometry
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
Definition: GlobalTrackingGeometry.cc:54
MuonChamberResidual::m_sign
double m_sign
Definition: MuonChamberResidual.h:101
MuonChamberResidual::kCSC
Definition: MuonChamberResidual.h:28
CSCLayerGeometry::stripAngle
float stripAngle(int strip) const
Definition: CSCLayerGeometry.cc:147
MuonChamberResidual::m_individual_weight
std::vector< double > m_individual_weight
Definition: MuonChamberResidual.h:98
MuonChamberResidual::m_individual_x
std::vector< double > m_individual_x
Definition: MuonChamberResidual.h:96
MuonHitsChamberResidual::m_residual_xy
double m_residual_xy
Definition: MuonHitsChamberResidual.h:38
MuonChamberResidual::m_individual_y
std::vector< double > m_individual_y
Definition: MuonChamberResidual.h:97
MuonChamberResidual::m_globalGeometry
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
Definition: MuonChamberResidual.h:88
MuonHitsChamberResidual::m_trackx_xy
double m_trackx_xy
Definition: MuonHitsChamberResidual.h:43
CSCGeometry::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
MuonHitsChamberResidual::m_hity_y
double m_hity_y
Definition: MuonHitsChamberResidual.h:56
MuonHitsChamberResidual::m_hitx_y
double m_hitx_y
Definition: MuonHitsChamberResidual.h:51
MuonChamberResidual::m_localResids
std::vector< double > m_localResids
Definition: MuonChamberResidual.h:95
MuonChamberResidual::m_numHits
int m_numHits
Definition: MuonChamberResidual.h:93
MuonHitsChamberResidual::m_hity_1
double m_hity_1
Definition: MuonHitsChamberResidual.h:54
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
MuonHitsChamberResidual::m_tracky_xy
double m_tracky_xy
Definition: MuonHitsChamberResidual.h:48
MuonChamberResidual::m_chamberAlignable
AlignableDetOrUnitPtr m_chamberAlignable
Definition: MuonChamberResidual.h:91
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
MuonHitsChamberResidual::m_residual_y
double m_residual_y
Definition: MuonHitsChamberResidual.h:36
MuonHitsChamberResidual::m_tracky_xx
double m_tracky_xx
Definition: MuonHitsChamberResidual.h:47
MuonHitsChamberResidual::m_hitx_x
double m_hitx_x
Definition: MuonHitsChamberResidual.h:50
MuonHitsChamberResidual::m_hity_xx
double m_hity_xx
Definition: MuonHitsChamberResidual.h:57
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
weight
Definition: weight.py:1
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MuonHitsChamberResidual::m_trackx_1
double m_trackx_1
Definition: MuonHitsChamberResidual.h:39