CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/Alignment/MuonAlignment/src/AlignableCSCChamber.cc

Go to the documentation of this file.
00001 
00008 #include "Alignment/MuonAlignment/interface/AlignableCSCChamber.h"
00009 
00010 AlignableCSCChamber::AlignableCSCChamber(const GeomDet *geomDet): AlignableDet(geomDet)
00011 {
00012    theStructureType = align::AlignableCSCChamber;
00013    // DO NOT let the chamber position become an average of the layers
00014    this->theSurface = geomDet->surface();
00015 }
00016 
00018 std::ostream& operator<< (std::ostream &os, const AlignableCSCChamber & r) {
00019    std::vector<Alignable*> theDets = r.components();
00020 
00021    os << "    This CSCChamber contains " << theDets.size() << " units" << std::endl ;
00022    os << "    position = " << r.globalPosition() << std::endl;
00023    os << "    (phi, r, z)= (" << r.globalPosition().phi() << "," << r.globalPosition().perp() << "," << r.globalPosition().z();
00024    os << "), orientation:" << std::endl<< r.globalRotation() << std::endl;
00025    
00026    os << "    total displacement and rotation: " << r.displacement() << std::endl;
00027    os << r.rotation() << std::endl;
00028  
00029    for (std::vector<Alignable*>::const_iterator idet = theDets.begin();  idet != theDets.end();  ++idet) {
00030       const align::Alignables& comp = (*idet)->components();
00031 
00032       for (unsigned int i = 0; i < comp.size(); ++i) {
00033          os << "     Det position, phi, r: " 
00034             << comp[i]->globalPosition() << " , "
00035             << comp[i]->globalPosition().phi() << " , "
00036             << comp[i]->globalPosition().perp() << std::endl; 
00037          os << "     local  position, phi, r: " 
00038             << r.surface().toLocal(comp[i]->globalPosition())        << " , "
00039             << r.surface().toLocal(comp[i]->globalPosition()).phi()  << " , "
00040             << r.surface().toLocal(comp[i]->globalPosition()).perp() << std::endl; 
00041       }
00042    }
00043 
00044    return os;
00045 }