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 87 of file FWFromTEveCaloDataSelector.cc.

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 }

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(
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 }

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

◆ doUnselect()

void FWFromTEveCaloDataSelector::doUnselect ( )
overridevirtual

Implements FWFromEveSelectorBase.

Definition at line 75 of file FWFromTEveCaloDataSelector.cc.

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 }

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 102 of file FWFromTEveCaloDataSelector.cc.

102 { 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:428
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