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
FWCaloRecHitDigitSetProxyBuilder Class Reference

#include <FWCaloRecHitDigitSetProxyBuilder.h>

Inheritance diagram for FWCaloRecHitDigitSetProxyBuilder:
FWDigitSetProxyBuilder FWProxyBuilderBase FWCastorRecHitProxyBuilder FWEcalRecHitProxyBuilder FWHBHERecHitProxyBuilder FWHFRecHitProxyBuilder FWHORecHitProxyBuilder FWZDCRecHitProxyBuilder

Public Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
 FWCaloRecHitDigitSetProxyBuilder ()
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual void invertBox (bool x)
 
virtual float scaleFactor (const FWViewContext *vc)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual void setItem (const FWEventItem *iItem)
 
virtual void viewContextBoxScale (const float *corners, float scale, bool plotEt, std::vector< float > &scaledCorners, const CaloRecHit *)
 
virtual ~FWCaloRecHitDigitSetProxyBuilder (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 setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual ~FWProxyBuilderBase ()
 

Private Member Functions

 FWCaloRecHitDigitSetProxyBuilder (const FWCaloRecHitDigitSetProxyBuilder &)
 
const
FWCaloRecHitDigitSetProxyBuilder
operator= (const FWCaloRecHitDigitSetProxyBuilder &)
 

Private Attributes

bool m_ignoreGeoShapeSize
 
bool m_invertBox
 
TEveVector m_vector
 

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 9 of file FWCaloRecHitDigitSetProxyBuilder.h.

Constructor & Destructor Documentation

FWCaloRecHitDigitSetProxyBuilder::FWCaloRecHitDigitSetProxyBuilder ( )
virtual FWCaloRecHitDigitSetProxyBuilder::~FWCaloRecHitDigitSetProxyBuilder ( void  )
inlinevirtual

Definition at line 13 of file FWCaloRecHitDigitSetProxyBuilder.h.

13 {}
FWCaloRecHitDigitSetProxyBuilder::FWCaloRecHitDigitSetProxyBuilder ( const FWCaloRecHitDigitSetProxyBuilder )
private

Member Function Documentation

void FWCaloRecHitDigitSetProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 138 of file FWCaloRecHitDigitSetProxyBuilder.cc.

References FWDigitSetProxyBuilder::addBox(), FWDigitSetProxyBuilder::addBoxSetToProduct(), FWProxyBuilderBase::context(), CaloRecHit::detid(), FWEventItem::ModelInfo::displayProperties(), CaloRecHit::energy(), f, FWGeometry::getCorners(), FWViewContext::getEnergyScale(), fireworks::Context::getGeom(), FWViewEnergyScale::getPlotEt(), i, cmsHarvester::index, FWProxyBuilderBase::item(), m_vector, FWEventItem::modelData(), FWEventItem::modelInfo(), pileupReCalc_HLTpaths::scale, scaleFactor(), FWEventItem::size(), findQualityFiles::size, viewContextBoxScale(), and fireworks::Context::voteMaxEtAndEnergy().

139 {
140  size_t size = iItem->size();
141  if (!size) return;
142 
143  // m_ignoreGeoShapeSize = item()->getConfig()->value<bool>("IgnoreShapeSize");
144 
145  std::vector<float> scaledCorners(24);
146 
147  float scale = scaleFactor(vc);
148 
149  TEveBoxSet* boxSet = addBoxSetToProduct(product);
150  boxSet->SetAntiFlick(kTRUE);
151  for (int index = 0; index < static_cast<int>(size); ++index)
152  {
153  const CaloRecHit* hit = (const CaloRecHit*)item()->modelData(index);
154 
155  const float* corners = context().getGeom()->getCorners(hit->detid());
156  if (corners)
157  {
158  m_vector.Set(0.f, 0.f, 0.f);
159  for( unsigned int i = 0; i < 24; i += 3 )
160  {
161  m_vector[0] += corners[i];
162  m_vector[1] += corners[i + 1];
163  m_vector[2] += corners[i + 2];
164  }
165  m_vector.Normalize();
166  context().voteMaxEtAndEnergy( m_vector.Perp() *hit->energy(), hit->energy());
167  viewContextBoxScale( corners, hit->energy()*scale, vc->getEnergyScale()->getPlotEt(), scaledCorners, hit);
168  }
169 
170  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index).displayProperties());
171  }
172 }
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
const DetId & detid() const
Definition: CaloRecHit.h:20
const FWGeometry * getGeom() const
Definition: Context.h:83
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
FWViewEnergyScale * getEnergyScale() const
virtual void viewContextBoxScale(const float *corners, float scale, bool plotEt, std::vector< float > &scaledCorners, const CaloRecHit *)
const FWEventItem * item() const
float energy() const
Definition: CaloRecHit.h:17
double f[11][100]
virtual float scaleFactor(const FWViewContext *vc)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:277
size_t size() const
Definition: FWEventItem.cc:548
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:567
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
tuple size
Write out results.
bool getPlotEt() const
virtual bool FWCaloRecHitDigitSetProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 17 of file FWCaloRecHitDigitSetProxyBuilder.h.

17 { return true; }
virtual void FWCaloRecHitDigitSetProxyBuilder::invertBox ( bool  x)
inlinevirtual
const FWCaloRecHitDigitSetProxyBuilder& FWCaloRecHitDigitSetProxyBuilder::operator= ( const FWCaloRecHitDigitSetProxyBuilder )
private
float FWCaloRecHitDigitSetProxyBuilder::scaleFactor ( const FWViewContext vc)
virtual

Reimplemented in FWCastorRecHitProxyBuilder.

Definition at line 101 of file FWCaloRecHitDigitSetProxyBuilder.cc.

References FWViewContext::getEnergyScale(), and FWViewEnergyScale::getScaleFactor3D().

Referenced by build(), FWCastorRecHitProxyBuilder::scaleFactor(), and scaleProduct().

102 {
103  // printf("scale face %f \n", vc->getEnergyScale()->getScaleFactor3D());
104  return vc->getEnergyScale()->getScaleFactor3D()/50;
105 }
float getScaleFactor3D() const
FWViewEnergyScale * getEnergyScale() const
void FWCaloRecHitDigitSetProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 110 of file FWCaloRecHitDigitSetProxyBuilder.cc.

References b, CaloRecHit::detid(), CaloRecHit::energy(), FWDigitSetProxyBuilder::BFreeBox_t::fVertices, FWGeometry::getCorners(), FWViewContext::getEnergyScale(), FWEventItem::getGeom(), FWViewEnergyScale::getPlotEt(), cmsHarvester::index, FWProxyBuilderBase::item(), FWEventItem::modelData(), pileupReCalc_HLTpaths::scale, scaleFactor(), FWEventItem::size(), findQualityFiles::size, and viewContextBoxScale().

111 {
112  size_t size = item()->size();
113  if (!size) return;
114 
115 
116  std::vector<float> scaledCorners(24);
117  float scale = scaleFactor(vc);
118 
119  assert(parent->NumChildren() == 1);
120  TEveBoxSet* boxSet = static_cast<TEveBoxSet*>(*parent->BeginChildren());
121 
122  for (int index = 0; index < static_cast<int>(size); ++index)
123  {
124  const CaloRecHit* hit = (const CaloRecHit*)item()->modelData(index);
125  const float* corners = item()->getGeom()->getCorners(hit->detid());
126  if (corners == 0) continue;
127 
129 
130  viewContextBoxScale(corners, hit->energy()*scale, vc->getEnergyScale()->getPlotEt(), scaledCorners, hit);
131  memcpy(b->fVertices, &scaledCorners[0], sizeof(b->fVertices));
132  }
133  boxSet->ElementChanged();
134 }
list parent
Definition: dbtoconf.py:74
const DetId & detid() const
Definition: CaloRecHit.h:20
FWViewEnergyScale * getEnergyScale() const
virtual void viewContextBoxScale(const float *corners, float scale, bool plotEt, std::vector< float > &scaledCorners, const CaloRecHit *)
const FWEventItem * item() const
float energy() const
Definition: CaloRecHit.h:17
virtual float scaleFactor(const FWViewContext *vc)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:277
size_t size() const
Definition: FWEventItem.cc:548
double b
Definition: hdecay.h:120
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:567
tuple size
Write out results.
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
bool getPlotEt() const
void FWCaloRecHitDigitSetProxyBuilder::setItem ( const FWEventItem iItem)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 19 of file FWCaloRecHitDigitSetProxyBuilder.cc.

References FWProxyBuilderBase::setItem().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.EventContentView::_addRow(), Vispa.Views.TableView.TableView::_createItem(), Vispa.Views.PropertyView.PropertyView::addCategory(), and Vispa.Views.PropertyView.PropertyView::append().

20 {
22  // if (iItem) iItem->getConfig()->assertParam( "IgnoreShapeSize", false);
23 }
virtual void setItem(const FWEventItem *iItem)
void FWCaloRecHitDigitSetProxyBuilder::viewContextBoxScale ( const float *  corners,
float  scale,
bool  plotEt,
std::vector< float > &  scaledCorners,
const CaloRecHit  
)
virtual

Reimplemented in FWEcalRecHitProxyBuilder.

Definition at line 26 of file FWCaloRecHitDigitSetProxyBuilder.cc.

References f, i, fireworks::invertBox(), m_ignoreGeoShapeSize, m_invertBox, m_vector, and pileupReCalc_HLTpaths::scale.

Referenced by build(), scaleProduct(), and FWEcalRecHitProxyBuilder::viewContextBoxScale().

27 {
29  {
30  // Same functionality as fireworks::energyTower3DCorners()
31 
32  for( int i = 0; i < 24; ++i )
33  scaledCorners[i] = corners[i];
34 
35  // Coordinates of a front face scaled
36  if( m_invertBox )
37  {
38  // We know, that an ES rechit geometry in -Z needs correction.
39  // The back face is actually its front face.
40  for( unsigned int i = 0; i < 12; i += 3 )
41  {
42  m_vector.Set( corners[i] - corners[i + 12], corners[i + 1] - corners[i + 13], corners[i + 2] - corners[i + 14] );
43  m_vector.Normalize();
44  m_vector *= scale;
45 
46  scaledCorners[i] = corners[i] + m_vector.fX;
47  scaledCorners[i + 1] = corners[i + 1] + m_vector.fY;
48  scaledCorners[i + 2] = corners[i + 2] + m_vector.fZ;
49  }
50  }
51  else
52  {
53  for( unsigned int i = 0; i < 12; i += 3 )
54  {
55  m_vector.Set( corners[i + 12] - corners[i], corners[i + 13] - corners[i + 1], corners[i + 14] - corners[i + 2] );
56  m_vector.Normalize();
57  m_vector *= scale;
58 
59  scaledCorners[i] = corners[i + 12];
60  scaledCorners[i + 1] = corners[i + 13];
61  scaledCorners[i + 2] = corners[i + 14];
62 
63  scaledCorners[i + 12] = corners[i + 12] + m_vector.fX;
64  scaledCorners[i + 13] = corners[i + 13] + m_vector.fY;
65  scaledCorners[i + 14] = corners[i + 14] + m_vector.fZ;
66  }
67  }
68  }
69  else {
70 
71  // Same functionality as fireworks::energyScaledBox3DCorners().
72 
73  m_vector.Set(0.f, 0.f, 0.f);
74  for( unsigned int i = 0; i < 24; i += 3 )
75  {
76  m_vector[0] += corners[i];
77  m_vector[1] += corners[i + 1];
78  m_vector[2] += corners[i + 2];
79  }
80  m_vector *= 1.f/8.f;
81 
82  if (plotEt)
83  {
84  scale *= m_vector.Perp()/m_vector.Mag();
85  }
86 
87  // Coordinates for a scaled version of the original box
88  for( unsigned int i = 0; i < 24; i += 3 )
89  {
90  scaledCorners[i] = m_vector[0] + ( corners[i] - m_vector[0] ) * scale;
91  scaledCorners[i + 1] = m_vector[1] + ( corners[i + 1] - m_vector[1] ) * scale;
92  scaledCorners[i + 2] = m_vector[2] + ( corners[i + 2] - m_vector[2] ) * scale;
93  }
94 
95  if( m_invertBox )
96  fireworks::invertBox( scaledCorners );
97  }
98 }
int i
Definition: DBlmapReader.cc:9
void invertBox(std::vector< float > &corners)
double f[11][100]

Member Data Documentation

bool FWCaloRecHitDigitSetProxyBuilder::m_ignoreGeoShapeSize
private

Definition at line 31 of file FWCaloRecHitDigitSetProxyBuilder.h.

Referenced by viewContextBoxScale().

bool FWCaloRecHitDigitSetProxyBuilder::m_invertBox
private

Definition at line 30 of file FWCaloRecHitDigitSetProxyBuilder.h.

Referenced by invertBox(), and viewContextBoxScale().

TEveVector FWCaloRecHitDigitSetProxyBuilder::m_vector
private

Definition at line 32 of file FWCaloRecHitDigitSetProxyBuilder.h.

Referenced by build(), and viewContextBoxScale().