CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
L1TLSBlock Class Reference

#include <L1TLSBlock.h>

Public Types

enum  BLOCKBY { STATISTICS, N_BLOCKINGBY }
 
typedef std::pair< int, int > LumiRange
 
typedef std::vector< LumiRangeLumiRangeList
 
typedef std::vector< std::pair
< int, double > > 
LumiTestDoubleList
 
typedef std::vector< std::pair
< int, double > > 
LumiTestIntList
 

Public Member Functions

LumiRangeList doBlocking (LumiTestDoubleList, double, BLOCKBY)
 
LumiRangeList doBlocking (LumiTestIntList, int, BLOCKBY)
 
 L1TLSBlock ()
 
virtual ~L1TLSBlock ()
 

Private Member Functions

void blockByStatistics ()
 
double computeErrorFromRange (LumiRange &)
 
void initializeIO (bool)
 
void orderTestDoubleList ()
 
void orderTestIntList ()
 

Private Attributes

LumiTestDoubleList inputDoubleList_
 
LumiTestIntList inputIntList_
 
LumiRangeList outputList_
 
double thresholdD_
 
int thresholdI_
 

Detailed Description

Definition at line 74 of file L1TLSBlock.h.

Member Typedef Documentation

typedef std::pair<int,int> L1TLSBlock::LumiRange

Definition at line 80 of file L1TLSBlock.h.

typedef std::vector<LumiRange> L1TLSBlock::LumiRangeList

Definition at line 81 of file L1TLSBlock.h.

typedef std::vector<std::pair<int,double> > L1TLSBlock::LumiTestDoubleList

Definition at line 78 of file L1TLSBlock.h.

typedef std::vector<std::pair<int,double> > L1TLSBlock::LumiTestIntList

Definition at line 79 of file L1TLSBlock.h.

Member Enumeration Documentation

Enumerator
STATISTICS 
N_BLOCKINGBY 

Definition at line 83 of file L1TLSBlock.h.

Constructor & Destructor Documentation

L1TLSBlock::L1TLSBlock ( )

Definition at line 64 of file L1TLSBlock.cc.

64  {
65 
66  // Initialize LumiRangeList object. This will be redone at every doBlocking call. Perhaps rethink this
67  initializeIO(false);
68 
69 }
void initializeIO(bool)
Definition: L1TLSBlock.cc:126
L1TLSBlock::~L1TLSBlock ( )
virtual

Definition at line 74 of file L1TLSBlock.cc.

74 {}

Member Function Documentation

void L1TLSBlock::blockByStatistics ( )
private

Definition at line 152 of file L1TLSBlock.cc.

References i.

152  {
153  LumiRange currentRange;
154  double currentError(0);
155  bool resetFlag(true);
156 
157  for(LumiTestDoubleList::iterator i=inputDoubleList_.begin(); i!=inputDoubleList_.end(); i++){
158  if(resetFlag){
159  currentRange = std::make_pair(i->first,i->first);
160  resetFlag = false;
161  }
162  else
163  currentRange = std::make_pair(currentRange.first,i->first);
164  currentError = computeErrorFromRange(currentRange);
165  if(currentError < thresholdD_){
166  outputList_.push_back(currentRange);
167  resetFlag = true;
168  }
169 
170  }
171 }
int i
Definition: DBlmapReader.cc:9
LumiRangeList outputList_
Definition: L1TLSBlock.h:105
std::pair< int, int > LumiRange
Definition: L1TLSBlock.h:80
double computeErrorFromRange(LumiRange &)
Definition: L1TLSBlock.cc:173
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:104
double thresholdD_
Definition: L1TLSBlock.h:106
double L1TLSBlock::computeErrorFromRange ( LumiRange lumiRange)
private

Definition at line 173 of file L1TLSBlock.cc.

References error, first, i, and edm::second().

173  {
174  std::vector<double> errorList;
175  errorList.clear();
176 
177  for(size_t i=0; i < inputDoubleList_.size(); i++){
178  if(inputDoubleList_[i].first>lumiRange.first && inputDoubleList_[i].first<lumiRange.second)
179  errorList.push_back(inputDoubleList_[i].second);
180  }
181 
182  double error(-1);
183  for(size_t i=0; i<errorList.size(); i++)
184  error += 1 / (errorList[i] * errorList[i] );
185  return error;
186 
187 }
int i
Definition: DBlmapReader.cc:9
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:94
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:104
L1TLSBlock::LumiRangeList L1TLSBlock::doBlocking ( LumiTestDoubleList  inputList,
double  threshold,
BLOCKBY  blockingMethod 
)

Definition at line 79 of file L1TLSBlock.cc.

References gather_cfg::cout, and dtDQMClient_cfg::threshold.

80 {
81  inputDoubleList_ = inputList;
83 
84  initializeIO(true);
85 
87 
88  switch(blockingMethod){
89  case STATISTICS:
91  break;
92  default:
93  cout << "[L1TLSBlock::doBlocking()]: Blocking method does not exist or is not implemented" << endl;
94  }
95 
96 
97  return outputList_;
98 }
LumiRangeList outputList_
Definition: L1TLSBlock.h:105
void blockByStatistics()
Definition: L1TLSBlock.cc:152
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:104
double thresholdD_
Definition: L1TLSBlock.h:106
void orderTestDoubleList()
Definition: L1TLSBlock.cc:137
void initializeIO(bool)
Definition: L1TLSBlock.cc:126
tuple cout
Definition: gather_cfg.py:121
L1TLSBlock::LumiRangeList L1TLSBlock::doBlocking ( LumiTestIntList  inputList,
int  threshold,
BLOCKBY  blockingMethod 
)

Definition at line 103 of file L1TLSBlock.cc.

References gather_cfg::cout, and dtDQMClient_cfg::threshold.

104 {
105  inputIntList_ = inputList;
107 
108  initializeIO(true);
109 
111 
112  switch(blockingMethod){
113  case STATISTICS:
114  cout << "[L1TLSBlock::doBlocking()]: Blocking by statistics require doubles as inputs for test variable and threshold" << endl;
115  break;
116  default:
117  cout << "[L1TLSBlock::doBlocking()]: Blocking method does not exist or is not implemented" << endl;
118  }
119 
120  return outputList_;
121 }
LumiRangeList outputList_
Definition: L1TLSBlock.h:105
void orderTestIntList()
Definition: L1TLSBlock.cc:145
LumiTestIntList inputIntList_
Definition: L1TLSBlock.h:103
int thresholdI_
Definition: L1TLSBlock.h:107
void initializeIO(bool)
Definition: L1TLSBlock.cc:126
tuple cout
Definition: gather_cfg.py:121
void L1TLSBlock::initializeIO ( bool  outputOnly)
private

Definition at line 126 of file L1TLSBlock.cc.

126  {
127  if(!outputOnly){
128  inputIntList_.clear();
129  inputDoubleList_.clear();
130  }
131  outputList_.clear();
132 }
LumiRangeList outputList_
Definition: L1TLSBlock.h:105
LumiTestIntList inputIntList_
Definition: L1TLSBlock.h:103
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:104
void L1TLSBlock::orderTestDoubleList ( )
private

Definition at line 137 of file L1TLSBlock.cc.

References python.multivaluedict::sort().

137  {
139  // std::sort(v.begin(), v.end(), sort_pair_second<int, std::greater<int> >());
140 }
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:104
void L1TLSBlock::orderTestIntList ( )
private

Definition at line 145 of file L1TLSBlock.cc.

References python.multivaluedict::sort().

145  {
147 }
LumiTestIntList inputIntList_
Definition: L1TLSBlock.h:103

Member Data Documentation

LumiTestDoubleList L1TLSBlock::inputDoubleList_
private

Definition at line 104 of file L1TLSBlock.h.

LumiTestIntList L1TLSBlock::inputIntList_
private

Definition at line 103 of file L1TLSBlock.h.

LumiRangeList L1TLSBlock::outputList_
private

Definition at line 105 of file L1TLSBlock.h.

double L1TLSBlock::thresholdD_
private

Definition at line 106 of file L1TLSBlock.h.

int L1TLSBlock::thresholdI_
private

Definition at line 107 of file L1TLSBlock.h.