6 |
|
#include <string> |
7 |
|
#include <vector> |
8 |
|
|
9 |
+ |
#include <fstream> |
10 |
+ |
#include <iostream> |
11 |
+ |
#include <algorithm> |
12 |
+ |
#include "TH1.h" |
13 |
+ |
#include "TH2.h" |
14 |
|
#include "TH1D.h" |
15 |
|
#include "TH2D.h" |
16 |
|
#include "TLorentzVector.h" |
23 |
|
#include "DataFormats/Common/interface/Handle.h" |
24 |
|
#include "CommonTools/UtilAlgos/interface/TFileService.h" |
25 |
|
#include "FWCore/Framework/interface/MakerMacros.h" |
26 |
+ |
#include "DataFormats/Math/interface/deltaPhi.h" |
27 |
+ |
#include "DataFormats/Math/interface/deltaR.h" |
28 |
|
|
29 |
|
#include "ProductArea/BNcollections/interface/BNbxlumi.h" |
30 |
|
#include "ProductArea/BNcollections/interface/BNelectron.h" |
44 |
|
#include "ProductArea/BNcollections/interface/BNgenjet.h" |
45 |
|
|
46 |
|
#include "OSUT3Analysis/AnaTools/interface/CutFlow.h" |
47 |
+ |
#include "OSUT3Analysis/AnaTools/interface/PUWeight.h" |
48 |
+ |
#include "OSUT3Analysis/AnaTools/interface/SFWeight.h" |
49 |
|
|
50 |
|
|
51 |
|
|
65 |
|
|
66 |
|
double valueLookup (const BNjet* object, string variable, string function = ""); |
67 |
|
double valueLookup (const BNmuon* object, string variable, string function = ""); |
68 |
+ |
double valueLookup (const BNmuon* object1, const BNmuon* object2, string variable, string function = ""); |
69 |
|
double valueLookup (const BNelectron* object, string variable, string function = ""); |
70 |
+ |
double valueLookup (const BNelectron* object1, const BNelectron* object2, string variable, string function = ""); |
71 |
+ |
double valueLookup (const BNelectron* object1, const BNmuon* object2, string variable, string function = ""); |
72 |
+ |
double valueLookup (const BNelectron* object1, const BNtrack* object2, string variable, string function = ""); |
73 |
+ |
double valueLookup (const BNmuon* object1, const BNtrack* object2, string variable, string function = ""); |
74 |
+ |
double valueLookup (const BNmuon* object1, const BNtau* object2, string variable, string function = ""); |
75 |
+ |
double valueLookup (const BNtau* object1, const BNtau* object2, string variable, string function = ""); |
76 |
|
double valueLookup (const BNevent* object, string variable, string function = ""); |
77 |
|
double valueLookup (const BNtau* object, string variable, string function = ""); |
78 |
|
double valueLookup (const BNmet* object, string variable, string function = ""); |
83 |
|
double valueLookup (const BNbxlumi* object, string variable, string function = ""); |
84 |
|
double valueLookup (const BNphoton* object, string variable, string function = ""); |
85 |
|
double valueLookup (const BNsupercluster* object, string variable, string function = ""); |
86 |
+ |
|
87 |
+ |
int getTrkIsIso (const BNtrack* track1, const BNtrackCollection* trackColl); |
88 |
+ |
double getTrkPtTrue (const BNtrack* track1, const BNmcparticleCollection* genPartColl); |
89 |
+ |
double getTrkPtRes (const BNtrack* track1); |
90 |
+ |
double getTrkIsIso (const BNtrack* track1); |
91 |
+ |
void WriteDeadEcal (); |
92 |
+ |
int getTrkIsMatchedDeadEcal (const BNtrack* track1); |
93 |
+ |
|
94 |
|
//BNskimbits |
95 |
|
//BNtrigobj |
96 |
|
|
105 |
|
//inner vector corresponds to each object in input collection |
106 |
|
//bool tells if object passes or fails cuts |
107 |
|
typedef map<string, vector < vector<bool> > > flagMap; |
108 |
< |
|
108 |
> |
|
109 |
|
//counterMap: |
110 |
|
//string holds input collection type |
111 |
|
//vector corresponds to each cut |
127 |
|
edm::InputTag photons_; |
128 |
|
edm::InputTag superclusters_; |
129 |
|
edm::InputTag triggers_; |
130 |
< |
|
131 |
< |
|
130 |
> |
std::string puFile_; |
131 |
> |
std::string deadEcalFile_; |
132 |
> |
std::string muonSFFile_; |
133 |
> |
std::string dataPU_; |
134 |
> |
std::string electronSFID_; |
135 |
> |
std::string muonSF_; |
136 |
> |
std::string dataset_; |
137 |
> |
std::string datasetType_; |
138 |
|
vector<edm::ParameterSet> channels_; |
139 |
|
vector<edm::ParameterSet> histogramSets_; |
140 |
+ |
bool plotAllObjectsInPassingEvents_; |
141 |
+ |
bool doPileupReweighting_; |
142 |
+ |
bool printEventInfo_; |
143 |
+ |
|
144 |
+ |
struct DeadEcal { |
145 |
+ |
double etaEcal; |
146 |
+ |
double phiEcal; |
147 |
+ |
}; |
148 |
+ |
|
149 |
+ |
std::vector<DeadEcal> DeadEcalVec; |
150 |
+ |
|
151 |
+ |
|
152 |
+ |
//Collections |
153 |
+ |
edm::Handle<BNtriggerCollection> triggers; |
154 |
+ |
edm::Handle<BNjetCollection> jets; |
155 |
+ |
edm::Handle<BNmuonCollection> muons; |
156 |
+ |
edm::Handle<BNelectronCollection> electrons; |
157 |
+ |
edm::Handle<BNeventCollection> events; |
158 |
+ |
edm::Handle<BNtauCollection> taus; |
159 |
+ |
edm::Handle<BNmetCollection> mets; |
160 |
+ |
edm::Handle<BNtrackCollection> tracks; |
161 |
+ |
edm::Handle<BNgenjetCollection> genjets; |
162 |
+ |
edm::Handle<BNmcparticleCollection> mcparticles; |
163 |
+ |
edm::Handle<BNprimaryvertexCollection> primaryvertexs; |
164 |
+ |
edm::Handle<BNbxlumiCollection> bxlumis; |
165 |
+ |
edm::Handle<BNphotonCollection> photons; |
166 |
+ |
edm::Handle<BNsuperclusterCollection> superclusters; |
167 |
+ |
|
168 |
+ |
flagMap cumulativeFlags; |
169 |
|
|
170 |
|
vector<map<string, TH1D*> > oneDHists_; |
171 |
+ |
vector<map<string, TH2D*> > twoDHists_; |
172 |
|
|
173 |
|
edm::Service<TFileService> fs_; |
174 |
|
|
176 |
|
vector<CutFlow *> cutFlows_; |
177 |
|
|
178 |
|
typedef struct { |
179 |
< |
string name; |
180 |
< |
string title; |
181 |
< |
vector<double> bins; |
182 |
< |
string inputCollection; |
183 |
< |
string inputVariable; |
124 |
< |
string function; |
179 |
> |
string name; |
180 |
> |
string title; |
181 |
> |
vector<double> bins; |
182 |
> |
string inputCollection; |
183 |
> |
vector<string> inputVariables; |
184 |
|
} histogram; |
185 |
|
|
186 |
|
struct cut { |
187 |
< |
string inputCollection; |
188 |
< |
string variable; |
189 |
< |
string comparativeOperator; |
190 |
< |
string function; |
191 |
< |
double cutValue; |
192 |
< |
int numberRequired; |
193 |
< |
string eventComparativeOperator; |
194 |
< |
string name; |
187 |
> |
string inputCollection; |
188 |
> |
vector<string> functions; |
189 |
> |
vector<string> variables; |
190 |
> |
vector<string> comparativeOperators;// >, <, =, etc. |
191 |
> |
vector<double> cutValues; |
192 |
> |
vector<string> logicalOperators;//and, or |
193 |
> |
int numSubcuts; |
194 |
> |
int numberRequired; |
195 |
> |
string eventComparativeOperator; |
196 |
> |
string name; |
197 |
|
}; |
198 |
|
|
199 |
|
struct channel { |
200 |
< |
string name; |
201 |
< |
vector<string> triggers; |
202 |
< |
vector<cut> cuts; |
200 |
> |
string name; |
201 |
> |
vector<string> triggers; |
202 |
> |
vector<cut> cuts; |
203 |
|
}; |
204 |
|
|
205 |
+ |
vector<string> objectsToGet; |
206 |
+ |
vector<string> objectsToCut; |
207 |
|
vector<string> objectsToPlot; |
145 |
– |
vector<string> allNecessaryObjects; |
208 |
|
vector<channel> channels; |
209 |
|
vector<histogram> histograms; |
210 |
|
|
211 |
+ |
PUWeight *puWeight_; |
212 |
+ |
MuonSFWeight *muonSFWeight_; |
213 |
+ |
ElectronSFWeight *electronSFWeight_; |
214 |
+ |
|
215 |
|
template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string); |
216 |
< |
template <class InputCollection> void fillHistogram(TH1D*, histogram, InputCollection); |
216 |
> |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, vector<bool>, vector<bool>, string); |
217 |
> |
|
218 |
> |
template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, vector<bool>, double); |
219 |
> |
template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
220 |
> |
template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, vector<bool>, double); |
221 |
> |
template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
222 |
> |
|
223 |
> |
template <class InputObject> int getGenMatchedParticleIndex(InputObject); |
224 |
> |
int getPdgIdBinValue(int); |
225 |
> |
int findTauMotherIndex(const BNmcparticle*); |
226 |
> |
|
227 |
> |
template <class InputObject> double getGenDeltaRLowest(InputObject); |
228 |
|
|
229 |
|
|
230 |
+ |
const BNprimaryvertex *chosenVertex (); |
231 |
+ |
const BNmet *chosenMET (); |
232 |
+ |
const BNelectron *chosenElectron (); |
233 |
+ |
const BNmuon *chosenMuon (); |
234 |
|
|
235 |
|
}; |
236 |
|
|