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 (const LumiTestDoubleList &, double, BLOCKBY)
 
LumiRangeList doBlocking (const 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

Description: offline DQM class for LS blocking

Implementation: <TODO: enter implementation details>

Author
: Pietro Vischia - LIP Lisbon pietr.nosp@m.o.vi.nosp@m.schia.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Changelog: 2012/10/23 12:01:01: Creation, infrastructure and blocking by statistics

Todo:

Description: offline DQM class for LS blocking

Implementation: <TODO: enter implementation details>

Author
: Pietro Vischia - LIP Lisbon pietr.nosp@m.o.vi.nosp@m.schia.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Changelog: 2012/10/23 12:01:01: Class

Todo: see header file

Definition at line 72 of file L1TLSBlock.h.

Member Typedef Documentation

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

Definition at line 78 of file L1TLSBlock.h.

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

Definition at line 79 of file L1TLSBlock.h.

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

Definition at line 76 of file L1TLSBlock.h.

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

Definition at line 77 of file L1TLSBlock.h.

Member Enumeration Documentation

Enumerator
STATISTICS 
N_BLOCKINGBY 

Definition at line 81 of file L1TLSBlock.h.

Constructor & Destructor Documentation

L1TLSBlock::L1TLSBlock ( )

Definition at line 62 of file L1TLSBlock.cc.

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

Definition at line 72 of file L1TLSBlock.cc.

72 {}

Member Function Documentation

void L1TLSBlock::blockByStatistics ( )
private

Definition at line 150 of file L1TLSBlock.cc.

References i.

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

Definition at line 171 of file L1TLSBlock.cc.

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

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

Definition at line 77 of file L1TLSBlock.cc.

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

78 {
79  inputDoubleList_ = inputList;
81 
82  initializeIO(true);
83 
85 
86  switch(blockingMethod){
87  case STATISTICS:
89  break;
90  default:
91  cout << "[L1TLSBlock::doBlocking()]: Blocking method does not exist or is not implemented" << endl;
92  }
93 
94 
95  return outputList_;
96 }
LumiRangeList outputList_
Definition: L1TLSBlock.h:103
void blockByStatistics()
Definition: L1TLSBlock.cc:150
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:102
double thresholdD_
Definition: L1TLSBlock.h:104
void orderTestDoubleList()
Definition: L1TLSBlock.cc:135
void initializeIO(bool)
Definition: L1TLSBlock.cc:124
tuple cout
Definition: gather_cfg.py:121
L1TLSBlock::LumiRangeList L1TLSBlock::doBlocking ( const LumiTestIntList inputList,
int  threshold,
BLOCKBY  blockingMethod 
)

Definition at line 101 of file L1TLSBlock.cc.

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

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

Definition at line 124 of file L1TLSBlock.cc.

124  {
125  if(!outputOnly){
126  inputIntList_.clear();
127  inputDoubleList_.clear();
128  }
129  outputList_.clear();
130 }
LumiRangeList outputList_
Definition: L1TLSBlock.h:103
LumiTestIntList inputIntList_
Definition: L1TLSBlock.h:101
LumiTestDoubleList inputDoubleList_
Definition: L1TLSBlock.h:102
void L1TLSBlock::orderTestDoubleList ( )
private

Definition at line 135 of file L1TLSBlock.cc.

References python.multivaluedict::sort().

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

Definition at line 143 of file L1TLSBlock.cc.

References python.multivaluedict::sort().

143  {
145 }
LumiTestIntList inputIntList_
Definition: L1TLSBlock.h:101

Member Data Documentation

LumiTestDoubleList L1TLSBlock::inputDoubleList_
private

Definition at line 102 of file L1TLSBlock.h.

LumiTestIntList L1TLSBlock::inputIntList_
private

Definition at line 101 of file L1TLSBlock.h.

LumiRangeList L1TLSBlock::outputList_
private

Definition at line 103 of file L1TLSBlock.h.

double L1TLSBlock::thresholdD_
private

Definition at line 104 of file L1TLSBlock.h.

int L1TLSBlock::thresholdI_
private

Definition at line 105 of file L1TLSBlock.h.