CMS 3D CMS Logo

CastorPedestalWidths Class Reference

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

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

List of all members.

Public Types

typedef CastorPedestalWidth Item

Public Member Functions

 CastorPedestalWidths ()
std::vector< DetIdgetAllChannels () const
 get list of all available channels
float getSigma (DetId fId, int fCapId1, int fCapId2) const
 get correlation for given capId1/2 = 0..3
const CastorPedestalWidthgetValues (DetId fId) const
 get all values
float getWidth (DetId fId, int fCapId) const
 get value for given capId = 0..3
void setWidth (const CastorPedestalWidth &fItem)
 add new (empty) item
CastorPedestalWidthsetWidth (DetId fId)
 add new (empty) item
void sort ()
 sort values by channelId
bool sorted () const
 check if data are sorted
 ~CastorPedestalWidths ()

Private Attributes

std::vector< CastorPedestalWidthmItems
bool mSorted


Detailed Description

Author:
Panos Katsas (UoA) POOL container to store PedestalWidth values 4xCapId $Author: katsas

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

Definition at line 19 of file CastorPedestalWidths.h.


Member Typedef Documentation

typedef CastorPedestalWidth CastorPedestalWidths::Item

Definition at line 40 of file CastorPedestalWidths.h.


Constructor & Destructor Documentation

CastorPedestalWidths::CastorPedestalWidths (  ) 

Definition at line 31 of file CastorPedestalWidths.cc.

00032   : mSorted (false) {}

CastorPedestalWidths::~CastorPedestalWidths (  ) 

Definition at line 34 of file CastorPedestalWidths.cc.

00034 {}


Member Function Documentation

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

get list of all available channels

Definition at line 87 of file CastorPedestalWidths.cc.

References mItems, and HLT_VtxMuL3::result.

00087                                                              {
00088   std::vector<DetId> result;
00089   for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) {
00090     result.push_back (DetId (item->rawId ()));
00091   }
00092   return result;
00093 }

float CastorPedestalWidths::getSigma ( DetId  fId,
int  fCapId1,
int  fCapId2 
) const

get correlation for given capId1/2 = 0..3

Definition at line 63 of file CastorPedestalWidths.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), CastorPedestalWidth::getSigma(), getValues(), and values.

Referenced by CastorPedestalAnalysis::CastorPedVal().

00063                                                                                {
00064   const CastorPedestalWidth* values;
00065   if (fCapId1 >= 0 && fCapId1 < 4 && fCapId2 >= 0 && fCapId2 < 4) {
00066     values = getValues (fId);
00067     if (values) return values->getSigma (fCapId1, fCapId2);
00068   }
00069   else {
00070     std::cerr << "CastorPedestalWidths::getSigma-> capId " << fCapId1 << " or " << fCapId2 << " is out of range [0..3]" << std::endl;
00071   }
00072   return -1;
00073 }

const CastorPedestalWidth * CastorPedestalWidths::getValues ( DetId  fId  )  const

get all values

Definition at line 36 of file CastorPedestalWidths.cc.

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

Referenced by CastorDbService::getPedestalWidth(), getSigma(), and getWidth().

00036                                                                            {
00037   CastorPedestalWidth target (fId.rawId ());
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 << "CastorPedestalWidths::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 PedestalWidth for cell " << HcalGenericDetId(fId);
00048   return &(*cell);
00049 }

float CastorPedestalWidths::getWidth ( DetId  fId,
int  fCapId 
) const

get value for given capId = 0..3

Definition at line 51 of file CastorPedestalWidths.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), getValues(), CastorPedestalWidth::getWidth(), and values.

00051                                                                  {
00052   const CastorPedestalWidth* values;
00053   if (fCapId >= 0 && fCapId < 4) {
00054     values = getValues (fId);
00055     if (values) return values->getWidth (fCapId);
00056   }
00057   else {
00058     std::cerr << "CastorPedestalWidths::getWidth-> capId " << fCapId << " is out of range [0..3]" << std::endl;
00059   }
00060   return -1;
00061 }

void CastorPedestalWidths::setWidth ( const CastorPedestalWidth fItem  ) 

add new (empty) item

Definition at line 82 of file CastorPedestalWidths.cc.

References mItems, and mSorted.

00082                                                                      {
00083   mItems.push_back (fItem);
00084   mSorted = false;
00085 }

CastorPedestalWidth * CastorPedestalWidths::setWidth ( DetId  fId  ) 

add new (empty) item

Definition at line 75 of file CastorPedestalWidths.cc.

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

Referenced by CastorPedestalAnalysis::CastorPedVal().

00075                                                               {
00076   CastorPedestalWidth item (fId.rawId ());
00077   mItems.push_back (item);
00078   mSorted = false;
00079   return &(mItems.back ());
00080 }

void CastorPedestalWidths::sort (  ) 

sort values by channelId

Definition at line 96 of file CastorPedestalWidths.cc.

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

Referenced by CastorPedestalAnalysis::done().

00096                                  {
00097   if (!mSorted) {
00098     std::sort (mItems.begin(), mItems.end(), compareItems ());
00099     mSorted = true;
00100   }
00101 }

bool CastorPedestalWidths::sorted (  )  const [inline]

check if data are sorted

Definition at line 33 of file CastorPedestalWidths.h.

References mSorted.

Referenced by getValues().

00033 {return mSorted;}


Member Data Documentation

std::vector<CastorPedestalWidth> CastorPedestalWidths::mItems [private]

Definition at line 42 of file CastorPedestalWidths.h.

Referenced by getAllChannels(), getValues(), setWidth(), and sort().

bool CastorPedestalWidths::mSorted [private]

Definition at line 43 of file CastorPedestalWidths.h.

Referenced by setWidth(), sort(), and sorted().


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