|
25 | 25 | #include "Fireworks/Core/interface/TEveElementIter.h" |
26 | 26 | #include "Fireworks/Core/interface/Context.h" |
27 | 27 | #include "Fireworks/Core/interface/FWColorManager.h" |
| 28 | +#include "Fireworks/Core/interface/fwLog.h" |
28 | 29 |
|
29 | 30 | #include "DataFormats/MuonDetId/interface/DTChamberId.h" |
30 | 31 | #include "DataFormats/MuonDetId/interface/CSCDetId.h" |
@@ -184,46 +185,46 @@ void FW3DViewGeometry::showMuonEndcap(bool showMuonEndcap) { |
184 | 185 | } |
185 | 186 | } |
186 | 187 | } |
| 188 | + |
187 | 189 | // hardcoded gem and me0; need to find better way for different gem geometries |
188 | | - for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion = iRegion + 2) { |
| 190 | + for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion += 2) { |
189 | 191 | TEveElementList* teEndcap = nullptr; |
190 | | - if (iRegion == 1) |
191 | | - teEndcap = new TEveElementList("GEM Forward"); |
192 | | - else |
193 | | - teEndcap = new TEveElementList("GEM Backward"); |
| 192 | + teEndcap = new TEveElementList(Form("GEM Reg=%d", iRegion)); |
194 | 193 | m_muonEndcapElements->AddElement(teEndcap); |
195 | | - |
196 | | - int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? GEMDetId::maxStationId : 1; |
197 | | - |
198 | | - for (Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation) { |
| 194 | + int iStation = 1; |
| 195 | + { |
199 | 196 | std::ostringstream s; |
200 | 197 | s << "Station" << iStation; |
201 | 198 | TEveElementList* cStation = new TEveElementList(s.str().c_str()); |
202 | 199 | teEndcap->AddElement(cStation); |
203 | 200 |
|
204 | | - Int_t iRing = 1; |
205 | 201 | for (Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId; ++iLayer) { |
206 | | - int maxChamber = 36; |
207 | | - if (iStation >= 2) |
208 | | - maxChamber = 18; |
| 202 | + int maxChamber = GEMDetId::maxChamberId; |
| 203 | + std::ostringstream sl; |
| 204 | + sl << "Layer" << iLayer; |
| 205 | + TEveElementList* elayer = new TEveElementList(sl.str().c_str()); |
| 206 | + cStation->AddElement(elayer); |
209 | 207 |
|
210 | 208 | for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) { |
211 | | - int maxRoll = iChamber % 2 ? 9 : 10; |
212 | | - if (iStation == 2) |
213 | | - maxRoll = 8; |
214 | | - if (iStation == 3) |
215 | | - maxRoll = 12; |
216 | | - |
217 | | - for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll; ++iRoll) { |
| 209 | + std::ostringstream cl; |
| 210 | + cl << "Chamber" << iChamber; |
| 211 | + TEveElementList* cha = new TEveElementList(cl.str().c_str()); |
| 212 | + elayer->AddElement(cha); |
| 213 | + |
| 214 | + Int_t iRing = 1; |
| 215 | + Int_t iRoll = 0; |
| 216 | + try { |
218 | 217 | GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll); |
219 | 218 | TEveGeoShape* shape = m_geom->getEveShape(id.rawId()); |
220 | 219 | if (shape) { |
221 | 220 | shape->SetTitle(TString::Format( |
222 | 221 | "GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u", iRing, iStation, iChamber, iRoll, id.rawId())); |
223 | 222 |
|
224 | | - cStation->AddElement(shape); |
| 223 | + cha->AddElement(shape); |
225 | 224 | addToCompound(shape, kFWMuonEndcapLineColorIndex); |
226 | 225 | } |
| 226 | + } catch (cms::Exception& e) { |
| 227 | + fwLog(fwlog::kError) << "FW3DViewGeomtery " << e << std::endl; |
227 | 228 | } |
228 | 229 | } |
229 | 230 | } |
|
0 commit comments