CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWPSimHitProxyBuilder Class Reference

Inheritance diagram for FWPSimHitProxyBuilder:
FWSimpleProxyBuilderTemplate< PSimHit > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

 FWPSimHitProxyBuilder (void)
virtual bool haveSingleProduct () const override
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWPSimHitProxyBuilder (void)

Private Member Functions

void buildViewType (const PSimHit &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
 FWPSimHitProxyBuilder (const FWPSimHitProxyBuilder &)
const FWPSimHitProxyBuilderoperator= (const FWPSimHitProxyBuilder &)

Detailed Description

Definition at line 18 of file FWPSimHitProxyBuilder.cc.


Constructor & Destructor Documentation

FWPSimHitProxyBuilder::FWPSimHitProxyBuilder ( void  ) [inline]

Definition at line 21 of file FWPSimHitProxyBuilder.cc.

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

Definition at line 22 of file FWPSimHitProxyBuilder.cc.

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

Member Function Documentation

void FWPSimHitProxyBuilder::buildViewType ( const PSimHit iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext  
) [override, private, virtual]

Reimplemented from FWSimpleProxyBuilderTemplate< PSimHit >.

Definition at line 38 of file FWPSimHitProxyBuilder.cc.

References abs, FWGeometry::contains(), PSimHit::detUnitId(), fwLog, relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, FWViewType::kRhoZ, DTWireId::layerId(), PSimHit::localPosition(), FWGeometry::localToGlobal(), DetId::Muon, PSimHit::particleType(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), DTSuperLayerId::superLayer(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

{
   TEvePointSet* pointSet = new TEvePointSet;
   setupAddElement( pointSet, &oItemHolder );
   const FWGeometry *geom = item()->getGeom();
   unsigned int rawid = iData.detUnitId();
   if( ! geom->contains( rawid ))
   {
      fwLog( fwlog::kError )
        << "failed to get geometry of detid: " 
        << rawid << std::endl;
      return;
   }
   
   float local[3] = { iData.localPosition().x(), iData.localPosition().y(), iData.localPosition().z() };
   float global[3];

   // Specialized for DT simhits
   DetId id(rawid);
   if (id.det()==DetId::Muon && id.subdetId()==1) {   
     DTWireId wId(rawid);
     rawid = wId.layerId().rawId(); // DT simhits are in the RF of the DTLayer, but their ID is the id of the wire!
     if (abs(iData.particleType())!=13){
       pointSet->SetMarkerStyle(26); // Draw non-muon simhits (e.g. delta rays) with a different marker
     } 
     if (type == FWViewType::kRhoZ) { // 
       // In RhoZ view, draw hits at the middle of the layer in the global Z coordinate, 
       // otherwise they won't align with 1D rechits, for which only one coordinate is known.
       if (wId.superLayer()==2) {
         local[1]=0;
       } else {
         local[0]=0;
       }
     }
   }

   geom->localToGlobal( rawid, local, global );
   pointSet->SetNextPoint( global[0], global[1], global[2] );
}
virtual bool FWPSimHitProxyBuilder::haveSingleProduct ( void  ) const [inline, override, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 24 of file FWPSimHitProxyBuilder.cc.

{ return false; }
const FWPSimHitProxyBuilder& FWPSimHitProxyBuilder::operator= ( const FWPSimHitProxyBuilder ) [private]
FWPSimHitProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )