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

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

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

Member Function Documentation

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

Definition at line 79 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

80 {
82  {
83  m_muonBarrelElements = new TEveElementList( "DT" );
84  for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
85  {
86  for ( Int_t iStation = 1; iStation <= 4; ++iStation )
87  {
88  // We display only the outer chambers to make the event look more
89  // prominent
90  if( iWheel == -2 || iWheel == 2 || iStation == 4 )
91  {
92  std::ostringstream s;
93  s << "Station" << iStation;
94  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
95  m_muonBarrelElements->AddElement( cStation );
96  for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
97  {
98  if( iStation < 4 && iSector > 12 ) continue;
99  DTChamberId id( iWheel, iStation, iSector );
100  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
102  cStation->AddElement( shape );
103  }
104  }
105  }
106  }
107  AddElement( m_muonBarrelElements );
108  }
109 
111  {
112  m_muonBarrelElements->SetRnrState( showMuonBarrel );
113  gEve->Redraw3D();
114  }
115 }
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 118 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

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

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

Referenced by FW3DViewBase::setContext().

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

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

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

248 {
250  {
251  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
252  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
253  for( std::vector<unsigned int>::const_iterator id = ids.begin();
254  id != ids.end(); ++id )
255  {
256  TEveGeoShape* shape = m_geom->getEveShape( *id );
257  PXFDetId idid = PXFDetId( *id );
258  unsigned int side = idid.side();
259  unsigned int disk = idid.disk();
260  unsigned int blade = idid.blade();
261  unsigned int panel = idid.panel();
262  unsigned int module = idid.module();
263 
264  shape->SetTitle( TString::Format( "PixelEndcap %d: Side=%u, Disk=%u, Blade=%u, Panel=%u, Module=%u",
265  *id, side, disk, blade, panel, module ));
266 
268  m_pixelEndcapElements->AddElement( shape );
269  }
270  AddElement( m_pixelEndcapElements );
271  }
272 
274  {
275  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
276  gEve->Redraw3D();
277  }
278 }
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 282 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().

283 {
285  {
286  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
288  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
289  for( std::vector<unsigned int>::const_iterator id = ids.begin();
290  id != ids.end(); ++id )
291  {
292  TEveGeoShape* shape = m_geom->getEveShape( *id );
294  m_trackerBarrelElements->AddElement( shape );
295  }
297  for( std::vector<unsigned int>::const_iterator id = ids.begin();
298  id != ids.end(); ++id )
299  {
300  TEveGeoShape* shape = m_geom->getEveShape( *id );
301  shape->SetTitle(Form("TrackerBarrel %d",*id));
303  m_trackerBarrelElements->AddElement( shape );
304  }
305  AddElement( m_trackerBarrelElements );
306  }
307 
309  {
311  gEve->Redraw3D();
312  }
313 }
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 317 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().

318 {
320  {
321  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
322  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
323  for( std::vector<unsigned int>::const_iterator id = ids.begin();
324  id != ids.end(); ++id )
325  {
326  TEveGeoShape* shape = m_geom->getEveShape( *id );
328  m_trackerEndcapElements->AddElement( shape );
329  }
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 
336  shape->SetTitle(Form("TrackerEndcap %d",*id));
338  m_trackerEndcapElements->AddElement( shape );
339  }
340  AddElement( m_trackerEndcapElements );
341  }
342 
344  {
346  gEve->Redraw3D();
347  }
348 }
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().