23 vector<DetLayer*>
result[2];
31 vector<unsigned> rings;
34 rings.push_back(
ring);
44 unsigned int nSector(1);
50 throw cms::Exception(
"MTDDetLayers") <<
"Not implemented scenario " << mtdTopologyMode;
70 pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(
result[1],
result[0]);
76 vector<unsigned>& rings,
80 vector<const ForwardDetRing*> frontRings, backRings;
82 for (
unsigned ring : rings) {
83 vector<const GeomDet*> frontGeomDets, backGeomDets;
89 if (geomDet !=
nullptr) {
91 frontGeomDets.push_back(geomDet);
93 backGeomDets.push_back(geomDet);
98 <<
" isFront? " << isInFront;
102 if (!backGeomDets.empty()) {
103 backRings.push_back(makeDetRing(backGeomDets));
106 if (!frontGeomDets.empty()) {
107 frontRings.push_back(makeDetRing(frontGeomDets));
108 assert(!backGeomDets.empty());
109 float frontz = frontRings[0]->position().z();
110 float backz = backRings[0]->position().z();
118 LogTrace(
"MTDDetLayers") <<
"New MTDRingForwardLayer with " << frontRings.size() <<
" and " << backRings.size()
119 <<
" rings, at Z " <<
result->position().z()
120 <<
" R1: " <<
result->specificSurface().innerRadius()
121 <<
" R2: " <<
result->specificSurface().outerRadius();
130 LogTrace(
"MTDDetLayers") <<
"ETLDetLayerGeometryBuilder: new MTDDetRing with " << geomDets.size()
131 <<
" chambers at z=" <<
result->position().z()
132 <<
" R1: " <<
result->specificSurface().innerRadius()
133 <<
" R2: " <<
result->specificSurface().outerRadius();
141 std::vector<const MTDDetSector*> frontSectors, backSectors;
143 LogDebug(
"MTDDetLayers") <<
"ETL dets array size = " << geo.
detsETL().size();
146 std::vector<const GeomDet*> frontGeomDets, backGeomDets;
147 LogDebug(
"MTDDetLayers") <<
"endcap = " <<
endcap <<
" layer = " << layer <<
" sector = " <<
sector;
149 unsigned int nfront(0), nback(0);
151 for (
auto det : geo.
detsETL()) {
152 ETLDetId theMod(det->geographicalId().rawId());
153 if (theMod.mtdSide() ==
endcap && theMod.nDisc() == layer && theMod.sector() ==
static_cast<int>(
sector)) {
154 LogTrace(
"MTDLayerDump") <<
std::fixed <<
"ETLDetId " << theMod.rawId() <<
" side = " << std::setw(4)
155 << theMod.mtdSide() <<
" Disc/Side/Sector = " << std::setw(4) << theMod.nDisc() <<
" " 156 << std::setw(4) << theMod.discSide() <<
" " << std::setw(4) << theMod.sector()
157 <<
" mod/type = " << std::setw(4) << theMod.module() <<
" " << std::setw(4)
158 << theMod.modType() <<
" pos = " << det->position();
160 if (theMod.discSide() == 0) {
163 LogTrace(
"MTDDetLayers") <<
"Front " << theMod.discSide() <<
" " << nfront;
165 frontGeomDets.emplace_back(det);
167 }
else if (theMod.discSide() == 1) {
170 LogTrace(
"MTDDetLayers") <<
"Back " << theMod.discSide() <<
" " << nback;
172 backGeomDets.emplace_back(det);
177 if (!backGeomDets.empty()) {
179 LogDebug(
"MTDDetLayers") <<
"backGeomDets size = " << backGeomDets.size();
180 backSectors.emplace_back(makeDetSector(backGeomDets, topo));
183 if (!frontGeomDets.empty()) {
185 LogDebug(
"MTDDetLayers") <<
"frontGeomDets size = " << frontGeomDets.size();
186 frontSectors.emplace_back(makeDetSector(frontGeomDets, topo));
187 assert(!backGeomDets.empty());
188 float frontz = frontSectors.back()->position().z();
189 float backz = backSectors.back()->position().z();
195 LogTrace(
"MTDDetLayers") <<
"New MTDSectorForwardDoubleLayer with " <<
std::fixed << std::setw(14)
196 << frontSectors.size() <<
" and " << std::setw(14) << backSectors.size() <<
" rings, at Z " 197 << std::setw(14) <<
result->specificSurface().position().z() <<
" R1: " << std::setw(14)
198 <<
result->specificSurface().innerRadius() <<
" R2: " << std::setw(14)
199 <<
result->specificSurface().outerRadius();
206 LogTrace(
"MTDDetLayers") <<
"ETLDetLayerGeometryBuilder::makeDetSector new MTDDetSector with " <<
std::fixed 207 << std::setw(14) << geomDets.size() <<
" modules \n"
static MTDDetSector * makeDetSector(std::vector< const GeomDet *> &geomDets, const MTDTopology &topo)
int getMTDTopologyMode() const
ExtractPhi< GeomDet, float > DetPhi
Geom::Phi< T > phi() const
const DetContainer & detsETL() const
static bool isFront(int layer, int ring, int module)
const MTDGeomDet * idToDet(DetId) const override
Abs< T >::type abs(const T &t)
static bool orderETLSector(const GeomDet *&gd1, const GeomDet *&gd2)
static constexpr int kETLv1maxRing
static constexpr int kETLv5maxSector
ETLDetId::EtlLayout etlLayoutFromTopoMode(const int &topoMode)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
static constexpr int kETLv4maxSector
constexpr uint32_t rawId() const
get the raw id
static constexpr uint32_t kETLmoduleMask
const Surface::PositionType & position() const
The position (origin of the R.F.)
Detector identifier class for the Endcap Timing Layer.
static MTDDetRing * makeDetRing(std::vector< const GeomDet *> &geomDets)
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo, const MTDTopology &topo)
static constexpr int kETLv4nDisc
static MTDRingForwardDoubleLayer * buildLayer(int endcap, int layer, std::vector< unsigned > &rings, const MTDGeometry &geo)
static constexpr int kETLv1nDisc
static MTDSectorForwardDoubleLayer * buildLayerNew(int endcap, int layer, std::vector< unsigned > §ors, const MTDGeometry &geo, const MTDTopology &topo)