CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWFromTEveCaloDataSelector Class Reference

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

Inheritance diagram for FWFromTEveCaloDataSelector:
FWFromEveSelectorBase

List of all members.

Public Member Functions

void addSliceSelector (int iSlice, FWFromSliceSelector *)
void doSelect ()
void doUnselect ()
 FWFromTEveCaloDataSelector (TEveCaloData *)
void resetSliceSelector (int iSlice)
virtual ~FWFromTEveCaloDataSelector ()

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.

                                                                         :
m_data(iData),
m_changeManager(0)
{                       
   // reserve 3 , first slice is background
   m_sliceSelectors.reserve(3);
   m_sliceSelectors.push_back(new FWFromSliceSelector(0));
}
FWFromTEveCaloDataSelector::~FWFromTEveCaloDataSelector ( ) [virtual]

Definition at line 45 of file FWFromTEveCaloDataSelector.cc.

References i, and m_sliceSelectors.

{
   for (std::vector<FWFromSliceSelector*>::iterator i = m_sliceSelectors.begin(); i != m_sliceSelectors.end(); ++i)
   {
      delete *i;
   }
   m_sliceSelectors.clear();
}
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().

{
   assert(iSlice>0 && (iSlice <= static_cast<int>(m_sliceSelectors.size())));

   if(0==m_changeManager) {
      m_changeManager = iSelector->changeManager();
   }

   if(iSlice ==static_cast<int>(m_sliceSelectors.size())) {
      m_sliceSelectors.push_back(iSelector);
   } else {
      assert(iSlice<static_cast<int>(m_sliceSelectors.size()));
      m_sliceSelectors[iSlice]=iSelector;
   }
}
void FWFromTEveCaloDataSelector::doSelect ( ) [virtual]

Implements FWFromEveSelectorBase.

Definition at line 70 of file FWFromTEveCaloDataSelector.cc.

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

{
   assert(m_changeManager);
   FWChangeSentry sentry(*m_changeManager);
   std::for_each(m_sliceSelectors.begin(),
                 m_sliceSelectors.end(),
                 boost::bind(&FWFromSliceSelector::clear,_1));
   const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
   for(TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(),itEnd=cellIds.end();
       it != itEnd;
       ++it) {
      assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
      m_sliceSelectors[it->fSlice]->doSelect(*it);
   }
}
void FWFromTEveCaloDataSelector::doUnselect ( ) [virtual]

Implements FWFromEveSelectorBase.

Definition at line 87 of file FWFromTEveCaloDataSelector.cc.

References m_changeManager, m_data, and m_sliceSelectors.

{
   assert(m_changeManager);
   //std::cout <<"FWFromTEveCaloDataSelector::doUnselect()"<<std::endl;
   
   FWChangeSentry sentry(*m_changeManager);
   const TEveCaloData::vCellId_t& cellIds = m_data->GetCellsSelected();
   for(TEveCaloData::vCellId_t::const_iterator it = cellIds.begin(),itEnd=cellIds.end();
       it != itEnd;
       ++it) {
      assert(it->fSlice < static_cast<int>(m_sliceSelectors.size()));
      m_sliceSelectors[it->fSlice]->doUnselect(*it);
   }
}
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().

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

Member Data Documentation

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