33 LogError(
"MTDDetLayers") <<
"No MTD geometry is available.";
36 if (mtopo ==
nullptr) {
37 LogError(
"MTDDetLayers") <<
"No MTD topology is available.";
41 throw cms::Exception(
"MTDDetLayers") <<
"No complete MTD geometry available, aborting.";
51 for (
auto const it : etllayers.first) {
52 etlLayers_fw.push_back(
it);
53 allForward.push_back(
it);
55 detLayersMap[makeDetLayerId(
it)] =
it;
58 for (
auto const it : etllayers.second) {
59 etlLayers_bk.push_back(
it);
60 allBackward.push_back(
it);
62 detLayersMap[makeDetLayerId(
it)] =
it;
67 for (
auto const it : dtlayers) {
68 btlLayers.push_back(
it);
69 allBarrel.push_back(
it);
71 detLayersMap[makeDetLayerId(
it)] =
it;
78 return ETLDetId(
id.mtdSide(), 0, 0, 0, 0);
81 return BTLDetId(
id.mtdSide(), 0, 0, 0, 0);
106 if (
detId.mtdSubDetector() == 2) {
108 idout =
ETLDetId(etlId.mtdSide(), 0, 0, 0, 0);
109 }
else if (
detId.mtdSubDetector() == 1) {
111 idout =
BTLDetId(btlId.mtdSide(), 0, 0, 0, 0);
115 std::map<DetId, const DetLayer*>::const_iterator layer = detLayersMap.find(idout);
116 if (layer == detLayersMap.end())
118 return layer->second;
152 etlLayers_all.reserve(etlLayers_bk.size() + etlLayers_fw.size());
153 std::copy(etlLayers_bk.begin(), etlLayers_bk.end(), back_inserter(etlLayers_all));
154 std::reverse(etlLayers_all.begin(), etlLayers_all.end());
155 std::copy(etlLayers_fw.begin(), etlLayers_fw.end(), back_inserter(etlLayers_all));
158 allEndcap.reserve(allBackward.size() + allForward.size());
159 std::copy(allBackward.begin(), allBackward.end(), back_inserter(allEndcap));
161 std::copy(allForward.begin(), allForward.end(), back_inserter(allEndcap));
164 allDetLayers.reserve(allBackward.size() + allBarrel.size() + allForward.size());
165 std::copy(allBackward.begin(), allBackward.end(), back_inserter(allDetLayers));
167 std::copy(allBarrel.begin(), allBarrel.end(), back_inserter(allDetLayers));
168 std::copy(allForward.begin(), allForward.end(), back_inserter(allDetLayers));
172 for (
auto l : allDetLayers)
173 (*
const_cast<DetLayer*
>(
l)).setSeqNum(sq++);
static std::vector< DetLayer * > buildLayers(const MTDGeometry &geo, const MTDTopology &topo)
Operations.
MTDDetLayerGeometry()
Constructor.
void addBTLLayers(const std::vector< DetLayer *> &btllayers)
const std::vector< const DetLayer * > & allBackwardLayers() const
return all endcap layers
~MTDDetLayerGeometry() override
Destructor.
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
Log< level::Error, false > LogError
Detector identifier base class for the MIP Timing Layer.
const std::vector< const DetLayer * > & allLayers() const
return all DetLayers (barrel + endcap), -Z to +Z
const std::vector< const DetLayer * > & allBarrelLayers() const
return all barrel layers
const DetLayer * idToLayer(const DetId &detId) const override
return the DetLayer which correspond to a certain DetId
void buildLayers(const MTDGeometry *geo, const MTDTopology *mtopo)
const std::vector< const DetLayer * > & allEndcapLayers() const
return all endcap layers
const std::vector< const DetLayer * > & allForwardLayers() const
return all endcap layers
const std::vector< const DetLayer * > & allBTLLayers() const
return the BTL DetLayers (barrel), inside-out
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
virtual const std::vector< const GeomDet * > & basicComponents() const =0
DetId makeDetLayerId(const DetLayer *detLayer) const
void addETLLayers(const std::pair< std::vector< DetLayer *>, std::vector< DetLayer *> > &etllayers)
Detector identifier class for the Endcap Timing Layer.
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo, const MTDTopology &topo)
const std::vector< const DetLayer * > & allETLLayers() const
return the ETL DetLayers (endcap), -Z to +Z