19 #include "TEveManager.h"
20 #include "TEveGeoNode.h"
46 m_muonBarrelElements(0), m_muonBarrelFullElements(0),
47 m_muonEndcapElements(0), m_muonEndcapFullElements(0),
48 m_pixelBarrelElements(0),
49 m_pixelEndcapElements(0),
50 m_trackerBarrelElements(0),
51 m_trackerEndcapElements(0)
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);
161 for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap )
163 TEveElementList* cEndcap = 0;
165 cEndcap =
new TEveElementList(
"Forward" );
167 cEndcap =
new TEveElementList(
"Backward" );
174 Int_t maxChambers = 36;
175 for( Int_t iStation = 1; iStation <= 4; ++iStation )
177 std::ostringstream
s; s <<
"Station" << iStation;
178 TEveElementList* cStation =
new TEveElementList( s.str().c_str() );
179 cEndcap->AddElement( cStation );
180 for( Int_t iRing = 1; iRing <= 4; ++iRing )
182 if( iStation > 1 && iRing > 2 )
continue;
183 if( iStation > 3 && iRing > 1 )
continue;
184 std::ostringstream
s; s <<
"Ring" << iRing;
185 TEveElementList* cRing =
new TEveElementList( s.str().c_str() );
186 cStation->AddElement( cRing );
187 ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
188 for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
191 CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
193 shape->SetTitle(TString::Format(
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
194 cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
197 cRing->AddElement( shape );
221 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
222 id != ids.end(); ++id )
226 unsigned int layer = idid.
layer();
227 unsigned int ladder = idid.
ladder();
230 shape->SetTitle( TString::Format(
"PixelBarrel %d: Layer=%u, Ladder=%u, Module=%u",
231 *
id, layer, ladder, module ));
254 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
255 id != ids.end(); ++id )
259 unsigned int side = idid.
side();
260 unsigned int disk = idid.
disk();
261 unsigned int blade = idid.
blade();
262 unsigned int panel = idid.
panel();
265 shape->SetTitle( TString::Format(
"PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
266 *
id, side, disk, blade, panel, module ));
290 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
291 id != ids.end(); ++id )
298 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
299 id != ids.end(); ++id )
302 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
324 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
325 id != ids.end(); ++id )
332 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
333 id != ids.end(); ++id )
337 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