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 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_muonEndcapFullElements
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
TEveElementList * m_muonBarrelFullElements
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(), errorMatrix2Lands_multiChannel::id, kFWMuonBarrelLineColorIndex, FWViewGeometryList::m_geom, m_muonBarrelElements, and alignCSCRings::s.

Referenced by FW3DViewBase::showMuonBarrel().

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
void FW3DViewGeometry::showMuonBarrelFull ( bool  showMuonBarrel)

Definition at line 117 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

118 {
120  {
121  m_muonBarrelFullElements = new TEveElementList( "DT Full" );
122  for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
123  {
124  TEveElementList* cWheel = new TEveElementList(TString::Format("Wheel %d", iWheel));
125  m_muonBarrelFullElements->AddElement(cWheel);
126  for (Int_t iStation = 1; iStation <= 4; ++iStation)
127  {
128  TEveElementList* cStation = new TEveElementList(TString::Format("Station %d", iStation));
129  cWheel->AddElement(cStation);
130  for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
131  {
132  if( iStation < 4 && iSector > 12 ) continue;
133  DTChamberId id( iWheel, iStation, iSector );
134  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
135  shape->SetTitle(TString::Format("DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
136  iWheel, iStation, iSector, id.rawId()));
138  cStation->AddElement(shape);
139  }
140  }
141  }
142  AddElement(m_muonBarrelFullElements);
143  }
144 
146  {
148  gEve->Redraw3D();
149  }
150 }
void showMuonBarrel(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_muonBarrelFullElements
void FW3DViewGeometry::showMuonEndcap ( bool  showMuonEndcap)

Definition at line 154 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

155 {
157  {
158  m_muonEndcapElements = new TEveElementList( "CSC" );
159  for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
160  {
161  TEveElementList* cEndcap = 0;
162  if( iEndcap == 1 )
163  cEndcap = new TEveElementList( "Forward" );
164  else
165  cEndcap = new TEveElementList( "Backward" );
166  m_muonEndcapElements->AddElement( cEndcap );
167  // Actual CSC geometry:
168  // Station 1 has 4 rings with 36 chambers in each
169  // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
170  // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
171  // Station 4: ring 1 has 18 chambers
172  Int_t maxChambers = 36;
173  for( Int_t iStation = 1; iStation <= 4; ++iStation )
174  {
175  std::ostringstream s; s << "Station" << iStation;
176  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
177  cEndcap->AddElement( cStation );
178  for( Int_t iRing = 1; iRing <= 4; ++iRing )
179  {
180  if( iStation > 1 && iRing > 2 ) continue;
181  if( iStation > 3 && iRing > 1 ) continue;
182  std::ostringstream s; s << "Ring" << iRing;
183  TEveElementList* cRing = new TEveElementList( s.str().c_str() );
184  cStation->AddElement( cRing );
185  ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
186  for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
187  {
188  Int_t iLayer = 0; // chamber
189  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
190  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
191  shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
192  cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
193 
195  cRing->AddElement( shape );
196  }
197  }
198  }
199  }
200  AddElement( m_muonEndcapElements );
201  }
202 
204  {
205  m_muonEndcapElements->SetRnrState( showMuonEndcap );
206  gEve->Redraw3D();
207  }
208 }
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
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

Definition at line 212 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

213 {
215  {
216  m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
217  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
218  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
219  for( std::vector<unsigned int>::const_iterator id = ids.begin();
220  id != ids.end(); ++id )
221  {
222  TEveGeoShape* shape = m_geom->getEveShape( *id );
223  shape->SetTitle(Form("PixelBarrel %d",*id));
225  m_pixelBarrelElements->AddElement( shape );
226  }
227  AddElement( m_pixelBarrelElements );
228  }
229 
231  {
232  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
233  gEve->Redraw3D();
234  }
235 }
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 239 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

240 {
242  {
243  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
244  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
245  for( std::vector<unsigned int>::const_iterator id = ids.begin();
246  id != ids.end(); ++id )
247  {
248  TEveGeoShape* shape = m_geom->getEveShape( *id );
249 
250  shape->SetTitle(Form("PixelEndCap %d",*id));
252  m_pixelEndcapElements->AddElement( shape );
253  }
254  AddElement( m_pixelEndcapElements );
255  }
256 
258  {
259  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
260  gEve->Redraw3D();
261  }
262 }
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 266 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

267 {
269  {
270  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
272  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
273  for( std::vector<unsigned int>::const_iterator id = ids.begin();
274  id != ids.end(); ++id )
275  {
276  TEveGeoShape* shape = m_geom->getEveShape( *id );
278  m_trackerBarrelElements->AddElement( shape );
279  }
281  for( std::vector<unsigned int>::const_iterator id = ids.begin();
282  id != ids.end(); ++id )
283  {
284  TEveGeoShape* shape = m_geom->getEveShape( *id );
285 
286  shape->SetTitle(Form("TrackerBarrel %d",*id));
288  m_trackerBarrelElements->AddElement( shape );
289  }
290  AddElement( m_trackerBarrelElements );
291  }
292 
294  {
296  gEve->Redraw3D();
297  }
298 }
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 302 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

303 {
305  {
306  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
307  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
308  for( std::vector<unsigned int>::const_iterator id = ids.begin();
309  id != ids.end(); ++id )
310  {
311  TEveGeoShape* shape = m_geom->getEveShape( *id );
313  m_trackerEndcapElements->AddElement( shape );
314  }
316  for( std::vector<unsigned int>::const_iterator id = ids.begin();
317  id != ids.end(); ++id )
318  {
319  TEveGeoShape* shape = m_geom->getEveShape( *id );
320 
321  shape->SetTitle(Form("TrackerEndcap %d",*id));
323  m_trackerEndcapElements->AddElement( shape );
324  }
325  AddElement( m_trackerEndcapElements );
326  }
327 
329  {
331  gEve->Redraw3D();
332  }
333 }
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 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().