CMS 3D CMS Logo

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

#include <MuonME0DetLayerGeometryBuilder.h>

Public Member Functions

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

Static Public Member Functions

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

Static Private Member Functions

static MuRingForwardLayerbuildLayer (int endcap, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const ME0Geometry &geo)
 
static bool isFront (const ME0DetId &me0Id)
 
static MuDetRingmakeDetRing (std::vector< const GeomDet * > &geomDets)
 

Detailed Description

Build the ME0 DetLayers.

Author
D. Nash

Definition at line 22 of file MuonME0DetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

MuonME0DetLayerGeometryBuilder::MuonME0DetLayerGeometryBuilder ( )
inline

Constructor (disabled, only static access is allowed)

Definition at line 25 of file MuonME0DetLayerGeometryBuilder.h.

References buildEndcapLayers(), buildLayer(), chambers, makeMuonMisalignmentScenario::endcap, isFront(), makeDetRing(), and ~MuonME0DetLayerGeometryBuilder().

25 {}
MuonME0DetLayerGeometryBuilder::~MuonME0DetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 21 of file MuonME0DetLayerGeometryBuilder.cc.

Referenced by MuonME0DetLayerGeometryBuilder().

21  {
22 }

Member Function Documentation

pair< vector< DetLayer * >, vector< DetLayer * > > MuonME0DetLayerGeometryBuilder::buildEndcapLayers ( const ME0Geometry geo)
static

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

Definition at line 27 of file MuonME0DetLayerGeometryBuilder.cc.

References relativeConstraints::chamber, chambers, makeMuonMisalignmentScenario::endcap, LogTrace, ME0DetId::maxChamberId, metname, ME0DetId::minChamberId, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MuonME0DetLayerGeometryBuilder(), and MuonDetLayerGeometryESProducer::produce().

27  {
28 
29  vector<DetLayer*> result[2];
30  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
31  LogTrace(metname) << "Starting endcaplayers ";
32  for (int endcap = -1; endcap<=1; endcap+=2) {
33  int iendcap = (endcap==1) ? 0 : 1; // +1: forward, -1: backward
34  int layer = 0;// only need to make layer 0 for segments
35  vector<int> rolls, chambers;
36  rolls.push_back(0);
38  chambers.push_back(chamber);
39 
40  LogTrace(metname) << "Encap = " << endcap
41  << "Chambers = " << chambers.size()
42  << "Rolls = " << rolls.size();
43  MuRingForwardLayer* ringLayer = buildLayer(endcap, layer, chambers, rolls, geo);
44 
45  if (ringLayer) result[iendcap].push_back(ringLayer);
46  }
47  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
48 
49  return res_pair;
50 
51 }
static const int minChamberId
Definition: ME0DetId.h:89
static const int maxChamberId
Definition: ME0DetId.h:90
const std::string metname
#define LogTrace(id)
static MuRingForwardLayer * buildLayer(int endcap, int layer, std::vector< int > &chambers, std::vector< int > &rolls, const ME0Geometry &geo)
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
MuRingForwardLayer * MuonME0DetLayerGeometryBuilder::buildLayer ( int  endcap,
int  layer,
std::vector< int > &  chambers,
std::vector< int > &  rolls,
const ME0Geometry geo 
)
staticprivate

Definition at line 54 of file MuonME0DetLayerGeometryBuilder.cc.

References relativeConstraints::chamber, ME0Geometry::idToDet(), LogTrace, metname, precomputed_value_sort(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MuonME0DetLayerGeometryBuilder().

58  {
59 
60  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
61  MuRingForwardLayer * result = nullptr;
62  vector<const ForwardDetRing*> frontRings, backRings;
63 
64  LogTrace(metname) << "Starting to Build Layer ";
65 
66  for (vector<int>::iterator roll = rolls.begin(); roll!=rolls.end(); roll++) {
67  LogTrace(metname) << "On a roll ";
68 
69  vector<const GeomDet*> frontDets, backDets;
70 
71  for(std::vector<int>::iterator chamber=chambers.begin(); chamber<chambers.end(); chamber++) {
72  ME0DetId me0Id(endcap,layer,(*chamber), (*roll));
73  const GeomDet* geomDet = geo.idToDet(me0Id);
74 
75  if (geomDet !=nullptr) {
76  bool isInFront = isFront(me0Id);
77  if(isInFront)
78  {
79  frontDets.push_back(geomDet);
80  }
81  else
82  {
83  backDets.push_back(geomDet);
84  }
85  }
86  }
87 
88  if (!frontDets.empty()) {
89  precomputed_value_sort(frontDets.begin(), frontDets.end(), geomsort::DetPhi());
90  frontRings.push_back(new MuDetRing(frontDets));
91  LogTrace(metname) << "New front ring with " << frontDets.size()
92  << " chambers at z="<< frontRings.back()->position().z();
93  }
94  if (!backDets.empty()) {
95  precomputed_value_sort(backDets.begin(), backDets.end(), geomsort::DetPhi());
96  backRings.push_back(new MuDetRing(backDets));
97  LogTrace(metname) << "New back ring with " << backDets.size()
98  << " chambers at z="<< backRings.back()->position().z();
99  }
100 
101  }
102 
103  LogTrace(metname) << "About to make a MuRingForwardLayer";
104  if(!frontRings.empty()) result = new MuRingForwardLayer(frontRings);
105  else result = nullptr;
106  if(result != nullptr){
107  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size()
108  << " and " << backRings.size()
109  << " rings, at Z " << result->position().z()
110  << " R1: " << result->specificSurface().innerRadius()
111  << " R2: " << result->specificSurface().outerRadius();
112  }
113  return result;
114 
115 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:39
const std::string metname
#define LogTrace(id)
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:42
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
static bool isFront(const ME0DetId &me0Id)
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
bool MuonME0DetLayerGeometryBuilder::isFront ( const ME0DetId me0Id)
staticprivate

Definition at line 118 of file MuonME0DetLayerGeometryBuilder.cc.

References mps_fire::result.

Referenced by MuonME0DetLayerGeometryBuilder().

119 {
120 
121  //ME0s do not currently have an arrangement of which are front and which are back, going to always return true
122 
123  bool result = true;
124  return result;
125 }
MuDetRing * MuonME0DetLayerGeometryBuilder::makeDetRing ( std::vector< const GeomDet * > &  geomDets)
staticprivate

Definition at line 127 of file MuonME0DetLayerGeometryBuilder.cc.

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

Referenced by MuonME0DetLayerGeometryBuilder().

128 {
129  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
130 
131 
132  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
133  MuDetRing * result = new MuDetRing(geomDets);
134  LogTrace(metname) << "New MuDetRing with " << geomDets.size()
135  << " chambers at z="<< result->position().z()
136  << " R1: " << result->specificSurface().innerRadius()
137  << " R2: " << result->specificSurface().outerRadius();
138  return result;
139 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:39
const std::string metname
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)