CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonChamberResidual.cc
Go to the documentation of this file.
1 
7 
12 
13 
15  AlignableNavigator *navigator,
16  DetId chamberId,
17  AlignableDetOrUnitPtr chamberAlignable):
18  m_globalGeometry(globalGeometry)
19  , m_navigator(navigator)
20  , m_chamberId(chamberId)
21  , m_chamberAlignable(chamberAlignable)
22  , m_numHits(0)
23  , m_type(-1)
24  , m_sign(0.)
25  , m_chi2(-999.)
26  , m_ndof(-1)
27  , m_residual(-999.)
28  , m_residual_error(-999.)
29  , m_resslope(-999.)
30  , m_resslope_error(-999.)
31  , m_trackdxdz(-999.)
32  , m_trackdydz(-999.)
33  , m_trackx(-999.)
34  , m_tracky(-999.)
35  , m_segdxdz(-999.)
36  , m_segdydz(-999.)
37  , m_segx(-999.)
38  , m_segy(-999.)
39 {}
40 
41 
43 {
45 }
46 
47 
49 {
51 }
52 
53 
55 {
56  return residual() * signConvention();
57 }
58 
59 
61 {
62  return resslope() * signConvention();
63 }
64 
65 
67 {
68  return hitresid(i) * signConvention();
69 }
70 
71 
73 {
74  assert(0 <= i && i < int(m_localIDs.size()));
75  return m_localResids[i];
76 }
77 
78 
80 { // only difference between DTs and CSCs is the DetId subclass
81  assert(0 <= i && i < int(m_localIDs.size()));
83  DTLayerId layerId(m_localIDs[i].rawId());
84  return 4*(layerId.superlayer() - 1) + layerId.layer();
85  }
86  else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
87  CSCDetId layerId(m_localIDs[i].rawId());
88  return layerId.layer();
89  }
90  else assert(false);
91 }
92 
93 
95 {
96  assert(0 <= i && i < int(m_localIDs.size()));
98  align::GlobalPoint pos = m_globalGeometry->idToDet(m_localIDs[i])->position();
99  return sqrt(pow(pos.x(), 2) + pow(pos.y(), 2)); // R for DTs
100  }
101  else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
102  return m_globalGeometry->idToDet(m_localIDs[i])->position().z(); // Z for CSCs
103  }
104  else assert(false);
105 }
int i
Definition: DBlmapReader.cc:9
align::GlobalPoint global_trackpos()
MuonChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
double global_hitresid(int i) const
T y() const
Definition: PV3DBase.h:63
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
int layer() const
Definition: CSCDetId.h:63
double global_residual() const
double trackx() const
double resslope() const
static const int CSC
Definition: MuonSubdetId.h:15
std::vector< DetId > m_localIDs
std::vector< double > m_localResids
T sqrt(T t)
Definition: SSEVec.h:48
AlignableDetOrUnitPtr chamberAlignable() const
double tracky() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DetId.h:20
double hitresid(int i) const
int hitlayer(int i) const
align::GlobalPoint global_stubpos()
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
double hitposition(int i) const
double global_resslope() const
static const int DT
Definition: MuonSubdetId.h:14
T x() const
Definition: PV3DBase.h:62
double residual() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
virtual double signConvention() const