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

FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( TEveCaloData *  iData)

Definition at line 30 of file FWFromTEveCaloDataSelector.cc.

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 }

References m_sliceSelectors.

◆ ~FWFromTEveCaloDataSelector()

FWFromTEveCaloDataSelector::~FWFromTEveCaloDataSelector ( )
override

Definition at line 41 of file FWFromTEveCaloDataSelector.cc.

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 }

References mps_fire::i, and m_sliceSelectors.

◆ FWFromTEveCaloDataSelector() [2/2]

FWFromTEveCaloDataSelector::FWFromTEveCaloDataSelector ( const FWFromTEveCaloDataSelector )
privatedelete

Member Function Documentation

◆ addSliceSelector()

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

Definition at line 86 of file FWFromTEveCaloDataSelector.cc.

86  {
87  assert(iSlice > 0 && (iSlice <= static_cast<int>(m_sliceSelectors.size())));
88 
89  if (nullptr == m_changeManager) {
90  m_changeManager = iSelector->changeManager();
91  }
92 
93  if (iSlice == static_cast<int>(m_sliceSelectors.size())) {
94  m_sliceSelectors.push_back(iSelector);
95  } else {
96  assert(iSlice < static_cast<int>(m_sliceSelectors.size()));
97  m_sliceSelectors[iSlice] = iSelector;
98  }
99 }

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

◆ doSelect()

void FWFromTEveCaloDataSelector::doSelect ( )
overridevirtual

Implements FWFromEveSelectorBase.

Definition at line 63 of file FWFromTEveCaloDataSelector.cc.

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

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

◆ doUnselect()

void FWFromTEveCaloDataSelector::doUnselect ( )
overridevirtual

Implements FWFromEveSelectorBase.

Definition at line 74 of file FWFromTEveCaloDataSelector.cc.

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

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

◆ operator=()

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

◆ resetSliceSelector()

void FWFromTEveCaloDataSelector::resetSliceSelector ( int  iSlice)

Definition at line 101 of file FWFromTEveCaloDataSelector.cc.

101 { m_sliceSelectors[iSlice]->reset(); }

References m_sliceSelectors.

Member Data Documentation

◆ m_changeManager

FWModelChangeManager* FWFromTEveCaloDataSelector::m_changeManager
private

Definition at line 58 of file FWFromTEveCaloDataSelector.h.

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

◆ m_data

TEveCaloData* FWFromTEveCaloDataSelector::m_data
private

Definition at line 57 of file FWFromTEveCaloDataSelector.h.

Referenced by doSelect(), and doUnselect().

◆ m_sliceSelectors

std::vector<FWFromSliceSelector*> FWFromTEveCaloDataSelector::m_sliceSelectors
private
mps_fire.i
i
Definition: mps_fire.py:355
cms::cuda::assert
assert(be >=bs)
FWFromSliceSelector::clear
void clear()
Definition: FWFromSliceSelector.cc:38
FWChangeSentry
Definition: FWModelChangeManager.h:68
FWFromTEveCaloDataSelector::m_changeManager
FWModelChangeManager * m_changeManager
Definition: FWFromTEveCaloDataSelector.h:58
FWFromTEveCaloDataSelector::m_data
TEveCaloData * m_data
Definition: FWFromTEveCaloDataSelector.h:57
FWFromSliceSelector
Definition: FWFromSliceSelector.h:30
FWFromTEveCaloDataSelector::m_sliceSelectors
std::vector< FWFromSliceSelector * > m_sliceSelectors
Definition: FWFromTEveCaloDataSelector.h:56
FWFromSliceSelector::changeManager
FWModelChangeManager * changeManager() const
Definition: FWFromSliceSelector.cc:55