Reimplemented from FWProxyBuilderBase.
Definition at line 73 of file FWDTDigiProxyBuilder.cc.
References FWGeometry::contains(), FWProxyBuilderBase::createCompound(), FWGeometry::find(), fwLog, relativeConstraints::geom, FWEventItem::get(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWViewType::k3D, FWViewType::kISpy, FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, fwlog::kWarning, FWGeometry::localToGlobal(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), DTSuperLayerId::superLayer(), and DTLayerId::superlayerId().
{
const DTDigiCollection* digis = 0;
iItem->get( digis );
if( ! digis )
{
return;
}
const FWGeometry *geom = iItem->getGeom();
for( DTDigiCollection::DigiRangeIterator det = digis->begin(), detEnd = digis->end(); det != detEnd; ++det )
{
const DTLayerId& layerId = (*det).first;
unsigned int rawid = layerId.rawId();
const DTDigiCollection::Range &range = (*det).second;
if( ! geom->contains( rawid ))
{
fwLog( fwlog::kWarning ) << "failed to get geometry of DT with detid: "
<< rawid << std::endl;
TEveCompound* compound = createCompound();
setupAddElement( compound, product );
continue;
}
const float* pars = geom->getParameters( rawid );
FWGeometry::IdToInfoItr det = geom->find( rawid );
int superLayer = layerId.superlayerId().superLayer();
float localPos[3] = { 0.0, 0.0, 0.0 };
for( DTDigiCollection::const_iterator it = range.first;
it != range.second; ++it )
{
float firstChannel = pars[3];
float nChannels = pars[5];
localPos[0] = ((*it).wire() - ( firstChannel - 1 ) - 0.5 ) * pars[0] - nChannels / 2.0 * pars[0];
if( type == FWViewType::k3D || type == FWViewType::kISpy )
{
TEveBox* box = new TEveBox;
setupAddElement( box, product );
addTube( box, *det, localPos, pars );
}
else if(( ( type == FWViewType::kRhoPhi || type == FWViewType::kRhoPhiPF ) && superLayer != 2 ) ||
( type == FWViewType::kRhoZ && superLayer == 2 ))
{
TEvePointSet* pointSet = new TEvePointSet;
pointSet->SetMarkerStyle( 24 );
setupAddElement( pointSet, product);
float globalPos[3];
geom->localToGlobal( *det, localPos, globalPos );
pointSet->SetNextPoint( globalPos[0], globalPos[1], globalPos[2] );
TEveBox* box = new TEveBox;
setupAddElement( box, product );
addTube( box, *det, localPos, pars );
}
else
{
TEveCompound* compound = createCompound();
setupAddElement( compound, product );
}
}
}
}