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

Public Member Functions

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

Private Attributes

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 18 of file FWEcalRecHitProxyBuilder.cc.

Constructor & Destructor Documentation

FWEcalRecHitProxyBuilder::FWEcalRecHitProxyBuilder ( )
inline
virtual FWEcalRecHitProxyBuilder::~FWEcalRecHitProxyBuilder ( )
inlinevirtual

Definition at line 22 of file FWEcalRecHitProxyBuilder.cc.

22 {}
FWEcalRecHitProxyBuilder::FWEcalRecHitProxyBuilder ( const FWEcalRecHitProxyBuilder )
private

Member Function Documentation

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

Reimplemented from FWProxyBuilderBase.

Definition at line 96 of file FWEcalRecHitProxyBuilder.cc.

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

97 {
99 
100  const EcalRecHitCollection* collection = 0;
101  iItem->get( collection );
102  if (! collection)
103  return;
104 
105  TEveBoxSet* boxSet = addBoxSetToProduct(product);
106  std::vector<float> scaledCorners(24);
107  int index = 0;
108  for (std::vector<EcalRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
109  {
110  const float* corners = item()->getGeom()->getCorners((*it).detid());
111  if (corners == 0)
112  continue;
113 
114  Float_t scale = 10.0;
115  bool reflect = false;
116  if (EcalSubdetector( (*it).detid().subdetId() ) == EcalPreshower)
117  {
118  scale = 1000.0; // FIXME: The scale should be taken form somewhere else
119  reflect = corners[2] < 0;
120  }
121 
122  if (m_plotEt)
123  fireworks::energyTower3DCorners(corners, (*it).energy() * scale, scaledCorners, reflect);
124  else
125  fireworks::energyTower3DCorners(corners, (*it).energy() * scale, scaledCorners, reflect);
126 
127  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
128  }
129 }
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
void get(const T *&oData) const
Definition: FWEventItem.h:84
FWViewEnergyScale * getEnergyScale() const
const FWEventItem * item() const
const_iterator end() const
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:278
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
EcalSubdetector
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:688
const_iterator begin() const
bool getPlotEt() const
virtual bool FWEcalRecHitProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 24 of file FWEcalRecHitProxyBuilder.cc.

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

Reimplemented from FWProxyBuilderBase.

Definition at line 42 of file FWEcalRecHitProxyBuilder.cc.

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

43 {
44 
45  if (m_plotEt != vc->getEnergyScale()->getPlotEt() )
46  {
47  m_plotEt = !m_plotEt;
48 
50  item()->get( collection );
51  if (! collection)
52  return;
53 
54  int index = 0;
55  std::vector<float> scaledCorners(24);
56  for (std::vector<EcalRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it, ++index)
57  {
58  const float* corners = item()->getGeom()->getCorners((*it).detid());
59  if (corners == 0)
60  continue;
61 
62  Float_t scale = 10.0;
63  bool reflect = false;
64  if (EcalSubdetector( (*it).detid().subdetId() ) == EcalPreshower)
65  {
66  scale = 1000.0; // FIXME: The scale should be taken form somewhere else
67  reflect = corners[2] < 0;
68  }
69 
71  /*
72  printf("--------------------scale product \n");
73  for (int i = 0; i < 8 ; ++i)
74  printf("[%f %f %f ]\n",b->fVertices[i][0], b->fVertices[i][1],b->fVertices[i][2] );
75  */
76 
77  if (m_plotEt)
78  fireworks::etTower3DCorners(corners, (*it).energy() * scale, scaledCorners, reflect);
79  else
80  fireworks::energyTower3DCorners(corners, (*it).energy() * scale, scaledCorners, reflect);
81 
82  memcpy(b->fVertices, &scaledCorners[0], sizeof(b->fVertices));
83 
84  /*
85  printf("after \n");
86  for (int i = 0; i < 8 ; ++i)
87  printf("[%f %f %f ]\n",b->fVertices[i][0], b->fVertices[i][1],b->fVertices[i][2] );
88  */
89  }
90  getBoxSet()->ElementChanged();
91  }
92 }
void etTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
void get(const T *&oData) const
Definition: FWEventItem.h:84
FWViewEnergyScale * getEnergyScale() const
TEveBoxSet * getBoxSet() const
const FWEventItem * item() const
const_iterator end() const
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:278
double b
Definition: hdecay.h:120
EcalSubdetector
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:688
const_iterator begin() const
bool getPlotEt() const

Member Data Documentation

bool FWEcalRecHitProxyBuilder::m_plotEt
private

Definition at line 35 of file FWEcalRecHitProxyBuilder.cc.

Referenced by build(), and scaleProduct().