Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:29

0001 /****************************************************************************
0002 *
0003 * This is a part of TOTEM offline software.
0004 * Authors: 
0005 *   Jan Kašpar (jan.kaspar@cern.ch)
0006 *
0007 ****************************************************************************/
0008 
0009 #include "CondFormats/PPSObjects/interface/TotemSymbId.h"
0010 #include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h"
0011 #include "DataFormats/CTPPSDetId/interface/CTPPSDiamondDetId.h"
0012 #include "DataFormats/CTPPSDetId/interface/CTPPSPixelDetId.h"
0013 #include "DataFormats/CTPPSDetId/interface/TotemRPDetId.h"
0014 #include "DataFormats/CTPPSDetId/interface/TotemT2DetId.h"
0015 #include "DataFormats/CTPPSDetId/interface/TotemTimingDetId.h"
0016 
0017 void TotemSymbID::print(std::ostream& os, std::string subSystemName) const {
0018   const auto ctppsDetId = CTPPSDetId(symbolicID);
0019   os << "DetId=" << symbolicID << " (";
0020 
0021   if (subSystemName == "TrackingStrip") {
0022     os << "subDet=" << ctppsDetId.subdetId() << " " << TotemRPDetId(symbolicID);
0023   } else if (subSystemName == "TimingDiamond") {
0024     os << "subDet=" << ctppsDetId.subdetId() << " " << CTPPSDiamondDetId(symbolicID);
0025   } else if (subSystemName == "TotemT2") {
0026     os << "subDet=" << ctppsDetId.subdetId() << " " << TotemT2DetId(symbolicID);
0027   } else if (subSystemName == "TotemTiming") {
0028     const auto timingId = TotemTimingDetId(symbolicID);
0029     os << "subDet=" << ctppsDetId.subdetId() << " " << timingId;
0030     if (timingId.channel() == TotemTimingDetId::ID_NOT_SET || timingId.plane() == 0) {
0031       os << ") - (plane/channel det ids not applicable to SAMPIC; initialized with def values " << 0 << "/"
0032          << TotemTimingDetId::ID_NOT_SET << " now";
0033     }
0034   } else {
0035     os << ctppsDetId;
0036   }
0037 
0038   os << ")";
0039 }
0040 
0041 std::ostream& operator<<(std::ostream& s, const TotemSymbID& sid) {
0042   s << "DetId=" << sid.symbolicID << " (" << CTPPSDetId(sid.symbolicID) << ")";
0043 
0044   return s;
0045 }