CMS 3D CMS Logo

AlignableDTChamber.cc
Go to the documentation of this file.
1 
10 
12  : AlignableDet(geomDet, false)
13 {
14  // even though we overload alignableObjectId(), it's dangerous to
15  // have two different claims about the structure type
17 
18  // The unique thing about DT chambers is that they are Dets that contain Dets (superlayers)
19  // The superlayer Dets contain DetUnits (layers), as usual
20  const std::vector<const GeomDet*>& geomDets = geomDet->components();
21  for (std::vector<const GeomDet*>::const_iterator idet = geomDets.begin(); idet != geomDets.end(); ++idet) {
23  }
24 
25  // DO NOT let the chamber position become an average of the layers
26  this->theSurface = geomDet->surface();
27 }
28 
30 std::ostream& operator<< (std::ostream &os, const AlignableDTChamber & r) {
31  const auto& theDets = r.components();
32 
33  os << " This DTChamber contains " << theDets.size() << " units" << std::endl ;
34  os << " position = " << r.globalPosition() << std::endl;
35  os << " (phi, r, z)= (" << r.globalPosition().phi() << "," << r.globalPosition().perp() << "," << r.globalPosition().z();
36  os << "), orientation:" << std::endl<< r.globalRotation() << std::endl;
37 
38  os << " total displacement and rotation: " << r.displacement() << std::endl;
39  os << r.rotation() << std::endl;
40 
41  for (const auto& idet: theDets) {
42  const auto& comp = idet->components();
43 
44  for (unsigned int i = 0; i < comp.size(); ++i) {
45  os << " Det position, phi, r: "
46  << comp[i]->globalPosition() << " , "
47  << comp[i]->globalPosition().phi() << " , "
48  << comp[i]->globalPosition().perp() << std::endl;
49  os << " local position, phi, r: "
50  << r.surface().toLocal(comp[i]->globalPosition()) << " , "
51  << r.surface().toLocal(comp[i]->globalPosition()).phi() << " , "
52  << r.surface().toLocal(comp[i]->globalPosition()).perp() << std::endl;
53  }
54  }
55 
56  return os;
57 }
const Alignables & components() const override
Return vector of direct components.
A muon DT Chamber( an AlignableDet )
T perp() const
Definition: PV3DBase.h:72
AlignableDTChamber(const GeomDet *geomDet)
Constructor.
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:144
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
StructureType theStructureType
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
friend std::ostream & operator<<(std::ostream &, const AlignableDTChamber &)
Printout the DetUnits in the DT chamber.
T z() const
Definition: PV3DBase.h:64
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:88
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
void addComponent(Alignable *component) final
AlignableSurface theSurface
Definition: Alignable.h:246