18 #include "TEveManager.h" 19 #include "TEveGeoNode.h" 20 #include "TEveCompound.h" 50 m_trackerBarrelElements(
nullptr),
51 m_trackerEndcapElements(
nullptr)
54 SetElementName(
"3D Geometry");
85 for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
87 for ( Int_t iStation = 1; iStation <= 4; ++iStation )
91 if( iWheel == -2 || iWheel == 2 || iStation == 4 )
94 s <<
"Station" << iStation;
95 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
97 for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
99 if( iStation < 4 && iSector > 12 )
continue;
103 cStation->AddElement( shape );
124 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
126 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
128 for (Int_t iStation = 1; iStation <= 4; ++iStation)
130 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
131 cWheel->AddElement(cStation);
132 for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
134 if( iStation < 4 && iSector > 12 )
continue;
137 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
138 iWheel, iStation, iSector,
id.rawId()));
140 cStation->AddElement(shape);
162 for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap )
164 TEveElementList* cEndcap =
nullptr;
166 cEndcap =
new TEveElementList(
"CSC Forward" );
168 cEndcap =
new TEveElementList(
"CSC Backward" );
175 Int_t maxChambers = 36;
176 for( Int_t iStation = 1; iStation <= 4; ++iStation )
178 std::ostringstream
s; s <<
"Station" << iStation;
179 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
180 cEndcap->AddElement( cStation );
181 for( Int_t iRing = 1; iRing <= 4; ++iRing )
183 if( iStation > 1 && iRing > 2 )
continue;
185 std::ostringstream
s; s <<
"Ring" << iRing;
186 TEveElementList* cRing =
new TEveElementList( s.str().c_str() );
187 cStation->AddElement( cRing );
188 ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
189 for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
192 CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
194 shape->SetTitle(TString::Format(
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
195 cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
198 cRing->AddElement( shape );
205 TEveElementList* teEndcap =
nullptr;
207 teEndcap =
new TEveElementList(
"GEM Forward" );
209 teEndcap =
new TEveElementList(
"GEM Backward" );
215 std::ostringstream
s; s <<
"Station" << iStation;
216 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
217 teEndcap->AddElement( cStation );
222 if (iStation >= 2) maxChamber = 18;
224 for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
225 int maxRoll = iChamber%2 ? 9:10;
226 if (iStation == 2) maxRoll = 8;
227 if (iStation == 3) maxRoll = 12;
230 GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
233 shape->SetTitle(TString::Format(
"GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
234 iRing, iStation, iChamber, iRoll,
id.rawId()));
236 cStation->AddElement( shape );
248 TEveElementList* teEndcap =
nullptr;
250 teEndcap =
new TEveElementList(
"ME0 Forward" );
252 teEndcap =
new TEveElementList(
"ME0 Backward" );
255 for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
256 std::ostringstream
s; s <<
"Layer" << iLayer;
257 TEveElementList* cLayer =
new TEveElementList( s.str().c_str() );
258 teEndcap->AddElement( cLayer );
260 for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
263 ME0DetId id( iRegion, iLayer, iChamber, iRoll );
266 shape->SetTitle(TString::Format(
"ME0: , Ch=%d Rl=%d\ndet-id=%u",
267 iChamber, iRoll,
id.rawId()));
270 cLayer->AddElement( shape );
296 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
297 id != ids.end(); ++
id )
301 uint32_t rawId = *
id;
304 shape->SetTitle( title.c_str());
327 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
328 id != ids.end(); ++
id )
331 uint32_t rawId = *
id;
334 shape->SetTitle( title.c_str());
357 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
358 id != ids.end(); ++
id )
365 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
366 id != ids.end(); ++
id )
369 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
391 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
392 id != ids.end(); ++
id )
399 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
400 id != ids.end(); ++
id )
404 shape->SetTitle(Form(
"TrackerEndcap %d",*
id));
~FW3DViewGeometry() override
void showMuonBarrel(bool)
TEveElementList * m_pixelBarrelElements
void showTrackerEndcap(bool)
static const int minRegionId
std::string print(DetId detid) const
static const int maxRegionId
void showMuonBarrelFull(bool)
const VersionInfo & versionInfo() const
void showTrackerBarrel(bool)
static const int maxLayerId
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