18 #include "TEveManager.h"
19 #include "TEveGeoNode.h"
45 m_muonBarrelElements(0), m_muonBarrelFullElements(0),
46 m_muonEndcapElements(0), m_muonEndcapFullElements(0),
47 m_pixelBarrelElements(0),
48 m_pixelEndcapElements(0),
49 m_trackerBarrelElements(0),
50 m_trackerEndcapElements(0)
53 SetElementName(
"3D Geometry");
84 for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
86 for ( Int_t iStation = 1; iStation <= 4; ++iStation )
90 if( iWheel == -2 || iWheel == 2 || iStation == 4 )
93 s <<
"Station" << iStation;
94 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
96 for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
98 if( iStation < 4 && iSector > 12 )
continue;
102 cStation->AddElement( shape );
123 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
125 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
127 for (Int_t iStation = 1; iStation <= 4; ++iStation)
129 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
130 cWheel->AddElement(cStation);
131 for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
133 if( iStation < 4 && iSector > 12 )
continue;
136 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
137 iWheel, iStation, iSector,
id.rawId()));
139 cStation->AddElement(shape);
160 for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap )
162 TEveElementList* cEndcap = 0;
164 cEndcap =
new TEveElementList(
"Forward" );
166 cEndcap =
new TEveElementList(
"Backward" );
173 Int_t maxChambers = 36;
174 for( Int_t iStation = 1; iStation <= 4; ++iStation )
176 std::ostringstream
s; s <<
"Station" << iStation;
177 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
178 cEndcap->AddElement( cStation );
179 for( Int_t iRing = 1; iRing <= 4; ++iRing )
181 if( iStation > 1 && iRing > 2 )
continue;
182 if( iStation > 3 && iRing > 1 )
continue;
183 std::ostringstream
s; s <<
"Ring" << iRing;
184 TEveElementList* cRing =
new TEveElementList( s.str().c_str() );
185 cStation->AddElement( cRing );
186 ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
187 for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
190 CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
192 shape->SetTitle(TString::Format(
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
193 cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
196 cRing->AddElement( shape );
220 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
221 id != ids.end(); ++id )
225 unsigned int layer = idid.
layer();
226 unsigned int ladder = idid.
ladder();
229 shape->SetTitle( TString::Format(
"PixelBarrel %d: Layer=%u, Ladder=%u, Module=%u",
230 *
id, layer, ladder, module ));
253 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
254 id != ids.end(); ++id )
258 unsigned int side = idid.
side();
259 unsigned int disk = idid.
disk();
260 unsigned int blade = idid.
blade();
261 unsigned int panel = idid.
panel();
264 shape->SetTitle( TString::Format(
"PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
265 *
id, side, disk, blade, panel, module ));
289 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
290 id != ids.end(); ++id )
297 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
298 id != ids.end(); ++id )
301 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
323 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
324 id != ids.end(); ++id )
331 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
332 id != ids.end(); ++id )
336 shape->SetTitle(Form(
"TrackerEndcap %d",*
id));
unsigned int panel() const
panel id
void showMuonBarrel(long)
void showMuonBarrel(bool)
TEveElementList * m_pixelBarrelElements
virtual ~FW3DViewGeometry()
void showTrackerEndcap(bool)
unsigned int ladder() const
ladder id
void showMuonBarrelFull(bool)
unsigned int layer() const
layer id
void showTrackerBarrel(bool)
unsigned int blade() const
blade id
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void showMuonEndcap(bool)
TEveElementList * m_pixelEndcapElements
TEveGeoShape * getEveShape(unsigned int id) const
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
unsigned int module() const
det id
unsigned int module() const
det id
const FWGeometry * m_geom
unsigned int disk() const
disk id
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
const fireworks::Context & context()
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
volatile std::atomic< bool > shutdown_flag false