CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWHORecHitProxyBuilder Class Reference

Inheritance diagram for FWHORecHitProxyBuilder:
FWDigitSetProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

 FWHORecHitProxyBuilder (void)
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWHORecHitProxyBuilder (void)

Private Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 FWHORecHitProxyBuilder (const FWHORecHitProxyBuilder &)
const FWHORecHitProxyBuilderoperator= (const FWHORecHitProxyBuilder &)

Private Attributes

Float_t m_maxEnergy

Detailed Description

Definition at line 9 of file FWHORecHitProxyBuilder.cc.


Constructor & Destructor Documentation

FWHORecHitProxyBuilder::FWHORecHitProxyBuilder ( void  ) [inline]

Definition at line 12 of file FWHORecHitProxyBuilder.cc.

     : m_maxEnergy( 1.0 )
    {}
virtual FWHORecHitProxyBuilder::~FWHORecHitProxyBuilder ( void  ) [inline, virtual]

Definition at line 16 of file FWHORecHitProxyBuilder.cc.

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

Member Function Documentation

void FWHORecHitProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
) [private, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 31 of file FWHORecHitProxyBuilder.cc.

References FWDigitSetProxyBuilder::addBox(), FWDigitSetProxyBuilder::addBoxSetToProduct(), edm::SortedCollection< T, SORT >::begin(), runEdmFileComparison::collection, edm::SortedCollection< T, SORT >::end(), fireworks::energyScaledBox3DCorners(), FWEventItem::get(), FWGeometry::getCorners(), FWEventItem::getGeom(), getHLTprescales::index, FWProxyBuilderBase::item(), m_maxEnergy, and FWEventItem::modelInfo().

{
   const HORecHitCollection* collection = 0;
   iItem->get( collection );

   if( 0 == collection )
   {
      return;
   }
   std::vector<HORecHit>::const_iterator it = collection->begin();
   std::vector<HORecHit>::const_iterator itEnd = collection->end();
   for( ; it != itEnd; ++it )
   {
      if(( *it ).energy() > m_maxEnergy)
         m_maxEnergy = ( *it ).energy();
   }

   TEveBoxSet* boxSet = addBoxSetToProduct(product);
   int index = 0;
   for (std::vector<HORecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
   {  
      const float* corners = item()->getGeom()->getCorners((*it).detid());
      std::vector<float> scaledCorners(24);
      if (corners)
         fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);

      addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
   }
}
const FWHORecHitProxyBuilder& FWHORecHitProxyBuilder::operator= ( const FWHORecHitProxyBuilder ) [private]
FWHORecHitProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )

Member Data Documentation

Definition at line 24 of file FWHORecHitProxyBuilder.cc.

Referenced by build().