CMS 3D CMS Logo

CastorChannelQuality Class Reference

Author:
Panos Katsas (UoA) POOL object to store channel quality information
More...

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

List of all members.

Public Types

enum  Quality {
  UNKNOWN = 0, BAD = 1, GOOD = 2, HOT = 3,
  DEAD = 4, END = 5
}

Public Member Functions

 CastorChannelQuality ()
std::vector< unsigned long > getAllChannels () const
Quality quality (unsigned long fId, bool fWarning=true) const
bool setChannel (unsigned long fId, Quality fQuality=UNKNOWN)
void sort ()
bool sorted () const
 ~CastorChannelQuality ()

Static Public Member Functions

static const char * str (Quality fQuality)

Protected Attributes

std::vector< ItemmItems
bool mSorted

Classes

class  Item


Detailed Description

Author:
Panos Katsas (UoA) POOL object to store channel quality information

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

Definition at line 15 of file CastorChannelQuality.h.


Member Enumeration Documentation

enum CastorChannelQuality::Quality

Enumerator:
UNKNOWN 
BAD 
GOOD 
HOT 
DEAD 
END 

Definition at line 17 of file CastorChannelQuality.h.

00017                {
00018     UNKNOWN = 0,
00019     BAD = 1,
00020     GOOD = 2,
00021     HOT = 3,
00022     DEAD = 4,
00023     END = 5
00024   };


Constructor & Destructor Documentation

CastorChannelQuality::CastorChannelQuality (  ) 

Definition at line 13 of file CastorChannelQuality.cc.

00014   : mSorted (false) {}

CastorChannelQuality::~CastorChannelQuality (  ) 

Definition at line 16 of file CastorChannelQuality.cc.

00016 {}


Member Function Documentation

std::vector< unsigned long > CastorChannelQuality::getAllChannels (  )  const

Definition at line 34 of file CastorChannelQuality.cc.

References mItems, and HLT_VtxMuL3::result.

00034                                                                      {
00035   std::vector<unsigned long> result;
00036   for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++) {
00037     result.push_back (item->mId);
00038   }
00039   return result;
00040 }

CastorChannelQuality::Quality CastorChannelQuality::quality ( unsigned long  fId,
bool  fWarning = true 
) const

Definition at line 18 of file CastorChannelQuality.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), find(), CastorChannelQuality::Item::mId, mItems, sorted(), and target.

00018                                                                                                  {
00019   Item target;
00020   target.mId = fId;
00021   std::vector<Item>::const_iterator cell;
00022   if (sorted ()) {
00023     cell = std::lower_bound (mItems.begin(), mItems.end(), target);
00024   }
00025   else {
00026     if (fWarning) std::cerr << "CastorChannelQuality::quality-> container is not sorted. Sort it to search effectively" << std::endl;
00027     cell = std::find (mItems.begin(), mItems.end(), target);
00028   }
00029   if (cell == mItems.end() || cell->mId != fId)
00030     throw cms::Exception ("Conditions not found") << "Unavailable Quality for cell " << HcalGenericDetId(fId);
00031   return (CastorChannelQuality::Quality) cell->mQuality;
00032 }

bool CastorChannelQuality::setChannel ( unsigned long  fId,
Quality  fQuality = UNKNOWN 
)

Definition at line 42 of file CastorChannelQuality.cc.

References CastorChannelQuality::Item::mId, CastorChannelQuality::Item::mQuality, and mSorted.

00042                                                                           {
00043   Item item;
00044   item.mId = fId;
00045   item.mQuality = unsigned (fQuality);
00046   mSorted = false;
00047   return true;
00048 }

void CastorChannelQuality::sort (  ) 

Definition at line 50 of file CastorChannelQuality.cc.

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

00050                                  {
00051   if (!mSorted) {
00052     std::sort (mItems.begin(), mItems.end());
00053     mSorted = true;
00054   }
00055 }

bool CastorChannelQuality::sorted (  )  const [inline]

Definition at line 28 of file CastorChannelQuality.h.

References mSorted.

Referenced by quality().

00028 {return mSorted;}

const char * CastorChannelQuality::str ( Quality  fQuality  )  [static]

Definition at line 57 of file CastorChannelQuality.cc.

References BAD, DEAD, END, GOOD, and HOT.

00057                                                        {
00058   switch (fQuality) {
00059   case BAD: return "BAD";
00060   case GOOD: return "GOOD";
00061   case HOT: return "HOT";
00062   case DEAD: return "DEAD";
00063   case END: return "END";
00064   default: return "UNKNOWN";
00065   }
00066 }


Member Data Documentation

std::vector<Item> CastorChannelQuality::mItems [protected]

Definition at line 42 of file CastorChannelQuality.h.

Referenced by getAllChannels(), quality(), and sort().

bool CastorChannelQuality::mSorted [protected]

Definition at line 43 of file CastorChannelQuality.h.

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


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