CMS 3D CMS Logo

EcalContainer< DetId, T > Class Template Reference

#include <DataFormats/EcalDetId/interface/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, T > self
typedef Item value_type

Public Member Functions

const_iterator begin () const
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 15 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 23 of file EcalContainer.h.

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

Definition at line 20 of file EcalContainer.h.

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

Definition at line 22 of file EcalContainer.h.

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

Definition at line 24 of file EcalContainer.h.

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

Definition at line 19 of file EcalContainer.h.

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

Definition at line 21 of file EcalContainer.h.


Member Function Documentation

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

Definition at line 61 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::begin().

00061                                                     {
00062                         return m_items.begin();
00063                 }

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

Definition at line 65 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::end(), and EcalCondObjectContainer< T >::find().

00065                                                   {
00066                         return m_items.end();
00067                 }

template<typename DetId, typename T>
const_iterator EcalContainer< DetId, T >::find ( uint32_t  rawId  )  const [inline]

Definition at line 55 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::find().

00055                                                                  {
00056                         DetId ib(rawId);
00057                         if ( !isValidId(ib) ) return m_items.end();
00058                         return m_items.begin() + ib.hashedIndex();
00059                 }

template<typename DetId, typename T>
void EcalContainer< DetId, T >::insert ( std::pair< uint32_t, Item > const &  a  )  [inline]

Definition at line 26 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::insert().

00026                                                               {
00027                         (*this)[a.first] = a.second;
00028                 }

template<typename DetId, typename T>
bool EcalContainer< DetId, T >::isValidId ( const DetId  id  )  const [inline, private]

Definition at line 76 of file EcalContainer.h.

Referenced by EcalContainer< EBDetId, Item >::find(), and EcalContainer< EBDetId, Item >::operator[]().

00076                                                             {
00077                         return id.det() == ::DetId::Ecal;
00078                 };

template<typename DetId, typename T>
const Item& EcalContainer< DetId, T >::item ( size_t  hashid  )  const [inline]

Definition at line 30 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::barrel(), and EcalCondObjectContainer< T >::endcap().

00030                                                               {
00031                         return m_items[hashid];
00032                 }

template<typename DetId, typename T>
const Items& EcalContainer< DetId, T >::items (  )  const [inline]

Definition at line 34 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::barrelItems(), and EcalCondObjectContainer< T >::endcapItems().

00034                                                    {
00035                         return m_items;
00036                 }

template<typename DetId, typename T>
Item const& EcalContainer< DetId, T >::operator[] ( uint32_t  rawId  )  const [inline]

Definition at line 48 of file EcalContainer.h.

00048                                                                      {
00049                         static Item dummy;
00050                         DetId id(rawId);
00051                         if ( !isValidId(id) ) return dummy;
00052                         return m_items[id.hashedIndex()];
00053                 }

template<typename DetId, typename T>
Item& EcalContainer< DetId, T >::operator[] ( uint32_t  rawId  )  [inline]

Definition at line 38 of file EcalContainer.h.

00038                                                          {
00039                         if (m_items.empty()) {
00040                                 m_items.resize(DetId::SIZE_HASH);
00041                         }
00042                         static Item dummy;
00043                         DetId id(rawId);
00044                         if ( !isValidId(id) ) return dummy;
00045                         return m_items[id.hashedIndex()];
00046                 }

template<typename DetId, typename T>
size_t EcalContainer< DetId, T >::size ( void   )  const [inline]

Definition at line 69 of file EcalContainer.h.

Referenced by EcalCondObjectContainer< T >::size().

00069                                            {
00070                         return m_items.size();
00071                 }


Member Data Documentation

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

Definition at line 78 of file EcalContainer.h.

Referenced by EcalContainer< EBDetId, Item >::begin(), EcalContainer< EBDetId, Item >::end(), EcalContainer< EBDetId, Item >::find(), EcalContainer< EBDetId, Item >::item(), EcalContainer< EBDetId, Item >::items(), EcalContainer< EBDetId, Item >::operator[](), and EcalContainer< EBDetId, Item >::size().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:19:28 2009 for CMSSW by  doxygen 1.5.4