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
FWHBHERecHitProxyBuilder Class Reference
Inheritance diagram for FWHBHERecHitProxyBuilder:
FWDigitSetProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHBHERecHitProxyBuilder (void)
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual ~FWHBHERecHitProxyBuilder (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 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 *)
 
 FWHBHERecHitProxyBuilder (const FWHBHERecHitProxyBuilder &)
 
const FWHBHERecHitProxyBuilderoperator= (const FWHBHERecHitProxyBuilder &)
 

Private Attributes

Float_t m_maxEnergy
 
bool m_plotEt
 

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 bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 12 of file FWHBHERecHitProxyBuilder.cc.

Constructor & Destructor Documentation

FWHBHERecHitProxyBuilder::FWHBHERecHitProxyBuilder ( void  )
inline

Definition at line 15 of file FWHBHERecHitProxyBuilder.cc.

virtual FWHBHERecHitProxyBuilder::~FWHBHERecHitProxyBuilder ( void  )
inlinevirtual

Definition at line 19 of file FWHBHERecHitProxyBuilder.cc.

20  {}
FWHBHERecHitProxyBuilder::FWHBHERecHitProxyBuilder ( const FWHBHERecHitProxyBuilder )
private

Member Function Documentation

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

Reimplemented from FWProxyBuilderBase.

Definition at line 84 of file FWHBHERecHitProxyBuilder.cc.

References FWDigitSetProxyBuilder::addBox(), FWDigitSetProxyBuilder::addBoxSetToProduct(), edm::SortedCollection< T, SORT >::begin(), runEdmFileComparison::collection, FWProxyBuilderBase::context(), FWEventItem::ModelInfo::displayProperties(), edm::SortedCollection< T, SORT >::end(), fireworks::energyScaledBox3DCorners(), fireworks::etScaledBox3DCorners(), FWEventItem::get(), FWGeometry::getCorners(), FWViewContext::getEnergyScale(), fireworks::Context::getGeom(), FWViewEnergyScale::getPlotEt(), getHLTprescales::index, m_maxEnergy, m_plotEt, and FWEventItem::modelInfo().

85 {
87 
89  iItem->get( collection );
90 
91  if( 0 == collection )
92  {
93  return;
94  }
95  std::vector<HBHERecHit>::const_iterator it = collection->begin();
96  std::vector<HBHERecHit>::const_iterator itEnd = collection->end();
97  std::vector<float> scaledCorners(24);
98 
99  for( ; it != itEnd; ++it )
100  {
101  if(( *it ).energy() > m_maxEnergy )
102  m_maxEnergy = ( *it ).energy();
103  }
104 
105  TEveBoxSet* boxSet = addBoxSetToProduct(product);
106  int index = 0;
107  for (std::vector<HBHERecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
108  {
109  const float* corners = context().getGeom()->getCorners((*it).detid());
110  if (corners)
111  {
112  if (m_plotEt)
113  fireworks::etScaledBox3DCorners(corners, (*it).energy(), m_maxEnergy, scaledCorners, true);
114  else
115  fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);
116  }
117  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
118  }
119 }
const fireworks::Context & context() const
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
const FWGeometry * getGeom() const
Definition: Context.h:84
void get(const T *&oData) const
Definition: FWEventItem.h:84
FWViewEnergyScale * getEnergyScale() const
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)
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
void etScaledBox3DCorners(const float *corners, float energy, float maxEnergy, std::vector< float > &scaledCorners, bool reflect=false)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const_iterator begin() const
bool getPlotEt() const
virtual bool FWHBHERecHitProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 22 of file FWHBHERecHitProxyBuilder.cc.

22 { return true; }
const FWHBHERecHitProxyBuilder& FWHBHERecHitProxyBuilder::operator= ( const FWHBHERecHitProxyBuilder )
private
FWHBHERecHitProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
void FWHBHERecHitProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 38 of file FWHBHERecHitProxyBuilder.cc.

References b, edm::SortedCollection< T, SORT >::begin(), runEdmFileComparison::collection, edm::SortedCollection< T, SORT >::end(), fireworks::energyScaledBox3DCorners(), fireworks::etScaledBox3DCorners(), FWDigitSetProxyBuilder::BFreeBox_t::fVertices, FWEventItem::get(), FWDigitSetProxyBuilder::getBoxSet(), FWGeometry::getCorners(), FWViewContext::getEnergyScale(), FWEventItem::getGeom(), FWViewEnergyScale::getPlotEt(), getHLTprescales::index, FWProxyBuilderBase::item(), m_maxEnergy, and m_plotEt.

39 {
40  if (m_plotEt != vc->getEnergyScale()->getPlotEt() )
41  {
42  m_plotEt = !m_plotEt;
43 
45  item()->get( collection );
46  if (! collection)
47  return;
48 
49  int index = 0;
50  std::vector<float> scaledCorners(24);
51  for (std::vector<HBHERecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it, ++index)
52  {
53  const float* corners = item()->getGeom()->getCorners((*it).detid());
54  if (corners == 0)
55  continue;
57 
58  /*
59  printf("--------------------scale product \n");
60  for (int i = 0; i < 8 ; ++i)
61  printf("[%f %f %f ]\n",b->fVertices[i][0], b->fVertices[i][1],b->fVertices[i][2] );
62  */
63 
64  if (m_plotEt)
65  fireworks::etScaledBox3DCorners(corners, (*it).energy(), m_maxEnergy, scaledCorners, true);
66  else
67  fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);
68 
69  /*
70  printf("after \n");
71  for (int i = 0; i < 8 ; ++i)
72  printf("[%f %f %f ]\n",b->fVertices[i][0], b->fVertices[i][1],b->fVertices[i][2] );
73  */
74  memcpy(b->fVertices, &scaledCorners[0], sizeof(b->fVertices));
75 
76  }
77  getBoxSet()->ElementChanged();
78  }
79 }
void get(const T *&oData) const
Definition: FWEventItem.h:84
FWViewEnergyScale * getEnergyScale() const
TEveBoxSet * getBoxSet() const
const FWEventItem * item() const
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)
double b
Definition: hdecay.h:120
void etScaledBox3DCorners(const float *corners, float energy, float maxEnergy, std::vector< float > &scaledCorners, bool reflect=false)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:687
const_iterator begin() const
bool getPlotEt() const

Member Data Documentation

Float_t FWHBHERecHitProxyBuilder::m_maxEnergy
private

Definition at line 30 of file FWHBHERecHitProxyBuilder.cc.

Referenced by build(), and scaleProduct().

bool FWHBHERecHitProxyBuilder::m_plotEt
private

Definition at line 31 of file FWHBHERecHitProxyBuilder.cc.

Referenced by build(), and scaleProduct().