CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FWSiStripClusterProxyBuilder Class Reference
Inheritance diagram for FWSiStripClusterProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWSiStripClusterProxyBuilder (void)
 
void itemBeingDestroyed (const FWEventItem *) override
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWSiStripClusterProxyBuilder (void) override
 
- 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
 
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

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
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 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 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 &)=delete
 
const FWSiStripClusterProxyBuilderoperator= (const FWSiStripClusterProxyBuilder &)=delete
 

Private Attributes

TEveElementList * m_shapeList
 

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  )

Definition at line 40 of file FWSiStripClusterProxyBuilder.cc.

References m_shapeList.

40  : m_shapeList(nullptr)
41 {
42 
43  m_shapeList = new TEveElementList("shapePool");
44  m_shapeList->IncDenyDestroy();
45 }
FWSiStripClusterProxyBuilder::~FWSiStripClusterProxyBuilder ( void  )
override

Definition at line 47 of file FWSiStripClusterProxyBuilder.cc.

References m_shapeList.

48 {
49  m_shapeList->DecDenyDestroy();
50 }
FWSiStripClusterProxyBuilder::FWSiStripClusterProxyBuilder ( const FWSiStripClusterProxyBuilder )
privatedelete

Member Function Documentation

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

Reimplemented from FWProxyBuilderBase.

Definition at line 60 of file FWSiStripClusterProxyBuilder.cc.

References mps_check::array, edmNew::DetSetVector< T >::begin(), fastPrimaryVertexProducer_cfi::clusters, FWProxyBuilderBase::createCompound(), edmNew::DetSetVector< T >::end(), FWGeometry::find(), FWEventItem::get(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShape(), mps_fire::i, triggerObjects_cff::id, info(), mps_splice::line, fireworks::localSiStrip(), FWGeometry::localToGlobal(), m_shapeList, FWGeometry::GeomDetInfo::matrix, FWProxyBuilderBase::setupAddElement(), edmNew::DetSetVector< T >::size(), and FWGeometry::GeomDetInfo::translation.

61 {
63  iItem->get( clusters );
64  if( nullptr == clusters ) return;
65  int cntEl = 0;
66 
67  for (TEveElement::List_i ei = product->BeginChildren(); ei != product->EndChildren(); ++ei) {
68  TEveElement* holder = *ei;
69  if (holder->HasChildren()) {
70  holder->SetRnrSelfChildren(false, false);
71  holder->RemoveElement(holder->LastChild());
72  }
73  }
74 
75  // check if need to create more shapes
76  int sdiff = clusters->size() - m_shapeList->NumChildren();
77  for (int i = 0; i <= sdiff; ++i)
78  m_shapeList->AddElement(new TEveGeoShape("Det"));
79 
80  TEveElement::List_i shapeIt = m_shapeList->BeginChildren();
81  for( edmNew::DetSetVector<SiStripCluster>::const_iterator set = clusters->begin(), setEnd = clusters->end();
82  set != setEnd; ++set) {
83 
84  unsigned int id = set->detId();
85  const FWGeometry::GeomDetInfo& info = *iItem->getGeom()->find( id );
86 
87  double array[16] = { info.matrix[0], info.matrix[3], info.matrix[6], 0.,
88  info.matrix[1], info.matrix[4], info.matrix[7], 0.,
89  info.matrix[2], info.matrix[5], info.matrix[8], 0.,
90  info.translation[0], info.translation[1], info.translation[2], 1.
91  };
92 
93 
94  // note TEveGeoShape owns shape
95  TEveGeoShape* shape = (TEveGeoShape*)(*shapeIt);
96  shape->SetShape(iItem->getGeom()->getShape(info));
97  shape->SetTransMatrix(array);
98  shape->SetRnrSelf(true);
99  shapeIt++;
100 
101  for( edmNew::DetSet<SiStripCluster>::const_iterator ic = set->begin (), icEnd = set->end (); ic != icEnd; ++ic )
102  {
103  TEveCompound* itemHolder = nullptr;
104  TEveLine* line = nullptr;
105 
106  if (cntEl < product->NumChildren())
107  {
108  TEveElement::List_i pit = product->BeginChildren();
109  std::advance(pit, cntEl);
110  itemHolder = (TEveCompound*)*pit;
111  itemHolder->SetRnrSelfChildren(true, true);
112 
113  line = (TEveLine*) (itemHolder->FirstChild());
114  setupAddElement( shape, itemHolder );
115  }
116  else {
117  itemHolder = createCompound();
118  setupAddElement( itemHolder, product );
119  line = new TEveLine("line");
120  setupAddElement( line, itemHolder );
121  setupAddElement( shape, itemHolder );
122  }
123  shape->SetMainTransparency(75);
124 
125  // setup line pnts
126  float localTop[3] = { 0.0, 0.0, 0.0 };
127  float localBottom[3] = { 0.0, 0.0, 0.0 };
128  fireworks::localSiStrip( (*ic).firstStrip(), localTop, localBottom, iItem->getGeom()->getParameters( id ), id );
129  float globalTop[3];
130  float globalBottom[3];
131  iItem->getGeom()->localToGlobal( id, localTop, globalTop, localBottom, globalBottom );
132  line->SetPoint(0, globalTop[0], globalTop[1], globalTop[2]);
133  line->SetPoint(1, globalBottom[0], globalBottom[1], globalBottom[2]);
134 
135  cntEl++;
136  }
137  }
138 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:508
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:446
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:85
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:257
data_type const * const_iterator
Definition: DetSetNew.h:30
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:278
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:478
size_type size() const
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:686
const_iterator begin(bool update=false) const
const std::string & FWSiStripClusterProxyBuilder::classPurpose ( )
static

Definition at line 146 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 146 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 146 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 146 of file FWSiStripClusterProxyBuilder.cc.

void FWSiStripClusterProxyBuilder::itemBeingDestroyed ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 53 of file FWSiStripClusterProxyBuilder.cc.

References FWProxyBuilderBase::itemBeingDestroyed(), and m_shapeList.

54 {
55  m_shapeList->DestroyElements();
57 }
virtual void itemBeingDestroyed(const FWEventItem *)
void FWSiStripClusterProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 140 of file FWSiStripClusterProxyBuilder.cc.

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

142 {
143  increaseComponentTransparency( iId.index(), iCompound, "Det", 60 );
144 }
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 )
privatedelete
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.

Member Data Documentation

TEveElementList* FWSiStripClusterProxyBuilder::m_shapeList
private