CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FW3DViewGeometry Class Reference

#include <Fireworks/Core/interface/FW3DViewGeometry.h>

Inheritance diagram for FW3DViewGeometry:
FWViewGeometryList

List of all members.

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

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

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)
FW3DViewGeometry::~FW3DViewGeometry ( ) [virtual]

Definition at line 60 of file FW3DViewGeometry.cc.

{
}
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::showMuonBarrel().

{
   if( !m_muonBarrelElements && showMuonBarrel )
   {
      m_muonBarrelElements = new TEveElementList( "DT" );
      for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
      {
         for ( Int_t iStation = 1; iStation <= 4; ++iStation )
         {
            // We display only the outer chambers to make the event look more
            // prominent
            if( iWheel == -2 || iWheel == 2 || iStation == 4 )
            {
               std::ostringstream s;
               s << "Station" << iStation;
               TEveElementList* cStation  = new TEveElementList( s.str().c_str() );
               m_muonBarrelElements->AddElement( cStation );
               for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
               {
                  if( iStation < 4 && iSector > 12 ) continue;
                  DTChamberId id( iWheel, iStation, iSector );
                  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
                  addToCompound(shape, kFWMuonBarrelLineColorIndex);
                  cStation->AddElement( shape );
               }
            }
         }
      }
      AddElement( m_muonBarrelElements );
   }

   if( m_muonBarrelElements )
   {
      m_muonBarrelElements->SetRnrState( showMuonBarrel );
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showMuonBarrelFull ( bool  showMuonBarrel)

Definition at line 117 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::showMuonBarrel().

{
   if (!m_muonBarrelFullElements && showMuonBarrel)
   {
      m_muonBarrelFullElements = new TEveElementList( "DT Full" );
      for (Int_t iWheel = -2; iWheel <= 2; ++iWheel)
      {
         TEveElementList* cWheel = new TEveElementList(TString::Format("Wheel %d", iWheel));
         m_muonBarrelFullElements->AddElement(cWheel);
         for (Int_t iStation = 1; iStation <= 4; ++iStation)
         {
            TEveElementList* cStation  = new TEveElementList(TString::Format("Station %d", iStation));
            cWheel->AddElement(cStation);
            for (Int_t iSector = 1 ; iSector <= 14; ++iSector)
            {
               if( iStation < 4 && iSector > 12 ) continue;
               DTChamberId id( iWheel, iStation, iSector );
               TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
               shape->SetTitle(TString::Format("DT: W=%d, S=%d, Sec=%d\ndet-id=%u",
                                               iWheel, iStation, iSector, id.rawId()));
               addToCompound(shape, kFWMuonBarrelLineColorIndex);
               cStation->AddElement(shape);
            }
         }
      }
      AddElement(m_muonBarrelFullElements);
   }

   if (m_muonBarrelFullElements)
   {
      m_muonBarrelFullElements->SetRnrState(showMuonBarrel);
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showMuonEndcap ( bool  showMuonEndcap)

Definition at line 154 of file FW3DViewGeometry.cc.

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

Referenced by FW3DViewBase::setContext().

{
   if( showMuonEndcap && !m_muonEndcapElements )
   {
      m_muonEndcapElements = new TEveElementList( "CSC" );
      for( Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap ) // 1=forward (+Z), 2=backward(-Z)
      { 
         TEveElementList* cEndcap = 0;
         if( iEndcap == 1 )
            cEndcap = new TEveElementList( "Forward" );
         else
            cEndcap = new TEveElementList( "Backward" );
         m_muonEndcapElements->AddElement( cEndcap );
         // Actual CSC geometry:
         // Station 1 has 4 rings with 36 chambers in each
         // Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
         // Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
         // Station 4: ring 1 has 18 chambers
         Int_t maxChambers = 36;
         for( Int_t iStation = 1; iStation <= 4; ++iStation )
         {
            std::ostringstream s; s << "Station" << iStation;
            TEveElementList* cStation  = new TEveElementList( s.str().c_str() );
            cEndcap->AddElement( cStation );
            for( Int_t iRing = 1; iRing <= 4; ++iRing )
            {
               if( iStation > 1 && iRing > 2 ) continue;
               if( iStation > 3 && iRing > 1 ) continue;
               std::ostringstream s; s << "Ring" << iRing;
               TEveElementList* cRing  = new TEveElementList( s.str().c_str() );
               cStation->AddElement( cRing );
               ( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
               for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
               {
                  Int_t iLayer = 0; // chamber
                  CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
                  TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
                  shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
                                                  cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
                            
                  addToCompound(shape, kFWMuonEndcapLineColorIndex);
                  cRing->AddElement( shape );
               }
            }
         }
      }
      AddElement( m_muonEndcapElements );
   }

   if( m_muonEndcapElements )
   {
      m_muonEndcapElements->SetRnrState( showMuonEndcap );
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showPixelBarrel ( bool  showPixelBarrel)

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

{
   if( showPixelBarrel && !m_pixelBarrelElements )
   {
      m_pixelBarrelElements = new TEveElementList( "PixelBarrel" );
      m_pixelBarrelElements->SetRnrState( showPixelBarrel );
      std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id );
         shape->SetTitle(Form("PixelBarrel %d",*id));
         addToCompound(shape, kFWPixelBarrelColorIndex);
         m_pixelBarrelElements->AddElement( shape );
      }
      AddElement( m_pixelBarrelElements );
   }

   if( m_pixelBarrelElements )
   {
      m_pixelBarrelElements->SetRnrState( showPixelBarrel );
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showPixelEndcap ( bool  showPixelEndcap)

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

{
   if( showPixelEndcap && ! m_pixelEndcapElements )
   {
      m_pixelEndcapElements = new TEveElementList( "PixelEndcap" );
      std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelEndcap );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id );

         shape->SetTitle(Form("PixelEndCap %d",*id));
         addToCompound(shape, kFWPixelEndcapColorIndex);
         m_pixelEndcapElements->AddElement( shape );
      }
      AddElement( m_pixelEndcapElements );
   }

   if( m_pixelEndcapElements )
   {
      m_pixelEndcapElements->SetRnrState( showPixelEndcap );
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showTrackerBarrel ( bool  showTrackerBarrel)

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

{
   if( showTrackerBarrel && ! m_trackerBarrelElements )
   {
      m_trackerBarrelElements = new TEveElementList( "TrackerBarrel" );
      m_trackerBarrelElements->SetRnrState( showTrackerBarrel );
      std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id ); 
         addToCompound(shape, kFWTrackerBarrelColorIndex);
         m_trackerBarrelElements->AddElement( shape );
      }
      ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TOB );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id );

         shape->SetTitle(Form("TrackerBarrel %d",*id));
         addToCompound(shape, kFWTrackerBarrelColorIndex);
         m_trackerBarrelElements->AddElement( shape );
      }
      AddElement( m_trackerBarrelElements );
   }

   if( m_trackerBarrelElements )
   {
      m_trackerBarrelElements->SetRnrState( showTrackerBarrel );
      gEve->Redraw3D();
   }
}
void FW3DViewGeometry::showTrackerEndcap ( bool  showTrackerEndcap)

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

{
   if( showTrackerEndcap && ! m_trackerEndcapElements )
   {
      m_trackerEndcapElements = new TEveElementList( "TrackerEndcap" );
      std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id );
         addToCompound(shape, kFWTrackerEndcapColorIndex);
         m_trackerEndcapElements->AddElement( shape );
      }
      ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TEC );
      for( std::vector<unsigned int>::const_iterator id = ids.begin();
           id != ids.end(); ++id )
      {
         TEveGeoShape* shape = m_geom->getEveShape( *id );

         shape->SetTitle(Form("TrackerEndcap %d",*id));
         addToCompound(shape, kFWTrackerEndcapColorIndex);
         m_trackerEndcapElements->AddElement( shape );
      }
      AddElement( m_trackerEndcapElements );
   }

   if (m_trackerEndcapElements )
   {
      m_trackerEndcapElements->SetRnrState( showTrackerEndcap );
      gEve->Redraw3D();
   }
}

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