Reimplemented from FWSimpleProxyBuilderTemplate< RPCRecHit >.
Definition at line 48 of file FWRPCRecHitProxyBuilder.cc.
References FWGeometry::contains(), FWGeometry::find(), fwLog, relativeConstraints::geom, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), FWViewType::k3D, fwlog::kError, FWViewType::kISpy, RPCRecHit::localPosition(), RPCRecHit::localPositionError(), FWGeometry::localToGlobal(), DetId::rawId(), RPCRecHit::rpcId(), FWProxyBuilderBase::setupAddElement(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().
{
RPCDetId rpcId = iData.rpcId();
unsigned int rawid = rpcId.rawId();
const FWGeometry *geom = item()->getGeom();
if( ! geom->contains( rawid ))
{
fwLog( fwlog::kError ) << "failed to get geometry of RPC roll with detid: "
<< rawid <<std::endl;
return;
}
TEveStraightLineSet* recHitSet = new TEveStraightLineSet;
recHitSet->SetLineWidth(3);
if( type == FWViewType::k3D || type == FWViewType::kISpy )
{
TEveGeoShape* shape = geom->getEveShape( rawid );
shape->SetMainTransparency( 75 );
shape->SetMainColor( item()->defaultDisplayProperties().color());
recHitSet->AddElement( shape );
}
float localX = iData.localPosition().x();
float localY = iData.localPosition().y();
float localZ = iData.localPosition().z();
float localXerr = sqrt(iData.localPositionError().xx());
float localYerr = sqrt(iData.localPositionError().yy());
float localU1[3] =
{
localX - localXerr, localY, localZ
};
float localU2[3] =
{
localX + localXerr, localY, localZ
};
float localV1[3] =
{
localX, localY - localYerr, localZ
};
float localV2[3] =
{
localX, localY + localYerr, localZ
};
float globalU1[3];
float globalU2[3];
float globalV1[3];
float globalV2[3];
FWGeometry::IdToInfoItr det = geom->find( rawid );
geom->localToGlobal( *det, localU1, globalU1 );
geom->localToGlobal( *det, localU2, globalU2 );
geom->localToGlobal( *det, localV1, globalV1 );
geom->localToGlobal( *det, localV2, globalV2 );
recHitSet->AddLine( globalU1[0], globalU1[1], globalU1[2],
globalU2[0], globalU2[1], globalU2[2] );
recHitSet->AddLine( globalV1[0], globalV1[1], globalV1[2],
globalV2[0], globalV2[1], globalV2[2] );
setupAddElement( recHitSet, &oItemHolder );
}