CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Private Member Functions
MuonGEMDetLayerGeometryBuilder Class Reference

#include <MuonGEMDetLayerGeometryBuilder.h>

Public Member Functions

 MuonGEMDetLayerGeometryBuilder ()
 Constructor (disabled, only static access is allowed) More...
 
virtual ~MuonGEMDetLayerGeometryBuilder ()
 Destructor. More...
 

Static Public Member Functions

static std::pair< std::vector
< DetLayer * >, std::vector
< DetLayer * > > 
buildEndcapLayers (const GEMGeometry &geo)
 

Static Private Member Functions

static MuRingForwardDoubleLayerbuildLayer (int endcap, std::vector< int > &rings, int station, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const GEMGeometry &geo)
 
static bool isFront (const GEMDetId &gemId)
 
static MuDetRingmakeDetRing (std::vector< const GeomDet * > &geomDets)
 

Detailed Description

Build the GEM DetLayers.

Author
R. Radogna

Definition at line 20 of file MuonGEMDetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

MuonGEMDetLayerGeometryBuilder::MuonGEMDetLayerGeometryBuilder ( )
inline

Constructor (disabled, only static access is allowed)

Definition at line 23 of file MuonGEMDetLayerGeometryBuilder.h.

23 {}
virtual MuonGEMDetLayerGeometryBuilder::~MuonGEMDetLayerGeometryBuilder ( )
virtual

Destructor.

Member Function Documentation

pair< vector< DetLayer * >, vector< DetLayer * > > MuonGEMDetLayerGeometryBuilder::buildEndcapLayers ( const GEMGeometry geo)
static

Builds the forward (+Z, return.first) and backward (-Z, return.second) layers. Both vectors are sorted inside-out

Definition at line 26 of file MuonGEMDetLayerGeometryBuilder.cc.

References chambers, Reference_intrackfit_cff::endcap, GEMDetId::maxChamberId, GEMDetId::maxLayerId, GEMDetId::maxRingId, GEMDetId::maxRollId, GEMDetId::maxStationId, GEMDetId::minChamberId, GEMDetId::minLayerId, GEMDetId::minRingId, GEMDetId::minRollId, GEMDetId::minStationId, mps_fire::result, relativeConstraints::ring, and relativeConstraints::station.

Referenced by MuonDetLayerGeometryESProducer::produce().

26  {
27 
28  vector<DetLayer*> result[2];
29 
30  for (int endcap = -1; endcap<=1; endcap+=2) {
31  int iendcap = (endcap==1) ? 0 : 1; // +1: forward, -1: backward
32 
34  for(int layer = GEMDetId::minLayerId; layer <= GEMDetId::maxLayerId; ++layer) {
35  vector<int> rolls;
36  std::vector<int> rings;
37  std::vector<int> chambers;
39  rings.push_back(ring);
40  }
41  for(int roll = GEMDetId::minRollId+1; roll <= GEMDetId::maxRollId; ++roll) {
42  rolls.push_back(roll);
43  }
44  for(int chamber = GEMDetId::minChamberId; chamber <= GEMDetId::maxChamberId; chamber++ ){
45  chambers.push_back(chamber);
46  }
47 
48  MuRingForwardDoubleLayer* ringLayer = buildLayer(endcap, rings, station, layer, chambers, rolls, geo);
49 
50  if (ringLayer) result[iendcap].push_back(ringLayer);
51 
52  }
53 
54  }
55 
56 
57  }
58  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
59 
60  return res_pair;
61 
62 }
static const int minRingId
Definition: GEMDetId.h:93
static const int minChamberId
Definition: GEMDetId.h:99
static const int maxRollId
Definition: GEMDetId.h:106
static const int maxChamberId
Definition: GEMDetId.h:100
static const int maxLayerId
Definition: GEMDetId.h:103
tuple result
Definition: mps_fire.py:84
static const int minRollId
Definition: GEMDetId.h:105
static const int maxStationId
Definition: GEMDetId.h:97
static const int minStationId
Definition: GEMDetId.h:96
static const int maxRingId
Definition: GEMDetId.h:94
static const int minLayerId
Definition: GEMDetId.h:102
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
static MuRingForwardDoubleLayer * buildLayer(int endcap, std::vector< int > &rings, int station, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const GEMGeometry &geo)
MuRingForwardDoubleLayer * MuonGEMDetLayerGeometryBuilder::buildLayer ( int  endcap,
std::vector< int > &  rings,
int  station,
int  layer,
std::vector< int > &  chambers,
std::vector< int > &  rolls,
const GEMGeometry geo 
)
staticprivate

Definition at line 67 of file MuonGEMDetLayerGeometryBuilder.cc.

References GEMGeometry::idToDet(), LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), precomputed_value_sort(), mps_fire::result, relativeConstraints::ring, AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

71  {
72 
73  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
75  vector<const ForwardDetRing*> frontRings, backRings;
76 
77 
78  for (std::vector<int>::iterator ring=rings.begin(); ring!=rings.end()-2;ring++){
79 
80  for (vector<int>::iterator roll = rolls.begin(); roll!=rolls.end(); roll++) {
81 
82  vector<const GeomDet*> frontDets, backDets;
83 
84  for(std::vector<int>::iterator chamber=chambers.begin()+1; chamber<chambers.end(); chamber++) {
85  GEMDetId gemId(endcap,(*ring), station,layer,(*chamber), (*roll));
86 
87  const GeomDet* geomDet = geo.idToDet(gemId);
88 
89  if (geomDet !=0) {
90  bool isInFront = isFront(gemId);
91  if(isInFront)
92  {
93  frontDets.push_back(geomDet);
94  }
95  else
96  {
97  backDets.push_back(geomDet);
98  }
99  LogTrace(metname) << "get GEM Endcap roll "
100  << gemId
101  << (isInFront ? "front" : "back ")
102  << " at R=" << geomDet->position().perp()
103  << ", phi=" << geomDet->position().phi()
104  << ", Z=" << geomDet->position().z();
105  }
106  }
107 
108  if (frontDets.size()!=0) {
109  precomputed_value_sort(frontDets.begin(), frontDets.end(), geomsort::DetPhi());
110  frontRings.push_back(new MuDetRing(frontDets));
111  LogTrace(metname) << "New front ring with " << frontDets.size()
112  << " chambers at z="<< frontRings.back()->position().z();
113  }
114  if (backDets.size()!=0) {
115  precomputed_value_sort(backDets.begin(), backDets.end(), geomsort::DetPhi());
116  backRings.push_back(new MuDetRing(backDets));
117  LogTrace(metname) << "New back ring with " << backDets.size()
118  << " chambers at z="<< backRings.back()->position().z();
119  }
120 
121  }
122 
123  }
124 
125  // How should they be sorted?
126  // precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractZ<GeometricSearchDet,float>());
127  if(backRings.size()!=0 && frontRings.size()!=0) result = new MuRingForwardDoubleLayer(frontRings, backRings);
128  else result = 0;
129  if(result != 0){
130  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size()
131  << " and " << backRings.size()
132  << " rings, at Z " << result->position().z()
133  << " R1: " << result->specificSurface().innerRadius()
134  << " R2: " << result->specificSurface().outerRadius();
135  }
136  return result;
137 
138 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:39
T perp() const
Definition: PV3DBase.h:72
const std::string metname
virtual const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
tuple result
Definition: mps_fire.py:84
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
T z() const
Definition: PV3DBase.h:64
static bool isFront(const GEMDetId &gemId)
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
bool MuonGEMDetLayerGeometryBuilder::isFront ( const GEMDetId gemId)
staticprivate

Definition at line 141 of file MuonGEMDetLayerGeometryBuilder.cc.

References GEMDetId::chamber(), and mps_fire::result.

142 {
143 
144  bool result = false;
145  int chamber = gemId.chamber();
146 
147  if(chamber%2 == 0) result = !result;
148 
149  return result;
150 }
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
tuple result
Definition: mps_fire.py:84
MuDetRing * MuonGEMDetLayerGeometryBuilder::makeDetRing ( std::vector< const GeomDet * > &  geomDets)
staticprivate

Definition at line 152 of file MuonGEMDetLayerGeometryBuilder.cc.

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

153 {
154  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonGEMDetLayerGeometryBuilder";
155 
156 
157  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
158  MuDetRing * result = new MuDetRing(geomDets);
159  LogTrace(metname) << "New MuDetRing with " << geomDets.size()
160  << " chambers at z="<< result->position().z()
161  << " R1: " << result->specificSurface().innerRadius()
162  << " R2: " << result->specificSurface().outerRadius();
163  return result;
164 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:39
const std::string metname
tuple result
Definition: mps_fire.py:84
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)