CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions
FWSiStripClusterProxyBuilder Class Reference
Inheritance diagram for FWSiStripClusterProxyBuilder:
FWProxyBuilderBase

Public Member Functions

virtual void clean () override
 
 FWSiStripClusterProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWSiStripClusterProxyBuilder (void)
 
- 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 havePerViewProduct (FWViewType::EType) 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 &)
 
virtual 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 bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Protected Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
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 modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 

Private Member Functions

 FWSiStripClusterProxyBuilder (const FWSiStripClusterProxyBuilder &)
 
const
FWSiStripClusterProxyBuilder
operator= (const FWSiStripClusterProxyBuilder &)
 

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 Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 17 of file FWSiStripClusterProxyBuilder.cc.

Constructor & Destructor Documentation

FWSiStripClusterProxyBuilder::FWSiStripClusterProxyBuilder ( void  )
inline

Definition at line 20 of file FWSiStripClusterProxyBuilder.cc.

20 {}
virtual FWSiStripClusterProxyBuilder::~FWSiStripClusterProxyBuilder ( void  )
inlinevirtual

Definition at line 21 of file FWSiStripClusterProxyBuilder.cc.

21 {}
FWSiStripClusterProxyBuilder::FWSiStripClusterProxyBuilder ( const FWSiStripClusterProxyBuilder )
private

Member Function Documentation

void FWSiStripClusterProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
overrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 55 of file FWSiStripClusterProxyBuilder.cc.

References edmNew::DetSetVector< T >::begin(), edm::contains(), FWProxyBuilderBase::createCompound(), edmNew::DetSetVector< T >::end(), fwLog, FWEventItem::get(), FWGeometry::getEveShape(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWProxyBuilderBase::increaseComponentTransparency(), FWProxyBuilderBase::item(), fwlog::kError, fwlog::kWarning, fireworks::localSiStrip(), FWGeometry::localToGlobal(), and FWProxyBuilderBase::setupAddElement().

56 {
57  const edmNew::DetSetVector<SiStripCluster>* clusters = 0;
58  iItem->get( clusters );
59  if( 0 == clusters ) return;
60  int cnt = 0;
61 
62  for( edmNew::DetSetVector<SiStripCluster>::const_iterator set = clusters->begin(), setEnd = clusters->end();
63  set != setEnd; ++set) {
64  unsigned int id = set->detId();
65 
66 
67  TEveGeoShape* shape = item()->getGeom()->getEveShape( id );
68  if (shape)
69  {
70  shape->SetMainTransparency( 75 );
71  shape->SetElementName( "Det" );
72  }
73  else
74  {
76  << "failed to get shape of SiStripCluster with detid: "
77  << id << std::endl;
78  }
79 
80  for( edmNew::DetSet<SiStripCluster>::const_iterator ic = set->begin (), icEnd = set->end (); ic != icEnd; ++ic )
81  {
82  TEveCompound* itemHolder = 0;
83  if (cnt < product->NumChildren())
84  {
85  TEveElement::List_i pit = product->BeginChildren();
86  std::advance(pit, cnt);
87  itemHolder = (TEveCompound*)*pit;
88  itemHolder->SetRnrSelfChildren(true, true);
89  }
90  else {
91  itemHolder = createCompound();
92  setupAddElement( itemHolder, product );
93  }
94 
95  // add common shape
96  if (shape)
97  {
98  setupAddElement( shape, itemHolder );
99  increaseComponentTransparency( cnt, itemHolder, "Det", 60 );
100  }
101 
102  // add line
103  if( ! item()->getGeom()->contains( id ))
104  {
106  << "failed to geometry of SiStripCluster with detid: "
107  << id << std::endl;
108  continue;
109  }
110 
111  TEveStraightLineSet *lineSet = new TEveStraightLineSet( "strip" );
112  setupAddElement( lineSet, itemHolder );
113  float localTop[3] = { 0.0, 0.0, 0.0 };
114  float localBottom[3] = { 0.0, 0.0, 0.0 };
115 
116  fireworks::localSiStrip( (*ic).firstStrip(), localTop, localBottom, iItem->getGeom()->getParameters( id ), id );
117 
118  float globalTop[3];
119  float globalBottom[3];
120  iItem->getGeom()->localToGlobal( id, localTop, globalTop, localBottom, globalBottom );
121 
122  lineSet->AddLine( globalTop[0], globalTop[1], globalTop[2],
123  globalBottom[0], globalBottom[1], globalBottom[2] );
124 
125  cnt++;
126  }
127  }
128 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:293
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
const FWEventItem * item() const
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:291
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:325
#define fwLog(_level_)
Definition: fwLog.h:50
const_iterator end(bool update=true) const
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
const_iterator begin(bool update=true) const
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
void FWSiStripClusterProxyBuilder::clean ( )
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 38 of file FWSiStripClusterProxyBuilder.cc.

References FWProxyBuilderBase::cleanLocal(), i, and FWProxyBuilderBase::m_products.

39 {
40  // keep itemholders to restore configuration
41 
42  for (FWProxyBuilderBase::Product_it i = m_products.begin(); i != m_products.end(); ++i)
43  {
44  if ((*i)->m_elements)
45  {
46  TEveElement* elms = (*i)->m_elements;
47  for (TEveElement::List_i it = elms->BeginChildren(); it != elms->EndChildren(); ++it)
48  (*it)->DestroyElements();
49  }
50  }
51 
52  cleanLocal();
53 }
int i
Definition: DBlmapReader.cc:9
std::vector< Product * >::iterator Product_it
std::vector< Product * > m_products
virtual void cleanLocal()
void FWSiStripClusterProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 130 of file FWSiStripClusterProxyBuilder.cc.

References FWProxyBuilderBase::increaseComponentTransparency(), and FWModelId::index().

132 {
133  increaseComponentTransparency( iId.index(), iCompound, "Det", 60 );
134 }
int index() const
Definition: FWModelId.h:49
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
const FWSiStripClusterProxyBuilder& FWSiStripClusterProxyBuilder::operator= ( const FWSiStripClusterProxyBuilder )
private
FWSiStripClusterProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )