CMS 3D CMS Logo

List of all members | Public Member Functions
MuonDT2ChamberResidual Class Reference

#include <MuonDT2ChamberResidual.h>

Inheritance diagram for MuonDT2ChamberResidual:
MuonHitsChamberResidual MuonChamberResidual

Public Member Functions

virtual void addResidual (edm::ESHandle< Propagator > prop, const TrajectoryStateOnSurface *tsos, const TrackingRecHit *hit, double, double)
 
 MuonDT2ChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, 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 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 transverse DT layers

Id

Definition at line 13 of file MuonDT2ChamberResidual.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file MuonDT2ChamberResidual.cc.

References GlobalTrackingGeometry::idToDet(), MuonChamberResidual::kDT2, MuonChamberResidual::m_chamberId, MuonChamberResidual::m_globalGeometry, MuonChamberResidual::m_sign, MuonChamberResidual::m_type, GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::y().

9 : MuonHitsChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
10 {
12  align::GlobalVector zDirection(0., 0., 1.);
13  m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(zDirection).y() > 0. ? 1. : -1.;
14 }
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
const GeomDet * idToDet(DetId) const override
MuonHitsChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, const AlignableDetOrUnitPtr &chamberAlignable)

Member Function Documentation

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

Implements MuonChamberResidual.

Definition at line 19 of file MuonDT2ChamberResidual.cc.

References gather_cfg::cout, TrackingRecHit::geographicalId(), GlobalTrackingGeometry::idToDet(), TrajectoryStateOnSurface::localPosition(), TrackingRecHit::localPosition(), TrackingRecHit::localPositionError(), MuonHitsChamberResidual::m_chamber_length, MuonHitsChamberResidual::m_chamber_width, 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(), GeomDet::toGlobal(), AlignableSurface::toLocal(), mps_merge::weight, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

20 {
21  bool m_debug = false;
22 
23  m_chamber_width = chamber_width;
24  m_chamber_length = chamber_length;
25 
26  DetId id = hit->geographicalId();
27 
30 
31  if (m_debug) {
32  std::cout << " MuonDT2ChamberResidual hitChamberPos x: " << hitChamberPos.x() << " tsosChamberPos x: " << tsosChamberPos.x() << std::endl;
33  std::cout << " hitChamberPos y: " << hitChamberPos.y() << " tsosChamberPos y: " << tsosChamberPos.y() << std::endl;
34  std::cout << " hitChamberPos z: " << hitChamberPos.z() << " tsosChamberPos z: " << tsosChamberPos.z() << std::endl;
35  }
36 
37  double residual = tsosChamberPos.y() - hitChamberPos.y(); // residual is track minus hit
38  double weight = 1. / hit->localPositionError().xx(); // weight linear fit by hit-only local error (yes, xx: layer x is chamber y)
39  double layerPosition = tsosChamberPos.z(); // the layer's position in the chamber's coordinate system
40  double layerHitPos = hitChamberPos.z();
41 
42  m_numHits++;
43 
44  // "x" is the layerPosition, "y" is the residual (this is a linear fit to residual versus layerPosition)
46  m_residual_x += weight * layerPosition;
47  m_residual_y += weight * residual;
48  m_residual_xx += weight * layerPosition * layerPosition;
49  m_residual_xy += weight * layerPosition * residual;
50 
51  // "x" is the layerPosition, "y" is chamberx (this is a linear fit to chamberx versus layerPosition)
52  m_trackx_1 += weight;
53  m_trackx_x += weight * layerPosition;
54  m_trackx_y += weight * tsosChamberPos.x();
55  m_trackx_xx += weight * layerPosition * layerPosition;
56  m_trackx_xy += weight * layerPosition * tsosChamberPos.x();
57 
58  // "x" is the layerPosition, "y" is chambery (this is a linear fit to chambery versus layerPosition)
59  m_tracky_1 += weight;
60  m_tracky_x += weight * layerPosition;
61  m_tracky_y += weight * tsosChamberPos.y();
62  m_tracky_xx += weight * layerPosition * layerPosition;
63  m_tracky_xy += weight * layerPosition * tsosChamberPos.y();
64 
65  m_hitx_1 += weight;
66  m_hitx_x += weight * layerHitPos;
67  m_hitx_y += weight * hitChamberPos.x();
68  m_hitx_xx += weight * layerHitPos * layerHitPos;
69  m_hitx_xy += weight * layerHitPos * hitChamberPos.x();
70 
71  m_hity_1 += weight;
72  m_hity_x += weight * layerHitPos;
73  m_hity_y += weight * hitChamberPos.y();
74  m_hity_xx += weight * layerHitPos * layerHitPos;
75  m_hity_xy += weight * layerHitPos * hitChamberPos.y();
76 
77  m_localIDs.push_back(id);
78  // m_localResids.push_back(tsos->localPosition().x() - hit->localPosition().x()); //FIXME looks like this line is not used anywhere, moreover it is wrong for segment-based reconstruction, I changed it to the follwoing line
79  m_localResids.push_back(residual);
80  m_individual_x.push_back(layerPosition);
81  m_individual_y.push_back(residual);
82  m_individual_weight.push_back(weight);
83 
84  if (m_numHits>1) segment_fit();
85 }
float xx() const
Definition: LocalError.h:24
std::vector< double > m_individual_y
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
Definition: weight.py:1
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
virtual LocalPoint localPosition() const =0
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
Definition: DetId.h:18
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
const GeomDet * idToDet(DetId) const override
DetId geographicalId() const
virtual LocalError localPositionError() const =0
T x() const
Definition: PV3DBase.h:62
std::vector< double > m_individual_weight
double residual() const
virtual void MuonDT2ChamberResidual::setSegmentResidual ( const reco::MuonChamberMatch ,
const reco::MuonSegmentMatch  
)
inlinevirtual

Implements MuonChamberResidual.

Definition at line 24 of file MuonDT2ChamberResidual.h.

24 {}