File indexing completed on 2024-04-06 12:09:33
0001 #ifndef DQMOffline_L1Trigger_L1TLSBlock_h
0002 #define DQMOffline_L1Trigger_L1TLSBlock_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #include <iostream>
0051 #include <fstream>
0052 #include <string>
0053 #include <vector>
0054 #include <algorithm>
0055
0056
0057
0058
0059 template <class T1, class T2, class Pred = std::less<T1> >
0060 struct sort_pair_first {
0061 bool operator()(const std::pair<T1, T2>& left, const std::pair<T1, T2>& right) {
0062 Pred p;
0063 return p(left.first, right.first);
0064 }
0065 };
0066
0067
0068 class L1TLSBlock {
0069 public:
0070
0071 typedef std::vector<std::pair<int, double> > LumiTestDoubleList;
0072 typedef std::vector<std::pair<int, double> > LumiTestIntList;
0073 typedef std::pair<int, int> LumiRange;
0074 typedef std::vector<LumiRange> LumiRangeList;
0075
0076 enum BLOCKBY { STATISTICS, N_BLOCKINGBY };
0077
0078 public:
0079
0080 L1TLSBlock();
0081
0082 virtual ~L1TLSBlock();
0083 LumiRangeList doBlocking(const LumiTestDoubleList&, double, BLOCKBY);
0084 LumiRangeList doBlocking(const LumiTestIntList&, int, BLOCKBY);
0085
0086
0087 private:
0088 void initializeIO(bool);
0089 void blockByStatistics();
0090 void orderTestDoubleList();
0091 void orderTestIntList();
0092
0093 double computeErrorFromRange(LumiRange&);
0094
0095
0096 private:
0097 LumiTestIntList inputIntList_;
0098 LumiTestDoubleList inputDoubleList_;
0099 LumiRangeList outputList_;
0100 double thresholdD_;
0101 int thresholdI_;
0102 };
0103
0104 #endif