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 21 of file MuonME0DetLayerGeometryBuilder.h.

Constructor & Destructor Documentation

◆ MuonME0DetLayerGeometryBuilder()

MuonME0DetLayerGeometryBuilder::MuonME0DetLayerGeometryBuilder ( )
inline

Constructor (disabled, only static access is allowed)

Definition at line 24 of file MuonME0DetLayerGeometryBuilder.h.

24 {}

◆ ~MuonME0DetLayerGeometryBuilder()

MuonME0DetLayerGeometryBuilder::~MuonME0DetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 21 of file MuonME0DetLayerGeometryBuilder.cc.

21 {}

Member Function Documentation

◆ buildEndcapLayers()

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 25 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 MuonDetLayerGeometryESProducer::produce().

25  {
26  vector<DetLayer*> result[2];
27  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
28  LogTrace(metname) << "Starting endcaplayers ";
29  for (int endcap = -1; endcap <= 1; endcap += 2) {
30  int iendcap = (endcap == 1) ? 0 : 1; // +1: forward, -1: backward
31  int layer = 0; // only need to make layer 0 for segments
32  vector<int> rolls, chambers;
33  rolls.push_back(0);
35  chambers.push_back(chamber);
36 
37  LogTrace(metname) << "Encap = " << endcap << "Chambers = " << chambers.size() << "Rolls = " << rolls.size();
38  MuRingForwardLayer* ringLayer = buildLayer(endcap, layer, chambers, rolls, geo);
39 
40  if (ringLayer)
41  result[iendcap].push_back(ringLayer);
42  }
43  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
44 
45  return res_pair;
46 }
static constexpr int maxChamberId
Definition: ME0DetId.h:67
const std::string metname
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr int minChamberId
Definition: ME0DetId.h:66
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

◆ buildLayer()

MuRingForwardLayer * MuonME0DetLayerGeometryBuilder::buildLayer ( int  endcap,
int  layer,
std::vector< int > &  chambers,
std::vector< int > &  rolls,
const ME0Geometry geo 
)
staticprivate

Definition at line 48 of file MuonME0DetLayerGeometryBuilder.cc.

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

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

◆ isFront()

bool MuonME0DetLayerGeometryBuilder::isFront ( const ME0DetId me0Id)
staticprivate

Definition at line 102 of file MuonME0DetLayerGeometryBuilder.cc.

References mps_fire::result.

102  {
103  //ME0s do not currently have an arrangement of which are front and which are back, going to always return true
104 
105  bool result = true;
106  return result;
107 }

◆ makeDetRing()

MuDetRing * MuonME0DetLayerGeometryBuilder::makeDetRing ( std::vector< const GeomDet *> &  geomDets)
staticprivate

Definition at line 109 of file MuonME0DetLayerGeometryBuilder.cc.

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

109  {
110  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
111 
112  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
113  MuDetRing* result = new MuDetRing(geomDets);
114  LogTrace(metname) << "New MuDetRing with " << geomDets.size() << " chambers at z=" << result->position().z()
115  << " R1: " << result->specificSurface().innerRadius()
116  << " R2: " << result->specificSurface().outerRadius();
117  return result;
118 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:37
const std::string metname
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)