CMS 3D CMS Logo

CastorRawGains Class Reference

Author:
Panos Katsas (UoA) POOL container to store Gain values 4xCapId
More...

#include <CondFormats/CastorObjects/interface/CastorRawGains.h>

List of all members.

Public Types

typedef std::vector< ItemContainer
typedef CastorRawGain Item

Public Member Functions

CastorRawGainaddItem (DetId fId)
 add new (empty) item
void addValues (DetId fId, const CastorRawGain &fValues)
 fill values
 CastorRawGains ()
std::vector< DetIdgetAllChannels () const
 get list of all available channels
const CastorRawGaingetValues (DetId fId) const
 get value
void sort ()
 sort values by channelId
bool sorted () const
 check if data are sorted
 ~CastorRawGains ()

Private Attributes

Container mItems
bool mSorted


Detailed Description

Author:
Panos Katsas (UoA) POOL container to store Gain values 4xCapId

Author:
Panos Katsas (UoA) POOL object to store Gain values 4xCapId

Definition at line 17 of file CastorRawGains.h.


Member Typedef Documentation

typedef std::vector<Item> CastorRawGains::Container

Definition at line 35 of file CastorRawGains.h.

typedef CastorRawGain CastorRawGains::Item

Definition at line 34 of file CastorRawGains.h.


Constructor & Destructor Documentation

CastorRawGains::CastorRawGains (  ) 

Definition at line 31 of file CastorRawGains.cc.

00032   : mSorted (false) {}

CastorRawGains::~CastorRawGains (  ) 

Definition at line 34 of file CastorRawGains.cc.

00034 {}


Member Function Documentation

CastorRawGain * CastorRawGains::addItem ( DetId  fId  ) 

add new (empty) item

Definition at line 60 of file CastorRawGains.cc.

References mItems, mSorted, and DetId::rawId().

00060                                                  {
00061   CastorRawGain item (fId.rawId ());
00062   mItems.push_back (item);
00063   mSorted = false;
00064   return &(mItems.back ());
00065 }

void CastorRawGains::addValues ( DetId  fId,
const CastorRawGain fValues 
)

fill values

Definition at line 67 of file CastorRawGains.cc.

References CastorRawGain::getError(), CastorRawGain::getStatus(), CastorRawGain::getValue(), CastorRawGain::getVoltage(), mItems, mSorted, and DetId::rawId().

00067                                                                        {
00068   Item item (fId.rawId (), fValues.getValue(), fValues.getError(), fValues.getVoltage(), fValues.getStatus());
00069   mItems.push_back (item);
00070   mSorted = false;
00071 }

std::vector< DetId > CastorRawGains::getAllChannels (  )  const

get list of all available channels

Definition at line 51 of file CastorRawGains.cc.

References mItems, and HLT_VtxMuL3::result.

00051                                                        {
00052   std::vector<DetId> result;
00053   for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) {
00054     result.push_back (DetId (item->rawId ()));
00055   }
00056   return result;
00057 }

const CastorRawGain * CastorRawGains::getValues ( DetId  fId  )  const

get value

Definition at line 36 of file CastorRawGains.cc.

References CastorRawGain::BAD, TestMuL1L2Filter_cff::cerr, lat::endl(), find(), mItems, DetId::rawId(), sorted(), and target.

00036                                                                {
00037   Item target (fId.rawId (), 0, 0, 0, CastorRawGain::BAD);
00038   std::vector<Item>::const_iterator cell;
00039   if (sorted ()) {
00040     cell = std::lower_bound (mItems.begin(), mItems.end(), target, compareItems ());
00041   }
00042   else {
00043     std::cerr << "CastorRawGains::getValues-> container is not sorted. Please sort it to search effectively" << std::endl;
00044     cell = find (mItems, fId.rawId ());
00045   }
00046   if (cell == mItems.end() || cell->rawId () != target.rawId ())
00047     throw cms::Exception ("Conditions not found") << "Unavailable Raw Gains for cell " << HcalGenericDetId(target.rawId());
00048   return &(*cell);
00049 }

void CastorRawGains::sort (  ) 

sort values by channelId

Definition at line 74 of file CastorRawGains.cc.

References mItems, mSorted, and python::multivaluedict::sort().

00074                            {
00075   if (!mSorted) {
00076     std::sort (mItems.begin(), mItems.end(), compareItems ());
00077     mSorted = true;
00078   }
00079 }

bool CastorRawGains::sorted (  )  const [inline]

check if data are sorted

Definition at line 26 of file CastorRawGains.h.

References mSorted.

Referenced by getValues().

00026 {return mSorted;}


Member Data Documentation

Container CastorRawGains::mItems [private]

Definition at line 37 of file CastorRawGains.h.

Referenced by addItem(), addValues(), getAllChannels(), getValues(), and sort().

bool CastorRawGains::mSorted [private]

Definition at line 38 of file CastorRawGains.h.

Referenced by addItem(), addValues(), sort(), and sorted().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:14 2009 for CMSSW by  doxygen 1.5.4