Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:39:38

0001 /** \file
0002  *
0003  *  $Date: 2008/03/26 21:59:25 $
0004  *  $Revision: 1.10 $
0005  *  \author Andre Sznajder - UERJ(Brazil)
0006  */
0007 
0008 #include "Alignment/MuonAlignment/interface/AlignableDTChamber.h"
0009 #include "Alignment/MuonAlignment/interface/AlignableDTSuperLayer.h"
0010 
0011 AlignableDTChamber::AlignableDTChamber(const GeomDet* geomDet) : AlignableDet(geomDet, false) {
0012   // even though we overload alignableObjectId(), it's dangerous to
0013   // have two different claims about the structure type
0014   theStructureType = align::AlignableDTChamber;
0015 
0016   // The unique thing about DT chambers is that they are Dets that contain Dets (superlayers)
0017   // The superlayer Dets contain DetUnits (layers), as usual
0018   const std::vector<const GeomDet*>& geomDets = geomDet->components();
0019   for (std::vector<const GeomDet*>::const_iterator idet = geomDets.begin(); idet != geomDets.end(); ++idet) {
0020     addComponent(new AlignableDTSuperLayer(*idet));
0021   }
0022 
0023   // DO NOT let the chamber position become an average of the layers
0024   this->theSurface = geomDet->surface();
0025 }
0026 
0027 /// Printout the DetUnits in the DT chamber
0028 std::ostream& operator<<(std::ostream& os, const AlignableDTChamber& r) {
0029   const auto& theDets = r.components();
0030 
0031   os << "    This DTChamber contains " << theDets.size() << " units" << std::endl;
0032   os << "    position = " << r.globalPosition() << std::endl;
0033   os << "    (phi, r, z)= (" << r.globalPosition().phi() << "," << r.globalPosition().perp() << ","
0034      << r.globalPosition().z();
0035   os << "), orientation:" << std::endl << r.globalRotation() << std::endl;
0036 
0037   os << "    total displacement and rotation: " << r.displacement() << std::endl;
0038   os << r.rotation() << std::endl;
0039 
0040   for (const auto& idet : theDets) {
0041     const auto& comp = idet->components();
0042 
0043     for (unsigned int i = 0; i < comp.size(); ++i) {
0044       os << "     Det position, phi, r: " << comp[i]->globalPosition() << " , " << comp[i]->globalPosition().phi()
0045          << " , " << comp[i]->globalPosition().perp() << std::endl;
0046       os << "     local  position, phi, r: " << r.surface().toLocal(comp[i]->globalPosition()) << " , "
0047          << r.surface().toLocal(comp[i]->globalPosition()).phi() << " , "
0048          << r.surface().toLocal(comp[i]->globalPosition()).perp() << std::endl;
0049     }
0050   }
0051 
0052   return os;
0053 }