Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /* AlignableGEMSuperChamber
0002  * \author Hyunyong Kim - TAMU
0003  */
0004 #include "Alignment/MuonAlignment/interface/AlignableGEMSuperChamber.h"
0005 #include "Alignment/MuonAlignment/interface/AlignableGEMChamber.h"
0006 
0007 AlignableGEMSuperChamber::AlignableGEMSuperChamber(const GeomDet* geomDet) : AlignableDet(geomDet, false) {
0008   theStructureType = align::AlignableGEMSuperChamber;
0009   const std::vector<const GeomDet*>& geomDets = geomDet->components();
0010   for (std::vector<const GeomDet*>::const_iterator idet = geomDets.begin(); idet != geomDets.end(); ++idet) {
0011     addComponent(new AlignableGEMChamber(*idet));
0012   }
0013   this->theSurface = geomDet->surface();
0014 }
0015 
0016 void AlignableGEMSuperChamber::update(const GeomDet* geomDet) {
0017   AlignableDet::update(geomDet);
0018   theSurface = geomDet->surface();
0019 }
0020 
0021 std::ostream& operator<<(std::ostream& os, const AlignableGEMSuperChamber& r) {
0022   const auto& theDets = r.components();
0023 
0024   os << "    This GEMSuperChamber contains " << theDets.size() << " units" << std::endl;
0025   os << "    position = " << r.globalPosition() << std::endl;
0026   os << "    (phi, r, z)= (" << r.globalPosition().phi() << "," << r.globalPosition().perp() << ","
0027      << r.globalPosition().z();
0028   os << "), orientation:" << std::endl << r.globalRotation() << std::endl;
0029 
0030   os << "    total displacement and rotation: " << r.displacement() << std::endl;
0031   os << r.rotation() << std::endl;
0032 
0033   for (const auto& idet : theDets) {
0034     const auto& comp = idet->components();
0035 
0036     for (unsigned int i = 0; i < comp.size(); ++i) {
0037       os << "     Det position, phi, r: " << comp[i]->globalPosition() << " , " << comp[i]->globalPosition().phi()
0038          << " , " << comp[i]->globalPosition().perp() << std::endl;
0039       os << "     local  position, phi, r: " << r.surface().toLocal(comp[i]->globalPosition()) << " , "
0040          << r.surface().toLocal(comp[i]->globalPosition()).phi() << " , "
0041          << r.surface().toLocal(comp[i]->globalPosition()).perp() << std::endl;
0042     }
0043   }
0044 
0045   return os;
0046 }