CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
MuonDT13ChamberResidual Class Reference

#include <MuonDT13ChamberResidual.h>

Inheritance diagram for MuonDT13ChamberResidual:
MuonHitsChamberResidual MuonChamberResidual

Public Member Functions

virtual void addResidual (const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit)
 
 MuonDT13ChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)
 
virtual void setSegmentResidual (const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *)
 
- 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 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, const 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_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_chi2
 
edm::ESHandle
< GlobalTrackingGeometry
m_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 axial DT layers

Id:

Definition at line 13 of file MuonDT13ChamberResidual.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file MuonDT13ChamberResidual.cc.

References funct::cos(), MuonChamberResidual::kDT13, MuonChamberResidual::m_chamberId, MuonChamberResidual::m_globalGeometry, M_PI, MuonChamberResidual::m_sign, MuonChamberResidual::m_type, and funct::sin().

10  : MuonHitsChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
11 {
13  double rphiAngle = atan2(m_globalGeometry->idToDet(m_chamberId)->position().y(), m_globalGeometry->idToDet(m_chamberId)->position().x()) + M_PI/2.;
14  align::GlobalVector rphiDirection(cos(rphiAngle), sin(rphiAngle), 0.);
15  m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(rphiDirection).x() > 0. ? 1. : -1.;
16 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define M_PI
Definition: BFit3D.cc:3
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
MuonHitsChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)

Member Function Documentation

void MuonDT13ChamberResidual::addResidual ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit hit 
)
virtual

Implements MuonChamberResidual.

Definition at line 19 of file MuonDT13ChamberResidual.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::localPosition(), TrajectoryStateOnSurface::localPosition(), TrackingRecHit::localPositionError(), 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, 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, MuonChamberResidual::residual(), MuonHitsChamberResidual::segment_fit(), Alignable::surface(), AlignableSurface::toLocal(), histoStyle::weight, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

20 {
21  DetId id = hit->geographicalId();
22 
23  align::LocalPoint hitChamberPos = m_chamberAlignable->surface().toLocal(m_globalGeometry->idToDet(id)->toGlobal(hit->localPosition()));
24  align::LocalPoint tsosChamberPos = m_chamberAlignable->surface().toLocal(m_globalGeometry->idToDet(id)->toGlobal(tsos->localPosition()));
25 
26  double residual = tsosChamberPos.x() - hitChamberPos.x(); // residual is hit minus hit
27  double weight = 1. / hit->localPositionError().xx(); // weight linear fit by hit-only local error
28  double layerPosition = tsosChamberPos.z(); // the layer's position in the chamber's coordinate system
29  double layerHitPos = hitChamberPos.z();
30 
31  m_numHits++;
32 
33  // "x" is the layerPosition, "y" is the residual (this is a linear fit to residual versus layerPosition)
35  m_residual_x += weight * layerPosition;
36  m_residual_y += weight * residual;
37  m_residual_xx += weight * layerPosition * layerPosition;
38  m_residual_xy += weight * layerPosition * residual;
39 
40  // "x" is the layerPosition, "y" is chamberx (this is a linear fit to chamberx versus layerPosition)
41  m_trackx_1 += weight;
42  m_trackx_x += weight * layerPosition;
43  m_trackx_y += weight * tsosChamberPos.x();
44  m_trackx_xx += weight * layerPosition * layerPosition;
45  m_trackx_xy += weight * layerPosition * tsosChamberPos.x();
46 
47  // "x" is the layerPosition, "y" is chambery (this is a linear fit to chambery versus layerPosition)
48  m_tracky_1 += weight;
49  m_tracky_x += weight * layerPosition;
50  m_tracky_y += weight * tsosChamberPos.y();
51  m_tracky_xx += weight * layerPosition * layerPosition;
52  m_tracky_xy += weight * layerPosition * tsosChamberPos.y();
53 
54  m_hitx_1 += weight;
55  m_hitx_x += weight * layerHitPos;
56  m_hitx_y += weight * hitChamberPos.x();
57  m_hitx_xx += weight * layerHitPos * layerHitPos;
58  m_hitx_xy += weight * layerHitPos * hitChamberPos.x();
59 
60  m_hity_1 += weight;
61  m_hity_x += weight * layerHitPos;
62  m_hity_y += weight * hitChamberPos.y();
63  m_hity_xx += weight * layerHitPos * layerPosition;
64  m_hity_xy += weight * layerHitPos * hitChamberPos.y();
65 
66  m_localIDs.push_back(id);
67  m_localResids.push_back(tsos->localPosition().x() - hit->localPosition().x());
68  m_individual_x.push_back(layerPosition);
69  m_individual_y.push_back(residual);
70  m_individual_weight.push_back(weight);
71 
72  if (m_numHits>1) segment_fit();
73 }
float xx() const
Definition: LocalError.h:24
std::vector< double > m_individual_y
T y() const
Definition: PV3DBase.h:63
std::vector< double > m_individual_x
std::vector< DetId > m_localIDs
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
std::vector< double > m_localResids
T z() const
Definition: PV3DBase.h:64
AlignableDetOrUnitPtr m_chamberAlignable
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
Definition: DetId.h:18
virtual LocalError localPositionError() const =0
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
DetId geographicalId() const
int weight
Definition: histoStyle.py:50
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const =0
std::vector< double > m_individual_weight
double residual() const
virtual void MuonDT13ChamberResidual::setSegmentResidual ( const reco::MuonChamberMatch ,
const reco::MuonSegmentMatch  
)
inlinevirtual

Implements MuonChamberResidual.

Definition at line 24 of file MuonDT13ChamberResidual.h.

24 {}