CMS 3D CMS Logo

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 () override
 
void doUnselect () override
 
 FWFromTEveCaloDataSelector (TEveCaloData *)
 
void resetSliceSelector (int iSlice)
 
 ~FWFromTEveCaloDataSelector () override
 
- Public Member Functions inherited from FWFromEveSelectorBase
 FWFromEveSelectorBase ()
 
virtual ~FWFromEveSelectorBase ()
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 34 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),
33 m_changeManager(nullptr)
34 {
35  // reserve 3 , first slice is background
36  m_sliceSelectors.reserve(3);
37  m_sliceSelectors.push_back(new FWFromSliceSelector(nullptr));
38 }
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors
FWFromTEveCaloDataSelector::~FWFromTEveCaloDataSelector ( )
override

Definition at line 45 of file FWFromTEveCaloDataSelector.cc.

References mps_fire::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 }
std::vector< FWFromSliceSelector * > m_sliceSelectors
FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( const FWFromTEveCaloDataSelector )
privatedelete

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 FWCaloDataHistProxyBuilder::assertCaloDataSlice(), FWHFTowerProxyBuilderBase::assertCaloDataSlice(), and FWHGTowerProxyBuilderBase::assertCaloDataSlice().

104 {
105  assert(iSlice>0 && (iSlice <= static_cast<int>(m_sliceSelectors.size())));
106 
107  if(nullptr==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 ( )
overridevirtual

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 ( )
overridevirtual

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 )
privatedelete
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 59 of file FWFromTEveCaloDataSelector.h.

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

TEveCaloData* FWFromTEveCaloDataSelector::m_data
private

Definition at line 58 of file FWFromTEveCaloDataSelector.h.

Referenced by doSelect(), and doUnselect().

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