Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:40

0001 /** \file
0002  *
0003  *  $Date: 2008/03/26 21:59:18 $
0004  *  $Revision: 1.10 $
0005  *  \author Andre Sznajder - UERJ(Brazil)
0006  */
0007 
0008 #include "Alignment/MuonAlignment/interface/AlignableCSCChamber.h"
0009 
0010 AlignableCSCChamber::AlignableCSCChamber(const GeomDet* geomDet) : AlignableDet(geomDet) {
0011   theStructureType = align::AlignableCSCChamber;
0012   // DO NOT let the chamber position become an average of the layers
0013   // FIXME: is this redundant?
0014   theSurface = geomDet->surface();
0015   compConstraintType_ = Alignable::CompConstraintType::NONE;
0016 }
0017 
0018 void AlignableCSCChamber::update(const GeomDet* geomDet) {
0019   AlignableDet::update(geomDet);
0020   // DO NOT let the chamber position become an average of the layers
0021   // FIXME: is this redundant?
0022   theSurface = geomDet->surface();
0023 }
0024 
0025 /// Printout the DetUnits in the CSC chamber
0026 std::ostream& operator<<(std::ostream& os, const AlignableCSCChamber& r) {
0027   const auto& theDets = r.components();
0028 
0029   os << "    This CSCChamber contains " << theDets.size() << " units" << std::endl;
0030   os << "    position = " << r.globalPosition() << std::endl;
0031   os << "    (phi, r, z)= (" << r.globalPosition().phi() << "," << r.globalPosition().perp() << ","
0032      << r.globalPosition().z();
0033   os << "), orientation:" << std::endl << r.globalRotation() << std::endl;
0034 
0035   os << "    total displacement and rotation: " << r.displacement() << std::endl;
0036   os << r.rotation() << std::endl;
0037 
0038   for (const auto& idet : theDets) {
0039     const auto& comp = idet->components();
0040 
0041     for (unsigned int i = 0; i < comp.size(); ++i) {
0042       os << "     Det position, phi, r: " << comp[i]->globalPosition() << " , " << comp[i]->globalPosition().phi()
0043          << " , " << comp[i]->globalPosition().perp() << std::endl;
0044       os << "     local  position, phi, r: " << r.surface().toLocal(comp[i]->globalPosition()) << " , "
0045          << r.surface().toLocal(comp[i]->globalPosition()).phi() << " , "
0046          << r.surface().toLocal(comp[i]->globalPosition()).perp() << std::endl;
0047     }
0048   }
0049 
0050   return os;
0051 }