CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Friends
HDQMSummary Class Reference

#include <HDQMSummary.h>

Classes

struct  DetRegistry
 
class  StrictWeakOrdering
 

Public Types

typedef std::vector< float >::const_iterator ContainerIterator
 
typedef std::vector< float > InputVector
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::vector< DetRegistryRegistry
 
typedef Registry::const_iterator RegistryIterator
 

Public Member Functions

ContainerIterator getDataVectorBegin () const
 
ContainerIterator getDataVectorEnd () const
 
std::vector< uint32_t > getDetIds () const
 
const Range getRange (const uint32_t &detID) const
 
RegistryIterator getRegistryVectorBegin () const
 
RegistryIterator getRegistryVectorEnd () const
 
int getRunNr () const
 
std::vector< float > getSummaryObj (uint32_t &detID, const std::vector< std::string > &list) const
 
std::vector< float > getSummaryObj (std::string elementName) const
 
std::vector< float > getSummaryObj (uint32_t &detID) const
 
std::vector< float > getSummaryObj () const
 
unsigned long long getTimeValue () const
 
std::vector< std::string > getUserDBContent () const
 
 HDQMSummary (std::vector< std::string > &userDBContent)
 
 HDQMSummary (const HDQMSummary &input)
 
 HDQMSummary ()
 
void print ()
 
bool put (const uint32_t &detID, InputVector &input, std::vector< std::string > &userContent)
 
void setObj (const uint32_t &detID, std::string elementName, float value)
 
void setRunNr (int inputRunNr)
 
void setTimeValue (unsigned long long inputTimeValue)
 
void setUserDBContent (const std::vector< std::string > &userDBContent)
 
 ~HDQMSummary ()
 

Public Attributes

std::vector< DetRegistryindexes_
 
int runNr_
 
unsigned long long timeValue_
 
std::vector< std::string > userDBContent_
 
std::vector< float > v_sum_
 

Protected Member Functions

const short getPosition (std::string elementName) const
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Author
D. Giordano, A.-C. Le Bihan

Definition at line 39 of file HDQMSummary.h.

Member Typedef Documentation

typedef std::vector<float>::const_iterator HDQMSummary::ContainerIterator

Definition at line 58 of file HDQMSummary.h.

typedef std::vector<float> HDQMSummary::InputVector

Definition at line 62 of file HDQMSummary.h.

Definition at line 59 of file HDQMSummary.h.

typedef std::vector<DetRegistry> HDQMSummary::Registry

Definition at line 60 of file HDQMSummary.h.

typedef Registry::const_iterator HDQMSummary::RegistryIterator

Definition at line 61 of file HDQMSummary.h.

Constructor & Destructor Documentation

HDQMSummary::HDQMSummary ( std::vector< std::string > &  userDBContent)

Definition at line 6 of file HDQMSummary.cc.

References runNr_, timeValue_, and userDBContent_.

7 {
8  userDBContent_ = userDBContent;
9  runNr_ = 0;
10  timeValue_ = 0;
11 }
unsigned long long timeValue_
Definition: HDQMSummary.h:132
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
HDQMSummary::HDQMSummary ( const HDQMSummary input)

Definition at line 14 of file HDQMSummary.cc.

References getRunNr(), getTimeValue(), getUserDBContent(), indexes_, runNr_, timeValue_, userDBContent_, and v_sum_.

15 {
17  runNr_ = input.getTimeValue();
18  timeValue_ = input.getRunNr();
19  v_sum_.clear();
20  indexes_.clear();
21  v_sum_.insert(v_sum_.end(),input.v_sum_.begin(),input.v_sum_.end());
22  indexes_.insert(indexes_.end(),input.indexes_.begin(),input.indexes_.end());
23 }
unsigned long long getTimeValue() const
Definition: HDQMSummary.h:115
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
unsigned long long timeValue_
Definition: HDQMSummary.h:132
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
int getRunNr() const
Definition: HDQMSummary.h:117
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
std::vector< std::string > getUserDBContent() const
Definition: HDQMSummary.h:116
HDQMSummary::HDQMSummary ( )
inline

Definition at line 67 of file HDQMSummary.h.

67 {};
HDQMSummary::~HDQMSummary ( )
inline

Definition at line 68 of file HDQMSummary.h.

68 {};

Member Function Documentation

ContainerIterator HDQMSummary::getDataVectorBegin ( ) const
inline

Definition at line 71 of file HDQMSummary.h.

References v_sum_.

71 {return v_sum_.begin(); }
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
ContainerIterator HDQMSummary::getDataVectorEnd ( ) const
inline

Definition at line 72 of file HDQMSummary.h.

References v_sum_.

72 {return v_sum_.end(); }
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
std::vector< uint32_t > HDQMSummary::getDetIds ( ) const

Definition at line 71 of file HDQMSummary.cc.

References begin, end, indexes_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by getRegistryVectorEnd(), and getSummaryObj().

72 {
73  // returns vector of DetIds in map
74  std::vector<uint32_t> DetIds_;
77  for (HDQMSummary::RegistryIterator p=begin; p != end; ++p) {
78  DetIds_.push_back(p->detid);
79  }
80  return DetIds_;
81 }
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:61
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
const short HDQMSummary::getPosition ( std::string  elementName) const
protected

Definition at line 85 of file HDQMSummary.cc.

References spr::find(), and userDBContent_.

Referenced by getSummaryObj(), put(), and setObj().

86 {
87  // returns position of elementName in UserDBContent_
88 
89  std::vector<std::string>::const_iterator it = find(userDBContent_.begin(),userDBContent_.end(),elementName);
90  short pos = -1;
91  if (it != userDBContent_.end()) pos = it - userDBContent_.begin();
92  else edm::LogError("HDQMSummary") << "attempting to retrieve non existing historic DB object : "<< elementName <<std::endl;
93  return pos;
94 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
const HDQMSummary::Range HDQMSummary::getRange ( const uint32_t &  detID) const

Definition at line 60 of file HDQMSummary.cc.

References gather_cfg::cout, indexes_, AlCaHLTBitMon_ParallelJobs::p, userDBContent_, and v_sum_.

Referenced by getRegistryVectorEnd(), getSummaryObj(), and setObj().

61 {
62 
63  RegistryIterator p = std::lower_bound(indexes_.begin(),indexes_.end(),DetId,HDQMSummary::StrictWeakOrdering());
64  if (p==indexes_.end()|| p->detid!=DetId) {
65  return HDQMSummary::Range(v_sum_.end(),v_sum_.end()); std::cout << "not in range " << std::endl;}
66  else
67  return HDQMSummary::Range(v_sum_.begin()+p->ibegin,v_sum_.begin()+p->ibegin+userDBContent_.size());
68 }
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:59
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:61
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
Definition: DetId.h:18
RegistryIterator HDQMSummary::getRegistryVectorBegin ( ) const
inline

Definition at line 73 of file HDQMSummary.h.

References indexes_.

73 {return indexes_.begin();}
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
RegistryIterator HDQMSummary::getRegistryVectorEnd ( ) const
inline

Definition at line 74 of file HDQMSummary.h.

References getDetIds(), getRange(), getSummaryObj(), indexes_, input, list(), put(), setObj(), and AlCaHLTBitMon_QueryRunRegistry::string.

74 {return indexes_.end(); }
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
int HDQMSummary::getRunNr ( ) const
inline

Definition at line 117 of file HDQMSummary.h.

References print(), and runNr_.

Referenced by HDQMSummary().

117 { return runNr_; }
std::vector< float > HDQMSummary::getSummaryObj ( uint32_t &  detID,
const std::vector< std::string > &  list 
) const

Definition at line 119 of file HDQMSummary.cc.

References getPosition(), getRange(), mps_fire::i, and list().

120 {
121  std::vector<std::string> list = _list;
122  std::vector<float> SummaryObj;
123  const HDQMSummary::Range range = getRange(detID);
124  if (range.first != range.second ) {
125  for (unsigned int i=0; i<list.size(); i++){
126  const short pos=getPosition(list.at(i));
127 
128  if (pos!=-1)
129  SummaryObj.push_back(*((range.first)+pos));
130  else
131  SummaryObj.push_back(-999.);
132  }
133  }
134  else
135  for (unsigned int i=0; i<list.size(); i++) SummaryObj.push_back(-99.); // no summary obj has ever been inserted for this detid, most likely all related histos were not available in DQM
136 
137  return SummaryObj;
138 }
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:59
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:85
const Range getRange(const uint32_t &detID) const
Definition: HDQMSummary.cc:60
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
std::vector< float > HDQMSummary::getSummaryObj ( std::string  elementName) const

Definition at line 159 of file HDQMSummary.cc.

References getDetIds(), getPosition(), getRange(), and mps_fire::i.

160 {
161  std::vector<float> vSumElement;
162  std::vector<uint32_t> DetIds_ = getDetIds();
163  const short pos = getPosition(elementName);
164 
165  if (pos !=-1)
166  {
167  for (unsigned int i=0; i<DetIds_.size(); i++){
168  const HDQMSummary::Range range = getRange(DetIds_.at(i));
169  if (range.first != range.second ) {
170  vSumElement.push_back(*((range.first)+pos));}
171  else { vSumElement.push_back(-99.);}
172  }
173  }
174 
175  return vSumElement;
176 }
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:59
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:85
const Range getRange(const uint32_t &detID) const
Definition: HDQMSummary.cc:60
std::vector< uint32_t > getDetIds() const
Definition: HDQMSummary.cc:71
std::vector< float > HDQMSummary::getSummaryObj ( uint32_t &  detID) const

Definition at line 140 of file HDQMSummary.cc.

References getRange(), mps_fire::i, and userDBContent_.

141 {
142  std::vector<float> SummaryObj;
143  const HDQMSummary::Range range = getRange(detID);
144  if (range.first != range.second ) {
145  for (unsigned int i=0; i<userDBContent_.size(); i++) SummaryObj.push_back(*((range.first)+i));}
146  else {
147  for (unsigned int i=0; i<userDBContent_.size(); i++) SummaryObj.push_back(-99.);}
148  return SummaryObj;
149 }
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:59
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
const Range getRange(const uint32_t &detID) const
Definition: HDQMSummary.cc:60
std::vector< float > HDQMSummary::getSummaryObj ( ) const

Definition at line 153 of file HDQMSummary.cc.

References v_sum_.

Referenced by getRegistryVectorEnd().

154 {
155  return v_sum_;
156 }
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
unsigned long long HDQMSummary::getTimeValue ( ) const
inline

Definition at line 115 of file HDQMSummary.h.

References timeValue_.

Referenced by HDQMSummary().

115 { return timeValue_; }
unsigned long long timeValue_
Definition: HDQMSummary.h:132
std::vector<std::string> HDQMSummary::getUserDBContent ( ) const
inline

Definition at line 116 of file HDQMSummary.h.

References userDBContent_.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob(), and HDQMSummary().

116 { return userDBContent_; }
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
void HDQMSummary::print ( void  )

Definition at line 179 of file HDQMSummary.cc.

References gather_cfg::cout, indexes_, runNr_, and timeValue_.

Referenced by getRunNr().

180 {
181  std::cout << "Nr. of detector elements in HDQMSummary object is " << indexes_.size()
182  << " RunNr= " << runNr_
183  << " timeValue= " << timeValue_
184  << std::endl;
185 }
unsigned long long timeValue_
Definition: HDQMSummary.h:132
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
bool HDQMSummary::put ( const uint32_t &  detID,
InputVector input,
std::vector< std::string > &  userContent 
)

Definition at line 26 of file HDQMSummary.cc.

References HDQMSummary::DetRegistry::detid, getPosition(), mps_fire::i, HDQMSummary::DetRegistry::ibegin, indexes_, AlCaHLTBitMon_ParallelJobs::p, tmp, userDBContent_, and v_sum_.

Referenced by getRegistryVectorEnd(), and SiStripDQMHistoryHelper::scanTreeAndFillSummary().

27 {
28  Registry::iterator p = std::lower_bound(indexes_.begin(),indexes_.end(),DetId,HDQMSummary::StrictWeakOrdering());
29 
30  if(p==indexes_.end() || p->detid!=DetId){
31  //First request for the given DetID
32  //Create entries for all the declared userDBContent
33  //and fill for the provided userContent
34 
35  DetRegistry detregistry;
36  detregistry.detid = DetId;
37  detregistry.ibegin = v_sum_.size();
38  indexes_.insert(p,detregistry);
39  InputVector tmp(userDBContent_.size(),-9999);
40 
41  for(size_t i=0;i<userContent.size();++i)
42  tmp[getPosition(userContent[i])]=input[i];
43 
44  v_sum_.insert(v_sum_.end(),tmp.begin(),tmp.end());
45  } else {
46 
47  if (p->detid==DetId){
48  //I should already find the entries
49  //fill for the provided userContent
50 
51  for(size_t i=0;i<userContent.size();++i)
52  v_sum_[p->ibegin+getPosition(userContent[i])]=input[i];
53  }
54  }
55 
56  return true;
57 }
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< float > InputVector
Definition: HDQMSummary.h:62
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127
Definition: DetId.h:18
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:85
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
template<class Archive >
void HDQMSummary::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HDQMSummary::setObj ( const uint32_t &  detID,
std::string  elementName,
float  value 
)

Definition at line 98 of file HDQMSummary.cc.

References Exception, getPosition(), getRange(), indexes_, AlCaHLTBitMon_ParallelJobs::p, v_sum_, and relativeConstraints::value.

Referenced by getRegistryVectorEnd().

99 {
100  // modifies value of info "elementName" for the given detID
101  // requires that an entry has be defined beforehand for detId in DB
102  RegistryIterator p = std::lower_bound(indexes_.begin(),indexes_.end(),detID,HDQMSummary::StrictWeakOrdering());
103  if (p==indexes_.end()|| p->detid!=detID)
104  {
105  throw cms::Exception("")
106  <<"not allowed to modify "<< elementName << " in historic DB - SummaryObj needs to be available first !";
107  }
108 
109  const HDQMSummary::Range range = getRange(detID);
110 
111  std::vector<float>::const_iterator it = range.first+getPosition(elementName);
112  std::vector<float>::difference_type pos = -1;
113  if (it != v_sum_.end()){
114  pos = it - v_sum_.begin();
115  v_sum_.at(pos) = value; }
116 }
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:59
std::vector< float > v_sum_
Definition: HDQMSummary.h:128
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:61
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:129
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:85
const Range getRange(const uint32_t &detID) const
Definition: HDQMSummary.cc:60
void HDQMSummary::setRunNr ( int  inputRunNr)
inline

Definition at line 112 of file HDQMSummary.h.

References runNr_.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob().

112 { runNr_ = inputRunNr; }
void HDQMSummary::setTimeValue ( unsigned long long  inputTimeValue)
inline

Definition at line 113 of file HDQMSummary.h.

References timeValue_.

113 { timeValue_=inputTimeValue;}
unsigned long long timeValue_
Definition: HDQMSummary.h:132
void HDQMSummary::setUserDBContent ( const std::vector< std::string > &  userDBContent)
inline

Definition at line 111 of file HDQMSummary.h.

References userDBContent_.

Referenced by SiStripPopConHistoryDQMBase::dqmEndJob().

111 { userDBContent_ = userDBContent;}
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:127

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 142 of file HDQMSummary.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 142 of file HDQMSummary.h.

Member Data Documentation

std::vector<DetRegistry> HDQMSummary::indexes_
int HDQMSummary::runNr_

Definition at line 131 of file HDQMSummary.h.

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

unsigned long long HDQMSummary::timeValue_

Definition at line 132 of file HDQMSummary.h.

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

std::vector<std::string> HDQMSummary::userDBContent_
std::vector<float> HDQMSummary::v_sum_