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 |
< |
|
50 |
> |
#ifdef DISPLACED_SUSY |
51 |
> |
#include "DisplacedSUSY/Configuration/interface/CTauWeight.h" |
52 |
> |
#endif |
53 |
|
|
54 |
|
using namespace std; |
55 |
|
|
66 |
|
|
67 |
|
double valueLookup (const BNjet* object, string variable, string function = ""); |
68 |
|
double valueLookup (const BNmuon* object, string variable, string function = ""); |
69 |
+ |
double valueLookup (const BNmuon* object1, const BNmuon* object2, string variable, string function = ""); |
70 |
|
double valueLookup (const BNelectron* object, string variable, string function = ""); |
71 |
+ |
double valueLookup (const BNelectron* object1, const BNelectron* object2, string variable, string function = ""); |
72 |
+ |
double valueLookup (const BNelectron* object1, const BNmuon* object2, string variable, string function = ""); |
73 |
+ |
double valueLookup (const BNelectron* object1, const BNtrack* object2, string variable, string function = ""); |
74 |
+ |
double valueLookup (const BNmuon* object1, const BNtrack* object2, string variable, string function = ""); |
75 |
+ |
double valueLookup (const BNmuon* object1, const BNtau* object2, string variable, string function = ""); |
76 |
+ |
double valueLookup (const BNtau* object1, const BNtau* object2, string variable, string function = ""); |
77 |
+ |
double valueLookup (const BNtau* object1, const BNtrack* object2, string variable, string function); |
78 |
|
double valueLookup (const BNevent* object, string variable, string function = ""); |
79 |
|
double valueLookup (const BNtau* object, string variable, string function = ""); |
80 |
|
double valueLookup (const BNmet* object, string variable, string function = ""); |
81 |
|
double valueLookup (const BNtrack* object, string variable, string function = ""); |
82 |
+ |
double valueLookup (const BNtrack* object1, const BNevent* object2, string variable, string function = ""); |
83 |
|
double valueLookup (const BNgenjet* object, string variable, string function = ""); |
84 |
|
double valueLookup (const BNmcparticle* object, string variable, string function = ""); |
85 |
|
double valueLookup (const BNprimaryvertex* object, string variable, string function = ""); |
86 |
|
double valueLookup (const BNbxlumi* object, string variable, string function = ""); |
87 |
|
double valueLookup (const BNphoton* object, string variable, string function = ""); |
88 |
|
double valueLookup (const BNsupercluster* object, string variable, string function = ""); |
89 |
+ |
|
90 |
+ |
#ifdef DISPLACED_SUSY |
91 |
+ |
double valueLookup (const BNstop* object, string variable, string function = ""); |
92 |
+ |
#endif |
93 |
+ |
int getTrkIsIso (const BNtrack* track1, const BNtrackCollection* trackColl); |
94 |
+ |
double getTrkPtTrue (const BNtrack* track1, const BNmcparticleCollection* genPartColl); |
95 |
+ |
double getTrkPtRes (const BNtrack* track1); |
96 |
+ |
double getTrkIsIso (const BNtrack* track1); |
97 |
+ |
double getTrkCaloTotRhoCorr(const BNtrack* track); |
98 |
+ |
void WriteDeadEcal (); |
99 |
+ |
int getTrkIsMatchedDeadEcal (const BNtrack* track1); |
100 |
+ |
|
101 |
|
//BNskimbits |
102 |
|
//BNtrigobj |
103 |
|
|
104 |
|
vector<string> splitString (string); |
105 |
< |
|
105 |
> |
void getTwoObjs(string tempInputCollection, string& obj1, string& obj2); |
106 |
> |
string getObjToGet(string obj); |
107 |
|
|
108 |
|
private: |
109 |
|
|
113 |
|
//inner vector corresponds to each object in input collection |
114 |
|
//bool tells if object passes or fails cuts |
115 |
|
typedef map<string, vector < vector<bool> > > flagMap; |
116 |
< |
|
116 |
> |
|
117 |
|
//counterMap: |
118 |
|
//string holds input collection type |
119 |
|
//vector corresponds to each cut |
130 |
|
edm::InputTag tracks_; |
131 |
|
edm::InputTag genjets_; |
132 |
|
edm::InputTag mcparticles_; |
133 |
+ |
edm::InputTag stops_; |
134 |
|
edm::InputTag primaryvertexs_; |
135 |
|
edm::InputTag bxlumis_; |
136 |
|
edm::InputTag photons_; |
137 |
|
edm::InputTag superclusters_; |
138 |
|
edm::InputTag triggers_; |
139 |
< |
|
140 |
< |
|
139 |
> |
std::string puFile_; |
140 |
> |
std::string deadEcalFile_; |
141 |
> |
std::string muonSFFile_; |
142 |
> |
std::string dataPU_; |
143 |
> |
std::string electronSFID_; |
144 |
> |
std::string muonSF_; |
145 |
> |
std::string dataset_; |
146 |
> |
std::string datasetType_; |
147 |
|
vector<edm::ParameterSet> channels_; |
148 |
|
vector<edm::ParameterSet> histogramSets_; |
149 |
+ |
bool plotAllObjectsInPassingEvents_; |
150 |
+ |
bool doPileupReweighting_; |
151 |
+ |
bool printEventInfo_; |
152 |
+ |
bool useTrackCaloRhoCorr_; // to use the calo-based rho correction for the by-hand calculation of the track isolation energy |
153 |
+ |
vector<double> stopCTau_; |
154 |
+ |
|
155 |
+ |
struct DeadEcal { |
156 |
+ |
double etaEcal; |
157 |
+ |
double phiEcal; |
158 |
+ |
}; |
159 |
+ |
|
160 |
+ |
std::vector<DeadEcal> DeadEcalVec; |
161 |
+ |
|
162 |
+ |
|
163 |
+ |
//Collections |
164 |
+ |
edm::Handle<BNtriggerCollection> triggers; |
165 |
+ |
edm::Handle<BNjetCollection> jets; |
166 |
+ |
edm::Handle<BNmuonCollection> muons; |
167 |
+ |
edm::Handle<BNelectronCollection> electrons; |
168 |
+ |
edm::Handle<BNeventCollection> events; |
169 |
+ |
edm::Handle<BNtauCollection> taus; |
170 |
+ |
edm::Handle<BNmetCollection> mets; |
171 |
+ |
edm::Handle<BNtrackCollection> tracks; |
172 |
+ |
edm::Handle<BNgenjetCollection> genjets; |
173 |
+ |
edm::Handle<BNmcparticleCollection> mcparticles; |
174 |
+ |
edm::Handle<BNprimaryvertexCollection> primaryvertexs; |
175 |
+ |
edm::Handle<BNbxlumiCollection> bxlumis; |
176 |
+ |
edm::Handle<BNphotonCollection> photons; |
177 |
+ |
edm::Handle<BNsuperclusterCollection> superclusters; |
178 |
+ |
#ifdef DISPLACED_SUSY |
179 |
+ |
edm::Handle<BNstopCollection> stops; |
180 |
+ |
#endif |
181 |
+ |
edm::Handle<double> rhokt6CaloJetsHandle_; |
182 |
+ |
|
183 |
+ |
flagMap cumulativeFlags; |
184 |
|
|
185 |
|
vector<map<string, TH1D*> > oneDHists_; |
186 |
+ |
vector<map<string, TH2D*> > twoDHists_; |
187 |
|
|
188 |
|
edm::Service<TFileService> fs_; |
189 |
|
|
191 |
|
vector<CutFlow *> cutFlows_; |
192 |
|
|
193 |
|
typedef struct { |
194 |
< |
string name; |
195 |
< |
string title; |
196 |
< |
vector<double> bins; |
197 |
< |
string inputCollection; |
198 |
< |
string inputVariable; |
124 |
< |
string function; |
194 |
> |
string name; |
195 |
> |
string title; |
196 |
> |
vector<double> bins; |
197 |
> |
string inputCollection; |
198 |
> |
vector<string> inputVariables; |
199 |
|
} histogram; |
200 |
|
|
201 |
|
struct cut { |
202 |
< |
string inputCollection; |
203 |
< |
string variable; |
204 |
< |
string comparativeOperator; |
205 |
< |
string function; |
206 |
< |
double cutValue; |
207 |
< |
int numberRequired; |
208 |
< |
string eventComparativeOperator; |
209 |
< |
string name; |
202 |
> |
string inputCollection; |
203 |
> |
vector<string> functions; |
204 |
> |
vector<string> variables; |
205 |
> |
vector<string> comparativeOperators;// >, <, =, etc. |
206 |
> |
vector<double> cutValues; |
207 |
> |
vector<string> logicalOperators;//and, or |
208 |
> |
int numSubcuts; |
209 |
> |
int numberRequired; |
210 |
> |
string eventComparativeOperator; |
211 |
> |
string name; |
212 |
|
}; |
213 |
|
|
214 |
|
struct channel { |
215 |
< |
string name; |
216 |
< |
vector<string> triggers; |
217 |
< |
vector<cut> cuts; |
215 |
> |
string name; |
216 |
> |
vector<string> triggers; |
217 |
> |
vector<cut> cuts; |
218 |
|
}; |
219 |
|
|
220 |
+ |
vector<string> objectsToGet; |
221 |
+ |
vector<string> objectsToCut; |
222 |
|
vector<string> objectsToPlot; |
145 |
– |
vector<string> allNecessaryObjects; |
223 |
|
vector<channel> channels; |
224 |
|
vector<histogram> histograms; |
225 |
|
|
226 |
+ |
PUWeight *puWeight_; |
227 |
+ |
MuonSFWeight *muonSFWeight_; |
228 |
+ |
ElectronSFWeight *electronSFWeight_; |
229 |
+ |
#ifdef DISPLACED_SUSY |
230 |
+ |
CTauWeight *cTauWeight_; |
231 |
+ |
#endif |
232 |
+ |
double cTauScaleFactor_; |
233 |
+ |
|
234 |
|
template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string); |
235 |
< |
template <class InputCollection> void fillHistogram(TH1D*, histogram, InputCollection); |
235 |
> |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, vector<bool>, vector<bool>, string); |
236 |
> |
|
237 |
> |
template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, vector<bool>, double); |
238 |
> |
template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
239 |
> |
template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, vector<bool>, double); |
240 |
> |
template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
241 |
> |
bool getPreviousCumulativeFlags(uint currentCutIndex, flagMap &individualFlags, string obj1Type, uint object1); |
242 |
> |
|
243 |
> |
template <class InputObject> int getGenMatchedParticleIndex(InputObject); |
244 |
> |
int getPdgIdBinValue(int); |
245 |
> |
int findTauMotherIndex(const BNmcparticle*); |
246 |
> |
|
247 |
> |
template <class InputObject> double getGenDeltaRLowest(InputObject); |
248 |
|
|
249 |
|
|
250 |
+ |
const BNprimaryvertex *chosenVertex (); |
251 |
+ |
const BNmet *chosenMET (); |
252 |
+ |
const BNelectron *chosenElectron (); |
253 |
+ |
const BNmuon *chosenMuon (); |
254 |
|
|
255 |
|
}; |
256 |
|
|