CMS 3D CMS Logo

List of all members | Static Public Member Functions | Private Member Functions | Static Private Member Functions
ETLDetLayerGeometryBuilder Class Reference

#include <ETLDetLayerGeometryBuilder.h>

Static Public Member Functions

static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers (const MTDGeometry &geo)
 

Private Member Functions

 ETLDetLayerGeometryBuilder ()
 

Static Private Member Functions

static MTDRingForwardDoubleLayerbuildLayer (int endcap, int layer, std::vector< unsigned > &rings, const MTDGeometry &geo)
 
static bool isFront (int layer, int ring, int module)
 
static MTDDetRingmakeDetRing (std::vector< const GeomDet * > &geomDets)
 

Detailed Description

Build the ETL DetLayers.

Author
L. Gray - FNAL

Definition at line 18 of file ETLDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ ETLDetLayerGeometryBuilder()

ETLDetLayerGeometryBuilder::ETLDetLayerGeometryBuilder ( )
inlineprivate

Definition at line 26 of file ETLDetLayerGeometryBuilder.h.

26 {}

Member Function Documentation

◆ buildLayer()

MTDRingForwardDoubleLayer * ETLDetLayerGeometryBuilder::buildLayer ( int  endcap,
int  layer,
std::vector< unsigned > &  rings,
const MTDGeometry geo 
)
staticprivate

Definition at line 36 of file ETLDetLayerGeometryBuilder.cc.

39  {
40  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|ETLDetLayerGeometryBuilder";
42 
43  vector<const ForwardDetRing*> frontRings, backRings;
44 
45  for (unsigned ring : rings) {
46  vector<const GeomDet*> frontGeomDets, backGeomDets;
47  for (unsigned module = 1; module <= ETLDetId::kETLmoduleMask; ++module) {
48  ETLDetId detId(endcap, ring, module, 0);
49  const GeomDet* geomDet = geo.idToDet(detId);
50  // we sometimes loop over more chambers than there are in ring
51  bool isInFront = isFront(layer, ring, module);
52  if (geomDet != nullptr) {
53  if (isInFront) {
54  frontGeomDets.push_back(geomDet);
55  } else {
56  backGeomDets.push_back(geomDet);
57  }
58  LogTrace(metname) << "get ETL module " << std::hex << ETLDetId(endcap, layer, ring, module).rawId() << std::dec
59  << " at R=" << geomDet->position().perp() << ", phi=" << geomDet->position().phi()
60  << ", z= " << geomDet->position().z() << " isFront? " << isInFront << std::endl;
61  }
62  }
63 
64  if (!backGeomDets.empty()) {
65  backRings.push_back(makeDetRing(backGeomDets));
66  }
67 
68  if (!frontGeomDets.empty()) {
69  frontRings.push_back(makeDetRing(frontGeomDets));
70  assert(!backGeomDets.empty());
71  float frontz = frontRings[0]->position().z();
72  float backz = backRings[0]->position().z();
73  assert(fabs(frontz) < fabs(backz));
74  }
75  }
76 
77  // How should they be sorted?
78  // precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractZ<GeometricSearchDet,float>());
79  result = new MTDRingForwardDoubleLayer(frontRings, backRings);
80  LogTrace(metname) << "New MTDRingForwardLayer with " << frontRings.size() << " and " << backRings.size()
81  << " rings, at Z " << result->position().z() << " R1: " << result->specificSurface().innerRadius()
82  << " R2: " << result->specificSurface().outerRadius() << std::endl;
83  return result;
84 }

References cms::cuda::assert(), TauDecayModes::dec, makeMuonMisalignmentScenario::endcap, MTDGeometry::idToDet(), ETLDetId::kETLmoduleMask, LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), DetId::rawId(), mps_fire::result, relativeConstraints::ring, AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

◆ buildLayers()

pair< vector< DetLayer * >, vector< DetLayer * > > ETLDetLayerGeometryBuilder::buildLayers ( const MTDGeometry geo)
static

return.first=forward (+Z), return.second=backward (-Z) both vectors are sorted inside-out

Definition at line 17 of file ETLDetLayerGeometryBuilder.cc.

17  {
18  vector<DetLayer*> result[2]; // one for each endcap
19 
20  for (unsigned endcap = 0; endcap < 2; ++endcap) {
21  // there is only one layer for ETL right now, maybe more later
22  for (unsigned layer = 0; layer <= 0; ++layer) {
23  vector<unsigned> rings;
24  for (unsigned ring = 1; ring <= 12; ++ring) {
25  rings.push_back(ring);
26  }
27  MTDRingForwardDoubleLayer* thelayer = buildLayer(endcap, layer, rings, geo);
28  if (thelayer)
29  result[endcap].push_back(thelayer);
30  }
31  }
32  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
33  return res_pair;
34 }

References makeMuonMisalignmentScenario::endcap, mps_fire::result, and relativeConstraints::ring.

Referenced by MTDDetLayerGeometryESProducer::produce().

◆ isFront()

bool ETLDetLayerGeometryBuilder::isFront ( int  layer,
int  ring,
int  module 
)
staticprivate

Definition at line 86 of file ETLDetLayerGeometryBuilder.cc.

86 { return (module + 1) % 2; }

◆ makeDetRing()

MTDDetRing * ETLDetLayerGeometryBuilder::makeDetRing ( std::vector< const GeomDet * > &  geomDets)
staticprivate

Definition at line 88 of file ETLDetLayerGeometryBuilder.cc.

88  {
89  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|ETLDetLayerGeometryBuilder";
90 
91  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
92  MTDDetRing* result = new MTDDetRing(geomDets);
93  LogTrace(metname) << "New MTDDetRing with " << geomDets.size() << " chambers at z=" << result->position().z()
94  << " R1: " << result->specificSurface().innerRadius()
95  << " R2: " << result->specificSurface().outerRadius() << std::endl;
96  ;
97  return result;
98 }

References LogTrace, metname, precomputed_value_sort(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GeomDet
Definition: GeomDet.h:27
MTDRingForwardDoubleLayer
Definition: MTDRingForwardDoubleLayer.h:19
cms::cuda::assert
assert(be >=bs)
ETLDetId
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
geomsort::DetPhi
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
MTDGeometry::idToDet
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:171
ETLDetLayerGeometryBuilder::buildLayer
static MTDRingForwardDoubleLayer * buildLayer(int endcap, int layer, std::vector< unsigned > &rings, const MTDGeometry &geo)
Definition: ETLDetLayerGeometryBuilder.cc:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
module
Definition: vlib.h:198
ETLDetLayerGeometryBuilder::makeDetRing
static MTDDetRing * makeDetRing(std::vector< const GeomDet * > &geomDets)
Definition: ETLDetLayerGeometryBuilder.cc:88
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
ETLDetId::kETLmoduleMask
static const uint32_t kETLmoduleMask
Definition: ETLDetId.h:18
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
ETLDetLayerGeometryBuilder::isFront
static bool isFront(int layer, int ring, int module)
Definition: ETLDetLayerGeometryBuilder.cc:86
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
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
MTDDetRing
Definition: MTDDetRing.h:16
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43