CMS 3D CMS Logo

BTLDetLayerGeometryBuilder.cc
Go to the documentation of this file.
1 //#define EDM_ML_DEBUG
2 
4 
9 
12 
14 
15 #include <iostream>
16 
17 using namespace std;
18 
20 
22 
24  vector<DetLayer*> detlayers;
25  vector<MTDTrayBarrelLayer*> result;
26 
27  vector<const DetRod*> btlDetTrays;
28 
29  for (unsigned tray = BTLDetId::MIN_ROD; tray <= BTLDetId::HALF_ROD; ++tray) {
30  vector<const GeomDet*> geomDets;
31  for (unsigned module = 1; module <= BTLDetId::kModulesPerROD; ++module) {
32  for (unsigned side = 0; side <= 1; ++side) {
33  const GeomDet* geomDet = geo.idToDet(BTLDetId(side, tray, module, 0, 1));
34  if (geomDet != nullptr) {
35  geomDets.push_back(geomDet);
36  LogTrace("MTDDetLayers") << "get BTL module " << std::hex << BTLDetId(side, tray, module, 0, 1).rawId()
37  << std::dec << " at R=" << geomDet->position().perp()
38  << ", phi=" << geomDet->position().phi();
39  }
40  }
41  }
42 
43  if (!geomDets.empty()) {
44  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetZ());
45  btlDetTrays.push_back(new MTDDetTray(geomDets));
46  LogTrace("MTDDetLayers") << " New BTLDetTray with " << geomDets.size()
47  << " modules at R=" << btlDetTrays.back()->position().perp()
48  << ", phi=" << btlDetTrays.back()->position().phi();
49  }
50  }
51 
52  precomputed_value_sort(btlDetTrays.begin(), btlDetTrays.end(), geomsort::ExtractPhi<GeometricSearchDet, float>());
53  result.push_back(new MTDTrayBarrelLayer(btlDetTrays));
54  LogTrace("MTDDetLayers") << "BTLDetLayerGeometryBuilder: new MTDTrayBarrelLayer with " << btlDetTrays.size()
55  << " rods, at R " << result.back()->specificSurface().radius();
56 
57  for (vector<MTDTrayBarrelLayer*>::const_iterator it = result.begin(); it != result.end(); it++)
58  detlayers.push_back((DetLayer*)(*it));
59 
60  return detlayers;
61 }
GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
BTLDetId.h
BTLDetId::HALF_ROD
static constexpr int HALF_ROD
Definition: BTLDetId.h:52
MessageLogger.h
GeomDet
Definition: GeomDet.h:27
BTLDetLayerGeometryBuilder::~BTLDetLayerGeometryBuilder
virtual ~BTLDetLayerGeometryBuilder()
Destructor.
Definition: BTLDetLayerGeometryBuilder.cc:21
DetLayer
Definition: DetLayer.h:21
BTLDetId::kModulesPerROD
static constexpr int kModulesPerROD
range constants, need two sets for the time being (one for tiles and one for bars)
Definition: BTLDetId.h:28
BTLDetLayerGeometryBuilder::buildLayers
static std::vector< DetLayer * > buildLayers(const MTDGeometry &geo)
Operations.
Definition: BTLDetLayerGeometryBuilder.cc:23
MTDTrayBarrelLayer.h
precomputed_value_sort.h
DetSorting.h
MTDGeometry::idToDet
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:171
BTLDetId
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
Definition: BTLDetId.h:18
geomsort::DetZ
ExtractZ< GeomDet, float > DetZ
Definition: DetSorting.h:50
MTDTrayBarrelLayer
Definition: MTDTrayBarrelLayer.h:17
BTLDetLayerGeometryBuilder::BTLDetLayerGeometryBuilder
BTLDetLayerGeometryBuilder()
Constructor.
Definition: BTLDetLayerGeometryBuilder.cc:19
geomsort::ExtractPhi
Definition: GeometricSorting.h:45
BTLDetId::MIN_ROD
static constexpr int MIN_ROD
Definition: BTLDetId.h:50
MTDDetTray
Definition: MTDDetTray.h:17
MTDGeometry
Definition: MTDGeometry.h:14
GeomDet.h
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MTDDetTray.h
BTLDetLayerGeometryBuilder.h
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66