CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions
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,
ContainerIterator
Range
 
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, 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 (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
 

Detailed Description

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

Definition at line 37 of file HDQMSummary.h.

Member Typedef Documentation

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

Definition at line 54 of file HDQMSummary.h.

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

Definition at line 58 of file HDQMSummary.h.

Definition at line 55 of file HDQMSummary.h.

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

Definition at line 56 of file HDQMSummary.h.

typedef Registry::const_iterator HDQMSummary::RegistryIterator

Definition at line 57 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:128
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:123
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:111
std::vector< float > v_sum_
Definition: HDQMSummary.h:124
unsigned long long timeValue_
Definition: HDQMSummary.h:128
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
int getRunNr() const
Definition: HDQMSummary.h:113
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:123
std::vector< std::string > getUserDBContent() const
Definition: HDQMSummary.h:112
HDQMSummary::HDQMSummary ( )
inline

Definition at line 63 of file HDQMSummary.h.

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

Definition at line 64 of file HDQMSummary.h.

64 {};

Member Function Documentation

ContainerIterator HDQMSummary::getDataVectorBegin ( ) const
inline

Definition at line 67 of file HDQMSummary.h.

References v_sum_.

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

Definition at line 68 of file HDQMSummary.h.

References v_sum_.

68 {return v_sum_.end(); }
std::vector< float > v_sum_
Definition: HDQMSummary.h:124
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 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:57
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
const short HDQMSummary::getPosition ( std::string  elementName) const
protected

Definition at line 85 of file HDQMSummary.cc.

References spr::find(), pos, 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:7
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:123
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 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:55
std::vector< float > v_sum_
Definition: HDQMSummary.h:124
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:57
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:123
Definition: DetId.h:20
tuple cout
Definition: gather_cfg.py:121
RegistryIterator HDQMSummary::getRegistryVectorBegin ( ) const
inline

Definition at line 69 of file HDQMSummary.h.

References indexes_.

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

Definition at line 70 of file HDQMSummary.h.

References indexes_.

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

Definition at line 113 of file HDQMSummary.h.

References runNr_.

Referenced by HDQMInspector::createTrend(), and HDQMSummary().

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

Definition at line 119 of file HDQMSummary.cc.

References getPosition(), getRange(), i, and pos.

Referenced by HDQMInspector::createTrend().

120 {
121  std::vector<float> SummaryObj;
122  const HDQMSummary::Range range = getRange(detID);
123  if (range.first != range.second ) {
124  for (unsigned int i=0; i<list.size(); i++){
125  const short pos=getPosition(list.at(i));
126 
127  if (pos!=-1)
128  SummaryObj.push_back(*((range.first)+pos));
129  else
130  SummaryObj.push_back(-999.);
131  }
132  }
133  else
134  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
135 
136  return SummaryObj;
137 }
int i
Definition: DBlmapReader.cc:9
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:55
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 158 of file HDQMSummary.cc.

References getDetIds(), getPosition(), getRange(), i, and pos.

159 {
160  std::vector<float> vSumElement;
161  std::vector<uint32_t> DetIds_ = getDetIds();
162  const short pos = getPosition(elementName);
163 
164  if (pos !=-1)
165  {
166  for (unsigned int i=0; i<DetIds_.size(); i++){
167  const HDQMSummary::Range range = getRange(DetIds_.at(i));
168  if (range.first != range.second ) {
169  vSumElement.push_back(*((range.first)+pos));}
170  else { vSumElement.push_back(-99.);}
171  }
172  }
173 
174  return vSumElement;
175 }
int i
Definition: DBlmapReader.cc:9
std::pair< ContainerIterator, ContainerIterator > Range
Definition: HDQMSummary.h:55
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 139 of file HDQMSummary.cc.

References getRange(), i, and userDBContent_.

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

Definition at line 152 of file HDQMSummary.cc.

References v_sum_.

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

Definition at line 111 of file HDQMSummary.h.

References timeValue_.

Referenced by HDQMSummary().

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

Definition at line 112 of file HDQMSummary.h.

References userDBContent_.

Referenced by DQMHistoryServiceBase::createSummary(), and HDQMSummary().

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

Definition at line 178 of file HDQMSummary.cc.

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

179 {
180  std::cout << "Nr. of detector elements in HDQMSummary object is " << indexes_.size()
181  << " RunNr= " << runNr_
182  << " timeValue= " << timeValue_
183  << std::endl;
184 }
unsigned long long timeValue_
Definition: HDQMSummary.h:128
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
tuple cout
Definition: gather_cfg.py:121
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(), i, HDQMSummary::DetRegistry::ibegin, indexes_, AlCaHLTBitMon_ParallelJobs::p, tmp, userDBContent_, and v_sum_.

Referenced by DQMHistoryServiceBase::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 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > v_sum_
Definition: HDQMSummary.h:124
std::vector< float > InputVector
Definition: HDQMSummary.h:58
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
std::vector< std::string > userDBContent_
Definition: HDQMSummary.h:123
Definition: DetId.h:20
const short getPosition(std::string elementName) const
Definition: HDQMSummary.cc:85
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void HDQMSummary::setObj ( const uint32_t &  detID,
std::string  elementName,
float  value 
)

Definition at line 98 of file HDQMSummary.cc.

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

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:55
std::vector< float > v_sum_
Definition: HDQMSummary.h:124
Registry::const_iterator RegistryIterator
Definition: HDQMSummary.h:57
std::vector< DetRegistry > indexes_
Definition: HDQMSummary.h:125
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 108 of file HDQMSummary.h.

References runNr_.

Referenced by DQMHistoryServiceBase::createSummary().

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

Definition at line 109 of file HDQMSummary.h.

References timeValue_.

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

Definition at line 107 of file HDQMSummary.h.

References userDBContent_.

Referenced by DQMHistoryServiceBase::createSummary().

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

Member Data Documentation

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

Definition at line 127 of file HDQMSummary.h.

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

unsigned long long HDQMSummary::timeValue_

Definition at line 128 of file HDQMSummary.h.

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

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