CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
BTLDetLayerGeometryBuilder Class Reference

#include <BTLDetLayerGeometryBuilder.h>

Public Member Functions

 BTLDetLayerGeometryBuilder ()
 Constructor. More...
 
virtual ~BTLDetLayerGeometryBuilder ()
 Destructor. More...
 

Static Public Member Functions

static std::vector< DetLayer * > buildLayers (const MTDGeometry &geo, const MTDTopology &topo)
 Operations. More...
 

Detailed Description

Build the BTL DetLayers.

Author
L. Gray - FNAL

Definition at line 17 of file BTLDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ BTLDetLayerGeometryBuilder()

BTLDetLayerGeometryBuilder::BTLDetLayerGeometryBuilder ( )

Constructor.

Definition at line 20 of file BTLDetLayerGeometryBuilder.cc.

20 {}

◆ ~BTLDetLayerGeometryBuilder()

BTLDetLayerGeometryBuilder::~BTLDetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 22 of file BTLDetLayerGeometryBuilder.cc.

22 {}

Member Function Documentation

◆ buildLayers()

vector< DetLayer * > BTLDetLayerGeometryBuilder::buildLayers ( const MTDGeometry geo,
const MTDTopology topo 
)
static

Operations.

Definition at line 24 of file BTLDetLayerGeometryBuilder.cc.

References MTDTopologyMode::crysLayoutFromTopoMode(), TauDecayModes::dec, MTDGeometry::detsBTL(), MTDTopology::getMTDTopologyMode(), BTLDetId::HALF_ROD, MTDGeometry::idToDet(), BTLDetId::kCrystalTypes, BTLDetId::kModulesPerRODBarPhiFlat, BTLDetId::kModulesPerRUV2, BTLDetId::kModulesPerTrkV2, BTLDetId::kRUPerTypeV2, LogTrace, callgraph::module, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), precomputed_value_sort(), DetId::rawId(), mps_fire::result, and BTLDetId::v2.

Referenced by MTDDetLayerGeometry::buildLayers().

24  {
25  vector<DetLayer*> detlayers;
26  vector<MTDTrayBarrelLayer*> result;
27 
28  vector<const DetRod*> btlDetTrays;
29 
30  const int mtdTopologyMode = topo.getMTDTopologyMode();
32 
33  if (btlL != BTLDetId::CrysLayout::v2) {
34  for (unsigned tray = 1; tray <= BTLDetId::HALF_ROD; ++tray) {
35  vector<const GeomDet*> geomDets;
36  for (unsigned module = 1; module <= BTLDetId::kModulesPerRODBarPhiFlat; ++module) {
37  for (unsigned side = 0; side <= 1; ++side) {
38  const GeomDet* geomDet = geo.idToDet(BTLDetId(side, tray, module, 0, 1));
39  if (geomDet != nullptr) {
40  geomDets.push_back(geomDet);
41  LogTrace("MTDDetLayers") << "get BTL module " << std::hex << BTLDetId(side, tray, module, 0, 1).rawId()
42  << std::dec << " at R=" << geomDet->position().perp()
43  << ", phi=" << geomDet->position().phi();
44  }
45  }
46  }
47 
48  if (!geomDets.empty()) {
49  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetZ());
50  btlDetTrays.push_back(new MTDDetTray(geomDets));
51  LogTrace("MTDDetLayers") << " New BTLDetTray with " << geomDets.size()
52  << " modules at R=" << btlDetTrays.back()->position().perp()
53  << ", phi=" << btlDetTrays.back()->position().phi();
54  }
55  }
56 
57  precomputed_value_sort(btlDetTrays.begin(), btlDetTrays.end(), geomsort::ExtractPhi<GeometricSearchDet, float>());
58  result.push_back(new MTDTrayBarrelLayer(btlDetTrays));
59  LogTrace("MTDDetLayers") << "BTLDetLayerGeometryBuilder: new MTDTrayBarrelLayer with " << btlDetTrays.size()
60  << " rods, at R " << result.back()->specificSurface().radius();
61  } else {
62  vector<const GeomDet*> geomDets;
63 
64  // logical tracking trays are now rows along z of modules, 3 per each mechanical tray, running from -z to z
65  // MTDGeometry is already built with the proper ordering, it is enough to exploit that
66  const uint32_t modulesPerDetTray =
68  geomDets.reserve(modulesPerDetTray);
69 
70  uint32_t index(0);
71  for (const auto& det : geo.detsBTL()) {
72  index++;
73  geomDets.emplace_back(det);
74  if (index == modulesPerDetTray) {
75  btlDetTrays.emplace_back(new MTDDetTray(geomDets));
76  LogTrace("MTDDetLayers") << " New BTLDetTray with " << geomDets.size()
77  << " modules at R=" << btlDetTrays.back()->position().perp()
78  << ", phi=" << btlDetTrays.back()->position().phi();
79  index = 0;
80  geomDets.clear();
81  }
82  }
83 
84  result.emplace_back(new MTDTrayBarrelLayer(btlDetTrays));
85  LogTrace("MTDDetLayers") << "BTLDetLayerGeometryBuilder: new MTDTrayBarrelLayer with " << btlDetTrays.size()
86  << " rods, at R " << result.back()->specificSurface().radius();
87  }
88 
89  for (vector<MTDTrayBarrelLayer*>::const_iterator it = result.begin(); it != result.end(); it++)
90  detlayers.push_back((DetLayer*)(*it));
91 
92  return detlayers;
93 }
int getMTDTopologyMode() const
Definition: MTDTopology.h:27
T perp() const
Definition: PV3DBase.h:69
CrysLayout
Definition: BTLDetId.h:46
const DetContainer & detsBTL() const
Definition: MTDGeometry.cc:159
static constexpr uint32_t kCrystalTypes
Definition: BTLDetId.h:38
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
#define LogTrace(id)
ExtractZ< GeomDet, float > DetZ
Definition: DetSorting.h:50
static constexpr uint32_t HALF_ROD
range constants, need two sets for the time being (one for tiles and one for bars) ...
Definition: BTLDetId.h:31
static constexpr uint32_t kModulesPerRODBarPhiFlat
Definition: BTLDetId.h:32
static constexpr uint32_t kModulesPerTrkV2
Definition: BTLDetId.h:37
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:171
static constexpr uint32_t kModulesPerRUV2
Definition: BTLDetId.h:35
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
static constexpr uint32_t kRUPerTypeV2
Definition: BTLDetId.h:34
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:19
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)