CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWSiPixelClusterDetProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Tracks
4 // Class : FWSiPixelClusterDetProxyBuilder
5 //
6 //
7 // Original Author:
8 // Created: Thu Dec 6 18:01:21 PST 2007
9 //
10 
11 #include "TEveGeoNode.h"
12 
16 
19 
21 {
22 public:
25 
27 
28 private:
29  virtual void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
32 };
33 
34 void FWSiPixelClusterDetProxyBuilder::build( const FWEventItem* iItem, TEveElementList* product , const FWViewContext*)
35 {
36  const SiPixelClusterCollectionNew* pixels = 0;
37 
38  iItem->get(pixels);
39 
40  if( ! pixels )
41  return;
42 
43  const FWGeometry* geom = iItem->getGeom();
44 
45  for( SiPixelClusterCollectionNew::const_iterator set = pixels->begin(), setEnd = pixels->end();
46  set != setEnd; ++set)
47  {
48  unsigned int id = set->detId();
49  DetId detid(id);
50 
51  if( geom->contains( detid ))
52  {
53  const edmNew::DetSet<SiPixelCluster> & clusters = *set;
54 
55  for( edmNew::DetSet<SiPixelCluster>::const_iterator itc = clusters.begin(), edc = clusters.end();
56  itc != edc; ++itc )
57  {
58  TEveGeoShape* shape = geom->getEveShape(detid);
59 
60  if ( shape )
61  {
62  shape->SetMainTransparency(50);
63  setupAddElement(shape, product);
64  }
65  }
66  }
67  }
68 }
69 
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:84
data_type const * const_iterator
Definition: DetSetNew.h:30
static const int kAll3DBits
Definition: FWViewType.h:59
const FWSiPixelClusterDetProxyBuilder & operator=(const FWSiPixelClusterDetProxyBuilder &)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
bool contains(unsigned int id) const
Definition: FWGeometry.h:98
Definition: DetId.h:18
const_iterator end(bool update=true) const
iterator end()
Definition: DetSetNew.h:70
const_iterator begin(bool update=true) const
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
iterator begin()
Definition: DetSetNew.h:67