File indexing completed on 2023-03-17 11:05:30
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef Geometry_VeryForwardGeometryBuilder_CTPPSGeometry
0009 #define Geometry_VeryForwardGeometryBuilder_CTPPSGeometry
0010
0011 #include "DataFormats/CTPPSDetId/interface/CTPPSDetId.h"
0012
0013 #include "Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h"
0014 #include "Geometry/VeryForwardGeometryBuilder/interface/CTPPSDDDNames.h"
0015
0016 #include <map>
0017 #include <set>
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 class CTPPSGeometry {
0031 public:
0032 typedef std::map<unsigned int, const DetGeomDesc*> mapType;
0033 typedef std::map<int, const DetGeomDesc*> RPDeviceMapType;
0034 typedef std::map<unsigned int, std::set<unsigned int> > mapSetType;
0035
0036 using Vector = DetGeomDesc::Translation;
0037
0038
0039 CTPPSGeometry(const DetGeomDesc* gd, unsigned int verbosity) { build(gd, verbosity); }
0040
0041
0042 void build(const DetGeomDesc*, unsigned int verbosity);
0043
0044
0045
0046
0047
0048
0049 bool addSensor(unsigned int, const DetGeomDesc*&);
0050
0051
0052
0053 bool addRP(unsigned int id, const DetGeomDesc*&);
0054
0055
0056
0057 const DetGeomDesc* sensor(unsigned int id) const;
0058 const DetGeomDesc* sensorNoThrow(unsigned int id) const noexcept;
0059
0060
0061 const DetGeomDesc* rp(unsigned int id) const;
0062 const DetGeomDesc* rpNoThrow(unsigned int id) const noexcept;
0063
0064
0065
0066
0067 mapType::const_iterator beginSensor() const { return sensors_map_.begin(); }
0068
0069 mapType::const_iterator endSensor() const { return sensors_map_.end(); }
0070
0071
0072 RPDeviceMapType::const_iterator beginRP() const { return rps_map_.begin(); }
0073
0074 RPDeviceMapType::const_iterator endRP() const { return rps_map_.end(); }
0075
0076
0077
0078
0079
0080
0081 Vector localToGlobal(const DetGeomDesc*, const Vector&) const;
0082 Vector globalToLocal(const DetGeomDesc*, const Vector&) const;
0083 Vector localToGlobal(unsigned int, const Vector&) const;
0084 Vector globalToLocal(unsigned int, const Vector&) const;
0085
0086
0087
0088 Vector localToGlobalDirection(unsigned int id, const Vector&) const;
0089
0090
0091 Vector globalToLocalDirection(unsigned int id, const Vector&) const;
0092
0093
0094
0095 Vector sensorTranslation(unsigned int id) const;
0096
0097
0098
0099 Vector rpTranslation(unsigned int id) const;
0100
0101
0102 const std::set<unsigned int>& stationsInArm(unsigned int) const;
0103
0104
0105 const std::set<unsigned int>& rpsInStation(unsigned int) const;
0106
0107
0108 const std::set<unsigned int>& sensorsInRP(unsigned int) const;
0109
0110 protected:
0111
0112 mapType sensors_map_;
0113
0114
0115 RPDeviceMapType rps_map_;
0116
0117
0118
0119 mapSetType stations_in_arm_, rps_in_station_, dets_in_rp_;
0120 };
0121
0122 #endif