CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWHFRecHitProxyBuilder Class Reference
Inheritance diagram for FWHFRecHitProxyBuilder:
FWDigitSetProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHFRecHitProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWHFRecHitProxyBuilder (void)
 
- Public Member Functions inherited from FWDigitSetProxyBuilder
 FWDigitSetProxyBuilder ()
 
virtual bool willHandleInteraction () const
 
virtual ~FWDigitSetProxyBuilder ()
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setItem (const FWEventItem *iItem)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual ~FWProxyBuilderBase ()
 

Private Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
 FWHFRecHitProxyBuilder (const FWHFRecHitProxyBuilder &)
 
const FWHFRecHitProxyBuilderoperator= (const FWHFRecHitProxyBuilder &)
 

Private Attributes

Float_t m_maxEnergy
 

Additional Inherited Members

- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWDigitSetProxyBuilder
void addBox (TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
 
TEveBoxSet * addBoxSetToProduct (TEveElementList *product)
 
TEveBoxSet * getBoxSet () const
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 10 of file FWHFRecHitProxyBuilder.cc.

Constructor & Destructor Documentation

FWHFRecHitProxyBuilder::FWHFRecHitProxyBuilder ( void  )
inline

Definition at line 13 of file FWHFRecHitProxyBuilder.cc.

14  : m_maxEnergy( 5.0 )
15  {}
virtual FWHFRecHitProxyBuilder::~FWHFRecHitProxyBuilder ( void  )
inlinevirtual

Definition at line 17 of file FWHFRecHitProxyBuilder.cc.

18  {}
FWHFRecHitProxyBuilder::FWHFRecHitProxyBuilder ( const FWHFRecHitProxyBuilder )
private

Member Function Documentation

void FWHFRecHitProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
privatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 32 of file FWHFRecHitProxyBuilder.cc.

References FWDigitSetProxyBuilder::addBox(), FWDigitSetProxyBuilder::addBoxSetToProduct(), edm::SortedCollection< T, SORT >::begin(), runEdmFileComparison::collection, edm::contains(), FWProxyBuilderBase::context(), FWEventItem::ModelInfo::displayProperties(), edm::SortedCollection< T, SORT >::end(), fireworks::energyScaledBox3DCorners(), fwLog, FWEventItem::get(), FWGeometry::getCorners(), fireworks::Context::getGeom(), getHLTprescales::index, fwlog::kInfo, m_maxEnergy, and FWEventItem::modelInfo().

33 {
34  const HFRecHitCollection* collection = 0;
35  iItem->get( collection );
36 
37  if( 0 == collection )
38  {
39  return;
40  }
41 
42  std::vector<HFRecHit>::const_iterator it = collection->begin();
43  std::vector<HFRecHit>::const_iterator itEnd = collection->end();
44  for( ; it != itEnd; ++it )
45  {
46  if(( *it ).energy() > m_maxEnergy )
47  m_maxEnergy = ( *it ).energy();
48  }
49 
50  TEveBoxSet* boxSet = addBoxSetToProduct(product);
51  int index = 0;
52  for (std::vector<HFRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
53  {
54  unsigned int rawid = ( *it ).detid().rawId();
55  if( ! context().getGeom()->contains( rawid ))
56  {
57  fwLog( fwlog::kInfo ) << "FWHFRecHitProxyBuilder cannot get geometry for DetId: "
58  << rawid << ". Ignored.\n";
59  }
60  const float* corners = context().getGeom()->getCorners( rawid );
61 
62  std::vector<float> scaledCorners(24);
63  if (corners)
64  fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);
65 
66  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
67  }
68 }
const fireworks::Context & context() const
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
const FWGeometry * getGeom() const
Definition: Context.h:84
void get(const T *&oData) const
Definition: FWEventItem.h:84
const_iterator end() const
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:278
void energyScaledBox3DCorners(const float *corners, float scale, std::vector< float > &, bool invert=false)
#define fwLog(_level_)
Definition: fwLog.h:51
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const_iterator begin() const
const FWHFRecHitProxyBuilder& FWHFRecHitProxyBuilder::operator= ( const FWHFRecHitProxyBuilder )
private
FWHFRecHitProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )

Member Data Documentation

Float_t FWHFRecHitProxyBuilder::m_maxEnergy
private

Definition at line 25 of file FWHFRecHitProxyBuilder.cc.

Referenced by build().