CMS 3D CMS Logo

SiStripPerformanceSummary Class Reference

Description: <one line="" class="" summary>=""> Implementation: <Object for writing to a DB the long-term detector performance of the Silicon Strip Tracker>. More...

#include <CondFormats/SiStripObjects/SiStripPerformanceSummary.h>

List of all members.

Public Member Functions

void clear ()
void getDetIds (std::vector< uint32_t > &vdetids) const
unsigned int getRunNr () const
void getSummary (const uint32_t input_detid, std::vector< float > &voutput) const
unsigned long long getTimeValue () const
std::vector< DetSummarygetWholeSummary () const
std::pair< bool, std::vector
< DetSummary >::iterator > 
initDet (const uint32_t input_detid)
void print (const std::vector< float > &pvec) const
void print (const uint32_t detid) const
void print () const
void printall () const
bool setClusterCharge (uint32_t input_detid, float clusterChargeMean, float clusterChargeRMS)
bool setClusterSize (uint32_t input_detid, float clusterSizeMean, float clusterSizeRMS)
std::pair< bool, std::vector
< DetSummary >::iterator > 
setDet (const uint32_t input_detid, const std::vector< float > &input_values)
bool setOccupancy (uint32_t input_detid, float occupancyMean, float occupancyRMS)
bool setPercentNoisyStrips (uint32_t input_detid, float noisyStrips)
void setRunNr (unsigned int inputRunNr)
void setTimeValue (unsigned long long inputTimeValue)
 SiStripPerformanceSummary (const SiStripPerformanceSummary &)
 SiStripPerformanceSummary ()
unsigned int size ()
 ~SiStripPerformanceSummary ()

Private Member Functions

float getOneValue (uint32_t input_detid, int index1)
bool setOneValue (uint32_t input_detid, float val1, int index1)
bool setTwoValues (uint32_t input_detid, float val1, float val2, int index1, int index2)

Private Attributes

unsigned int runNr_
unsigned long long timeValue_
std::vector< DetSummaryvDetSummary_

Classes

struct  DetSummary
class  MatchDetSummaryDetId
class  StrictWeakOrdering


Detailed Description

Description: <one line="" class="" summary>=""> Implementation: <Object for writing to a DB the long-term detector performance of the Silicon Strip Tracker>.

Definition at line 22 of file SiStripPerformanceSummary.h.


Constructor & Destructor Documentation

SiStripPerformanceSummary::SiStripPerformanceSummary (  ) 

Definition at line 5 of file SiStripPerformanceSummary.cc.

00005 : runNr_(0), timeValue_(0){}

SiStripPerformanceSummary::SiStripPerformanceSummary ( const SiStripPerformanceSummary rhs  ) 

Definition at line 9 of file SiStripPerformanceSummary.cc.

References getRunNr(), getTimeValue(), getWholeSummary(), runNr_, timeValue_, and vDetSummary_.

00009                                                                                         {
00010   runNr_ = rhs.getRunNr();
00011   timeValue_ = rhs.getTimeValue();
00012   vDetSummary_ = rhs.getWholeSummary();
00013 }

SiStripPerformanceSummary::~SiStripPerformanceSummary (  ) 

Definition at line 6 of file SiStripPerformanceSummary.cc.

00006 { edm::LogInfo("Destructor")<<" SiStripPerformanceSummary destructor called."; }


Member Function Documentation

void SiStripPerformanceSummary::clear ( void   )  [inline]

Definition at line 47 of file SiStripPerformanceSummary.h.

References vDetSummary_.

Referenced by HistoricOfflineClient::beginRun().

00047 {vDetSummary_.clear();}; // reset the list of summaries

void SiStripPerformanceSummary::getDetIds ( std::vector< uint32_t > &  vdetids  )  const

Definition at line 93 of file SiStripPerformanceSummary.cc.

References begin, end, and vDetSummary_.

00093                                                                             {
00094   std::vector<DetSummary>::const_iterator begin = vDetSummary_.begin();
00095   std::vector<DetSummary>::const_iterator end   = vDetSummary_.end();
00096   for (std::vector<DetSummary>::const_iterator perf=begin; perf != end; ++perf) {
00097     vdetids.push_back(perf->detId);
00098   }
00099 }

float SiStripPerformanceSummary::getOneValue ( uint32_t  input_detid,
int  index1 
) [private]

Definition at line 78 of file SiStripPerformanceSummary.cc.

References getSummary(), kDetSummarySize, and kNonsenseValue.

00078                                                                             {
00079   if(index1>kDetSummarySize){
00080     edm::LogError("GetError")<<" Could not get values for such index index1="<<index1<<" Maximum index is "<<kDetSummarySize;
00081     return kNonsenseValue;
00082   }
00083   std::vector<float> voutput; voutput.clear();
00084   getSummary(input_detid, voutput);
00085   if(voutput.size()==kDetSummarySize){
00086      return voutput[index1];
00087   }else{
00088     return kNonsenseValue;
00089   }
00090 }

unsigned int SiStripPerformanceSummary::getRunNr (  )  const [inline]

Definition at line 80 of file SiStripPerformanceSummary.h.

References runNr_.

Referenced by SiStripPerformanceSummary().

00080 {return runNr_;};

void SiStripPerformanceSummary::getSummary ( const uint32_t  input_detid,
std::vector< float > &  voutput 
) const

Definition at line 119 of file SiStripPerformanceSummary.cc.

References SiStripPerformanceSummary::DetSummary::detId, dummy, and vDetSummary_.

Referenced by getOneValue().

00119                                                                                                      {
00120   DetSummary dummy; dummy.detId = input_detid;
00121   std::vector<DetSummary>::const_iterator ivDet = std::find_if(vDetSummary_.begin(),vDetSummary_.end(), MatchDetSummaryDetId(input_detid));
00122   if( ivDet==vDetSummary_.end() ){
00123     edm::LogError("get")<<"Cannot find any DetSummary for DetId="<<input_detid;
00124   }else{
00125     voutput = ivDet->performanceValues;
00126   }
00127 }

unsigned long long SiStripPerformanceSummary::getTimeValue (  )  const [inline]

Definition at line 82 of file SiStripPerformanceSummary.h.

References timeValue_.

Referenced by SiStripPerformanceSummary().

00082 {return timeValue_;};

std::vector<DetSummary> SiStripPerformanceSummary::getWholeSummary (  )  const [inline]

Definition at line 83 of file SiStripPerformanceSummary.h.

References vDetSummary_.

Referenced by SiStripPerformanceSummary().

00083 {return vDetSummary_;};

std::pair< bool, std::vector< SiStripPerformanceSummary::DetSummary >::iterator > SiStripPerformanceSummary::initDet ( const uint32_t  input_detid  ) 

Definition at line 37 of file SiStripPerformanceSummary.cc.

References i, kDetSummarySize, kNonsenseValue, and setDet().

Referenced by setOneValue(), and setTwoValues().

00037                                                                                                                                   { // initialize with defaults
00038   std::vector<float> input_values; for(int i = 0; i<kDetSummarySize; ++i) input_values.push_back(kNonsenseValue);
00039   return  setDet(input_detid, input_values);
00040 }

void SiStripPerformanceSummary::print ( const std::vector< float > &  pvec  )  const

Definition at line 141 of file SiStripPerformanceSummary.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00141                                                                        {
00142  for(std::vector<float>::const_iterator ip = pvec.begin(); ip != pvec.end(); ++ip) std::cout<<" "<<*ip;
00143  std::cout<<std::endl;
00144 }

void SiStripPerformanceSummary::print ( const uint32_t  detid  )  const

Definition at line 107 of file SiStripPerformanceSummary.cc.

References SiStripPerformanceSummary::DetSummary::detId, dummy, print(), and vDetSummary_.

00107                                                                      {
00108   DetSummary dummy; dummy.detId = input_detid;
00109   std::vector<DetSummary>::const_iterator ivDet = std::find_if(vDetSummary_.begin(),vDetSummary_.end(), MatchDetSummaryDetId(input_detid));
00110   if( ivDet==vDetSummary_.end() ){
00111     edm::LogError("print")<<"Cannot find any DetSummary for DetId="<<input_detid;
00112   }else{
00113     edm::LogInfo("print")<<"Input detid="<<input_detid<<"  DetSummary for DetId="<<ivDet->detId;
00114     print(ivDet->performanceValues);
00115   }
00116 }

void SiStripPerformanceSummary::print ( void   )  const

Definition at line 102 of file SiStripPerformanceSummary.cc.

References lat::endl(), runNr_, timeValue_, and vDetSummary_.

Referenced by SiStripPerformanceSummaryBuilder::analyze(), CopyPerformanceSummary::endRun(), HistoricOfflineClient::endRun(), print(), and printall().

00102                                            {
00103   edm::LogInfo("print")<<"Nr. of elements in SiStripPerformanceSummary object is "<<  vDetSummary_.size()<<" RunNr="<<runNr_<<" timeValue="<<timeValue_<<std::endl;
00104 }

void SiStripPerformanceSummary::printall (  )  const

Definition at line 130 of file SiStripPerformanceSummary.cc.

References begin, GenMuonPlsPt100GeV_cfg::cout, end, print(), and vDetSummary_.

00130                                               {
00131   print();
00132   std::vector<DetSummary>::const_iterator begin = vDetSummary_.begin();
00133   std::vector<DetSummary>::const_iterator end   = vDetSummary_.end();
00134   for (std::vector<DetSummary>::const_iterator perf=begin; perf != end; ++perf) {
00135     std::cout<<" detid = "<<perf->detId;
00136     print(perf->performanceValues);
00137   }
00138 }

bool SiStripPerformanceSummary::setClusterCharge ( uint32_t  input_detid,
float  clusterChargeMean,
float  clusterChargeRMS 
) [inline]

Definition at line 70 of file SiStripPerformanceSummary.h.

References setTwoValues().

Referenced by SiStripPerformanceSummaryBuilder::analyze(), and HistoricOfflineClient::fillSummaryObjects().

00070                                                                                                {
00071      return setTwoValues(input_detid,clusterChargeMean,clusterChargeRMS,2,3);
00072    };

bool SiStripPerformanceSummary::setClusterSize ( uint32_t  input_detid,
float  clusterSizeMean,
float  clusterSizeRMS 
) [inline]

Definition at line 67 of file SiStripPerformanceSummary.h.

References setTwoValues().

Referenced by SiStripPerformanceSummaryBuilder::analyze(), and HistoricOfflineClient::fillSummaryObjects().

00067                                                                                          {
00068      return setTwoValues(input_detid,clusterSizeMean,clusterSizeRMS,0,1);
00069    };

std::pair< bool, std::vector< SiStripPerformanceSummary::DetSummary >::iterator > SiStripPerformanceSummary::setDet ( const uint32_t  input_detid,
const std::vector< float > &  input_values 
)

Definition at line 16 of file SiStripPerformanceSummary.cc.

References SiStripPerformanceSummary::DetSummary::detId, kDetSummarySize, SiStripPerformanceSummary::DetSummary::performanceValues, and vDetSummary_.

Referenced by initDet().

00016                                                                                                                                                                        {
00017   std::vector<DetSummary>::iterator ivDet = vDetSummary_.end();
00018   // return false and end() if input vector not appropriate
00019   if(input_values.size() != kDetSummarySize) {
00020    edm::LogError("FillError")<<"wrong input size "<<input_values.size()<<". Can only add "<<kDetSummarySize<<" values. Not adding to SiStripPerformanceSummary";
00021     return std::make_pair(false, ivDet);
00022   }
00023   // return false and the old iterator if detid already exists
00024   ivDet = std::lower_bound(vDetSummary_.begin(),vDetSummary_.end(),input_detid,SiStripPerformanceSummary::StrictWeakOrdering());
00025   if (ivDet!=vDetSummary_.end() && ivDet->detId==input_detid){
00026     return std::make_pair(false, ivDet); // Already exists, not adding
00027   }
00028   // create detector summary for the input_detid, return true and the new iterator
00029   DetSummary detSummary;
00030   detSummary.detId=input_detid;
00031   detSummary.performanceValues = input_values;
00032   // put at the position-1 returned by the StrictWeakOrdering
00033   return std::make_pair(true, vDetSummary_.insert(ivDet, detSummary));
00034 }

bool SiStripPerformanceSummary::setOccupancy ( uint32_t  input_detid,
float  occupancyMean,
float  occupancyRMS 
) [inline]

Definition at line 73 of file SiStripPerformanceSummary.h.

References setTwoValues().

Referenced by SiStripPerformanceSummaryBuilder::analyze(), and HistoricOfflineClient::fillSummaryObjects().

00073                                                                                    {
00074      return setTwoValues(input_detid,occupancyMean,occupancyRMS,4,5);
00075    };

bool SiStripPerformanceSummary::setOneValue ( uint32_t  input_detid,
float  val1,
int  index1 
) [private]

Definition at line 61 of file SiStripPerformanceSummary.cc.

References initDet(), kDetSummarySize, and vDetSummary_.

Referenced by setPercentNoisyStrips().

00061                                                                                        {
00062   if(index1>kDetSummarySize){
00063    edm::LogError("SetError")<<" Could not set values for such index index1="<<index1<<" Maximum index is "<<kDetSummarySize;
00064    return false;
00065   }
00066   std::pair<bool, std::vector<DetSummary>::iterator> init_result = initDet(input_detid);
00067   if (init_result.first == true || init_result.second != vDetSummary_.end() ){ // new entry was created or existed before
00068     init_result.second->performanceValues[index1] = val1;
00069     return true;
00070   }else{
00071     edm::LogError("SetError")<<" Could not set values, new entry could not be created for detid="<<input_detid;
00072     return false;
00073   }
00074   return true;
00075 }

bool SiStripPerformanceSummary::setPercentNoisyStrips ( uint32_t  input_detid,
float  noisyStrips 
) [inline]

Definition at line 76 of file SiStripPerformanceSummary.h.

References setOneValue().

Referenced by SiStripPerformanceSummaryBuilder::analyze(), and HistoricOfflineClient::fillSummaryObjects().

00076                                                                       {
00077      return setOneValue(input_detid,noisyStrips,6);
00078    };

void SiStripPerformanceSummary::setRunNr ( unsigned int  inputRunNr  )  [inline]

Definition at line 79 of file SiStripPerformanceSummary.h.

References runNr_.

Referenced by HistoricOfflineClient::beginRun().

00079 { runNr_ = inputRunNr;};

void SiStripPerformanceSummary::setTimeValue ( unsigned long long  inputTimeValue  )  [inline]

Definition at line 81 of file SiStripPerformanceSummary.h.

References timeValue_.

Referenced by HistoricOfflineClient::analyze(), and SiStripPerformanceSummaryBuilder::analyze().

00081 {timeValue_=inputTimeValue;};

bool SiStripPerformanceSummary::setTwoValues ( uint32_t  input_detid,
float  val1,
float  val2,
int  index1,
int  index2 
) [private]

Definition at line 43 of file SiStripPerformanceSummary.cc.

References initDet(), kDetSummarySize, and vDetSummary_.

Referenced by setClusterCharge(), setClusterSize(), and setOccupancy().

00043                                                                                                                 {
00044   if(index1>kDetSummarySize || index2>kDetSummarySize){
00045    edm::LogError("SetError")<<" Could not set values for such indeces index1="<<index1<<" index2="<<index2<<" Maximum index is "<<kDetSummarySize;
00046    return false;
00047   }
00048   std::pair<bool, std::vector<DetSummary>::iterator> init_result = initDet(input_detid);
00049   if (init_result.first == true || init_result.second != vDetSummary_.end() ){ // new entry was created or existed before
00050     init_result.second->performanceValues[index1] = val1;
00051     init_result.second->performanceValues[index2] = val2;
00052     return true;
00053   }else{
00054     edm::LogError("SetError")<<" Could not set values, new entry could not be created for detid="<<input_detid;
00055     return false;
00056   }
00057   return true;
00058 }

unsigned int SiStripPerformanceSummary::size ( void   )  [inline]

Definition at line 48 of file SiStripPerformanceSummary.h.

References vDetSummary_.

00048 {return vDetSummary_.size();}; // size of list of summaries


Member Data Documentation

unsigned int SiStripPerformanceSummary::runNr_ [private]

Definition at line 93 of file SiStripPerformanceSummary.h.

Referenced by getRunNr(), print(), setRunNr(), and SiStripPerformanceSummary().

unsigned long long SiStripPerformanceSummary::timeValue_ [private]

Definition at line 94 of file SiStripPerformanceSummary.h.

Referenced by getTimeValue(), print(), setTimeValue(), and SiStripPerformanceSummary().

std::vector<DetSummary> SiStripPerformanceSummary::vDetSummary_ [private]

Definition at line 92 of file SiStripPerformanceSummary.h.

Referenced by clear(), getDetIds(), getSummary(), getWholeSummary(), print(), printall(), setDet(), setOneValue(), setTwoValues(), SiStripPerformanceSummary(), and size().


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