Reimplemented from FWSimpleProxyBuilderTemplate< DTRecHit1DPair >.
Definition at line 42 of file FWDTRecHitProxyBuilder.cc.
References DTRecHit1DPair::componentRecHit(), FWGeometry::contains(), fwLog, relativeConstraints::geom, FWViewType::k3D, fwlog::kError, FWViewType::kISpy, FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, DTWireId::layerId(), DTEnums::Left, DTRecHit1D::localPosition(), FWGeometry::localToGlobal(), DTEnums::Right, fireworks::setupAddElement(), DTSuperLayerId::superLayer(), DTLayerId::superlayerId(), DTRecHit1DPair::wireId(), and PV3DBase< T, PVType, FrameType >::x().
{
const DTLayerId& layerId = iData.wireId().layerId();
int superLayer = layerId.superlayerId().superLayer();
const FWGeometry *geom = item()->getGeom();
if( ! geom->contains( layerId ))
{
fwLog( fwlog::kError ) << "failed get geometry of DT layer with detid: "
<< layerId << std::endl;
return;
}
TEveStraightLineSet* recHitSet = new TEveStraightLineSet;
setupAddElement( recHitSet, &oItemHolder );
TEvePointSet* pointSet = new TEvePointSet;
setupAddElement( pointSet, &oItemHolder );
const DTRecHit1D* leftRecHit = iData.componentRecHit( Left );
const DTRecHit1D* rightRecHit = iData.componentRecHit( Right );
float lLocalPos[3] = { leftRecHit->localPosition().x(), 0.0, 0.0 };
float rLocalPos[3] = { rightRecHit->localPosition().x(), 0.0, 0.0 };
if(( (type == FWViewType::kRhoPhi || type == FWViewType::kRhoPhiPF) && superLayer != 2 ) ||
( type == FWViewType::kRhoZ && superLayer == 2 ) ||
type == FWViewType::k3D ||
type == FWViewType::kISpy )
{
float leftGlobalPoint[3];
float rightGlobalPoint[3];
geom->localToGlobal( layerId, lLocalPos, leftGlobalPoint, rLocalPos, rightGlobalPoint );
pointSet->SetNextPoint( leftGlobalPoint[0], leftGlobalPoint[1], leftGlobalPoint[2] );
pointSet->SetNextPoint( rightGlobalPoint[0], rightGlobalPoint[1], rightGlobalPoint[2] );
recHitSet->AddLine( leftGlobalPoint[0], leftGlobalPoint[1], leftGlobalPoint[2],
rightGlobalPoint[0], rightGlobalPoint[1], rightGlobalPoint[2] );
}
}