CMS 3D CMS Logo

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

#include <SiStripSummary.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 (sistripsummary::TrackerRegion region, 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
 
void print ()
 
bool put (const uint32_t &detID, InputVector &input, std::vector< std::string > &userContent)
 
bool put (sistripsummary::TrackerRegion region, 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)
 
 SiStripSummary (std::vector< std::string > &userDBContent)
 
 SiStripSummary (const SiStripSummary &input)
 
 SiStripSummary ()
 
 ~SiStripSummary ()
 

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 66 of file SiStripSummary.h.

Member Typedef Documentation

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

Definition at line 82 of file SiStripSummary.h.

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

Definition at line 86 of file SiStripSummary.h.

Definition at line 83 of file SiStripSummary.h.

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

Definition at line 84 of file SiStripSummary.h.

typedef Registry::const_iterator SiStripSummary::RegistryIterator

Definition at line 85 of file SiStripSummary.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripSummary.cc.

References runNr_, timeValue_, and userDBContent_.

6  {
7  userDBContent_ = userDBContent;
8  runNr_ = 0;
9  timeValue_ = 0;
10 }
unsigned long long timeValue_
std::vector< std::string > userDBContent_
SiStripSummary::SiStripSummary ( const SiStripSummary input)

Definition at line 12 of file SiStripSummary.cc.

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

12  {
14  runNr_ = input.getTimeValue();
15  timeValue_ = input.getRunNr();
16  v_sum_.clear();
17  indexes_.clear();
18  v_sum_.insert(v_sum_.end(), input.v_sum_.begin(), input.v_sum_.end());
19  indexes_.insert(indexes_.end(), input.indexes_.begin(), input.indexes_.end());
20 }
unsigned long long getTimeValue() const
std::vector< DetRegistry > indexes_
std::vector< float > v_sum_
unsigned long long timeValue_
std::vector< std::string > getUserDBContent() const
int getRunNr() const
std::vector< std::string > userDBContent_
SiStripSummary::SiStripSummary ( )
inline

Definition at line 90 of file SiStripSummary.h.

90 {};
SiStripSummary::~SiStripSummary ( )
inline

Definition at line 91 of file SiStripSummary.h.

91 {};

Member Function Documentation

ContainerIterator SiStripSummary::getDataVectorBegin ( ) const
inline

Definition at line 93 of file SiStripSummary.h.

93 { return v_sum_.begin(); }
std::vector< float > v_sum_
ContainerIterator SiStripSummary::getDataVectorEnd ( ) const
inline

Definition at line 94 of file SiStripSummary.h.

94 { return v_sum_.end(); }
std::vector< float > v_sum_
std::vector< uint32_t > SiStripSummary::getDetIds ( ) const

Definition at line 70 of file SiStripSummary.cc.

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

Referenced by SiStripSummaryReader::analyze(), and getSummaryObj().

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

Definition at line 81 of file SiStripSummary.cc.

References spr::find(), and userDBContent_.

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

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

Definition at line 61 of file SiStripSummary.cc.

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

Referenced by SiStripSummaryReader::analyze(), getSummaryObj(), and setObj().

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

Definition at line 95 of file SiStripSummary.h.

95 { return indexes_.begin(); }
std::vector< DetRegistry > indexes_
RegistryIterator SiStripSummary::getRegistryVectorEnd ( ) const
inline

Definition at line 96 of file SiStripSummary.h.

References input, list(), put(), HLT_2018_cff::region, and AlCaHLTBitMon_QueryRunRegistry::string.

96 { return indexes_.end(); }
std::vector< DetRegistry > indexes_
int SiStripSummary::getRunNr ( ) const
inline

Definition at line 137 of file SiStripSummary.h.

References edm::print().

Referenced by SiStripSummary().

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

Definition at line 113 of file SiStripSummary.cc.

References getPosition(), getRange(), mps_fire::i, and FastTimerService_cff::range.

113  {
114  std::vector<float> SummaryObj;
115  const SiStripSummary::Range range = getRange(detID);
116  if (range.first != range.second) {
117  for (unsigned int i = 0; i < list.size(); i++) {
118  const short pos = getPosition(list.at(i));
119 
120  if (pos != -1)
121  SummaryObj.push_back(*((range.first) + pos));
122  else
123  SummaryObj.push_back(-999.);
124  }
125  } else
126  for (unsigned int i = 0; i < list.size(); i++)
127  SummaryObj.push_back(
128  -99.); // no summary obj has ever been inserted for this detid, most likely all related histos were not available in DQM
129 
130  return SummaryObj;
131 }
const Range getRange(const uint32_t &detID) const
std::pair< ContainerIterator, ContainerIterator > Range
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
const short getPosition(std::string elementName) const
std::vector< float > SiStripSummary::getSummaryObj ( sistripsummary::TrackerRegion  region,
const std::vector< std::string > &  list 
) const

Definition at line 133 of file SiStripSummary.cc.

References getSummaryObj(), and HLT_2018_cff::region.

134  {
135  uint32_t fakeDet = region;
136  return getSummaryObj(fakeDet, list);
137 }
std::vector< float > getSummaryObj() const
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 > SiStripSummary::getSummaryObj ( std::string  elementName) const

Definition at line 154 of file SiStripSummary.cc.

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

154  {
155  std::vector<float> vSumElement;
156  std::vector<uint32_t> DetIds_ = getDetIds();
157  const short pos = getPosition(elementName);
158 
159  if (pos != -1) {
160  for (unsigned int i = 0; i < DetIds_.size(); i++) {
161  const SiStripSummary::Range range = getRange(DetIds_.at(i));
162  if (range.first != range.second) {
163  vSumElement.push_back(*((range.first) + pos));
164  } else {
165  vSumElement.push_back(-99.);
166  }
167  }
168  }
169 
170  return vSumElement;
171 }
std::vector< uint32_t > getDetIds() const
const Range getRange(const uint32_t &detID) const
std::pair< ContainerIterator, ContainerIterator > Range
const short getPosition(std::string elementName) const
std::vector< float > SiStripSummary::getSummaryObj ( uint32_t &  detID) const

Definition at line 139 of file SiStripSummary.cc.

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

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

Definition at line 152 of file SiStripSummary.cc.

References v_sum_.

Referenced by getSummaryObj().

152 { return v_sum_; }
std::vector< float > v_sum_
unsigned long long SiStripSummary::getTimeValue ( ) const
inline

Definition at line 135 of file SiStripSummary.h.

Referenced by SiStripSummary().

135 { return timeValue_; }
unsigned long long timeValue_
std::vector<std::string> SiStripSummary::getUserDBContent ( ) const
inline

Definition at line 136 of file SiStripSummary.h.

Referenced by SiStripSummaryBuilder::analyze(), SiStripSummaryReader::analyze(), and SiStripSummary().

136 { return userDBContent_; }
std::vector< std::string > userDBContent_
void SiStripSummary::print ( void  )

Definition at line 173 of file SiStripSummary.cc.

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

173  {
174  std::cout << "Nr. of detector elements in SiStripSummary object is " << indexes_.size() << " RunNr= " << runNr_
175  << " timeValue= " << timeValue_ << std::endl;
176 }
std::vector< DetRegistry > indexes_
unsigned long long timeValue_
bool SiStripSummary::put ( const uint32_t &  detID,
InputVector input,
std::vector< std::string > &  userContent 
)

Definition at line 22 of file SiStripSummary.cc.

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

Referenced by SiStripSummaryBuilder::analyze(), and put().

22  {
23  Registry::iterator p =
24  std::lower_bound(indexes_.begin(), indexes_.end(), DetId, SiStripSummary::StrictWeakOrdering());
25 
26  if (p == indexes_.end() || p->detid != DetId) {
27  //First request for the given DetID
28  //Create entries for all the declared userDBContent
29  //and fill for the provided userContent
30 
31  DetRegistry detregistry;
32  detregistry.detid = DetId;
33  detregistry.ibegin = v_sum_.size();
34  indexes_.insert(p, detregistry);
35  InputVector tmp(userDBContent_.size(), -9999);
36 
37  for (size_t i = 0; i < userContent.size(); ++i)
38  tmp[getPosition(userContent[i])] = input[i];
39 
40  v_sum_.insert(v_sum_.end(), tmp.begin(), tmp.end());
41  } else {
42  if (p->detid == DetId) {
43  //I should already find the entries
44  //fill for the provided userContent
45 
46  for (size_t i = 0; i < userContent.size(); ++i)
47  v_sum_[p->ibegin + getPosition(userContent[i])] = input[i];
48  }
49  }
50 
51  return true;
52 }
std::vector< DetRegistry > indexes_
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< float > v_sum_
std::vector< float > InputVector
Definition: DetId.h:17
std::vector< std::string > userDBContent_
tmp
align.sh
Definition: createJobs.py:716
const short getPosition(std::string elementName) const
bool SiStripSummary::put ( sistripsummary::TrackerRegion  region,
InputVector input,
std::vector< std::string > &  userContent 
)

Definition at line 54 of file SiStripSummary.cc.

References put(), and HLT_2018_cff::region.

56  {
57  uint32_t fakeDet = region;
58  return put(fakeDet, input, userContent);
59 }
static std::string const input
Definition: EdmProvDump.cc:48
bool put(const uint32_t &detID, InputVector &input, std::vector< std::string > &userContent)
template<class Archive >
void SiStripSummary::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiStripSummary::setObj ( const uint32_t &  detID,
std::string  elementName,
float  value 
)

Definition at line 94 of file SiStripSummary.cc.

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

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

Definition at line 132 of file SiStripSummary.h.

Referenced by SiStripSummaryBuilder::analyze().

132 { runNr_ = inputRunNr; }
void SiStripSummary::setTimeValue ( unsigned long long  inputTimeValue)
inline

Definition at line 133 of file SiStripSummary.h.

133 { timeValue_ = inputTimeValue; }
unsigned long long timeValue_
void SiStripSummary::setUserDBContent ( const std::vector< std::string > &  userDBContent)
inline

Definition at line 131 of file SiStripSummary.h.

Referenced by SiStripSummaryBuilder::analyze().

131 { userDBContent_ = userDBContent; }
std::vector< std::string > userDBContent_

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 156 of file SiStripSummary.h.

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

Definition at line 156 of file SiStripSummary.h.

Member Data Documentation

std::vector<DetRegistry> SiStripSummary::indexes_

Definition at line 147 of file SiStripSummary.h.

Referenced by getDetIds(), getRange(), print(), put(), setObj(), and SiStripSummary().

int SiStripSummary::runNr_

Definition at line 149 of file SiStripSummary.h.

Referenced by print(), and SiStripSummary().

unsigned long long SiStripSummary::timeValue_

Definition at line 150 of file SiStripSummary.h.

Referenced by print(), and SiStripSummary().

std::vector<std::string> SiStripSummary::userDBContent_

Definition at line 145 of file SiStripSummary.h.

Referenced by getPosition(), getRange(), getSummaryObj(), put(), and SiStripSummary().

std::vector<float> SiStripSummary::v_sum_

Definition at line 146 of file SiStripSummary.h.

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