CMS 3D CMS Logo

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)
 
 ~FW3DViewGeometry () override
 
- Public Member Functions inherited from FWViewGeometryList
 FWViewGeometryList (const fireworks::Context &context, bool projected=true)
 
void updateColors ()
 
void updateTransparency (bool projectedType)
 
 ~FWViewGeometryList () override
 

Private Member Functions

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

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

44  :
45  FWViewGeometryList(context, false),
48  m_pixelBarrelElements(nullptr),
49  m_pixelEndcapElements(nullptr),
50  m_trackerBarrelElements(nullptr),
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 ( )
override

Definition at line 62 of file FW3DViewGeometry.cc.

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

Member Function Documentation

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

Definition at line 80 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), triggerObjects_cff::id, 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:270
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(), triggerObjects_cff::id, 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:270
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(), FWGeometry::VersionInfo::haveExtraDet(), triggerObjects_cff::id, kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_muonEndcapElements, GEMDetId::maxLayerId, ME0DetId::maxRegionId, GEMDetId::maxRegionId, GEMDetId::maxStationId, GEMDetId::minLayerId, ME0DetId::minRegionId, GEMDetId::minRegionId, GEMDetId::minRollId, GEMDetId::minStationId, alignCSCRings::s, and FWGeometry::versionInfo().

Referenced by FW3DViewBase::setContext().

157 {
159  {
160  m_muonEndcapElements = new TEveElementList( "EndCap" );
161 
162  for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
163  {
164  TEveElementList* cEndcap = nullptr;
165  if( iEndcap == 1 )
166  cEndcap = new TEveElementList( "CSC Forward" );
167  else
168  cEndcap = new TEveElementList( "CSC Backward" );
169  m_muonEndcapElements->AddElement( cEndcap );
170  // Actual CSC geometry:
171  // Station 1 has 4 rings with 36 chambers in each
172  // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
173  // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
174  // Station 4: ring 1 has 18 chambers
175  Int_t maxChambers = 36;
176  for( Int_t iStation = 1; iStation <= 4; ++iStation )
177  {
178  std::ostringstream s; s << "Station" << iStation;
179  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
180  cEndcap->AddElement( cStation );
181  for( Int_t iRing = 1; iRing <= 4; ++iRing )
182  {
183  if( iStation > 1 && iRing > 2 ) continue;
184  // if( iStation > 3 && iRing > 1 ) continue;
185  std::ostringstream s; s << "Ring" << iRing;
186  TEveElementList* cRing = new TEveElementList( s.str().c_str() );
187  cStation->AddElement( cRing );
188  ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
189  for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
190  {
191  Int_t iLayer = 0; // chamber
192  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
193  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
194  shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
195  cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
196 
198  cRing->AddElement( shape );
199  }
200  }
201  }
202  }
203  // hardcoded gem and me0; need to find better way for different gem geometries
204  for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
205  TEveElementList* teEndcap = nullptr;
206  if( iRegion == 1 )
207  teEndcap = new TEveElementList( "GEM Forward" );
208  else
209  teEndcap = new TEveElementList( "GEM Backward" );
210  m_muonEndcapElements->AddElement( teEndcap );
211 
212  int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? GEMDetId::maxStationId :1;
213 
214  for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
215  std::ostringstream s; s << "Station" << iStation;
216  TEveElementList* cStation = new TEveElementList( s.str().c_str() );
217  teEndcap->AddElement( cStation );
218 
219  Int_t iRing = 1;
220  for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
221  int maxChamber = 36;
222  if (iStation >= 2) maxChamber = 18;
223 
224  for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
225  int maxRoll = iChamber%2 ? 9:10;
226  if (iStation == 2) maxRoll = 8;
227  if (iStation == 3) maxRoll = 12;
228 
229  for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
230  GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
231  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
232  if (shape){
233  shape->SetTitle(TString::Format("GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
234  iRing, iStation, iChamber, iRoll, id.rawId()));
235 
236  cStation->AddElement( shape );
238  }
239  }
240  }
241  }
242  }
243  }
244 
245  // adding me0
246  if (m_geom->versionInfo().haveExtraDet("ME0") ){
247  for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
248  TEveElementList* teEndcap = nullptr;
249  if( iRegion == 1 )
250  teEndcap = new TEveElementList( "ME0 Forward" );
251  else
252  teEndcap = new TEveElementList( "ME0 Backward" );
253  m_muonEndcapElements->AddElement( teEndcap );
254 
255  for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
256  std::ostringstream s; s << "Layer" << iLayer;
257  TEveElementList* cLayer = new TEveElementList( s.str().c_str() );
258  teEndcap->AddElement( cLayer );
259 
260  for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
261  Int_t iRoll = 1;
262  // for (Int_t iRoll = ME0DetId::minRollId; iRoll <= ME0DetId::maxRollId ; ++iRoll ){
263  ME0DetId id( iRegion, iLayer, iChamber, iRoll );
264  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
265  if (shape){
266  shape->SetTitle(TString::Format("ME0: , Ch=%d Rl=%d\ndet-id=%u",
267  iChamber, iRoll, id.rawId()));
268 
270  cLayer->AddElement( shape );
271  }
272  }
273  }
274  }
275  }
276 
277  AddElement( m_muonEndcapElements );
278  }
279 
281  {
282  m_muonEndcapElements->SetRnrState( showMuonEndcap );
283  gEve->Redraw3D();
284  }
285 }
static const int minRegionId
Definition: GEMDetId.h:94
static const int maxRegionId
Definition: ME0DetId.h:87
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:123
static const int maxLayerId
Definition: GEMDetId.h:108
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:396
void showMuonEndcap(bool)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
TEveElementList * m_muonEndcapElements
static const int minRollId
Definition: GEMDetId.h:110
const FWGeometry * m_geom
static const int maxStationId
Definition: GEMDetId.h:101
static const int minStationId
Definition: GEMDetId.h:100
static const int minLayerId
Definition: GEMDetId.h:107
static const int maxRegionId
Definition: GEMDetId.h:95
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

Definition at line 289 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), FWGeometry::getTrackerTopology(), triggerObjects_cff::id, electrons_cff::ids, kFWPixelBarrelColorIndex, FWViewGeometryList::m_geom, m_pixelBarrelElements, FWGeometry::PixelBarrel, TrackerTopology::print(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

290 {
292  {
293  m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
294  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
295  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
296  for( std::vector<unsigned int>::const_iterator id = ids.begin();
297  id != ids.end(); ++id )
298  {
299  TEveGeoShape* shape = m_geom->getEveShape( *id );
300 
301  uint32_t rawId = *id;
302  DetId did = DetId(rawId);
304  shape->SetTitle( title.c_str());
305 
307  m_pixelBarrelElements->AddElement( shape );
308  }
309  AddElement( m_pixelBarrelElements );
310  }
311 
313  {
314  m_pixelBarrelElements->SetRnrState( showPixelBarrel );
315  gEve->Redraw3D();
316  }
317 }
TEveElementList * m_pixelBarrelElements
std::string print(DetId detid) const
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
const FWGeometry * m_geom
Definition: DetId.h:18
void showPixelBarrel(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
const TrackerTopology * getTrackerTopology() const
Definition: FWGeometry.h:129
void FW3DViewGeometry::showPixelEndcap ( bool  showPixelEndcap)

Definition at line 321 of file FW3DViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), FWGeometry::getTrackerTopology(), triggerObjects_cff::id, electrons_cff::ids, kFWPixelEndcapColorIndex, FWViewGeometryList::m_geom, m_pixelEndcapElements, FWGeometry::PixelEndcap, TrackerTopology::print(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and FWGeometry::Tracker.

Referenced by FW3DViewBase::setContext().

322 {
324  {
325  m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
326  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
327  for( std::vector<unsigned int>::const_iterator id = ids.begin();
328  id != ids.end(); ++id )
329  {
330  TEveGeoShape* shape = m_geom->getEveShape( *id );
331  uint32_t rawId = *id;
332  DetId did = DetId(rawId);
334  shape->SetTitle( title.c_str());
336  m_pixelEndcapElements->AddElement( shape );
337  }
338  AddElement( m_pixelEndcapElements );
339  }
340 
342  {
343  m_pixelEndcapElements->SetRnrState( showPixelEndcap );
344  gEve->Redraw3D();
345  }
346 }
std::string print(DetId detid) const
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveElementList * m_pixelEndcapElements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
const FWGeometry * m_geom
Definition: DetId.h:18
void showPixelEndcap(bool)
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
const TrackerTopology * getTrackerTopology() const
Definition: FWGeometry.h:129
void FW3DViewGeometry::showTrackerBarrel ( bool  showTrackerBarrel)

Definition at line 350 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

351 {
353  {
354  m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
356  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
357  for( std::vector<unsigned int>::const_iterator id = ids.begin();
358  id != ids.end(); ++id )
359  {
360  TEveGeoShape* shape = m_geom->getEveShape( *id );
362  m_trackerBarrelElements->AddElement( shape );
363  }
365  for( std::vector<unsigned int>::const_iterator id = ids.begin();
366  id != ids.end(); ++id )
367  {
368  TEveGeoShape* shape = m_geom->getEveShape( *id );
369  shape->SetTitle(Form("TrackerBarrel %d",*id));
371  m_trackerBarrelElements->AddElement( shape );
372  }
373  AddElement( m_trackerBarrelElements );
374  }
375 
377  {
379  gEve->Redraw3D();
380  }
381 }
void showTrackerBarrel(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
const FWGeometry * m_geom
TEveElementList * m_trackerBarrelElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
void FW3DViewGeometry::showTrackerEndcap ( bool  showTrackerEndcap)

Definition at line 385 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

386 {
388  {
389  m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
390  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
391  for( std::vector<unsigned int>::const_iterator id = ids.begin();
392  id != ids.end(); ++id )
393  {
394  TEveGeoShape* shape = m_geom->getEveShape( *id );
396  m_trackerEndcapElements->AddElement( shape );
397  }
399  for( std::vector<unsigned int>::const_iterator id = ids.begin();
400  id != ids.end(); ++id )
401  {
402  TEveGeoShape* shape = m_geom->getEveShape( *id );
403 
404  shape->SetTitle(Form("TrackerEndcap %d",*id));
406  m_trackerEndcapElements->AddElement( shape );
407  }
408  AddElement( m_trackerEndcapElements );
409  }
410 
412  {
414  gEve->Redraw3D();
415  }
416 }
void showTrackerEndcap(bool)
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214

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().