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 31 of file FW3DViewGeometry.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file FW3DViewGeometry.cc.

44  :
45  FWViewGeometryList(context, false),
52 {
53 
54  SetElementName("3D Geometry");
55 }
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 62 of file FW3DViewGeometry.cc.

63 {
64 }
FW3DViewGeometry::FW3DViewGeometry ( const FW3DViewGeometry )
private

Member Function Documentation

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

Definition at line 80 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

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

Definition at line 119 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

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

Definition at line 156 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_muonEndcapElements, and alignCSCRings::s.

Referenced by FW3DViewBase::setContext().

157 {
159  {
160  m_muonEndcapElements = new TEveElementList( "CSC" );
161  for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
162  {
163  TEveElementList* cEndcap = 0;
164  if( iEndcap == 1 )
165  cEndcap = new TEveElementList( "Forward" );
166  else
167  cEndcap = new TEveElementList( "Backward" );
168  m_muonEndcapElements->AddElement( cEndcap );
169  // Actual CSC geometry:
170  // Station 1 has 4 rings with 36 chambers in each
171  // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
172  // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
173  // Station 4: ring 1 has 18 chambers
174  Int_t maxChambers = 36;
175  for( Int_t iStation = 1; iStation <= 4; ++iStation )
176  {
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 )
181  {
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 )
189  {
190  Int_t iLayer = 0; // chamber
191  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
192  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
193  shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
194  cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
195 
197  cRing->AddElement( shape );
198  }
199  }
200  }
201  }
202  AddElement( m_muonEndcapElements );
203  }
204 
206  {
207  m_muonEndcapElements->SetRnrState( showMuonEndcap );
208  gEve->Redraw3D();
209  }
210 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void showMuonEndcap(bool)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
TEveElementList * m_muonEndcapElements
const FWGeometry * m_geom
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

Definition at line 214 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().

215 {
217  {
218  m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
219  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
220  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
221  for( std::vector<unsigned int>::const_iterator id = ids.begin();
222  id != ids.end(); ++id )
223  {
224  TEveGeoShape* shape = m_geom->getEveShape( *id );
225  PXBDetId idid = PXBDetId( *id );
226  unsigned int layer = idid.layer();
227  unsigned int ladder = idid.ladder();
228  unsigned int module = idid.module();
229 
230  shape->SetTitle( TString::Format( "PixelBarrel %d: Layer=%u, Ladder=%u, Module=%u",
231  *id, layer, ladder, module ));
232 
234  m_pixelBarrelElements->AddElement( shape );
235  }
236  AddElement( m_pixelBarrelElements );
237  }
238 
240  {
241  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
242  gEve->Redraw3D();
243  }
244 }
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:250
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:194
Definition: vlib.h:209
void FW3DViewGeometry::showPixelEndcap ( bool  showPixelEndcap)

Definition at line 248 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().

249 {
251  {
252  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
253  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
254  for( std::vector<unsigned int>::const_iterator id = ids.begin();
255  id != ids.end(); ++id )
256  {
257  TEveGeoShape* shape = m_geom->getEveShape( *id );
258  PXFDetId idid = PXFDetId( *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();
263  unsigned int module = idid.module();
264 
265  shape->SetTitle( TString::Format( "PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
266  *id, side, disk, blade, panel, module ));
267 
269  m_pixelEndcapElements->AddElement( shape );
270  }
271  AddElement( m_pixelEndcapElements );
272  }
273 
275  {
276  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
277  gEve->Redraw3D();
278  }
279 }
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:250
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:194
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
Definition: vlib.h:209
void FW3DViewGeometry::showTrackerBarrel ( bool  showTrackerBarrel)

Definition at line 283 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().

284 {
286  {
287  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
289  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
290  for( std::vector<unsigned int>::const_iterator id = ids.begin();
291  id != ids.end(); ++id )
292  {
293  TEveGeoShape* shape = m_geom->getEveShape( *id );
295  m_trackerBarrelElements->AddElement( shape );
296  }
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  shape->SetTitle(Form("TrackerBarrel %d",*id));
304  m_trackerBarrelElements->AddElement( shape );
305  }
306  AddElement( m_trackerBarrelElements );
307  }
308 
310  {
312  gEve->Redraw3D();
313  }
314 }
void showTrackerBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
const FWGeometry * m_geom
TEveElementList * m_trackerBarrelElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:194
void FW3DViewGeometry::showTrackerEndcap ( bool  showTrackerEndcap)

Definition at line 318 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().

319 {
321  {
322  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
323  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
324  for( std::vector<unsigned int>::const_iterator id = ids.begin();
325  id != ids.end(); ++id )
326  {
327  TEveGeoShape* shape = m_geom->getEveShape( *id );
329  m_trackerEndcapElements->AddElement( shape );
330  }
332  for( std::vector<unsigned int>::const_iterator id = ids.begin();
333  id != ids.end(); ++id )
334  {
335  TEveGeoShape* shape = m_geom->getEveShape( *id );
336 
337  shape->SetTitle(Form("TrackerEndcap %d",*id));
339  m_trackerEndcapElements->AddElement( shape );
340  }
341  AddElement( m_trackerEndcapElements );
342  }
343 
345  {
347  gEve->Redraw3D();
348  }
349 }
void showTrackerEndcap(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:194

Member Data Documentation

TEveElementList* FW3DViewGeometry::m_muonBarrelElements
private

Definition at line 58 of file FW3DViewGeometry.h.

Referenced by showMuonBarrel().

TEveElementList* FW3DViewGeometry::m_muonBarrelFullElements
private

Definition at line 59 of file FW3DViewGeometry.h.

Referenced by showMuonBarrelFull().

TEveElementList* FW3DViewGeometry::m_muonEndcapElements
private

Definition at line 60 of file FW3DViewGeometry.h.

Referenced by showMuonEndcap().

TEveElementList* FW3DViewGeometry::m_muonEndcapFullElements
private

Definition at line 61 of file FW3DViewGeometry.h.

TEveElementList* FW3DViewGeometry::m_pixelBarrelElements
private

Definition at line 62 of file FW3DViewGeometry.h.

Referenced by showPixelBarrel().

TEveElementList* FW3DViewGeometry::m_pixelEndcapElements
private

Definition at line 63 of file FW3DViewGeometry.h.

Referenced by showPixelEndcap().

TEveElementList* FW3DViewGeometry::m_trackerBarrelElements
private

Definition at line 64 of file FW3DViewGeometry.h.

Referenced by showTrackerBarrel().

TEveElementList* FW3DViewGeometry::m_trackerEndcapElements
private

Definition at line 65 of file FW3DViewGeometry.h.

Referenced by showTrackerEndcap().