CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

EcalContainer< DetId, T > Class Template Reference

#include <EcalContainer.h>

List of all members.

Public Types

typedef std::vector< Item >
::const_iterator 
const_iterator
typedef T Item
typedef std::vector< ItemItems
typedef std::vector< Item >
::iterator 
iterator
typedef EcalContainer< DetId, Tself
typedef Item value_type

Public Member Functions

const_iterator begin () const
void checkAndResize ()
void checkAndResize (size_t priv_size)
 EcalContainer ()
const_iterator end () const
const_iterator find (uint32_t rawId) const
void insert (std::pair< uint32_t, Item > const &a)
const Itemitem (size_t hashid) const
const Itemsitems () const
Item const & operator[] (uint32_t rawId) const
Itemoperator[] (uint32_t rawId)
size_t size () const

Private Member Functions

bool isValidId (const DetId id) const

Private Attributes

std::vector< Itemm_items

Detailed Description

template<typename DetId, typename T>
class EcalContainer< DetId, T >

Definition at line 18 of file EcalContainer.h.


Member Typedef Documentation

template<typename DetId, typename T>
typedef std::vector<Item>::const_iterator EcalContainer< DetId, T >::const_iterator

Definition at line 26 of file EcalContainer.h.

template<typename DetId, typename T>
typedef T EcalContainer< DetId, T >::Item

Definition at line 23 of file EcalContainer.h.

template<typename DetId, typename T>
typedef std::vector<Item> EcalContainer< DetId, T >::Items

Definition at line 25 of file EcalContainer.h.

template<typename DetId, typename T>
typedef std::vector<Item>::iterator EcalContainer< DetId, T >::iterator

Definition at line 27 of file EcalContainer.h.

template<typename DetId, typename T>
typedef EcalContainer<DetId, T> EcalContainer< DetId, T >::self

Definition at line 22 of file EcalContainer.h.

template<typename DetId, typename T>
typedef Item EcalContainer< DetId, T >::value_type

Definition at line 24 of file EcalContainer.h.


Constructor & Destructor Documentation

template<typename DetId, typename T>
EcalContainer< DetId, T >::EcalContainer ( ) [inline]

Definition at line 30 of file EcalContainer.h.


Member Function Documentation

template<typename DetId, typename T>
const_iterator EcalContainer< DetId, T >::begin ( void  ) const [inline]
template<typename DetId, typename T>
void EcalContainer< DetId, T >::checkAndResize ( ) [inline]

Definition at line 53 of file EcalContainer.h.

Referenced by EcalCondTowerObjectContainer< T >::EcalCondTowerObjectContainer(), EcalContainer< EcalTrigTowerDetId, Item >::EcalContainer(), and EcalContainer< EcalTrigTowerDetId, Item >::operator[]().

                                      {
                  if (m_items.size()==0) {
                    //              std::cout << "resizing to " << DetId::kSizeForDenseIndexing << std::endl;
                    m_items.resize(DetId::kSizeForDenseIndexing);
                  }
                }
template<typename DetId, typename T>
void EcalContainer< DetId, T >::checkAndResize ( size_t  priv_size) [inline]

Definition at line 61 of file EcalContainer.h.

                                                        {
                  // this method allows to resize the vector to a specific size forcing a specific value
                  if (m_items.size()==0) {
                    //              std::cout << "resizing to " << priv_size << std::endl;
                    m_items.resize(priv_size);
                  }
                }
template<typename DetId, typename T>
const_iterator EcalContainer< DetId, T >::end ( void  ) const [inline]
template<typename DetId, typename T>
const_iterator EcalContainer< DetId, T >::find ( uint32_t  rawId) const [inline]

Definition at line 80 of file EcalContainer.h.

Referenced by ESCondObjectContainer< T >::find(), EcalCondTowerObjectContainer< T >::find(), and EcalCondObjectContainer< EcalLaserAPDPNpair >::find().

                                                                 {
                        DetId ib(rawId);
                        if ( !isValidId(ib) ) return m_items.end();
                        return m_items.begin() + ib.hashedIndex();
                }
template<typename DetId, typename T>
void EcalContainer< DetId, T >::insert ( std::pair< uint32_t, Item > const &  a) [inline]
template<typename DetId, typename T>
bool EcalContainer< DetId, T >::isValidId ( const DetId  id) const [inline, private]
template<typename DetId, typename T>
const Item& EcalContainer< DetId, T >::item ( size_t  hashid) const [inline]
template<typename DetId, typename T>
const Items& EcalContainer< DetId, T >::items ( ) const [inline]
template<typename DetId, typename T>
Item& EcalContainer< DetId, T >::operator[] ( uint32_t  rawId) [inline]

Definition at line 44 of file EcalContainer.h.

                                                         {
                  checkAndResize();
                  static Item dummy;
                  DetId id(rawId);
                  if ( !isValidId(id) ) return dummy;
                  return m_items[id.hashedIndex()];
                }
template<typename DetId, typename T>
Item const& EcalContainer< DetId, T >::operator[] ( uint32_t  rawId) const [inline]

Definition at line 69 of file EcalContainer.h.

                                                                     {
                  //                        if (m_items.size()==0) {
                  //      std::cout << "resizing to " << DetId::kSizeForDenseIndexing << std::endl;
                  //              m_items.resize((size_t) DetId::kSizeForDenseIndexing);
                  //      }
                        static Item dummy;
                        DetId id(rawId);
                        if ( !isValidId(id) ) return dummy;
                        return m_items[id.hashedIndex()];
                }
template<typename DetId, typename T>
size_t EcalContainer< DetId, T >::size ( void  ) const [inline]

Member Data Documentation

template<typename DetId, typename T>
std::vector<Item> EcalContainer< DetId, T >::m_items [private]