18 #include "TEveManager.h" 19 #include "TEveGeoNode.h" 20 #include "TEveCompound.h" 48 m_muonBarrelElements(0), m_muonBarrelFullElements(0),
49 m_muonEndcapElements(0), m_muonEndcapFullElements(0),
50 m_pixelBarrelElements(0),
51 m_pixelEndcapElements(0),
52 m_trackerBarrelElements(0),
53 m_trackerEndcapElements(0)
56 SetElementName(
"3D Geometry");
87 for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
89 for ( Int_t iStation = 1; iStation <= 4; ++iStation )
93 if( iWheel == -2 || iWheel == 2 || iStation == 4 )
96 s <<
"Station" << iStation;
97 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
99 for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
101 if( iStation < 4 && iSector > 12 )
continue;
105 cStation->AddElement( shape );
126 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
128 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
130 for (Int_t iStation = 1; iStation <= 4; ++iStation)
132 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
133 cWheel->AddElement(cStation);
134 for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
136 if( iStation < 4 && iSector > 12 )
continue;
139 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
140 iWheel, iStation, iSector,
id.rawId()));
142 cStation->AddElement(shape);
164 for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap )
166 TEveElementList* cEndcap = 0;
168 cEndcap =
new TEveElementList(
"CSC Forward" );
170 cEndcap =
new TEveElementList(
"CSC Backward" );
177 Int_t maxChambers = 36;
178 for( Int_t iStation = 1; iStation <= 4; ++iStation )
180 std::ostringstream
s; s <<
"Station" << iStation;
181 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
182 cEndcap->AddElement( cStation );
183 for( Int_t iRing = 1; iRing <= 4; ++iRing )
185 if( iStation > 1 && iRing > 2 )
continue;
187 std::ostringstream
s; s <<
"Ring" << iRing;
188 TEveElementList* cRing =
new TEveElementList( s.str().c_str() );
189 cStation->AddElement( cRing );
190 ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
191 for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
194 CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
196 shape->SetTitle(TString::Format(
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
197 cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
200 cRing->AddElement( shape );
207 TEveElementList* teEndcap = 0;
209 teEndcap =
new TEveElementList(
"GEM Forward" );
211 teEndcap =
new TEveElementList(
"GEM Backward" );
217 std::ostringstream
s; s <<
"Station" << iStation;
218 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
219 teEndcap->AddElement( cStation );
224 if (iStation >= 2) maxChamber = 18;
226 for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
227 int maxRoll = iChamber%2 ? 9:10;
228 if (iStation == 2) maxRoll = 8;
229 if (iStation == 3) maxRoll = 12;
232 GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
235 shape->SetTitle(TString::Format(
"GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
236 iRing, iStation, iChamber, iRoll,
id.rawId()));
238 cStation->AddElement( shape );
250 TEveElementList* teEndcap = 0;
252 teEndcap =
new TEveElementList(
"ME0 Forward" );
254 teEndcap =
new TEveElementList(
"ME0 Backward" );
257 for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
258 std::ostringstream
s; s <<
"Layer" << iLayer;
259 TEveElementList* cLayer =
new TEveElementList( s.str().c_str() );
260 teEndcap->AddElement( cLayer );
262 for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
265 ME0DetId id( iRegion, iLayer, iChamber, iRoll );
268 shape->SetTitle(TString::Format(
"ME0: , Ch=%d Rl=%d\ndet-id=%u",
269 iChamber, iRoll,
id.rawId()));
272 cLayer->AddElement( shape );
298 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
299 id != ids.end(); ++
id )
303 unsigned int layer = idid.
layer();
307 shape->SetTitle( TString::Format(
"PixelBarrel %d: Layer=%u, Ladder=%u, Module=%u",
308 *
id, layer, ladder, module ));
331 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
332 id != ids.end(); ++
id )
336 unsigned int side = idid.
side();
337 unsigned int disk = idid.
disk();
338 unsigned int blade = idid.
blade();
339 unsigned int panel = idid.
panel();
342 shape->SetTitle( TString::Format(
"PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
343 *
id, side, disk, blade, panel, module ));
367 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
368 id != ids.end(); ++
id )
375 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
376 id != ids.end(); ++
id )
379 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
401 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
402 id != ids.end(); ++
id )
409 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
410 id != ids.end(); ++
id )
414 shape->SetTitle(Form(
"TrackerEndcap %d",*
id));
unsigned int panel() const
panel id
void showMuonBarrel(bool)
TEveElementList * m_pixelBarrelElements
virtual ~FW3DViewGeometry()
void showTrackerEndcap(bool)
static const int minRegionId
unsigned int ladder() const
ladder id
static const int maxRegionId
void showMuonBarrelFull(bool)
unsigned int layer() const
layer id
const VersionInfo & versionInfo() const
void showTrackerBarrel(bool)
static const int maxLayerId
unsigned int blade() const
blade id
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
unsigned int module() const
det id
unsigned int module() const
det id
const FWGeometry * m_geom
static const int maxStationId
unsigned int disk() const
disk id
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
unsigned int side() const
positive or negative id
static const int minLayerId
static const int maxRegionId