CMS 3D CMS Logo

List of all members | Public 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 *)
 
 FWFromTEveCaloDataSelector (const FWFromTEveCaloDataSelector &)=delete
 
const FWFromTEveCaloDataSelectoroperator= (const FWFromTEveCaloDataSelector &)=delete
 
void resetSliceSelector (int iSlice)
 
 ~FWFromTEveCaloDataSelector () override
 
- Public Member Functions inherited from FWFromEveSelectorBase
 FWFromEveSelectorBase ()
 
virtual ~FWFromEveSelectorBase ()
 

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() [1/2]

FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( TEveCaloData *  iData)

Definition at line 30 of file FWFromTEveCaloDataSelector.cc.

References m_sliceSelectors.

30  : m_data(iData), m_changeManager(nullptr) {
31  // reserve 3 , first slice is background
32  m_sliceSelectors.reserve(3);
33  m_sliceSelectors.push_back(new FWFromSliceSelector(nullptr));
34 }
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors

◆ ~FWFromTEveCaloDataSelector()

FWFromTEveCaloDataSelector::~FWFromTEveCaloDataSelector ( )
override

Definition at line 41 of file FWFromTEveCaloDataSelector.cc.

References mps_fire::i, and m_sliceSelectors.

41  {
42  for (std::vector<FWFromSliceSelector*>::iterator i = m_sliceSelectors.begin(); i != m_sliceSelectors.end(); ++i) {
43  delete *i;
44  }
45  m_sliceSelectors.clear();
46 }
std::vector< FWFromSliceSelector * > m_sliceSelectors

◆ FWFromTEveCaloDataSelector() [2/2]

FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( const FWFromTEveCaloDataSelector )
delete

Member Function Documentation

◆ addSliceSelector()

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

Definition at line 87 of file FWFromTEveCaloDataSelector.cc.

References cms::cuda::assert(), FWFromSliceSelector::changeManager(), m_changeManager, and m_sliceSelectors.

87  {
88  assert(iSlice > 0 && (iSlice <= static_cast<int>(m_sliceSelectors.size())));
89 
90  if (nullptr == m_changeManager) {
91  m_changeManager = iSelector->changeManager();
92  }
93 
94  if (iSlice == static_cast<int>(m_sliceSelectors.size())) {
95  m_sliceSelectors.push_back(iSelector);
96  } else {
97  assert(iSlice < static_cast<int>(m_sliceSelectors.size()));
98  m_sliceSelectors[iSlice] = iSelector;
99  }
100 }
FWModelChangeManager * changeManager() const
assert(be >=bs)
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors

◆ doSelect()

void FWFromTEveCaloDataSelector::doSelect ( )
overridevirtual

Implements FWFromEveSelectorBase.

Definition at line 63 of file FWFromTEveCaloDataSelector.cc.

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

63  {
66  std::for_each(
67  m_sliceSelectors.begin(), m_sliceSelectors.end(), std::bind(&FWFromSliceSelector::clear, std::placeholders::_1));
68  const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
69  for (TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(), itEnd = cellIds.end(); it != itEnd; ++it) {
70  assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
71  m_sliceSelectors[it->fSlice]->doSelect(*it);
72  }
73 }
assert(be >=bs)
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors

◆ doUnselect()

void FWFromTEveCaloDataSelector::doUnselect ( )
overridevirtual

Implements FWFromEveSelectorBase.

Definition at line 75 of file FWFromTEveCaloDataSelector.cc.

References cms::cuda::assert(), m_changeManager, m_data, and m_sliceSelectors.

75  {
77  //std::cout <<"FWFromTEveCaloDataSelector::doUnselect()"<<std::endl;
78 
80  const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
81  for (TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(), itEnd = cellIds.end(); it != itEnd; ++it) {
82  assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
83  m_sliceSelectors[it->fSlice]->doUnselect(*it);
84  }
85 }
assert(be >=bs)
FWModelChangeManager * m_changeManager
std::vector< FWFromSliceSelector * > m_sliceSelectors

◆ operator=()

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

◆ resetSliceSelector()

void FWFromTEveCaloDataSelector::resetSliceSelector ( int  iSlice)

Definition at line 102 of file FWFromTEveCaloDataSelector.cc.

References m_sliceSelectors.

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

Member Data Documentation

◆ m_changeManager

FWModelChangeManager* FWFromTEveCaloDataSelector::m_changeManager
private

Definition at line 57 of file FWFromTEveCaloDataSelector.h.

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

◆ m_data

TEveCaloData* FWFromTEveCaloDataSelector::m_data
private

Definition at line 56 of file FWFromTEveCaloDataSelector.h.

Referenced by doSelect(), and doUnselect().

◆ m_sliceSelectors

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