CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
FWCaloDataProxyBuilderBase Class Referenceabstract

#include <Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h>

Inheritance diagram for FWCaloDataProxyBuilderBase:
FWProxyBuilderBase FWCaloDataHistProxyBuilder FWHFTowerProxyBuilderBase FWHGTowerProxyBuilderBase FWCaloTowerProxyBuilderBase FWCandidateTowerProxyBuilder FWHGCalMultiClusterLegoProxyBuilder FWPFCandidateTowerProxyBuilder FWECalCaloTowerProxyBuilder FWHCalCaloTowerProxyBuilder FWHOCaloTowerProxyBuilder FWECalPFCandidateProxyBuilder FWHCalPFCandidateProxyBuilder

Public Member Functions

 FWCaloDataProxyBuilderBase ()
 
 FWCaloDataProxyBuilderBase (const FWCaloDataProxyBuilderBase &)=delete
 
const FWCaloDataProxyBuilderBaseoperator= (const FWCaloDataProxyBuilderBase &)=delete
 
bool willHandleInteraction () const override
 
 ~FWCaloDataProxyBuilderBase () 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 ~FWProxyBuilderBase ()
 

Protected Member Functions

virtual bool assertCaloDataSlice ()=0
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void fillCaloData ()=0
 
void itemBeingDestroyed (const FWEventItem *) override
 
virtual void setCaloData (const fireworks::Context &)=0
 
- 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 localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 

Protected Attributes

TEveCaloData * m_caloData
 
Int_t m_sliceIndex
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Private Member Functions

void clearCaloDataSelection ()
 
void modelChanges (const FWModelIds &, Product *) override
 

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
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 34 of file FWCaloDataProxyBuilderBase.h.

Constructor & Destructor Documentation

◆ FWCaloDataProxyBuilderBase() [1/2]

FWCaloDataProxyBuilderBase::FWCaloDataProxyBuilderBase ( )

◆ ~FWCaloDataProxyBuilderBase()

FWCaloDataProxyBuilderBase::~FWCaloDataProxyBuilderBase ( )
override

Definition at line 50 of file FWCaloDataProxyBuilderBase.cc.

50 {}

◆ FWCaloDataProxyBuilderBase() [2/2]

FWCaloDataProxyBuilderBase::FWCaloDataProxyBuilderBase ( const FWCaloDataProxyBuilderBase )
delete

Member Function Documentation

◆ assertCaloDataSlice()

virtual bool FWCaloDataProxyBuilderBase::assertCaloDataSlice ( )
protectedpure virtual

◆ build()

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

Reimplemented from FWProxyBuilderBase.

Reimplemented in FWHFTowerProxyBuilderBase, FWHGTowerProxyBuilderBase, FWCaloTowerProxyBuilderBase, FWPFCandidateTowerProxyBuilder, FWCandidateTowerProxyBuilder, and FWHGCalMultiClusterLegoProxyBuilder.

Definition at line 68 of file FWCaloDataProxyBuilderBase.cc.

References assertCaloDataSlice(), FWEventItem::context(), fillCaloData(), FWProxyBuilderBase::item(), m_caloData, m_sliceIndex, and setCaloData().

68  {
69  setCaloData(iItem->context());
70 
72  fillCaloData();
73 
74  m_caloData->SetSliceColor(m_sliceIndex, item()->defaultDisplayProperties().color());
75  m_caloData->SetSliceTransparency(m_sliceIndex, item()->defaultDisplayProperties().transparency());
76  m_caloData->DataChanged();
77  m_caloData->CellSelectionChanged();
78 }
const fireworks::Context & context() const
Definition: FWEventItem.h:121
virtual bool assertCaloDataSlice()=0
virtual void setCaloData(const fireworks::Context &)=0
const FWEventItem * item() const
virtual void fillCaloData()=0

◆ clearCaloDataSelection()

void FWCaloDataProxyBuilderBase::clearCaloDataSelection ( )
private

Definition at line 116 of file FWCaloDataProxyBuilderBase.cc.

References m_caloData, m_sliceIndex, and edm::swap().

Referenced by itemBeingDestroyed(), and modelChanges().

116  {
117  //find all selected cell ids which are not from this FWEventItem and preserve only them
118  // do this by moving them to the end of the list and then clearing only the end of the list
119  // this avoids needing any additional memory
120 
121  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
122 
123  TEveCaloData::vCellId_t::iterator itEnd = selected.end();
124  for (TEveCaloData::vCellId_t::iterator it = selected.begin(); it != itEnd; ++it) {
125  if (it->fSlice == m_sliceIndex) {
126  //we have found one we want to get rid of, so we swap it with the
127  // one closest to the end which is not of this slice
128  do {
129  TEveCaloData::vCellId_t::iterator itLast = itEnd - 1;
130  itEnd = itLast;
131  } while (itEnd != it && itEnd->fSlice == m_sliceIndex);
132 
133  if (itEnd != it) {
134  std::swap(*it, *itEnd);
135  } else {
136  //shouldn't go on since advancing 'it' will put us past itEnd
137  break;
138  }
139  //std::cout <<"keeping "<<it->fTower<<" "<<it->fSlice<<std::endl;
140  }
141  }
142  selected.erase(itEnd, selected.end());
143 
144  // reset higlight
145  m_caloData->GetCellsHighlighted().clear();
146 }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112

◆ fillCaloData()

virtual void FWCaloDataProxyBuilderBase::fillCaloData ( )
protectedpure virtual

◆ itemBeingDestroyed()

void FWCaloDataProxyBuilderBase::itemBeingDestroyed ( const FWEventItem iItem)
overrideprotectedvirtual

◆ modelChanges()

void FWCaloDataProxyBuilderBase::modelChanges ( const FWModelIds ,
Product p 
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 82 of file FWCaloDataProxyBuilderBase.cc.

References clearCaloDataSelection(), fillCaloData(), FWProxyBuilderBase::item(), m_caloData, and m_sliceIndex.

82  {
83  if (m_caloData && item()) {
85  fillCaloData();
86 
87  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
88  if (!selected.empty()) {
89  if (0 == m_caloData->GetSelectedLevel()) {
90  gEve->GetSelection()->AddElement(m_caloData);
91  }
92  } else {
93  if (1 == m_caloData->GetSelectedLevel() || 2 == m_caloData->GetSelectedLevel()) {
94  gEve->GetSelection()->RemoveElement(m_caloData);
95  }
96  }
97 
98  m_caloData->SetSliceColor(m_sliceIndex, item()->defaultDisplayProperties().color());
99  m_caloData->SetSliceTransparency(m_sliceIndex, item()->defaultDisplayProperties().transparency());
100  m_caloData->DataChanged();
101  m_caloData->CellSelectionChanged();
102  }
103 }
const FWEventItem * item() const
virtual void fillCaloData()=0

◆ operator=()

const FWCaloDataProxyBuilderBase& FWCaloDataProxyBuilderBase::operator= ( const FWCaloDataProxyBuilderBase )
delete

◆ setCaloData()

virtual void FWCaloDataProxyBuilderBase::setCaloData ( const fireworks::Context )
protectedpure virtual

◆ willHandleInteraction()

bool FWCaloDataProxyBuilderBase::willHandleInteraction ( ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 41 of file FWCaloDataProxyBuilderBase.h.

41 { return true; }

Member Data Documentation

◆ m_caloData

TEveCaloData* FWCaloDataProxyBuilderBase::m_caloData
protected

◆ m_sliceIndex

Int_t FWCaloDataProxyBuilderBase::m_sliceIndex
protected