CMS 3D CMS Logo

MuonChamberResidual.cc
Go to the documentation of this file.
1 
7 
12 
15  DetId chamberId,
16  AlignableDetOrUnitPtr chamberAlignable)
17  : m_globalGeometry(globalGeometry),
18  m_navigator(navigator),
19  m_chamberId(chamberId),
20  m_chamberAlignable(chamberAlignable),
21  m_numHits(0),
22  m_type(-1),
23  m_sign(0.),
24  m_chi2(-999.),
25  m_ndof(-1),
26  m_residual(-999.),
27  m_residual_error(-999.),
28  m_resslope(-999.),
29  m_resslope_error(-999.),
30  m_trackdxdz(-999.),
31  m_trackdydz(-999.),
32  m_trackx(-999.),
33  m_tracky(-999.),
34  m_segdxdz(-999.),
35  m_segdydz(-999.),
36  m_segx(-999.),
37  m_segy(-999.),
38  m_ChambW(-999),
39  m_Chambl(-999) {}
40 
43 }
44 
47 }
48 
50 
52 
54 
55 double MuonChamberResidual::hitresid(int i) const {
56  assert(0 <= i && i < int(m_localIDs.size()));
57  return m_localResids[i];
58 }
59 
60 int MuonChamberResidual::hitlayer(int i) const { // only difference between DTs and CSCs is the DetId subclass
61  assert(0 <= i && i < int(m_localIDs.size()));
63  DTLayerId layerId(m_localIDs[i].rawId());
64  return 4 * (layerId.superlayer() - 1) + layerId.layer();
65  } else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
66  CSCDetId layerId(m_localIDs[i].rawId());
67  return layerId.layer();
68  } else
69  assert(false);
70 }
71 
73  assert(0 <= i && i < int(m_localIDs.size()));
76  return sqrt(pow(pos.x(), 2) + pow(pos.y(), 2)); // R for DTs
77  } else if (m_chamberId.subdetId() == MuonSubdetId::CSC) {
78  return m_globalGeometry->idToDet(m_localIDs[i])->position().z(); // Z for CSCs
79  } else
80  assert(false);
81 }
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
virtual double signConvention() const
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
T z() const
Definition: PV3DBase.h:61
align::GlobalPoint global_trackpos()
MuonChamberResidual(edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
int hitlayer(int i) const
int layer() const
Definition: CSCDetId.h:56
assert(be >=bs)
const GeomDet * idToDet(DetId) const override
std::vector< DetId > m_localIDs
std::vector< double > m_localResids
T sqrt(T t)
Definition: SSEVec.h:19
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
double global_hitresid(int i) const
Definition: DetId.h:17
int superlayer() const
Return the superlayer number (deprecated method name)
double global_residual() const
double hitposition(int i) const
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
int layer() const
Return the layer number.
Definition: DTLayerId.h:45
align::GlobalPoint global_stubpos()
double hitresid(int i) const
edm::ESHandle< GlobalTrackingGeometry > m_globalGeometry
AlignableDetOrUnitPtr chamberAlignable() const
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
double global_resslope() const