test
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
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, 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.

25 {}
MuonME0DetLayerGeometryBuilder::~MuonME0DetLayerGeometryBuilder ( )
virtual

Destructor.

Definition at line 21 of file MuonME0DetLayerGeometryBuilder.cc.

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 chambers, Reference_intrackfit_cff::endcap, LogTrace, ME0DetId::maxChamberId, ME0DetId::maxRollId, metname, ME0DetId::minChamberId, ME0DetId::minRollId, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by 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 
35  vector<int> rolls;
36  std::vector<int> rings;
37  std::vector<int> chambers;
38  for(int roll = ME0DetId::minRollId+1; roll <= ME0DetId::maxRollId; ++roll) {
39  rolls.push_back(roll);
40  }
41  for(int chamber = ME0DetId::minChamberId+1; chamber <= ME0DetId::maxChamberId; chamber++ ){
42  chambers.push_back(chamber);
43  }
44 
45  LogTrace(metname) << "Encap = " << endcap
46  << "Chambers = " << chambers.size()
47  << "Rolls = " << rolls.size();
48  MuRingForwardLayer* ringLayer = buildLayer(endcap, chambers, rolls, geo);
49 
50  if (ringLayer) result[iendcap].push_back(ringLayer);
51  }
52  pair<vector<DetLayer*>, vector<DetLayer*> > res_pair(result[0], result[1]);
53 
54  return res_pair;
55 
56 }
static const int minChamberId
Definition: ME0DetId.h:89
static MuRingForwardLayer * buildLayer(int endcap, std::vector< int > &chambers, std::vector< int > &rolls, const ME0Geometry &geo)
static const int maxChamberId
Definition: ME0DetId.h:90
static const int maxRollId
Definition: ME0DetId.h:96
const std::string metname
tuple result
Definition: mps_fire.py:84
#define LogTrace(id)
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
static const int minRollId
Definition: ME0DetId.h:95
MuRingForwardLayer * MuonME0DetLayerGeometryBuilder::buildLayer ( int  endcap,
std::vector< int > &  chambers,
std::vector< int > &  rolls,
const ME0Geometry geo 
)
staticprivate

Definition at line 59 of file MuonME0DetLayerGeometryBuilder.cc.

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

62  {
63 
64  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
66  vector<const ForwardDetRing*> frontRings, backRings;
67 
68  LogTrace(metname) << "Starting to Build Layer ";
69 
70  for (vector<int>::iterator roll = rolls.begin(); roll!=rolls.end(); roll++) {
71  LogTrace(metname) << "On a roll ";
72 
73  vector<const GeomDet*> frontDets, backDets;
74 
75  for(std::vector<int>::iterator chamber=chambers.begin(); chamber<chambers.end(); chamber++) {
76  ME0DetId me0Id(endcap,1,(*chamber), 0);
77  const GeomDet* geomDet = geo.idToDet(me0Id);
78 
79  if (geomDet !=0) {
80  bool isInFront = isFront(me0Id);
81  if(isInFront)
82  {
83  frontDets.push_back(geomDet);
84  }
85  else
86  {
87  backDets.push_back(geomDet);
88  }
89  }
90  }
91 
92  if (frontDets.size()!=0) {
93  precomputed_value_sort(frontDets.begin(), frontDets.end(), geomsort::DetPhi());
94  frontRings.push_back(new MuDetRing(frontDets));
95  LogTrace(metname) << "New front ring with " << frontDets.size()
96  << " chambers at z="<< frontRings.back()->position().z();
97  }
98  if (backDets.size()!=0) {
99  precomputed_value_sort(backDets.begin(), backDets.end(), geomsort::DetPhi());
100  backRings.push_back(new MuDetRing(backDets));
101  LogTrace(metname) << "New back ring with " << backDets.size()
102  << " chambers at z="<< backRings.back()->position().z();
103  }
104 
105  }
106  LogTrace(metname) << "About to make a MuRingForwardLayer";
107  result = new MuRingForwardLayer(frontRings);
108 
109  LogTrace(metname) << "New MuRingForwardLayer with " << frontRings.size()
110  << " and " << backRings.size()
111  << " rings, at Z " << result->position().z()
112  << " R1: " << result->specificSurface().innerRadius()
113  << " R2: " << result->specificSurface().outerRadius();
114 
115  return result;
116 
117 }
ExtractPhi< GeomDet, float > DetPhi
Definition: DetSorting.h:39
const std::string metname
virtual const GeomDet * idToDet(DetId) const
Definition: ME0Geometry.cc:44
tuple result
Definition: mps_fire.py:84
#define LogTrace(id)
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 120 of file MuonME0DetLayerGeometryBuilder.cc.

References mps_fire::result.

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

Definition at line 129 of file MuonME0DetLayerGeometryBuilder.cc.

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

130 {
131  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonME0DetLayerGeometryBuilder";
132 
133 
134  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetPhi());
135  MuDetRing * result = new MuDetRing(geomDets);
136  LogTrace(metname) << "New MuDetRing with " << geomDets.size()
137  << " chambers at z="<< result->position().z()
138  << " R1: " << result->specificSurface().innerRadius()
139  << " R2: " << result->specificSurface().outerRadius();
140  return result;
141 }
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)