CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWFromTEveCaloDataSelector Class Reference

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

Inheritance diagram for FWFromTEveCaloDataSelector:
FWFromEveSelectorBase

Public Member Functions

void addSliceSelector (int iSlice, FWFromSliceSelector *)
 
void doSelect ()
 
void doUnselect ()
 
 FWFromTEveCaloDataSelector (TEveCaloData *)
 
void resetSliceSelector (int iSlice)
 
virtual ~FWFromTEveCaloDataSelector ()
 
- Public Member Functions inherited from FWFromEveSelectorBase
 FWFromEveSelectorBase ()
 
virtual ~FWFromEveSelectorBase ()
 

Private Member Functions

 FWFromTEveCaloDataSelector (const FWFromTEveCaloDataSelector &)
 
const FWFromTEveCaloDataSelectoroperator= (const FWFromTEveCaloDataSelector &)
 

Private Attributes

FWModelChangeManagerm_changeManager
 
TEveCaloData * m_data
 
std::vector
< FWFromSliceSelector * > 
m_sliceSelectors
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 35 of file FWFromTEveCaloDataSelector.h.

Constructor & Destructor Documentation

FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( TEveCaloData *  iData)

Definition at line 31 of file FWFromTEveCaloDataSelector.cc.

References m_sliceSelectors.

31  :
32 m_data(iData),
34 {
35  // reserve 3 , first slice is background
36  m_sliceSelectors.reserve(3);
37  m_sliceSelectors.push_back(new FWFromSliceSelector(0));
38 }
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors
FWFromTEveCaloDataSelector::~FWFromTEveCaloDataSelector ( )
virtual

Definition at line 45 of file FWFromTEveCaloDataSelector.cc.

References i, and m_sliceSelectors.

46 {
47  for (std::vector<FWFromSliceSelector*>::iterator i = m_sliceSelectors.begin(); i != m_sliceSelectors.end(); ++i)
48  {
49  delete *i;
50  }
51  m_sliceSelectors.clear();
52 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWFromSliceSelector * > m_sliceSelectors
FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( const FWFromTEveCaloDataSelector )
private

Member Function Documentation

void FWFromTEveCaloDataSelector::addSliceSelector ( int  iSlice,
FWFromSliceSelector iSelector 
)

Definition at line 103 of file FWFromTEveCaloDataSelector.cc.

References FWFromSliceSelector::changeManager(), m_changeManager, and m_sliceSelectors.

Referenced by FWHFTowerProxyBuilderBase::assertCaloDataSlice(), and FWCaloTowerProxyBuilderBase::assertCaloDataSlice().

104 {
105  assert(iSlice>0 && (iSlice <= static_cast<int>(m_sliceSelectors.size())));
106 
107  if(0==m_changeManager) {
108  m_changeManager = iSelector->changeManager();
109  }
110 
111  if(iSlice ==static_cast<int>(m_sliceSelectors.size())) {
112  m_sliceSelectors.push_back(iSelector);
113  } else {
114  assert(iSlice<static_cast<int>(m_sliceSelectors.size()));
115  m_sliceSelectors[iSlice]=iSelector;
116  }
117 }
FWModelChangeManager * m_changeManager
FWModelChangeManager * changeManager() const
std::vector< FWFromSliceSelector * > m_sliceSelectors
void FWFromTEveCaloDataSelector::doSelect ( )
virtual

Implements FWFromEveSelectorBase.

Definition at line 70 of file FWFromTEveCaloDataSelector.cc.

References FWFromSliceSelector::clear(), m_changeManager, m_data, and m_sliceSelectors.

71 {
72  assert(m_changeManager);
74  std::for_each(m_sliceSelectors.begin(),
75  m_sliceSelectors.end(),
76  boost::bind(&FWFromSliceSelector::clear,_1));
77  const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
78  for(TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(),itEnd=cellIds.end();
79  it != itEnd;
80  ++it) {
81  assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
82  m_sliceSelectors[it->fSlice]->doSelect(*it);
83  }
84 }
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors
void FWFromTEveCaloDataSelector::doUnselect ( )
virtual

Implements FWFromEveSelectorBase.

Definition at line 87 of file FWFromTEveCaloDataSelector.cc.

References m_changeManager, m_data, and m_sliceSelectors.

88 {
89  assert(m_changeManager);
90  //std::cout <<"FWFromTEveCaloDataSelector::doUnselect()"<<std::endl;
91 
93  const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
94  for(TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(),itEnd=cellIds.end();
95  it != itEnd;
96  ++it) {
97  assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
98  m_sliceSelectors[it->fSlice]->doUnselect(*it);
99  }
100 }
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors
const FWFromTEveCaloDataSelector& FWFromTEveCaloDataSelector::operator= ( const FWFromTEveCaloDataSelector )
private
void FWFromTEveCaloDataSelector::resetSliceSelector ( int  iSlice)

Definition at line 120 of file FWFromTEveCaloDataSelector.cc.

References m_sliceSelectors.

Referenced by FWCaloDataProxyBuilderBase::itemBeingDestroyed().

121 {
122  m_sliceSelectors[iSlice]->reset();
123 }
std::vector< FWFromSliceSelector * > m_sliceSelectors

Member Data Documentation

FWModelChangeManager* FWFromTEveCaloDataSelector::m_changeManager
private

Definition at line 60 of file FWFromTEveCaloDataSelector.h.

Referenced by addSliceSelector(), doSelect(), and doUnselect().

TEveCaloData* FWFromTEveCaloDataSelector::m_data
private

Definition at line 59 of file FWFromTEveCaloDataSelector.h.

Referenced by doSelect(), and doUnselect().

std::vector<FWFromSliceSelector*> FWFromTEveCaloDataSelector::m_sliceSelectors
private