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...
 
const DetLayeridToLayer (const DetId &detId) const override
 return the DetLayer which correspond to a certain DetId More...
 
 MTDDetLayerGeometry ()
 Constructor. More...
 
 ~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
 
void sortLayers ()
 

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 19 of file MTDDetLayerGeometry.h.

Constructor & Destructor Documentation

MTDDetLayerGeometry::MTDDetLayerGeometry ( )

Constructor.

Definition at line 22 of file MTDDetLayerGeometry.cc.

22 {}
MTDDetLayerGeometry::~MTDDetLayerGeometry ( )
override

Destructor.

Definition at line 24 of file MTDDetLayerGeometry.cc.

24  {
25 }

Member Function Documentation

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

Definition at line 44 of file MTDDetLayerGeometry.cc.

44  {
45 
46  for(auto const it : dtlayers) {
47  btlLayers.push_back(it);
48  allBarrel.push_back(it);
49 
50  detLayersMap[ makeDetLayerId(it) ] = it;
51  }
52 }
DetId makeDetLayerId(const DetLayer *detLayer) const
std::vector< const DetLayer * > allBarrel
std::vector< const DetLayer * > btlLayers
std::map< DetId, const DetLayer * > detLayersMap
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 27 of file MTDDetLayerGeometry.cc.

27  {
28 
29  for(auto const it : etllayers.first) {
30  etlLayers_fw.push_back(it);
31  allForward.push_back(it);
32 
33  detLayersMap[ makeDetLayerId(it) ] = it;
34  }
35 
36  for(auto const it: etllayers.second) {
37  etlLayers_bk.push_back(it);
38  allBackward.push_back(it);
39 
40  detLayersMap[ makeDetLayerId(it) ] = it;
41  }
42 }
std::vector< const DetLayer * > etlLayers_fw
DetId makeDetLayerId(const DetLayer *detLayer) const
std::vector< const DetLayer * > etlLayers_bk
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > allForward
std::map< DetId, const DetLayer * > detLayersMap
const vector< const DetLayer * > & MTDDetLayerGeometry::allBackwardLayers ( ) const

return all endcap layers

Definition at line 83 of file MTDDetLayerGeometry.cc.

Referenced by DirectMTDNavigation::inOutBackward(), MTDNavigationPrinter::MTDNavigationPrinter(), and DirectMTDNavigation::outInBackward().

83  {
84  return allBackward;
85 }
std::vector< const DetLayer * > allBackward
const vector< const DetLayer * > & MTDDetLayerGeometry::allBarrelLayers ( ) const

return all barrel layers

Definition at line 68 of file MTDDetLayerGeometry.cc.

Referenced by DirectMTDNavigation::inOutBarrel(), MTDNavigationPrinter::MTDNavigationPrinter(), MTDNavigationSchool::MTDNavigationSchool(), and DirectMTDNavigation::outInBarrel().

68  {
69  return allBarrel;
70 }
std::vector< const DetLayer * > allBarrel
const vector< const DetLayer * > & MTDDetLayerGeometry::allBTLLayers ( ) const

return the BTL DetLayers (barrel), inside-out

Definition at line 88 of file MTDDetLayerGeometry.cc.

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

88  {
89  return btlLayers;
90 }
std::vector< const DetLayer * > btlLayers
const vector< const DetLayer * > & MTDDetLayerGeometry::allEndcapLayers ( ) const

return all endcap layers

Definition at line 73 of file MTDDetLayerGeometry.cc.

Referenced by MTDNavigationSchool::MTDNavigationSchool().

73  {
74  return allEndcap;
75 }
std::vector< const DetLayer * > allEndcap
const vector< const DetLayer * > & MTDDetLayerGeometry::allETLLayers ( ) const

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

Definition at line 93 of file MTDDetLayerGeometry.cc.

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

93  {
94  return etlLayers_all;
95 }
std::vector< const DetLayer * > etlLayers_all
const vector< const DetLayer * > & MTDDetLayerGeometry::allForwardLayers ( ) const

return all endcap layers

Definition at line 78 of file MTDDetLayerGeometry.cc.

Referenced by DirectMTDNavigation::inOutForward(), MTDNavigationPrinter::MTDNavigationPrinter(), and DirectMTDNavigation::outInForward().

78  {
79  return allForward;
80 }
std::vector< const DetLayer * > allForward
const vector< const DetLayer * > & MTDDetLayerGeometry::allLayers ( ) const

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

Definition at line 98 of file MTDDetLayerGeometry.cc.

Referenced by MTDNavigationSchool::MTDNavigationSchool().

98  {
99  return allDetLayers;
100 }
std::vector< const DetLayer * > allDetLayers
const DetLayer * MTDDetLayerGeometry::idToLayer ( const DetId detId) const
overridevirtual

return the DetLayer which correspond to a certain DetId

Reimplemented from DetLayerGeometry.

Definition at line 105 of file MTDDetLayerGeometry.cc.

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

Referenced by GlobalDetLayerGeometry::idToLayer().

105  {
106 
107  DetId idout;
108  MTDDetId detId(id);
109 
110  if(detId.mtdSubDetector() == 2){ // 2 is ETL
111  ETLDetId etlId( detId.rawId() );
112  idout = ETLDetId(etlId.mtdSide(),0,0,0);
113  }
114  else if (detId.mtdSubDetector() == 1){ // 1 is BTL
115  BTLDetId btlId( detId.rawId() );
116  idout = BTLDetId(btlId.mtdSide(),0,0,0,0);
117  }
118  else throw cms::Exception("InvalidSubdetId")<< detId.subdetId();
119 
120  std::map<DetId,const DetLayer*>::const_iterator layer = detLayersMap.find(idout);
121  if (layer == detLayersMap.end()) return nullptr;
122  return layer->second;
123 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:18
std::map< DetId, const DetLayer * > detLayersMap
DetId MTDDetLayerGeometry::makeDetLayerId ( const DetLayer detLayer) const
private

Definition at line 54 of file MTDDetLayerGeometry.cc.

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

54  {
55 
57  ETLDetId id( detLayer->basicComponents().front()->geographicalId().rawId() ) ;
58  return ETLDetId(id.mtdSide(),0,0,0);
59  }
60  else if(detLayer->subDetector() == GeomDetEnumerators::TimingBarrel) {
61  BTLDetId id( detLayer->basicComponents().front()->geographicalId().rawId() ) ;
62  return BTLDetId(id.mtdSide(),0,0,0,0);
63  }
64  else throw cms::Exception("InvalidModuleIdentification"); // << detLayer->module();
65 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual const std::vector< const GeomDet * > & basicComponents() const =0
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:18
void MTDDetLayerGeometry::sortLayers ( )
private

Definition at line 138 of file MTDDetLayerGeometry.cc.

References popcon2dropbox::copy(), checklumidiff::l, precomputed_value_sort(), and groupFilesInBlocks::reverse.

138  {
139 
140  // The following are filled inside-out, no need to re-sort
141  // precomputed_value_sort(dtLayers.begin(), dtLayers.end(),ExtractR<DetLayer,float>());
142  // precomputed_value_sort(cscLayers_fw.begin(), cscLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
143  // precomputed_value_sort(cscLayers_bk.begin(), cscLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
144  // precomputed_value_sort(rpcLayers_fw.begin(), rpcLayers_fw.end(),ExtractAbsZ<DetLayer,float>());
145  // precomputed_value_sort(rpcLayers_bk.begin(), rpcLayers_bk.end(),ExtractAbsZ<DetLayer,float>());
146  // precomputed_value_sort(rpcLayers_barrel.begin(), rpcLayers_barrel.end(), ExtractR<DetLayer,float>());
147 
148  // Sort these inside-out
152 
153  // Build more complicated vectors with correct sorting
154 
155  //etlLayers_all: from -Z to +Z
156  etlLayers_all.reserve(etlLayers_bk.size()+etlLayers_fw.size());
157  std::copy(etlLayers_bk.begin(),etlLayers_bk.end(),back_inserter(etlLayers_all));
159  std::copy(etlLayers_fw.begin(),etlLayers_fw.end(),back_inserter(etlLayers_all));
160 
161  // allEndcap: order is all bw, all fw
162  allEndcap.reserve(allBackward.size()+allForward.size());
163  std::copy(allBackward.begin(),allBackward.end(),back_inserter(allEndcap));
164  std::reverse(allEndcap.begin(),allEndcap.end());
165  std::copy(allForward.begin(),allForward.end(),back_inserter(allEndcap));
166 
167  // allDetLayers: order is all bw, all barrel, all fw
168  allDetLayers.reserve(allBackward.size()+allBarrel.size()+allForward.size());
169  std::copy(allBackward.begin(),allBackward.end(),back_inserter(allDetLayers));
170  std::reverse(allDetLayers.begin(),allDetLayers.end());
171  std::copy(allBarrel.begin(),allBarrel.end(),back_inserter(allDetLayers));
172  std::copy(allForward.begin(),allForward.end(),back_inserter(allDetLayers));
173 
174  // number layers
175  int sq=0;
176  for (auto l : allDetLayers)
177  (*const_cast<DetLayer*>(l)).setSeqNum(sq++);
178 
179 
180 }
std::vector< const DetLayer * > etlLayers_fw
def copy(args, dbName)
std::vector< const DetLayer * > etlLayers_bk
std::vector< const DetLayer * > etlLayers_all
std::vector< const DetLayer * > allBackward
std::vector< const DetLayer * > allEndcap
std::vector< const DetLayer * > allBarrel
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
std::vector< const DetLayer * > allDetLayers
std::vector< const DetLayer * > allForward

Friends And Related Function Documentation

friend class MTDDetLayerGeometryESProducer
friend

Definition at line 25 of file MTDDetLayerGeometry.h.

Member Data Documentation

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

Definition at line 74 of file MTDDetLayerGeometry.h.

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

Definition at line 76 of file MTDDetLayerGeometry.h.

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

Definition at line 77 of file MTDDetLayerGeometry.h.

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

Definition at line 75 of file MTDDetLayerGeometry.h.

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

Definition at line 73 of file MTDDetLayerGeometry.h.

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

Definition at line 72 of file MTDDetLayerGeometry.h.

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

Definition at line 79 of file MTDDetLayerGeometry.h.

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

Definition at line 69 of file MTDDetLayerGeometry.h.

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

Definition at line 68 of file MTDDetLayerGeometry.h.

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

Definition at line 67 of file MTDDetLayerGeometry.h.