CMS 3D CMS Logo

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