CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
MTDDetLayerGeometry Class Reference

#include <MTDDetLayerGeometry.h>

Inheritance diagram for MTDDetLayerGeometry:
DetLayerGeometry

Public Member Functions

const std::vector< const DetLayer * > & allBackwardLayers () const
 return all endcap layers More...
 
const std::vector< const DetLayer * > & allBarrelLayers () const
 return all barrel layers More...
 
const std::vector< const DetLayer * > & allBTLLayers () const
 return the BTL DetLayers (barrel), inside-out More...
 
const std::vector< const DetLayer * > & allEndcapLayers () const
 return all endcap layers More...
 
const std::vector< const DetLayer * > & allETLLayers () const
 return the ETL DetLayers (endcap), -Z to +Z More...
 
const std::vector< const DetLayer * > & allForwardLayers () const
 return all endcap layers More...
 
const std::vector< const DetLayer * > & allLayers () const
 return all DetLayers (barrel + endcap), -Z to +Z More...
 
void buildLayers (const MTDGeometry *geo, const MTDTopology *mtopo)
 
const DetLayeridToLayer (const DetId &detId) const override
 return the DetLayer which correspond to a certain DetId More...
 
 MTDDetLayerGeometry ()
 Constructor. More...
 
void sortLayers ()
 
 ~MTDDetLayerGeometry () override
 Destructor. More...
 
- Public Member Functions inherited from DetLayerGeometry
 DetLayerGeometry ()
 
virtual ~DetLayerGeometry ()
 

Private Member Functions

void addBTLLayers (const std::vector< DetLayer * > &btllayers)
 
void addETLLayers (const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &etllayers)
 
DetId makeDetLayerId (const DetLayer *detLayer) const
 

Private Attributes

std::vector< const DetLayer * > allBackward
 
std::vector< const DetLayer * > allBarrel
 
std::vector< const DetLayer * > allDetLayers
 
std::vector< const DetLayer * > allEndcap
 
std::vector< const DetLayer * > allForward
 
std::vector< const DetLayer * > btlLayers
 
std::map< DetId, const DetLayer * > detLayersMap
 
std::vector< const DetLayer * > etlLayers_all
 
std::vector< const DetLayer * > etlLayers_bk
 
std::vector< const DetLayer * > etlLayers_fw
 

Friends

class MTDDetLayerGeometryESProducer
 

Detailed Description

Provide access to the DetLayers of mip timing detectors.

Author
L. Gray - FNAL

Definition at line 22 of file MTDDetLayerGeometry.h.

Constructor & Destructor Documentation

◆ MTDDetLayerGeometry()

MTDDetLayerGeometry::MTDDetLayerGeometry ( )

Constructor.

Definition at line 26 of file MTDDetLayerGeometry.cc.

26 {}

◆ ~MTDDetLayerGeometry()

MTDDetLayerGeometry::~MTDDetLayerGeometry ( )
override

Destructor.

Definition at line 28 of file MTDDetLayerGeometry.cc.

28 {}

Member Function Documentation

◆ addBTLLayers()

void MTDDetLayerGeometry::addBTLLayers ( const std::vector< DetLayer * > &  btllayers)
private

Definition at line 61 of file MTDDetLayerGeometry.cc.

61  {
62  for (auto const it : dtlayers) {
63  btlLayers.push_back(it);
64  allBarrel.push_back(it);
65 
66  detLayersMap[makeDetLayerId(it)] = it;
67  }
68 }

◆ addETLLayers()

void MTDDetLayerGeometry::addETLLayers ( const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &  etllayers)
private

Add ETL layers etllayers.first=forward (+Z), etllayers.second=backward (-Z) both vectors are ASSUMED to be sorted inside-out

Definition at line 45 of file MTDDetLayerGeometry.cc.

45  {
46  for (auto const it : etllayers.first) {
47  etlLayers_fw.push_back(it);
48  allForward.push_back(it);
49 
50  detLayersMap[makeDetLayerId(it)] = it;
51  }
52 
53  for (auto const it : etllayers.second) {
54  etlLayers_bk.push_back(it);
55  allBackward.push_back(it);
56 
57  detLayersMap[makeDetLayerId(it)] = it;
58  }
59 }

◆ allBackwardLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allBackwardLayers ( ) const

return all endcap layers

Definition at line 87 of file MTDDetLayerGeometry.cc.

87 { return allBackward; }

Referenced by GeometricSearchTrackerBuilder::build().

◆ allBarrelLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allBarrelLayers ( ) const

return all barrel layers

Definition at line 81 of file MTDDetLayerGeometry.cc.

81 { return allBarrel; }

Referenced by GeometricSearchTrackerBuilder::build().

◆ allBTLLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allBTLLayers ( ) const

return the BTL DetLayers (barrel), inside-out

Definition at line 89 of file MTDDetLayerGeometry.cc.

89 { return btlLayers; }

Referenced by TrackExtenderWithMTDT< TrackCollection >::tryBTLLayers().

◆ allEndcapLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allEndcapLayers ( ) const

return all endcap layers

Definition at line 83 of file MTDDetLayerGeometry.cc.

83 { return allEndcap; }

◆ allETLLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allETLLayers ( ) const

return the ETL DetLayers (endcap), -Z to +Z

Definition at line 91 of file MTDDetLayerGeometry.cc.

91 { return etlLayers_all; }

Referenced by TrackExtenderWithMTDT< TrackCollection >::tryETLLayers().

◆ allForwardLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allForwardLayers ( ) const

return all endcap layers

Definition at line 85 of file MTDDetLayerGeometry.cc.

85 { return allForward; }

Referenced by GeometricSearchTrackerBuilder::build().

◆ allLayers()

const vector< const DetLayer * > & MTDDetLayerGeometry::allLayers ( ) const

return all DetLayers (barrel + endcap), -Z to +Z

Definition at line 93 of file MTDDetLayerGeometry.cc.

93 { return allDetLayers; }

◆ buildLayers()

void MTDDetLayerGeometry::buildLayers ( const MTDGeometry geo,
const MTDTopology mtopo 
)

Definition at line 30 of file MTDDetLayerGeometry.cc.

30  {
31  if (geo) {
32  // Build BTL layers
34  // Build ETL layers, depends on the scenario
35  if (mtopo) {
37  } else {
38  LogWarning("MTDDetLayers") << "No MTD topology is available.";
39  }
40  } else {
41  LogWarning("MTDDetLayers") << "No MTD geometry is available.";
42  }
43 }

References ETLDetLayerGeometryBuilder::buildLayers(), BTLDetLayerGeometryBuilder::buildLayers(), and MTDTopology::getMTDTopologyMode().

Referenced by GeometricSearchTrackerBuilder::build().

◆ idToLayer()

const DetLayer * MTDDetLayerGeometry::idToLayer ( const DetId detId) const
overridevirtual

return the DetLayer which correspond to a certain DetId

Reimplemented from DetLayerGeometry.

Definition at line 97 of file MTDDetLayerGeometry.cc.

97  {
98  DetId idout;
99  MTDDetId detId(id);
100 
101  if (detId.mtdSubDetector() == 2) { // 2 is ETL
102  ETLDetId etlId(detId.rawId());
103  idout = ETLDetId(etlId.mtdSide(), 0, 0, 0);
104  } else if (detId.mtdSubDetector() == 1) { // 1 is BTL
105  BTLDetId btlId(detId.rawId());
106  idout = BTLDetId(btlId.mtdSide(), 0, 0, 0, 0);
107  } else
108  throw cms::Exception("InvalidSubdetId") << detId.subdetId();
109 
110  std::map<DetId, const DetLayer*>::const_iterator layer = detLayersMap.find(idout);
111  if (layer == detLayersMap.end())
112  return nullptr;
113  return layer->second;
114 }

References Exception, phase1PixelTopology::layer, MTDDetId::mtdSubDetector(), DetId::rawId(), and DetId::subdetId().

Referenced by GlobalDetLayerGeometry::idToLayer(), and GeometricSearchTracker::idToLayer().

◆ makeDetLayerId()

DetId MTDDetLayerGeometry::makeDetLayerId ( const DetLayer detLayer) const
private

Definition at line 70 of file MTDDetLayerGeometry.cc.

70  {
71  if (detLayer->subDetector() == GeomDetEnumerators::TimingEndcap) {
72  ETLDetId id(detLayer->basicComponents().front()->geographicalId().rawId());
73  return ETLDetId(id.mtdSide(), 0, 0, 0);
74  } else if (detLayer->subDetector() == GeomDetEnumerators::TimingBarrel) {
75  BTLDetId id(detLayer->basicComponents().front()->geographicalId().rawId());
76  return BTLDetId(id.mtdSide(), 0, 0, 0, 0);
77  } else
78  throw cms::Exception("InvalidModuleIdentification"); // << detLayer->module();
79 }

References GeometricSearchDet::basicComponents(), Exception, triggerObjects_cff::id, DetLayer::subDetector(), GeomDetEnumerators::TimingBarrel, and GeomDetEnumerators::TimingEndcap.

◆ sortLayers()

void MTDDetLayerGeometry::sortLayers ( )

Definition at line 130 of file MTDDetLayerGeometry.cc.

130  {
131  // The following are filled inside-out, no need to re-sort
132  // precomputed_value_sort(dtLayers.begin(), dtLayers.end(),ExtractR<DetLayer,float>());
133  // precomputed_value_sort(cscLayers_fw.begin(), cscLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
134  // precomputed_value_sort(cscLayers_bk.begin(), cscLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
135  // precomputed_value_sort(rpcLayers_fw.begin(), rpcLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
136  // precomputed_value_sort(rpcLayers_bk.begin(), rpcLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
137  // precomputed_value_sort(rpcLayers_barrel.begin(), rpcLayers_barrel.end(), ExtractR<DetLayer,float>());
138 
139  // Sort these inside-out
143 
144  // Build more complicated vectors with correct sorting
145 
146  //etlLayers_all: from -Z to +Z
147  etlLayers_all.reserve(etlLayers_bk.size() + etlLayers_fw.size());
148  std::copy(etlLayers_bk.begin(), etlLayers_bk.end(), back_inserter(etlLayers_all));
149  std::reverse(etlLayers_all.begin(), etlLayers_all.end());
150  std::copy(etlLayers_fw.begin(), etlLayers_fw.end(), back_inserter(etlLayers_all));
151 
152  // allEndcap: order is all bw, all fw
153  allEndcap.reserve(allBackward.size() + allForward.size());
154  std::copy(allBackward.begin(), allBackward.end(), back_inserter(allEndcap));
155  std::reverse(allEndcap.begin(), allEndcap.end());
156  std::copy(allForward.begin(), allForward.end(), back_inserter(allEndcap));
157 
158  // allDetLayers: order is all bw, all barrel, all fw
159  allDetLayers.reserve(allBackward.size() + allBarrel.size() + allForward.size());
160  std::copy(allBackward.begin(), allBackward.end(), back_inserter(allDetLayers));
161  std::reverse(allDetLayers.begin(), allDetLayers.end());
162  std::copy(allBarrel.begin(), allBarrel.end(), back_inserter(allDetLayers));
163  std::copy(allForward.begin(), allForward.end(), back_inserter(allDetLayers));
164 
165  // number layers
166  int sq = 0;
167  for (auto l : allDetLayers)
168  (*const_cast<DetLayer*>(l)).setSeqNum(sq++);
169 }

References filterCSVwithJSON::copy, cmsLHEtoEOSManager::l, precomputed_value_sort(), and groupFilesInBlocks::reverse.

Referenced by GeometricSearchTrackerBuilder::build().

Friends And Related Function Documentation

◆ MTDDetLayerGeometryESProducer

friend class MTDDetLayerGeometryESProducer
friend

Definition at line 27 of file MTDDetLayerGeometry.h.

Member Data Documentation

◆ allBackward

std::vector<const DetLayer*> MTDDetLayerGeometry::allBackward
private

Definition at line 79 of file MTDDetLayerGeometry.h.

◆ allBarrel

std::vector<const DetLayer*> MTDDetLayerGeometry::allBarrel
private

Definition at line 81 of file MTDDetLayerGeometry.h.

◆ allDetLayers

std::vector<const DetLayer*> MTDDetLayerGeometry::allDetLayers
private

Definition at line 82 of file MTDDetLayerGeometry.h.

◆ allEndcap

std::vector<const DetLayer*> MTDDetLayerGeometry::allEndcap
private

Definition at line 80 of file MTDDetLayerGeometry.h.

◆ allForward

std::vector<const DetLayer*> MTDDetLayerGeometry::allForward
private

Definition at line 78 of file MTDDetLayerGeometry.h.

◆ btlLayers

std::vector<const DetLayer*> MTDDetLayerGeometry::btlLayers
private

Definition at line 77 of file MTDDetLayerGeometry.h.

◆ detLayersMap

std::map<DetId, const DetLayer*> MTDDetLayerGeometry::detLayersMap
private

Definition at line 84 of file MTDDetLayerGeometry.h.

◆ etlLayers_all

std::vector<const DetLayer*> MTDDetLayerGeometry::etlLayers_all
private

Definition at line 74 of file MTDDetLayerGeometry.h.

◆ etlLayers_bk

std::vector<const DetLayer*> MTDDetLayerGeometry::etlLayers_bk
private

Definition at line 73 of file MTDDetLayerGeometry.h.

◆ etlLayers_fw

std::vector<const DetLayer*> MTDDetLayerGeometry::etlLayers_fw
private

Definition at line 72 of file MTDDetLayerGeometry.h.

ExtractBarrelDetLayerR
Definition: MTDDetLayerGeometry.cc:119
MTDDetLayerGeometry::allDetLayers
std::vector< const DetLayer * > allDetLayers
Definition: MTDDetLayerGeometry.h:82
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
MTDDetLayerGeometry::addETLLayers
void addETLLayers(const std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > &etllayers)
Definition: MTDDetLayerGeometry.cc:45
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
BTLDetLayerGeometryBuilder::buildLayers
static std::vector< DetLayer * > buildLayers(const MTDGeometry &geo)
Operations.
Definition: BTLDetLayerGeometryBuilder.cc:23
ETLDetId
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
ETLDetLayerGeometryBuilder::buildLayers
static std::pair< std::vector< DetLayer * >, std::vector< DetLayer * > > buildLayers(const MTDGeometry &geo, const int mtdTopologyMode)
Definition: ETLDetLayerGeometryBuilder.cc:21
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MTDDetLayerGeometry::makeDetLayerId
DetId makeDetLayerId(const DetLayer *detLayer) const
Definition: MTDDetLayerGeometry.cc:70
MTDDetLayerGeometry::addBTLLayers
void addBTLLayers(const std::vector< DetLayer * > &btllayers)
Definition: MTDDetLayerGeometry.cc:61
MTDTopology::getMTDTopologyMode
int getMTDTopologyMode() const
Definition: MTDTopology.h:15
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
DetId
Definition: DetId.h:17
BTLDetId
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
Definition: BTLDetId.h:18
MTDDetLayerGeometry::allBarrel
std::vector< const DetLayer * > allBarrel
Definition: MTDDetLayerGeometry.h:81
GeomDetEnumerators::TimingBarrel
Definition: GeomDetEnumerators.h:29
MTDDetLayerGeometry::allEndcap
std::vector< const DetLayer * > allEndcap
Definition: MTDDetLayerGeometry.h:80
MTDDetLayerGeometry::etlLayers_all
std::vector< const DetLayer * > etlLayers_all
Definition: MTDDetLayerGeometry.h:74
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
MTDDetLayerGeometry::allForward
std::vector< const DetLayer * > allForward
Definition: MTDDetLayerGeometry.h:78
MTDDetLayerGeometry::etlLayers_fw
std::vector< const DetLayer * > etlLayers_fw
Definition: MTDDetLayerGeometry.h:72
MTDDetLayerGeometry::btlLayers
std::vector< const DetLayer * > btlLayers
Definition: MTDDetLayerGeometry.h:77
GeomDetEnumerators::TimingEndcap
Definition: GeomDetEnumerators.h:30
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
geomsort::ExtractAbsZ
Definition: GeometricSorting.h:83
MTDDetLayerGeometry::allBackward
std::vector< const DetLayer * > allBackward
Definition: MTDDetLayerGeometry.h:79
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
Exception
Definition: hltDiff.cc:245
GeometricSearchDet::basicComponents
virtual const std::vector< const GeomDet * > & basicComponents() const =0
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
MTDDetLayerGeometry::etlLayers_bk
std::vector< const DetLayer * > etlLayers_bk
Definition: MTDDetLayerGeometry.h:73
MTDDetLayerGeometry::detLayersMap
std::map< DetId, const DetLayer * > detLayersMap
Definition: MTDDetLayerGeometry.h:84