Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:49

0001 /****************************************************************************
0002 * Authors: 
0003 *  Jan Kašpar (jan.kaspar@gmail.com) 
0004 ****************************************************************************/
0005 
0006 #include "CalibPPS/AlignmentRelative/interface/AlignmentGeometry.h"
0007 #include "CalibPPS/AlignmentRelative/interface/Utilities.h"
0008 
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 
0011 #include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h"
0012 
0013 using namespace std;
0014 
0015 //----------------------------------------------------------------------------------------------------
0016 
0017 const DetGeometry &AlignmentGeometry::get(unsigned int id) const {
0018   auto it = sensorGeometry.find(id);
0019   if (it == sensorGeometry.end())
0020     throw cms::Exception("PPS") << "No geometry available for sensor " << id << ".";
0021 
0022   return it->second;
0023 }
0024 
0025 //----------------------------------------------------------------------------------------------------
0026 
0027 void AlignmentGeometry::insert(unsigned int id, const DetGeometry &g) { sensorGeometry[id] = g; }
0028 
0029 //----------------------------------------------------------------------------------------------------
0030 
0031 void AlignmentGeometry::print() const {
0032   for (const auto &it : sensorGeometry) {
0033     printId(it.first);
0034 
0035     printf(" z = %+10.4f mm │ shift: x = %+7.3f mm, y = %+7.3f mm │ ", it.second.z, it.second.sx, it.second.sy);
0036 
0037     for (const auto &dit : it.second.directionData) {
0038       printf("dir%u: %+.3f, %+.3f, %+.3f │ ", dit.first, dit.second.dx, dit.second.dy, dit.second.dz);
0039     }
0040 
0041     if (CTPPSDetId(it.first).subdetId() == CTPPSDetId::sdTrackingStrip)
0042       printf("%s", (it.second.isU) ? "U-det" : "V-det");
0043 
0044     printf("\n");
0045   }
0046 }