1 |
ahart |
1.1 |
#ifndef CUT_FLOW
|
2 |
|
|
|
3 |
|
|
#define CUT_FLOW
|
4 |
|
|
|
5 |
|
|
#include <iostream>
|
6 |
|
|
#include <iomanip>
|
7 |
|
|
#include <map>
|
8 |
|
|
#include <string>
|
9 |
|
|
#include <vector>
|
10 |
|
|
|
11 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
12 |
|
|
#include "CommonTools/UtilAlgos/interface/TFileService.h"
|
13 |
|
|
|
14 |
|
|
#include "TH1D.h"
|
15 |
|
|
#include "TStopwatch.h"
|
16 |
|
|
|
17 |
|
|
using namespace std;
|
18 |
|
|
|
19 |
|
|
class CutFlow
|
20 |
|
|
{
|
21 |
ahart |
1.2 |
typedef void (CutFlow::*boolType) () const;
|
22 |
|
|
|
23 |
ahart |
1.1 |
public:
|
24 |
|
|
CutFlow () {};
|
25 |
ahart |
1.2 |
CutFlow (const edm::Service<TFileService> &, const string &prefix = "");
|
26 |
ahart |
1.1 |
~CutFlow ();
|
27 |
|
|
bool &operator[] (const string &);
|
28 |
|
|
bool &at (const string &cutName) { return (*this)[cutName]; };
|
29 |
ahart |
1.2 |
bool pass () const;
|
30 |
|
|
operator boolType () const { return pass () ? &CutFlow::thisTypeDoesNotSupportComparisons : 0; };
|
31 |
ahart |
1.1 |
|
32 |
ahart |
1.3 |
void fillCutFlow (double);
|
33 |
|
|
void fillCutFlow () { fillCutFlow (1.0); };
|
34 |
ahart |
1.1 |
void outputTime ();
|
35 |
|
|
void outputCutFlow ();
|
36 |
|
|
|
37 |
|
|
private:
|
38 |
|
|
TH1D *cutFlow_;
|
39 |
|
|
TH1D *selection_;
|
40 |
ahart |
1.2 |
TH1D *rejection_;
|
41 |
ahart |
1.1 |
|
42 |
|
|
TStopwatch sw_;
|
43 |
|
|
string prefix_;
|
44 |
|
|
vector<string> cutNames_;
|
45 |
|
|
map<string, bool> cuts_;
|
46 |
ahart |
1.2 |
|
47 |
|
|
void thisTypeDoesNotSupportComparisons () const {};
|
48 |
ahart |
1.1 |
};
|
49 |
|
|
|
50 |
|
|
#endif
|