Go to the documentation of this file.00001 #ifndef DQMOffline_L1Trigger_L1TLSBlock_h
00002 #define DQMOffline_L1Trigger_L1TLSBlock_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #include <iostream>
00055 #include <fstream>
00056 #include <string>
00057 #include <vector>
00058 #include <algorithm>
00059
00060
00061
00062
00063
00064
00065 template<class T1, class T2, class Pred = std::less<T1> >
00066 struct sort_pair_first {
00067 bool operator()(const std::pair<T1,T2>&left, const std::pair<T1,T2>&right) {
00068 Pred p;
00069 return p(left.first, right.first);
00070 }
00071 };
00072
00073
00074 class L1TLSBlock {
00075
00076 public:
00077
00078 typedef std::vector<std::pair<int,double> > LumiTestDoubleList;
00079 typedef std::vector<std::pair<int,double> > LumiTestIntList;
00080 typedef std::pair<int,int> LumiRange;
00081 typedef std::vector<LumiRange> LumiRangeList;
00082
00083 enum BLOCKBY{STATISTICS, N_BLOCKINGBY};
00084 public:
00085
00086 L1TLSBlock();
00087
00088 virtual ~L1TLSBlock();
00089 LumiRangeList doBlocking(LumiTestDoubleList, double, BLOCKBY);
00090 LumiRangeList doBlocking(LumiTestIntList, int, BLOCKBY);
00091
00092
00093 private:
00094 void initializeIO(bool);
00095 void blockByStatistics();
00096 void orderTestDoubleList();
00097 void orderTestIntList();
00098
00099 double computeErrorFromRange(LumiRange&);
00100
00101
00102 private:
00103 LumiTestIntList inputIntList_;
00104 LumiTestDoubleList inputDoubleList_;
00105 LumiRangeList outputList_;
00106 double thresholdD_;
00107 int thresholdI_;
00108
00109 };
00110
00111 #endif