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 FWPFCandidateTowerProxyBuilder FWECalCaloTowerProxyBuilder FWHCalCaloTowerProxyBuilder FWHOCaloTowerProxyBuilder FWECalPFCandidateProxyBuilder FWHCalPFCandidateProxyBuilder

Public Member Functions

 FWCaloDataProxyBuilderBase ()
 
virtual bool willHandleInteraction () const
 
virtual ~FWCaloDataProxyBuilderBase ()
 
- 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
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void fillCaloData ()=0
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
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 ()
 
 FWCaloDataProxyBuilderBase (const FWCaloDataProxyBuilderBase &)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWCaloDataProxyBuilderBaseoperator= (const FWCaloDataProxyBuilderBase &)
 

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::FWCaloDataProxyBuilderBase ( )

Definition at line 44 of file FWCaloDataProxyBuilderBase.cc.

44  :
45  m_caloData(0),
46  m_sliceIndex(-1)
47 {
48 }
FWCaloDataProxyBuilderBase::~FWCaloDataProxyBuilderBase ( )
virtual

Definition at line 55 of file FWCaloDataProxyBuilderBase.cc.

56 {
57 }
FWCaloDataProxyBuilderBase::FWCaloDataProxyBuilderBase ( const FWCaloDataProxyBuilderBase )
private

Member Function Documentation

virtual bool FWCaloDataProxyBuilderBase::assertCaloDataSlice ( )
protectedpure virtual
void FWCaloDataProxyBuilderBase::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

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

Definition at line 76 of file FWCaloDataProxyBuilderBase.cc.

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

78 {
79  setCaloData(iItem->context());
80 
82  fillCaloData();
83 
84  m_caloData->SetSliceColor(m_sliceIndex,item()->defaultDisplayProperties().color());
85  m_caloData->SetSliceTransparency(m_sliceIndex,item()->defaultDisplayProperties().transparency());
86  m_caloData->DataChanged();
87  m_caloData->CellSelectionChanged();
88 }
const FWEventItem * item() const
const fireworks::Context & context() const
Definition: FWEventItem.h:128
virtual bool assertCaloDataSlice()=0
virtual void setCaloData(const fireworks::Context &)=0
virtual void fillCaloData()=0
void FWCaloDataProxyBuilderBase::clearCaloDataSelection ( )
private

Definition at line 135 of file FWCaloDataProxyBuilderBase.cc.

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

Referenced by itemBeingDestroyed(), and modelChanges().

136 {
137  //find all selected cell ids which are not from this FWEventItem and preserve only them
138  // do this by moving them to the end of the list and then clearing only the end of the list
139  // this avoids needing any additional memory
140 
141  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
142 
143  TEveCaloData::vCellId_t::iterator itEnd = selected.end();
144  for(TEveCaloData::vCellId_t::iterator it = selected.begin();
145  it != itEnd;
146  ++it) {
147  if(it->fSlice ==m_sliceIndex) {
148  //we have found one we want to get rid of, so we swap it with the
149  // one closest to the end which is not of this slice
150  do {
151  TEveCaloData::vCellId_t::iterator itLast = itEnd-1;
152  itEnd = itLast;
153  } while (itEnd != it && itEnd->fSlice==m_sliceIndex);
154 
155  if(itEnd != it) {
156  std::swap(*it,*itEnd);
157  } else {
158  //shouldn't go on since advancing 'it' will put us past itEnd
159  break;
160  }
161  //std::cout <<"keeping "<<it->fTower<<" "<<it->fSlice<<std::endl;
162  }
163  }
164  selected.erase(itEnd,selected.end());
165 
166 
167  // reset higlight
168  m_caloData->GetCellsHighlighted().clear();
169 }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
virtual void FWCaloDataProxyBuilderBase::fillCaloData ( )
protectedpure virtual
void FWCaloDataProxyBuilderBase::itemBeingDestroyed ( const FWEventItem iItem)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

Reimplemented in FWHGTowerProxyBuilderBase, FWHFTowerProxyBuilderBase, and FWCaloDataHistProxyBuilder.

Definition at line 120 of file FWCaloDataProxyBuilderBase.cc.

References clearCaloDataSelection(), FWProxyBuilderBase::itemBeingDestroyed(), m_caloData, m_sliceIndex, and FWFromTEveCaloDataSelector::resetSliceSelector().

Referenced by FWCaloDataHistProxyBuilder::itemBeingDestroyed(), FWHFTowerProxyBuilderBase::itemBeingDestroyed(), and FWHGTowerProxyBuilderBase::itemBeingDestroyed().

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

Reimplemented from FWProxyBuilderBase.

Definition at line 93 of file FWCaloDataProxyBuilderBase.cc.

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

94 {
95  if(m_caloData && item())
96  {
98  fillCaloData();
99 
100  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
101  if(!selected.empty()) {
102  if(0==m_caloData->GetSelectedLevel()) {
103  gEve->GetSelection()->AddElement(m_caloData);
104  }
105  } else {
106  if(1==m_caloData->GetSelectedLevel()||2==m_caloData->GetSelectedLevel()) {
107  gEve->GetSelection()->RemoveElement(m_caloData);
108  }
109  }
110 
111  m_caloData->SetSliceColor(m_sliceIndex,item()->defaultDisplayProperties().color());
112  m_caloData->SetSliceTransparency(m_sliceIndex,item()->defaultDisplayProperties().transparency());
113  m_caloData->DataChanged();
114  m_caloData->CellSelectionChanged();
115  }
116 }
const FWEventItem * item() const
virtual void fillCaloData()=0
const FWCaloDataProxyBuilderBase& FWCaloDataProxyBuilderBase::operator= ( const FWCaloDataProxyBuilderBase )
private
virtual void FWCaloDataProxyBuilderBase::setCaloData ( const fireworks::Context )
protectedpure virtual
virtual bool FWCaloDataProxyBuilderBase::willHandleInteraction ( ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 42 of file FWCaloDataProxyBuilderBase.h.

References assertCaloDataSlice(), FWProxyBuilderBase::build(), fillCaloData(), and setCaloData().

42 { return true; }

Member Data Documentation

TEveCaloData* FWCaloDataProxyBuilderBase::m_caloData
protected
Int_t FWCaloDataProxyBuilderBase::m_sliceIndex
protected