22 const int mtdTopologyMode) {
23 vector<DetLayer*>
result[2];
29 vector<unsigned> rings;
32 rings.push_back(
ring);
42 unsigned int nSector(1);
43 switch (mtdTopologyMode) {
51 throw cms::Exception(
"MTDDetLayers") <<
"Not implemented scenario " << mtdTopologyMode;
60 for (
unsigned sector = 1; sector <= nSector; ++sector) {
69 pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(
result[0],
result[1]);
75 vector<unsigned>& rings,
79 vector<const ForwardDetRing*> frontRings, backRings;
81 for (
unsigned ring : rings) {
82 vector<const GeomDet*> frontGeomDets, backGeomDets;
87 bool isInFront = isFront(layer,
ring, module);
88 if (geomDet !=
nullptr) {
90 frontGeomDets.push_back(geomDet);
92 backGeomDets.push_back(geomDet);
97 <<
" isFront? " << isInFront;
101 if (!backGeomDets.empty()) {
102 backRings.push_back(makeDetRing(backGeomDets));
105 if (!frontGeomDets.empty()) {
106 frontRings.push_back(makeDetRing(frontGeomDets));
107 assert(!backGeomDets.empty());
108 float frontz = frontRings[0]->position().z();
109 float backz = backRings[0]->position().z();
117 LogTrace(
"MTDDetLayers") <<
"New MTDRingForwardLayer with " << frontRings.size() <<
" and " << backRings.size()
118 <<
" rings, at Z " <<
result->position().z()
119 <<
" R1: " <<
result->specificSurface().innerRadius()
120 <<
" R2: " <<
result->specificSurface().outerRadius();
129 LogTrace(
"MTDDetLayers") <<
"ETLDetLayerGeometryBuilder: new MTDDetRing with " << geomDets.size()
130 <<
" chambers at z=" <<
result->position().z()
131 <<
" R1: " <<
result->specificSurface().innerRadius()
132 <<
" R2: " <<
result->specificSurface().outerRadius();
142 std::vector<const MTDDetSector*> frontSectors, backSectors;
144 LogDebug(
"MTDDetLayers") <<
"ETL dets array size = " << geo.
detsETL().size();
146 for (
unsigned sector :
sectors) {
147 std::vector<const GeomDet*> frontGeomDets, backGeomDets;
148 LogDebug(
"MTDDetLayers") <<
"endcap = " <<
endcap <<
" layer = " << layer <<
" sector = " << sector;
150 unsigned int nfront(0), nback(0);
152 for (
auto det : geo.
detsETL()) {
153 ETLDetId theMod(det->geographicalId().rawId());
154 if (theMod.mtdSide() ==
endcap && theMod.nDisc() == layer && theMod.sector() == static_cast<int>(sector)) {
155 LogTrace(
"MTDLayerDump") <<
std::fixed <<
"ETLDetId " << theMod.rawId() <<
" side = " << std::setw(4)
156 << theMod.mtdSide() <<
" Disc/Side/Sector = " << std::setw(4) << theMod.nDisc() <<
" "
157 << std::setw(4) << theMod.discSide() <<
" " << std::setw(4) << theMod.sector()
158 <<
" mod/type = " << std::setw(4) << theMod.module() <<
" " << std::setw(4)
159 << theMod.modType() <<
" pos = " << det->position();
161 if (theMod.discSide() == 0) {
164 LogTrace(
"MTDDetLayers") <<
"Front " << theMod.discSide() <<
" " << nfront;
166 frontGeomDets.emplace_back(det);
168 }
else if (theMod.discSide() == 1) {
171 LogTrace(
"MTDDetLayers") <<
"Back " << theMod.discSide() <<
" " << nback;
173 backGeomDets.emplace_back(det);
178 if (!backGeomDets.empty()) {
179 std::sort(backGeomDets.begin(), backGeomDets.end(), orderGeomDets);
180 LogDebug(
"MTDDetLayers") <<
"backGeomDets size = " << backGeomDets.size();
181 backSectors.emplace_back(makeDetSector(backGeomDets));
184 if (!frontGeomDets.empty()) {
185 std::sort(frontGeomDets.begin(), frontGeomDets.end(), orderGeomDets);
186 LogDebug(
"MTDDetLayers") <<
"frontGeomDets size = " << frontGeomDets.size();
187 frontSectors.emplace_back(makeDetSector(frontGeomDets));
188 assert(!backGeomDets.empty());
189 float frontz = frontSectors.back()->position().z();
190 float backz = backSectors.back()->position().z();
196 LogTrace(
"MTDDetLayers") <<
"New MTDSectorForwardDoubleLayer with " <<
std::fixed << std::setw(14)
197 << frontSectors.size() <<
" and " << std::setw(14) << backSectors.size() <<
" rings, at Z "
198 << std::setw(14) <<
result->specificSurface().position().z() <<
" R1: " << std::setw(14)
199 <<
result->specificSurface().innerRadius() <<
" R2: " << std::setw(14)
200 <<
result->specificSurface().outerRadius();
207 LogTrace(
"MTDDetLayers") <<
"ETLDetLayerGeometryBuilder::makeDetSector new MTDDetSector with " <<
std::fixed
208 << std::setw(14) << geomDets.size() <<
" modules \n"