Reimplemented from FWProxyBuilderBase.
Definition at line 41 of file FWSiPixelDigiProxyBuilder.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, FWViewType::kAll3DBits, FWViewType::kAllRPZBits, fwlog::kWarning, FWGeometry::localToGlobal(), fireworks::pixelLocalX(), fireworks::pixelLocalY(), REGISTER_FWPROXYBUILDER, and FWProxyBuilderBase::setupAddElement().
{
const edm::DetSetVector<PixelDigi>* digis = 0;
iItem->get( digis );
if( ! digis )
{
return;
}
const FWGeometry *geom = iItem->getGeom();
for( edm::DetSetVector<PixelDigi>::const_iterator it = digis->begin(), end = digis->end();
it != end; ++it )
{
edm::DetSet<PixelDigi> ds = *it;
unsigned int id = ds.id;
const float* pars = geom->getParameters( id );
for( edm::DetSet<PixelDigi>::const_iterator idigi = ds.data.begin(), idigiEnd = ds.data.end();
idigi != idigiEnd; ++idigi )
{
TEvePointSet* pointSet = new TEvePointSet;
pointSet->SetMarkerSize( 2 );
pointSet->SetMarkerStyle( 2 );
setupAddElement( pointSet, product );
if( ! geom->contains( id ))
{
fwLog( fwlog::kWarning )
<< "failed get geometry of SiPixelDigi with detid: "
<< id << std::endl;
}
else
{
float localPoint[3] = {
fireworks::pixelLocalX(( *idigi ).row(), pars[0] ),
fireworks::pixelLocalY(( *idigi ).column(), pars[1] ),
0.0 };
float globalPoint[3];
geom->localToGlobal( id, localPoint, globalPoint );
pointSet->SetNextPoint( globalPoint[0], globalPoint[1], globalPoint[2] );
}
}
}
}