12 #include "CLHEP/Units/GlobalSystemOfUnits.h" 21 const std::vector<DetId>& detids(rgeo.
detIds());
22 std::unordered_map<uint32_t, GEMSuperChamber*> superChambers;
23 std::unordered_map<uint32_t, GEMChamber*>
chambers;
24 std::unordered_map<uint32_t, GEMEtaPartition*>
partitions;
26 for (
unsigned int id = 0;
id < detids.size(); ++
id) {
28 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"GEMGeometryBuilderFromDDD adding " << gemid << std::endl;
29 if (gemid.
roll() == 0) {
30 if (gemid.
layer() == 0) {
32 superChambers.emplace(gemid.
rawId(), gsc);
35 chambers.emplace(gemid.
rawId(), gch);
39 partitions.emplace(gemid.
rawId(), gep);
46 if (superChambers.empty()) {
47 for (
unsigned int id = 0;
id < detids.size(); ++
id) {
49 if (gemid.
roll() == 1) {
52 if (gemid.
layer() == 1) {
62 for (
int re = -1; re <= 1; re = re + 2) {
71 for (
int ri = 1; ri <= 1; ++ri) {
74 for (
auto sch : superChambers) {
75 auto superChamber = sch.second;
76 const GEMDetId scId(superChamber->id());
77 if (scId.region() != re || scId.station() != st || scId.ring() != ri)
82 const GEMDetId chId(re, ri, st, ly, ch, 0);
83 auto chamberIt = chambers.find(chId.
rawId());
84 if (chamberIt == chambers.end())
86 auto chamber = chamberIt->second;
89 const GEMDetId rollId(re, ri, st, ly, ch, roll);
90 auto gepIt = partitions.find(rollId.
rawId());
91 if (gepIt == partitions.end())
93 auto gep = gepIt->second;
103 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding super chamber " << scId <<
" to ring: " << std::endl;
104 ring->
add(superChamber);
105 theGeometry.
add(superChamber);
109 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding ring " << ri <<
" to station " 110 <<
"re " << re <<
" st " << st << std::endl;
112 theGeometry.
add(ring);
119 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding station " << st <<
" to region " << re << std::endl;
120 region->
add(station);
121 theGeometry.
add(station);
127 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding region " << re <<
" to the geometry " << std::endl;
128 theGeometry.
add(region);
135 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildSuperChamber " << detId << std::endl;
146 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildChamber " << detId << std::endl;
157 std::vector<std::string>::const_iterator strStart = rgeo.
strStart(gid);
159 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildEtaPartition " << name <<
" " << detId << std::endl;
161 std::vector<double>::const_iterator shapeStart = rgeo.
shapeStart(gid);
162 float be = *(shapeStart + 0) / cm;
163 float te = *(shapeStart + 1) / cm;
164 float ap = *(shapeStart + 2) / cm;
165 float ti = *(shapeStart + 3) / cm;
166 float nstrip = *(shapeStart + 4);
167 float npad = *(shapeStart + 5);
169 std::vector<float> pars;
170 pars.emplace_back(be);
171 pars.emplace_back(te);
172 pars.emplace_back(ap);
173 pars.emplace_back(nstrip);
174 pars.emplace_back(npad);
179 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"size " << be <<
" " << te <<
" " << ap <<
" " << ti << std::endl;
187 std::vector<double>::const_iterator shapeStart = rgeo.
shapeStart(gid);
188 float be = *(shapeStart + 0) / cm;
189 float te = *(shapeStart + 1) / cm;
190 float ap = *(shapeStart + 2) / cm;
191 float ti = *(shapeStart + 3) / cm;
194 std::vector<double>::const_iterator tranStart = rgeo.
tranStart(gid);
197 std::vector<double>::const_iterator rotStart = rgeo.
rotStart(gid);
int nSuperChambers() const
Return numbers of chambers.
std::vector< double >::const_iterator rotStart(size_t ind) const
constexpr uint32_t rawId() const
get the raw id
GEMSuperChamber * buildSuperChamber(const RecoIdealGeometry &rgeo, unsigned int gid, GEMDetId detId) const
static int32_t maxStationId
GEMDetId superChamberId() const
ReferenceCountingPointer< BoundPlane > RCPBoundPlane
void add(GEMRing *ring)
Add ring to the station which takes ownership.
void add(GEMSuperChamber *ch)
Add super chamber to the ring which takes ownership.
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
std::vector< std::string >::const_iterator strStart(size_t ind) const
GEMDetId chamberId() const
GEMEtaPartition * buildEtaPartition(const RecoIdealGeometry &rgeo, unsigned int gid, GEMDetId detId) const
std::vector< double >::const_iterator tranStart(size_t ind) const
void setName(std::string name)
Set the station name.
GEMChamber * buildChamber(const RecoIdealGeometry &rgeo, unsigned int gid, GEMDetId detId) const
const std::vector< DetId > & detIds() const
RCPBoundPlane boundPlane(const RecoIdealGeometry &rgeo, unsigned int gid, GEMDetId detId) const
~GEMGeometryBuilderFromCondDB()
static int32_t maxLayerId
GEMGeometryBuilderFromCondDB()
std::vector< double >::const_iterator shapeStart(size_t ind) const
int nRings() const
Return numbers of rings for this station.
void add(GEMStation *st)
Add station to the region which takes ownership.
static char chambers[264][20]
void build(GEMGeometry &theGeometry, const RecoIdealGeometry &rgeo)
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.