1 |
lantonel |
1.1 |
#ifndef OSU_ANALYSIS
|
2 |
|
|
|
3 |
|
|
#define OSU_ANALYSIS
|
4 |
|
|
|
5 |
|
|
#include <map>
|
6 |
|
|
#include <string>
|
7 |
|
|
#include <vector>
|
8 |
|
|
|
9 |
|
|
#include "TH1D.h"
|
10 |
|
|
#include "TH2D.h"
|
11 |
|
|
#include "TLorentzVector.h"
|
12 |
|
|
|
13 |
|
|
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
14 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
15 |
|
|
#include "FWCore/Framework/interface/EventSetup.h"
|
16 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
17 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
18 |
|
|
#include "DataFormats/Common/interface/Handle.h"
|
19 |
|
|
#include "CommonTools/UtilAlgos/interface/TFileService.h"
|
20 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
21 |
|
|
|
22 |
|
|
#include "ProductArea/BNcollections/interface/BNbxlumi.h"
|
23 |
|
|
#include "ProductArea/BNcollections/interface/BNelectron.h"
|
24 |
|
|
#include "ProductArea/BNcollections/interface/BNevent.h"
|
25 |
|
|
#include "ProductArea/BNcollections/interface/BNjet.h"
|
26 |
|
|
#include "ProductArea/BNcollections/interface/BNmcparticle.h"
|
27 |
|
|
#include "ProductArea/BNcollections/interface/BNmet.h"
|
28 |
|
|
#include "ProductArea/BNcollections/interface/BNmuon.h"
|
29 |
|
|
#include "ProductArea/BNcollections/interface/BNphoton.h"
|
30 |
|
|
#include "ProductArea/BNcollections/interface/BNprimaryvertex.h"
|
31 |
|
|
#include "ProductArea/BNcollections/interface/BNskimbits.h"
|
32 |
|
|
#include "ProductArea/BNcollections/interface/BNsupercluster.h"
|
33 |
|
|
#include "ProductArea/BNcollections/interface/BNtrack.h"
|
34 |
|
|
#include "ProductArea/BNcollections/interface/BNtrigger.h"
|
35 |
|
|
#include "ProductArea/BNcollections/interface/BNtrigobj.h"
|
36 |
|
|
#include "ProductArea/BNcollections/interface/BNtau.h"
|
37 |
|
|
#include "ProductArea/BNcollections/interface/BNgenjet.h"
|
38 |
|
|
|
39 |
|
|
#include "OSUT3Analysis/AnaTools/interface/CutFlow.h"
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
using namespace std;
|
45 |
|
|
|
46 |
|
|
class OSUAnalysis : public edm::EDAnalyzer
|
47 |
|
|
{
|
48 |
|
|
public:
|
49 |
|
|
OSUAnalysis (const edm::ParameterSet &);
|
50 |
|
|
~OSUAnalysis ();
|
51 |
|
|
|
52 |
|
|
void analyze (const edm::Event &, const edm::EventSetup &);
|
53 |
|
|
bool evaluateComparison (double, string, double);
|
54 |
lantonel |
1.2 |
bool evaluateTriggers (vector<string>,const BNtriggerCollection*);
|
55 |
lantonel |
1.3 |
double applyFunction(string, double);
|
56 |
|
|
|
57 |
lantonel |
1.2 |
double valueLookup (const BNjet*, string, string);
|
58 |
|
|
double valueLookup (const BNmuon*, string, string);
|
59 |
|
|
double valueLookup (const BNelectron*, string, string);
|
60 |
|
|
double valueLookup (const BNevent*, string, string);
|
61 |
|
|
double valueLookup (const BNtau*, string, string);
|
62 |
|
|
double valueLookup (const BNmet*, string, string);
|
63 |
|
|
double valueLookup (const BNtrack*, string, string);
|
64 |
|
|
double valueLookup (const BNgenjet*, string, string);
|
65 |
|
|
double valueLookup (const BNmcparticle*, string, string);
|
66 |
|
|
double valueLookup (const BNprimaryvertex*, string, string);
|
67 |
|
|
double valueLookup (const BNbxlumi*, string, string);
|
68 |
|
|
double valueLookup (const BNphoton*, string, string);
|
69 |
|
|
double valueLookup (const BNsupercluster*, string, string);
|
70 |
lantonel |
1.1 |
//BNskimbits
|
71 |
|
|
//BNtrigger
|
72 |
|
|
//BNtrigobj
|
73 |
|
|
|
74 |
|
|
vector<string> splitString (string);
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
private:
|
78 |
|
|
|
79 |
|
|
//flagMap:
|
80 |
|
|
//string holds input collection type
|
81 |
|
|
//outer vector corresponds to each cut
|
82 |
|
|
//inner vector corresponds to each object in input collection
|
83 |
|
|
//bool tells if object passes or fails cuts
|
84 |
|
|
typedef map<string, vector < vector<bool> > > flagMap;
|
85 |
|
|
|
86 |
|
|
//counterMap:
|
87 |
|
|
//string holds input collection type
|
88 |
|
|
//vector corresponds to each cut
|
89 |
|
|
//int holds number of objects passing all cuts up to that point
|
90 |
|
|
typedef map<string ,vector <int> > counterMap;
|
91 |
|
|
|
92 |
|
|
// Remember to define parameters to be retrieved from the configuration file.
|
93 |
|
|
edm::InputTag jets_;
|
94 |
|
|
edm::InputTag muons_;
|
95 |
|
|
edm::InputTag electrons_;
|
96 |
|
|
edm::InputTag events_;
|
97 |
|
|
edm::InputTag taus_;
|
98 |
|
|
edm::InputTag mets_;
|
99 |
|
|
edm::InputTag tracks_;
|
100 |
|
|
edm::InputTag genjets_;
|
101 |
|
|
edm::InputTag mcparticles_;
|
102 |
|
|
edm::InputTag primaryvertexs_;
|
103 |
|
|
edm::InputTag bxlumis_;
|
104 |
|
|
edm::InputTag photons_;
|
105 |
|
|
edm::InputTag superclusters_;
|
106 |
lantonel |
1.2 |
edm::InputTag triggers_;
|
107 |
lantonel |
1.1 |
|
108 |
|
|
|
109 |
|
|
vector<edm::ParameterSet> channels_;
|
110 |
|
|
|
111 |
|
|
vector<map<string, TH1D*> > oneDHists_;
|
112 |
|
|
|
113 |
|
|
edm::Service<TFileService> fs_;
|
114 |
|
|
|
115 |
|
|
CutFlow *masterCutFlow_;
|
116 |
|
|
vector<CutFlow *> cutFlows_;
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
struct cut {
|
120 |
|
|
string inputCollection;
|
121 |
|
|
string variable;
|
122 |
|
|
string comparativeOperator;
|
123 |
lantonel |
1.2 |
string function;
|
124 |
lantonel |
1.1 |
double cutValue;
|
125 |
|
|
int numberRequired;
|
126 |
|
|
string eventComparativeOperator;
|
127 |
|
|
string name;
|
128 |
|
|
};
|
129 |
|
|
|
130 |
|
|
struct channel {
|
131 |
|
|
string name;
|
132 |
lantonel |
1.2 |
vector<string> triggers;
|
133 |
lantonel |
1.1 |
vector<cut> cuts;
|
134 |
|
|
vector<string> inputCollections;
|
135 |
|
|
};
|
136 |
|
|
|
137 |
|
|
vector<string> allNecessaryObjects;
|
138 |
|
|
vector<channel> channels;
|
139 |
|
|
|
140 |
|
|
template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string);
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
|
144 |
|
|
};
|
145 |
|
|
|
146 |
|
|
#endif
|