CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWSiStripDigiProxyBuilder Class Reference

Inheritance diagram for FWSiStripDigiProxyBuilder:
FWProxyBuilderBase

List of all members.

Public Member Functions

 FWSiStripDigiProxyBuilder (void)
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWSiStripDigiProxyBuilder (void)

Private Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 FWSiStripDigiProxyBuilder (const FWSiStripDigiProxyBuilder &)
const FWSiStripDigiProxyBuilderoperator= (const FWSiStripDigiProxyBuilder &)

Detailed Description

Definition at line 24 of file FWSiStripDigiProxyBuilder.cc.


Constructor & Destructor Documentation

FWSiStripDigiProxyBuilder::FWSiStripDigiProxyBuilder ( void  ) [inline]

Definition at line 27 of file FWSiStripDigiProxyBuilder.cc.

{}
virtual FWSiStripDigiProxyBuilder::~FWSiStripDigiProxyBuilder ( void  ) [inline, virtual]

Definition at line 28 of file FWSiStripDigiProxyBuilder.cc.

{}
FWSiStripDigiProxyBuilder::FWSiStripDigiProxyBuilder ( const FWSiStripDigiProxyBuilder ) [private]

Member Function Documentation

void FWSiStripDigiProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
) [private, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 39 of file FWSiStripDigiProxyBuilder.cc.

References edm::DetSetVector< T >::begin(), FWGeometry::contains(), edm::DetSet< T >::data, end, edm::DetSetVector< T >::end(), fwLog, relativeConstraints::geom, FWEventItem::get(), FWEventItem::getGeom(), FWGeometry::getParameters(), edm::DetSet< T >::id, fwlog::kWarning, fireworks::localSiStrip(), FWGeometry::localToGlobal(), and FWProxyBuilderBase::setupAddElement().

{
  const edm::DetSetVector<SiStripDigi>* digis = 0;

  iItem->get( digis );

  if( ! digis )
  {
    return;
  }
  const FWGeometry* geom = iItem->getGeom();
   
  for( edm::DetSetVector<SiStripDigi>::const_iterator it = digis->begin(), end = digis->end();
       it != end; ++it )     
  { 
    edm::DetSet<SiStripDigi> ds = *it;
    const uint32_t& id = ds.id;

    const float* pars = geom->getParameters( id );
        
    for( edm::DetSet<SiStripDigi>::const_iterator idigi = ds.data.begin(), idigiEnd = ds.data.end();
         idigi != idigiEnd; ++idigi )        
    {
      TEveStraightLineSet *lineSet = new TEveStraightLineSet;
      setupAddElement( lineSet, product );

      if( ! geom->contains( id ))
      {
        fwLog( fwlog::kWarning ) 
          << "failed get geometry and topology of SiStripDigi with detid: "
          << id << std::endl;
        continue;
      }
      float localTop[3] = { 0.0, 0.0, 0.0 };
      float localBottom[3] = { 0.0, 0.0, 0.0 };

      fireworks::localSiStrip(( *idigi ).strip(), localTop, localBottom, pars, id );

      float globalTop[3];
      float globalBottom[3];
      geom->localToGlobal( id, localTop, globalTop, localBottom, globalBottom );
  
      lineSet->AddLine( globalTop[0], globalTop[1], globalTop[2],
                        globalBottom[0], globalBottom[1], globalBottom[2] );
    } // end of iteration over digis  
  } // end of iteration over the DetSetVector
}
const FWSiStripDigiProxyBuilder& FWSiStripDigiProxyBuilder::operator= ( const FWSiStripDigiProxyBuilder ) [private]
FWSiStripDigiProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )