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 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_muonEndcapElements
 
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 42 of file FW3DViewGeometry.cc.

42  :
43  FWViewGeometryList(context, false),
50 {
51 
52  SetElementName("3D Geometry");
53 }
TEveElementList * m_pixelBarrelElements
FWViewGeometryList(const fireworks::Context &context, bool projected=true)
TEveElementList * m_pixelEndcapElements
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
FW3DViewGeometry::~FW3DViewGeometry ( )
virtual

Definition at line 60 of file FW3DViewGeometry.cc.

61 {
62 }
FW3DViewGeometry::FW3DViewGeometry ( const FW3DViewGeometry )
private

Member Function Documentation

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

Definition at line 78 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

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

Definition at line 118 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

119 {
121  {
122  m_muonEndcapElements = new TEveElementList( "CSC" );
123  for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
124  {
125  TEveElementList* cEndcap = 0;
126  if( iEndcap == 1 )
127  cEndcap = new TEveElementList( "Forward" );
128  else
129  cEndcap = new TEveElementList( "Backward" );
130  m_muonEndcapElements->AddElement( cEndcap );
131  // Actual CSC geometry:
132  // Station 1 has 4 rings with 36 chambers in each
133  // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
134  // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
135  // Station 4: ring 1 has 18 chambers
136  Int_t maxChambers = 36;
137  for( Int_t iStation = 1; iStation <= 4; ++iStation )
138  {
139  std::ostringstream s; s << "Station" << iStation;
140  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
141  cEndcap->AddElement( cStation );
142  for( Int_t iRing = 1; iRing <= 4; ++iRing )
143  {
144  if( iStation > 1 && iRing > 2 ) continue;
145  if( iStation > 3 && iRing > 1 ) continue;
146  std::ostringstream s; s << "Ring" << iRing;
147  TEveElementList* cRing = new TEveElementList( s.str().c_str() );
148  cStation->AddElement( cRing );
149  ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
150  for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
151  {
152  Int_t iLayer = 0; // chamber
153  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
154  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
156  cRing->AddElement( shape );
157  }
158  }
159  }
160  }
161  AddElement( m_muonEndcapElements );
162  }
163 
165  {
166  m_muonEndcapElements->SetRnrState( showMuonEndcap );
167  gEve->Redraw3D();
168  }
169 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void showMuonEndcap(bool)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:251
TEveElementList * m_muonEndcapElements
const FWGeometry * m_geom
string s
Definition: asciidump.py:422
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

Definition at line 173 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

174 {
176  {
177  m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
178  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
179  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
180  for( std::vector<unsigned int>::const_iterator id = ids.begin();
181  id != ids.end(); ++id )
182  {
183  TEveGeoShape* shape = m_geom->getEveShape( *id );
185  m_pixelBarrelElements->AddElement( shape );
186  }
187  AddElement( m_pixelBarrelElements );
188  }
189 
191  {
192  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
193  gEve->Redraw3D();
194  }
195 }
TEveElementList * m_pixelBarrelElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:251
const FWGeometry * m_geom
void showPixelBarrel(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:195
void FW3DViewGeometry::showPixelEndcap ( bool  showPixelEndcap)

Definition at line 199 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), kFWPixelEndcapColorIndex, FWViewGeometryList::m_geom, m_pixelEndcapElements, FWGeometry::PixelEndcap, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

200 {
202  {
203  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
204  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
205  for( std::vector<unsigned int>::const_iterator id = ids.begin();
206  id != ids.end(); ++id )
207  {
208  TEveGeoShape* shape = m_geom->getEveShape( *id );
210  m_pixelEndcapElements->AddElement( shape );
211  }
212  AddElement( m_pixelEndcapElements );
213  }
214 
216  {
217  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
218  gEve->Redraw3D();
219  }
220 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveElementList * m_pixelEndcapElements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:251
const FWGeometry * m_geom
void showPixelEndcap(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:195
void FW3DViewGeometry::showTrackerBarrel ( bool  showTrackerBarrel)

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

225 {
227  {
228  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
230  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
231  for( std::vector<unsigned int>::const_iterator id = ids.begin();
232  id != ids.end(); ++id )
233  {
234  TEveGeoShape* shape = m_geom->getEveShape( *id );
236  m_trackerBarrelElements->AddElement( shape );
237  }
239  for( std::vector<unsigned int>::const_iterator id = ids.begin();
240  id != ids.end(); ++id )
241  {
242  TEveGeoShape* shape = m_geom->getEveShape( *id );
244  m_trackerBarrelElements->AddElement( shape );
245  }
246  AddElement( m_trackerBarrelElements );
247  }
248 
250  {
252  gEve->Redraw3D();
253  }
254 }
void showTrackerBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:251
const FWGeometry * m_geom
TEveElementList * m_trackerBarrelElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:195
void FW3DViewGeometry::showTrackerEndcap ( bool  showTrackerEndcap)

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

259 {
261  {
262  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
263  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
264  for( std::vector<unsigned int>::const_iterator id = ids.begin();
265  id != ids.end(); ++id )
266  {
267  TEveGeoShape* shape = m_geom->getEveShape( *id );
269  m_trackerEndcapElements->AddElement( shape );
270  }
272  for( std::vector<unsigned int>::const_iterator id = ids.begin();
273  id != ids.end(); ++id )
274  {
275  TEveGeoShape* shape = m_geom->getEveShape( *id );
277  m_trackerEndcapElements->AddElement( shape );
278  }
279  AddElement( m_trackerEndcapElements );
280  }
281 
283  {
285  gEve->Redraw3D();
286  }
287 }
void showTrackerEndcap(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:251
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:195

Member Data Documentation

TEveElementList* FW3DViewGeometry::m_muonBarrelElements
private

Definition at line 57 of file FW3DViewGeometry.h.

Referenced by showMuonBarrel().

TEveElementList* FW3DViewGeometry::m_muonEndcapElements
private

Definition at line 58 of file FW3DViewGeometry.h.

Referenced by showMuonEndcap().

TEveElementList* FW3DViewGeometry::m_pixelBarrelElements
private

Definition at line 59 of file FW3DViewGeometry.h.

Referenced by showPixelBarrel().

TEveElementList* FW3DViewGeometry::m_pixelEndcapElements
private

Definition at line 60 of file FW3DViewGeometry.h.

Referenced by showPixelEndcap().

TEveElementList* FW3DViewGeometry::m_trackerBarrelElements
private

Definition at line 61 of file FW3DViewGeometry.h.

Referenced by showTrackerBarrel().

TEveElementList* FW3DViewGeometry::m_trackerEndcapElements
private

Definition at line 62 of file FW3DViewGeometry.h.

Referenced by showTrackerEndcap().