CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FW3DViewGeometry Class Reference

#include <Fireworks/Core/interface/FW3DViewGeometry.h>

Inheritance diagram for FW3DViewGeometry:
FWViewGeometryList

Public Member Functions

 FW3DViewGeometry (const fireworks::Context &context)
 
void showMuonBarrel (bool)
 
void showMuonBarrelFull (bool)
 
void showMuonEndcap (bool)
 
void showPixelBarrel (bool)
 
void showPixelEndcap (bool)
 
void showTrackerBarrel (bool)
 
void showTrackerEndcap (bool)
 
virtual ~FW3DViewGeometry ()
 
- Public Member Functions inherited from FWViewGeometryList
 FWViewGeometryList (const fireworks::Context &context, bool projected=true)
 
void updateColors ()
 
void updateTransparency (bool projectedType)
 
virtual ~FWViewGeometryList ()
 

Private Member Functions

 FW3DViewGeometry (const FW3DViewGeometry &)
 
const FW3DViewGeometryoperator= (const FW3DViewGeometry &)
 

Private Attributes

TEveElementList * m_muonBarrelElements
 
TEveElementList * m_muonBarrelFullElements
 
TEveElementList * m_muonEndcapElements
 
TEveElementList * m_muonEndcapFullElements
 
TEveElementList * m_pixelBarrelElements
 
TEveElementList * m_pixelEndcapElements
 
TEveElementList * m_trackerBarrelElements
 
TEveElementList * m_trackerEndcapElements
 

Additional Inherited Members

- Protected Member Functions inherited from FWViewGeometryList
void addToCompound (TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
 
- Protected Attributes inherited from FWViewGeometryList
TEveCompound * m_colorComp [kFWGeomColorSize]
 
const fireworks::Contextm_context
 
const FWGeometrym_geom
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 30 of file FW3DViewGeometry.h.

Constructor & Destructor Documentation

FW3DViewGeometry::FW3DViewGeometry ( const fireworks::Context context)

Definition at line 46 of file FW3DViewGeometry.cc.

46  :
47  FWViewGeometryList(context, false),
54 {
55 
56  SetElementName("3D Geometry");
57 }
TEveElementList * m_pixelBarrelElements
FWViewGeometryList(const fireworks::Context &context, bool projected=true)
TEveElementList * m_pixelEndcapElements
TEveElementList * m_muonEndcapFullElements
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
TEveElementList * m_muonBarrelFullElements
FW3DViewGeometry::~FW3DViewGeometry ( )
virtual

Definition at line 64 of file FW3DViewGeometry.cc.

65 {
66 }
FW3DViewGeometry::FW3DViewGeometry ( const FW3DViewGeometry )
private

Member Function Documentation

const FW3DViewGeometry& FW3DViewGeometry::operator= ( const FW3DViewGeometry )
private
void FW3DViewGeometry::showMuonBarrel ( bool  showMuonBarrel)

Definition at line 82 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), kFWMuonBarrelLineColorIndex, FWViewGeometryList::m_geom, m_muonBarrelElements, and alignCSCRings::s.

Referenced by FW3DViewBase::showMuonBarrel().

83 {
85  {
86  m_muonBarrelElements = new TEveElementList( "DT" );
87  for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
88  {
89  for ( Int_t iStation = 1; iStation <= 4; ++iStation )
90  {
91  // We display only the outer chambers to make the event look more
92  // prominent
93  if( iWheel == -2 || iWheel == 2 || iStation == 4 )
94  {
95  std::ostringstream s;
96  s << "Station" << iStation;
97  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
98  m_muonBarrelElements->AddElement( cStation );
99  for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
100  {
101  if( iStation < 4 && iSector > 12 ) continue;
102  DTChamberId id( iWheel, iStation, iSector );
103  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
105  cStation->AddElement( shape );
106  }
107  }
108  }
109  }
110  AddElement( m_muonBarrelElements );
111  }
112 
114  {
115  m_muonBarrelElements->SetRnrState( showMuonBarrel );
116  gEve->Redraw3D();
117  }
118 }
void showMuonBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
TEveElementList * m_muonBarrelElements
const FWGeometry * m_geom
void FW3DViewGeometry::showMuonBarrelFull ( bool  showMuonBarrel)

Definition at line 121 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), kFWMuonBarrelLineColorIndex, FWViewGeometryList::m_geom, and m_muonBarrelFullElements.

Referenced by FW3DViewBase::showMuonBarrel().

122 {
124  {
125  m_muonBarrelFullElements = new TEveElementList( "DT Full" );
126  for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
127  {
128  TEveElementList* cWheel = new TEveElementList(TString::Format("Wheel %d", iWheel));
129  m_muonBarrelFullElements->AddElement(cWheel);
130  for (Int_t iStation = 1; iStation <= 4; ++iStation)
131  {
132  TEveElementList* cStation = new TEveElementList(TString::Format("Station %d", iStation));
133  cWheel->AddElement(cStation);
134  for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
135  {
136  if( iStation < 4 && iSector > 12 ) continue;
137  DTChamberId id( iWheel, iStation, iSector );
138  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
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);
143  }
144  }
145  }
146  AddElement(m_muonBarrelFullElements);
147  }
148 
150  {
152  gEve->Redraw3D();
153  }
154 }
void showMuonBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
const FWGeometry * m_geom
TEveElementList * m_muonBarrelFullElements
void FW3DViewGeometry::showMuonEndcap ( bool  showMuonEndcap)

Definition at line 158 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_muonEndcapElements, GEMDetId::maxLayerId, ME0DetId::maxRegionId, GEMDetId::maxRegionId, GEMDetId::minLayerId, ME0DetId::minRegionId, GEMDetId::minRegionId, GEMDetId::minRollId, GEMDetId::minStationId, alignCSCRings::s, and FWGeometry::versionInfo().

Referenced by FW3DViewBase::setContext().

159 {
161  {
162  m_muonEndcapElements = new TEveElementList( "EndCap" );
163 
164  for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
165  {
166  TEveElementList* cEndcap = 0;
167  if( iEndcap == 1 )
168  cEndcap = new TEveElementList( "CSC Forward" );
169  else
170  cEndcap = new TEveElementList( "CSC Backward" );
171  m_muonEndcapElements->AddElement( cEndcap );
172  // Actual CSC geometry:
173  // Station 1 has 4 rings with 36 chambers in each
174  // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
175  // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
176  // Station 4: ring 1 has 18 chambers
177  Int_t maxChambers = 36;
178  for( Int_t iStation = 1; iStation <= 4; ++iStation )
179  {
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 )
184  {
185  if( iStation > 1 && iRing > 2 ) continue;
186  if( iStation > 3 && iRing > 1 ) 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 )
192  {
193  Int_t iLayer = 0; // chamber
194  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
195  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
196  shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
197  cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
198 
200  cRing->AddElement( shape );
201  }
202  }
203  }
204  }
205  // hardcoded gem and me0; need to find better way for different gem geometries
206  for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
207  TEveElementList* teEndcap = 0;
208  if( iRegion == 1 )
209  teEndcap = new TEveElementList( "GEM Forward" );
210  else
211  teEndcap = new TEveElementList( "GEM Backward" );
212  m_muonEndcapElements->AddElement( teEndcap );
213 
214  int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? 3:1;
215 
216  for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
217  std::ostringstream s; s << "Station" << iStation;
218  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
219  teEndcap->AddElement( cStation );
220 
221  Int_t iRing = 1;
222  for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
223  int maxChamber = 36;
224  if (iStation >= 2) maxChamber = 18;
225 
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;
230 
231  for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
232  GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
233  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
234  if (shape){
235  shape->SetTitle(TString::Format("GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
236  iRing, iStation, iChamber, iRoll, id.rawId()));
237 
238  cStation->AddElement( shape );
240  }
241  }
242  }
243  }
244  }
245  }
246 
247  // adding me0
248  if (m_geom->versionInfo().haveExtraDet("ME0") ){
249  for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
250  TEveElementList* teEndcap = 0;
251  if( iRegion == 1 )
252  teEndcap = new TEveElementList( "ME0 Forward" );
253  else
254  teEndcap = new TEveElementList( "ME0 Backward" );
255  m_muonEndcapElements->AddElement( teEndcap );
256 
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 );
261 
262  for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
263  Int_t iRoll = 1;
264  // for (Int_t iRoll = ME0DetId::minRollId; iRoll <= ME0DetId::maxRollId ; ++iRoll ){
265  ME0DetId id( iRegion, iLayer, iChamber, iRoll );
266  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
267  if (shape){
268  shape->SetTitle(TString::Format("ME0: , Ch=%d Rl=%d\ndet-id=%u",
269  iChamber, iRoll, id.rawId()));
270 
272  cLayer->AddElement( shape );
273  }
274  }
275  }
276  }
277  }
278 
279  AddElement( m_muonEndcapElements );
280  }
281 
283  {
284  m_muonEndcapElements->SetRnrState( showMuonEndcap );
285  gEve->Redraw3D();
286  }
287 }
static const int minRegionId
Definition: GEMDetId.h:90
static const int maxRegionId
Definition: ME0DetId.h:87
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:117
static const int maxLayerId
Definition: GEMDetId.h:103
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static const int minRegionId
Definition: ME0DetId.h:86
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:379
void showMuonEndcap(bool)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
TEveElementList * m_muonEndcapElements
static const int minRollId
Definition: GEMDetId.h:105
const FWGeometry * m_geom
static const int minStationId
Definition: GEMDetId.h:96
static const int minLayerId
Definition: GEMDetId.h:102
static const int maxRegionId
Definition: GEMDetId.h:91
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

Definition at line 291 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), kFWPixelBarrelColorIndex, PXBDetId::ladder(), PXBDetId::layer(), FWViewGeometryList::m_geom, m_pixelBarrelElements, PXBDetId::module(), FWGeometry::PixelBarrel, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

292 {
294  {
295  m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
296  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
297  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
298  for( std::vector<unsigned int>::const_iterator id = ids.begin();
299  id != ids.end(); ++id )
300  {
301  TEveGeoShape* shape = m_geom->getEveShape( *id );
302  PXBDetId idid = PXBDetId( *id );
303  unsigned int layer = idid.layer();
304  unsigned int ladder = idid.ladder();
305  unsigned int module = idid.module();
306 
307  shape->SetTitle( TString::Format( "PixelBarrel %d: Layer=%u, Ladder=%u, Module=%u",
308  *id, layer, ladder, module ));
309 
311  m_pixelBarrelElements->AddElement( shape );
312  }
313  AddElement( m_pixelBarrelElements );
314  }
315 
317  {
318  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
319  gEve->Redraw3D();
320  }
321 }
TEveElementList * m_pixelBarrelElements
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
unsigned int module() const
det id
Definition: PXBDetId.h:43
const FWGeometry * m_geom
void showPixelBarrel(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
Definition: vlib.h:208
void FW3DViewGeometry::showPixelEndcap ( bool  showPixelEndcap)

Definition at line 325 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), PXFDetId::blade(), PXFDetId::disk(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), kFWPixelEndcapColorIndex, FWViewGeometryList::m_geom, m_pixelEndcapElements, PXFDetId::module(), PXFDetId::panel(), FWGeometry::PixelEndcap, PXFDetId::side(), and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

326 {
328  {
329  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
330  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
331  for( std::vector<unsigned int>::const_iterator id = ids.begin();
332  id != ids.end(); ++id )
333  {
334  TEveGeoShape* shape = m_geom->getEveShape( *id );
335  PXFDetId idid = PXFDetId( *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();
340  unsigned int module = idid.module();
341 
342  shape->SetTitle( TString::Format( "PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
343  *id, side, disk, blade, panel, module ));
344 
346  m_pixelEndcapElements->AddElement( shape );
347  }
348  AddElement( m_pixelEndcapElements );
349  }
350 
352  {
353  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
354  gEve->Redraw3D();
355  }
356 }
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveElementList * m_pixelEndcapElements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
unsigned int module() const
det id
Definition: PXFDetId.h:56
const FWGeometry * m_geom
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
void showPixelEndcap(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
Definition: vlib.h:208
void FW3DViewGeometry::showTrackerBarrel ( bool  showTrackerBarrel)

Definition at line 360 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), kFWTrackerBarrelColorIndex, FWViewGeometryList::m_geom, m_trackerBarrelElements, FWGeometry::TIB, FWGeometry::TOB, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

361 {
363  {
364  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
366  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
367  for( std::vector<unsigned int>::const_iterator id = ids.begin();
368  id != ids.end(); ++id )
369  {
370  TEveGeoShape* shape = m_geom->getEveShape( *id );
372  m_trackerBarrelElements->AddElement( shape );
373  }
375  for( std::vector<unsigned int>::const_iterator id = ids.begin();
376  id != ids.end(); ++id )
377  {
378  TEveGeoShape* shape = m_geom->getEveShape( *id );
379  shape->SetTitle(Form("TrackerBarrel %d",*id));
381  m_trackerBarrelElements->AddElement( shape );
382  }
383  AddElement( m_trackerBarrelElements );
384  }
385 
387  {
389  gEve->Redraw3D();
390  }
391 }
void showTrackerBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
const FWGeometry * m_geom
TEveElementList * m_trackerBarrelElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
void FW3DViewGeometry::showTrackerEndcap ( bool  showTrackerEndcap)

Definition at line 395 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), kFWTrackerEndcapColorIndex, FWViewGeometryList::m_geom, m_trackerEndcapElements, FWGeometry::TEC, FWGeometry::TID, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

396 {
398  {
399  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
400  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
401  for( std::vector<unsigned int>::const_iterator id = ids.begin();
402  id != ids.end(); ++id )
403  {
404  TEveGeoShape* shape = m_geom->getEveShape( *id );
406  m_trackerEndcapElements->AddElement( shape );
407  }
409  for( std::vector<unsigned int>::const_iterator id = ids.begin();
410  id != ids.end(); ++id )
411  {
412  TEveGeoShape* shape = m_geom->getEveShape( *id );
413 
414  shape->SetTitle(Form("TrackerEndcap %d",*id));
416  m_trackerEndcapElements->AddElement( shape );
417  }
418  AddElement( m_trackerEndcapElements );
419  }
420 
422  {
424  gEve->Redraw3D();
425  }
426 }
void showTrackerEndcap(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197

Member Data Documentation

TEveElementList* FW3DViewGeometry::m_muonBarrelElements
private

Definition at line 57 of file FW3DViewGeometry.h.

Referenced by showMuonBarrel().

TEveElementList* FW3DViewGeometry::m_muonBarrelFullElements
private

Definition at line 58 of file FW3DViewGeometry.h.

Referenced by showMuonBarrelFull().

TEveElementList* FW3DViewGeometry::m_muonEndcapElements
private

Definition at line 59 of file FW3DViewGeometry.h.

Referenced by showMuonEndcap().

TEveElementList* FW3DViewGeometry::m_muonEndcapFullElements
private

Definition at line 60 of file FW3DViewGeometry.h.

TEveElementList* FW3DViewGeometry::m_pixelBarrelElements
private

Definition at line 61 of file FW3DViewGeometry.h.

Referenced by showPixelBarrel().

TEveElementList* FW3DViewGeometry::m_pixelEndcapElements
private

Definition at line 62 of file FW3DViewGeometry.h.

Referenced by showPixelEndcap().

TEveElementList* FW3DViewGeometry::m_trackerBarrelElements
private

Definition at line 63 of file FW3DViewGeometry.h.

Referenced by showTrackerBarrel().

TEveElementList* FW3DViewGeometry::m_trackerEndcapElements
private

Definition at line 64 of file FW3DViewGeometry.h.

Referenced by showTrackerEndcap().