test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static 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)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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 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

- 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 56 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().

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

Definition at line 137 of file FWSiStripClusterProxyBuilder.cc.

const std::string & FWSiStripClusterProxyBuilder::classRegisterTypeName ( )
static

Definition at line 137 of file FWSiStripClusterProxyBuilder.cc.

const std::string & FWSiStripClusterProxyBuilder::classTypeName ( )
static

Definition at line 137 of file FWSiStripClusterProxyBuilder.cc.

const std::string & FWSiStripClusterProxyBuilder::classView ( )
static

Definition at line 137 of file FWSiStripClusterProxyBuilder.cc.

void FWSiStripClusterProxyBuilder::clean ( )
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 39 of file FWSiStripClusterProxyBuilder.cc.

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

40 {
41  // keep itemholders to restore configuration
42 
43  for (FWProxyBuilderBase::Product_it i = m_products.begin(); i != m_products.end(); ++i)
44  {
45  if ((*i)->m_elements)
46  {
47  TEveElement* elms = (*i)->m_elements;
48  for (TEveElement::List_i it = elms->BeginChildren(); it != elms->EndChildren(); ++it)
49  (*it)->DestroyElements();
50  }
51  }
52 
53  cleanLocal();
54 }
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 131 of file FWSiStripClusterProxyBuilder.cc.

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

133 {
134  increaseComponentTransparency( iId.index(), iCompound, "Det", 60 );
135 }
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
const std::string& FWSiStripClusterProxyBuilder::purpose ( ) const
inline

Definition at line 23 of file FWSiStripClusterProxyBuilder.cc.

const std::string& FWSiStripClusterProxyBuilder::typeName ( ) const
inline

Definition at line 23 of file FWSiStripClusterProxyBuilder.cc.

const std::string& FWSiStripClusterProxyBuilder::view ( ) const
inline

Definition at line 23 of file FWSiStripClusterProxyBuilder.cc.