15 using namespace geant_units::operators;
22 const std::vector<DetId>& detids(rgeo.
detIds());
23 std::unordered_map<uint32_t, GEMSuperChamber*> superChambers;
24 std::unordered_map<uint32_t, GEMChamber*>
chambers;
25 std::unordered_map<uint32_t, GEMEtaPartition*>
partitions;
27 for (
unsigned int id = 0;
id < detids.size(); ++
id) {
29 LogDebug(
"GEMGeometryBuilder") <<
"GEMGeometryBuilder adding " << gemid;
30 if (gemid.
roll() == 0) {
31 if (gemid.
layer() == 0) {
33 superChambers.emplace(gemid.
rawId(), gsc);
35 GEMChamber* gch = buildChamber(rgeo,
id, gemid);
36 chambers.emplace(gemid.
rawId(), gch);
40 partitions.emplace(gemid.
rawId(), gep);
47 if (superChambers.empty()) {
48 for (
unsigned int id = 0;
id < detids.size(); ++
id) {
50 if (gemid.
roll() == 1) {
53 if (gemid.
layer() == 1) {
63 for (
int re = -1; re <= 1; re = re + 2) {
72 for (
int ri = 1; ri <= 1; ++ri) {
75 for (
auto sch : superChambers) {
76 auto superChamber = sch.second;
77 const GEMDetId scId(superChamber->id());
78 if (scId.region() != re || scId.station() != st || scId.ring() != ri)
83 const GEMDetId chId(re, ri, st, ly, ch, 0);
84 auto chamberIt = chambers.find(chId.
rawId());
85 if (chamberIt == chambers.end())
87 auto chamber = chamberIt->second;
90 const GEMDetId rollId(re, ri, st, ly, ch, roll);
91 auto gepIt = partitions.find(rollId.
rawId());
92 if (gepIt == partitions.end())
94 auto gep = gepIt->second;
100 superChamber->add(chamber);
101 theGeometry.
add(chamber);
104 LogDebug(
"GEMGeometryBuilder") <<
"Adding super chamber " << scId <<
" to ring:";
105 ring->
add(superChamber);
106 theGeometry.
add(superChamber);
110 LogDebug(
"GEMGeometryBuilder") <<
"Adding ring " << ri <<
" to station "
111 <<
"re " << re <<
" st " << st;
113 theGeometry.
add(ring);
120 LogDebug(
"GEMGeometryBuilder") <<
"Adding station " << st <<
" to region " << re;
121 region->
add(station);
122 theGeometry.
add(station);
128 LogDebug(
"GEMGeometryBuilder") <<
"Adding region " << re <<
" to the geometry";
129 theGeometry.
add(region);
136 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildSuperChamber " << detId;
147 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildChamber " << detId;
158 std::vector<std::string>::const_iterator strStart = rgeo.
strStart(gid);
160 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"buildEtaPartition " << name <<
" " << detId;
162 std::vector<double>::const_iterator shapeStart = rgeo.
shapeStart(gid);
167 float nstrip = *(shapeStart + 4);
168 float npad = *(shapeStart + 5);
169 float dphi = (shapeStart + 6 < rgeo.
shapeEnd(gid)) ? *(shapeStart + 6) : 0.17715;
171 std::vector<float> pars;
172 pars.emplace_back(be);
173 pars.emplace_back(te);
174 pars.emplace_back(ap);
175 pars.emplace_back(nstrip);
176 pars.emplace_back(npad);
177 pars.emplace_back(dphi);
182 LogDebug(
"GEMGeometryBuilderFromCondDB") <<
"size " << be <<
" " << te <<
" " << ap <<
" " << ti;
190 std::vector<double>::const_iterator shapeStart = rgeo.
shapeStart(gid);
197 std::vector<double>::const_iterator tranStart = rgeo.
tranStart(gid);
201 std::vector<double>::const_iterator rotStart = rgeo.
rotStart(gid);
uint16_t *__restrict__ id
int nSuperChambers() const
Return numbers of chambers.
constexpr int roll() const
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
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
GEMEtaPartition * buildEtaPartition(const RecoIdealGeometry &rgeo, unsigned int gid, GEMDetId detId) const
static constexpr int32_t maxStationId
std::vector< double >::const_iterator tranStart(size_t ind) const
constexpr GEMDetId chamberId() 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()
constexpr int chamber() const
constexpr int layer() const
static constexpr int32_t maxLayerId
GEMGeometryBuilderFromCondDB()
std::vector< double >::const_iterator shapeEnd(size_t ind) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
int nRings() const
Return numbers of rings for this station.
constexpr NumType convertMmToCm(NumType millimeters)
void add(GEMStation *st)
Add station to the region which takes ownership.
constexpr GEMDetId superChamberId() const
static char chambers[264][20]
static constexpr int32_t maxRollId
void build(GEMGeometry &theGeometry, const RecoIdealGeometry &rgeo)
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.