CMS 3D CMS Logo

MuonDTDetLayerGeometryBuilder.cc
Go to the documentation of this file.
2 
7 
10 
12 
13 #include <iostream>
14 
15 using namespace std;
16 
18 
20 
22  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDTDetLayerGeometryBuilder";
23 
24  vector<DetLayer*> detlayers;
25  vector<MuRodBarrelLayer*> result;
26 
28  vector<const DetRod*> muDetRods;
30  vector<const GeomDet*> geomDets;
32  const GeomDet* geomDet = geo.idToDet(DTChamberId(wheel, station, sector));
33  if (geomDet) {
34  geomDets.push_back(geomDet);
35  LogTrace(metname) << "get DT chamber " << DTChamberId(wheel, station, sector)
36  << " at R=" << geomDet->position().perp() << ", phi=" << geomDet->position().phi();
37  }
38  }
39 
40  if (!geomDets.empty()) {
41  precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetZ());
42  muDetRods.push_back(new MuDetRod(geomDets));
43  LogTrace(metname) << " New MuDetRod with " << geomDets.size()
44  << " chambers at R=" << muDetRods.back()->position().perp()
45  << ", phi=" << muDetRods.back()->position().phi();
46  }
47  }
48  precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractPhi<GeometricSearchDet, float>());
49  result.push_back(new MuRodBarrelLayer(muDetRods));
50  LogDebug(metname) << " New MuRodBarrelLayer with " << muDetRods.size() << " rods, at R "
51  << result.back()->specificSurface().radius();
52  }
53 
54  for (vector<MuRodBarrelLayer*>::const_iterator it = result.begin(); it != result.end(); it++)
55  detlayers.push_back((DetLayer*)(*it));
56 
57  return detlayers;
58 }
static const int minSectorId
lowest sector id. 0 indicates all sectors (a station)
Definition: DTChamberId.h:56
T perp() const
Definition: PV3DBase.h:69
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
static const int minStationId
lowest station id
Definition: DTChamberId.h:52
#define LogTrace(id)
ExtractZ< GeomDet, float > DetZ
Definition: DetSorting.h:50
virtual ~MuonDTDetLayerGeometryBuilder()
Destructor.
static std::vector< DetLayer * > buildLayers(const DTGeometry &geo)
Operations.
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77
static const int maxStationId
highest station id
Definition: DTChamberId.h:54
static const int minWheelId
lowest wheel number
Definition: DTChamberId.h:60
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
static const int maxWheelId
highest wheel number
Definition: DTChamberId.h:62
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
static const int maxSectorId
highest sector id.
Definition: DTChamberId.h:58
#define LogDebug(id)