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 42 of file FWSiStripClusterProxyBuilder.cc.

References m_shapeList.

42  : m_shapeList(nullptr) {
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.

47 { m_shapeList->DecDenyDestroy(); }
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 54 of file FWSiStripClusterProxyBuilder.cc.

References mps_check::array, edmNew::DetSetVector< T >::begin(), bsc_activity_cfg::clusters, FWProxyBuilderBase::createCompound(), DataFormats::L1THGCal::ei, 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.

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

Definition at line 150 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 150 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 150 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 150 of file FWSiStripClusterProxyBuilder.cc.

void FWSiStripClusterProxyBuilder::itemBeingDestroyed ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 49 of file FWSiStripClusterProxyBuilder.cc.

References FWProxyBuilderBase::itemBeingDestroyed(), and m_shapeList.

49  {
50  m_shapeList->DestroyElements();
52 }
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(), FWModelId::index(), and REGISTER_FWPROXYBUILDER.

143  {
144  increaseComponentTransparency(iId.index(), iCompound, "Det", 60);
145 }
int index() const
Definition: FWModelId.h:41
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 22 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 22 of file FWSiStripClusterProxyBuilder.cc.

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

Definition at line 22 of file FWSiStripClusterProxyBuilder.cc.

Member Data Documentation

TEveElementList* FWSiStripClusterProxyBuilder::m_shapeList
private