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 // $Id: FWSiPixelClusterDetProxyBuilder.cc,v 1.5 2010/09/07 15:46:48 yana Exp $
10 //
11 
12 #include "TEveGeoNode.h"
13 
17 
20 
22 {
23 public:
26 
28 
29 private:
30  virtual void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*);
33 };
34 
35 void FWSiPixelClusterDetProxyBuilder::build( const FWEventItem* iItem, TEveElementList* product , const FWViewContext*)
36 {
37  const SiPixelClusterCollectionNew* pixels = 0;
38 
39  iItem->get(pixels);
40 
41  if( ! pixels )
42  return;
43 
44  const FWGeometry* geom = iItem->getGeom();
45 
46  for( SiPixelClusterCollectionNew::const_iterator set = pixels->begin(), setEnd = pixels->end();
47  set != setEnd; ++set)
48  {
49  unsigned int id = set->detId();
50  DetId detid(id);
51 
52  if( geom->contains( detid ))
53  {
54  const edmNew::DetSet<SiPixelCluster> & clusters = *set;
55 
56  for( edmNew::DetSet<SiPixelCluster>::const_iterator itc = clusters.begin(), edc = clusters.end();
57  itc != edc; ++itc )
58  {
59  TEveGeoShape* shape = geom->getEveShape(detid);
60 
61  if ( shape )
62  {
63  shape->SetMainTransparency(50);
64  setupAddElement(shape, product);
65  }
66  }
67  }
68  }
69 }
70 
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin() const
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:59
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:85
data_type const * const_iterator
Definition: DetSetNew.h:25
static const int kAll3DBits
Definition: FWViewType.h:60
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
const_iterator end() const
Definition: DetId.h:20
iterator end()
Definition: DetSetNew.h:59
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
void set(const std::string &name, int value)
set the flag, with a run-time name
iterator begin()
Definition: DetSetNew.h:56