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" |
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 |
|
|
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 = ""); |
79 |
|
double valueLookup (const BNtrack* object, string variable, string function = ""); |
80 |
+ |
double valueLookup (const BNtrack* object1, const BNevent* object2, string variable, string function = ""); |
81 |
|
double valueLookup (const BNgenjet* object, string variable, string function = ""); |
82 |
|
double valueLookup (const BNmcparticle* object, string variable, string function = ""); |
83 |
|
double valueLookup (const BNprimaryvertex* object, string variable, string function = ""); |
84 |
|
double valueLookup (const BNbxlumi* object, string variable, string function = ""); |
85 |
|
double valueLookup (const BNphoton* object, string variable, string function = ""); |
86 |
|
double valueLookup (const BNsupercluster* object, string variable, string function = ""); |
87 |
+ |
|
88 |
+ |
int getTrkIsIso (const BNtrack* track1, const BNtrackCollection* trackColl); |
89 |
+ |
double getTrkPtTrue (const BNtrack* track1, const BNmcparticleCollection* genPartColl); |
90 |
+ |
double getTrkPtRes (const BNtrack* track1); |
91 |
+ |
double getTrkIsIso (const BNtrack* track1); |
92 |
+ |
double getTrkCaloTotRhoCorr(const BNtrack* track); |
93 |
+ |
void WriteDeadEcal (); |
94 |
+ |
int getTrkIsMatchedDeadEcal (const BNtrack* track1); |
95 |
+ |
|
96 |
|
//BNskimbits |
97 |
|
//BNtrigobj |
98 |
|
|
107 |
|
//inner vector corresponds to each object in input collection |
108 |
|
//bool tells if object passes or fails cuts |
109 |
|
typedef map<string, vector < vector<bool> > > flagMap; |
110 |
< |
|
110 |
> |
|
111 |
|
//counterMap: |
112 |
|
//string holds input collection type |
113 |
|
//vector corresponds to each cut |
130 |
|
edm::InputTag superclusters_; |
131 |
|
edm::InputTag triggers_; |
132 |
|
std::string puFile_; |
133 |
+ |
std::string deadEcalFile_; |
134 |
+ |
std::string muonSFFile_; |
135 |
|
std::string dataPU_; |
136 |
+ |
std::string electronSFID_; |
137 |
+ |
std::string muonSF_; |
138 |
|
std::string dataset_; |
139 |
|
std::string datasetType_; |
140 |
|
vector<edm::ParameterSet> channels_; |
141 |
|
vector<edm::ParameterSet> histogramSets_; |
142 |
|
bool plotAllObjectsInPassingEvents_; |
143 |
+ |
bool doPileupReweighting_; |
144 |
+ |
bool printEventInfo_; |
145 |
+ |
bool useTrackCaloRhoCorr_; // to use the calo-based rho correction for the by-hand calculation of the track isolation energy |
146 |
+ |
|
147 |
+ |
struct DeadEcal { |
148 |
+ |
double etaEcal; |
149 |
+ |
double phiEcal; |
150 |
+ |
}; |
151 |
+ |
|
152 |
+ |
std::vector<DeadEcal> DeadEcalVec; |
153 |
+ |
|
154 |
|
|
155 |
< |
BNprimaryvertex *primaryVertex_; |
155 |
> |
//Collections |
156 |
> |
edm::Handle<BNtriggerCollection> triggers; |
157 |
> |
edm::Handle<BNjetCollection> jets; |
158 |
> |
edm::Handle<BNmuonCollection> muons; |
159 |
> |
edm::Handle<BNelectronCollection> electrons; |
160 |
> |
edm::Handle<BNeventCollection> events; |
161 |
> |
edm::Handle<BNtauCollection> taus; |
162 |
> |
edm::Handle<BNmetCollection> mets; |
163 |
> |
edm::Handle<BNtrackCollection> tracks; |
164 |
> |
edm::Handle<BNgenjetCollection> genjets; |
165 |
> |
edm::Handle<BNmcparticleCollection> mcparticles; |
166 |
> |
edm::Handle<BNprimaryvertexCollection> primaryvertexs; |
167 |
> |
edm::Handle<BNbxlumiCollection> bxlumis; |
168 |
> |
edm::Handle<BNphotonCollection> photons; |
169 |
> |
edm::Handle<BNsuperclusterCollection> superclusters; |
170 |
> |
edm::Handle<double> rhokt6CaloJetsHandle_; |
171 |
> |
|
172 |
> |
flagMap cumulativeFlags; |
173 |
|
|
174 |
|
vector<map<string, TH1D*> > oneDHists_; |
175 |
|
vector<map<string, TH2D*> > twoDHists_; |
180 |
|
vector<CutFlow *> cutFlows_; |
181 |
|
|
182 |
|
typedef struct { |
183 |
< |
string name; |
184 |
< |
string title; |
185 |
< |
vector<double> bins; |
186 |
< |
string inputCollection; |
187 |
< |
vector<string> inputVariables; |
183 |
> |
string name; |
184 |
> |
string title; |
185 |
> |
vector<double> bins; |
186 |
> |
string inputCollection; |
187 |
> |
vector<string> inputVariables; |
188 |
|
} histogram; |
189 |
|
|
190 |
|
struct cut { |
191 |
< |
string inputCollection; |
192 |
< |
vector<string> functions; |
193 |
< |
vector<string> variables; |
194 |
< |
vector<string> comparativeOperators;// >, <, =, etc. |
195 |
< |
vector<double> cutValues; |
196 |
< |
vector<string> logicalOperators;//and, or |
197 |
< |
int numSubcuts; |
198 |
< |
int numberRequired; |
199 |
< |
string eventComparativeOperator; |
200 |
< |
string name; |
191 |
> |
string inputCollection; |
192 |
> |
vector<string> functions; |
193 |
> |
vector<string> variables; |
194 |
> |
vector<string> comparativeOperators;// >, <, =, etc. |
195 |
> |
vector<double> cutValues; |
196 |
> |
vector<string> logicalOperators;//and, or |
197 |
> |
int numSubcuts; |
198 |
> |
int numberRequired; |
199 |
> |
string eventComparativeOperator; |
200 |
> |
string name; |
201 |
|
}; |
202 |
|
|
203 |
|
struct channel { |
204 |
< |
string name; |
205 |
< |
vector<string> triggers; |
206 |
< |
vector<cut> cuts; |
204 |
> |
string name; |
205 |
> |
vector<string> triggers; |
206 |
> |
vector<cut> cuts; |
207 |
|
}; |
208 |
|
|
209 |
+ |
vector<string> objectsToGet; |
210 |
+ |
vector<string> objectsToCut; |
211 |
|
vector<string> objectsToPlot; |
160 |
– |
vector<string> allNecessaryObjects; |
212 |
|
vector<channel> channels; |
213 |
|
vector<histogram> histograms; |
214 |
|
|
215 |
|
PUWeight *puWeight_; |
216 |
+ |
MuonSFWeight *muonSFWeight_; |
217 |
+ |
ElectronSFWeight *electronSFWeight_; |
218 |
|
|
219 |
|
template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string); |
220 |
< |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, string); |
220 |
> |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, vector<bool>, vector<bool>, string); |
221 |
> |
|
222 |
|
template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, vector<bool>, double); |
223 |
|
template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
224 |
|
template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, vector<bool>, double); |
225 |
|
template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
226 |
|
|
227 |
+ |
template <class InputObject> int getGenMatchedParticleIndex(InputObject); |
228 |
+ |
int getPdgIdBinValue(int); |
229 |
+ |
int findTauMotherIndex(const BNmcparticle*); |
230 |
+ |
|
231 |
+ |
template <class InputObject> double getGenDeltaRLowest(InputObject); |
232 |
+ |
|
233 |
+ |
|
234 |
+ |
const BNprimaryvertex *chosenVertex (); |
235 |
+ |
const BNmet *chosenMET (); |
236 |
+ |
const BNelectron *chosenElectron (); |
237 |
+ |
const BNmuon *chosenMuon (); |
238 |
|
|
239 |
|
}; |
240 |
|
|