18 #include "TEveManager.h" 19 #include "TEveGeoNode.h" 20 #include "TEveCompound.h" 50 m_trackerBarrelElements(
nullptr),
51 m_trackerEndcapElements(
nullptr),
55 SetElementName(
"3D Geometry");
86 for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
88 for ( Int_t iStation = 1; iStation <= 4; ++iStation )
92 if( iWheel == -2 || iWheel == 2 || iStation == 4 )
95 s <<
"Station" << iStation;
96 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
98 for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
100 if( iStation < 4 && iSector > 12 )
continue;
104 cStation->AddElement( shape );
125 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
127 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
129 for (Int_t iStation = 1; iStation <= 4; ++iStation)
131 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
132 cWheel->AddElement(cStation);
133 for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
135 if( iStation < 4 && iSector > 12 )
continue;
138 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
139 iWheel, iStation, iSector,
id.rawId()));
141 cStation->AddElement(shape);
163 for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap )
165 TEveElementList* cEndcap =
nullptr;
167 cEndcap =
new TEveElementList(
"CSC Forward" );
169 cEndcap =
new TEveElementList(
"CSC Backward" );
176 Int_t maxChambers = 36;
177 for( Int_t iStation = 1; iStation <= 4; ++iStation )
179 std::ostringstream
s; s <<
"Station" << iStation;
180 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
181 cEndcap->AddElement( cStation );
182 for( Int_t iRing = 1; iRing <= 4; ++iRing )
184 if( iStation > 1 && iRing > 2 )
continue;
186 std::ostringstream
s; s <<
"Ring" << iRing;
187 TEveElementList* cRing =
new TEveElementList( s.str().c_str() );
188 cStation->AddElement( cRing );
189 ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
190 for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
193 CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
195 shape->SetTitle(TString::Format(
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
196 cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
199 cRing->AddElement( shape );
206 TEveElementList* teEndcap =
nullptr;
208 teEndcap =
new TEveElementList(
"GEM Forward" );
210 teEndcap =
new TEveElementList(
"GEM Backward" );
216 std::ostringstream
s; s <<
"Station" << iStation;
217 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
218 teEndcap->AddElement( cStation );
223 if (iStation >= 2) maxChamber = 18;
225 for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
226 int maxRoll = iChamber%2 ? 9:10;
227 if (iStation == 2) maxRoll = 8;
228 if (iStation == 3) maxRoll = 12;
231 GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
234 shape->SetTitle(TString::Format(
"GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
235 iRing, iStation, iChamber, iRoll,
id.rawId()));
237 cStation->AddElement( shape );
249 TEveElementList* teEndcap =
nullptr;
251 teEndcap =
new TEveElementList(
"ME0 Forward" );
253 teEndcap =
new TEveElementList(
"ME0 Backward" );
256 for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
257 std::ostringstream
s; s <<
"Layer" << iLayer;
258 TEveElementList* cLayer =
new TEveElementList( s.str().c_str() );
259 teEndcap->AddElement( cLayer );
261 for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
264 ME0DetId id( iRegion, iLayer, iChamber, iRoll );
267 shape->SetTitle(TString::Format(
"ME0: , Ch=%d Rl=%d\ndet-id=%u",
268 iChamber, iRoll,
id.rawId()));
271 cLayer->AddElement( shape );
297 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
298 id != ids.end(); ++
id )
302 uint32_t rawId = *
id;
305 shape->SetTitle( title.c_str());
328 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
329 id != ids.end(); ++
id )
332 uint32_t rawId = *
id;
335 shape->SetTitle( title.c_str());
358 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
359 id != ids.end(); ++
id )
366 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
367 id != ids.end(); ++
id )
370 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
392 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
393 id != ids.end(); ++
id )
400 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
401 id != ids.end(); ++
id )
405 shape->SetTitle(Form(
"TrackerEndcap %d",*
id));
427 const unsigned int layer = (
id>>20)&0x1F;
428 shape->SetTitle(Form(
"HGCalEE %d", layer));
431 color[0] = color[1] = color[2] = 0.3f + 0.7f*(1.0f-layer/28.0f);
432 color[1] = 0.5f*(layer&2
U) + 0.5
f*color[1];
433 const bool isFine = ((
id>>26)&0x3) == 0;
434 color[0] *= isFine ? 1.0f : 1.0f;
435 color[1] *= isFine ? 1.0f : 0.4f;
436 color[2] *= isFine ? 0.0f : 0.0f;
437 shape->SetMainColorRGB( color[0], color[1], color[2] );
438 shape->SetPickable(
false);
458 const unsigned int layer = (
id>>20)&0x1F;
459 shape->SetTitle(Form(
"HGCalHSi %d",layer));
462 color[0] = color[1] = color[2] = 0.3f + 0.7f*(1.0f-layer/28.0f);
463 color[0] = 0.5f*(layer&2
U) + 0.5
f*color[0];
464 const bool isFine = ((
id>>26)&0x3) == 0;
465 color[0] *= isFine ? 1.0f : 0.4f;
466 color[1] *= isFine ? 0.7f : 0.7f;
467 color[2] *= isFine ? 0.2f : 0.2f;
468 shape->SetMainColorRGB( color[0], color[1], color[2] );
469 shape->SetPickable(
false);
490 const unsigned int layer = (
id>>17)&0x1F;
491 shape->SetTitle(Form(
"HGCalHSc %d", layer));
~FW3DViewGeometry() override
TEveGeoShape * getHGCSiliconEveShape(unsigned int id) const
TEveCompound * m_colorComp[kFWGeomColorSize]
void showMuonBarrel(bool)
TEveElementList * m_pixelBarrelElements
TEveElementList * m_HGCalEEElements
void showTrackerEndcap(bool)
static const int minRegionId
std::string print(DetId detid) const
static const int maxRegionId
void showMuonBarrelFull(bool)
const VersionInfo & versionInfo() const
TEveElementList * m_HGCalHSiElements
void showTrackerBarrel(bool)
static const int maxLayerId
TEveElementList * m_HGCalHScElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static const int minRegionId
bool haveExtraDet(const char *) const
void showMuonEndcap(bool)
TEveElementList * m_pixelEndcapElements
TEveGeoShape * getEveShape(unsigned int id) const
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
static const int minRollId
const FWGeometry * m_geom
static const int maxStationId
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
const fireworks::Context & context()
static const int minStationId
void showPixelBarrel(bool)
TEveElementList * m_muonBarrelFullElements
FW3DViewGeometry(const fireworks::Context &context)
void showPixelEndcap(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
static const int minLayerId
const TrackerTopology * getTrackerTopology() const
static const int maxRegionId
TEveGeoShape * getHGCScintillatorEveShape(unsigned int id) const