17 |
|
#include "TLorentzVector.h" |
18 |
|
#include "TTree.h" |
19 |
|
|
20 |
< |
#include "FWCore/Framework/interface/EDAnalyzer.h" |
20 |
> |
#include "FWCore/Framework/interface/EDProducer.h" |
21 |
|
#include "FWCore/Framework/interface/Event.h" |
22 |
|
#include "FWCore/Framework/interface/EventSetup.h" |
23 |
|
#include "FWCore/ParameterSet/interface/ParameterSet.h" |
49 |
|
#include "OSUT3Analysis/AnaTools/interface/CutFlow.h" |
50 |
|
#include "OSUT3Analysis/AnaTools/interface/PUWeight.h" |
51 |
|
#include "OSUT3Analysis/AnaTools/interface/SFWeight.h" |
52 |
< |
|
52 |
> |
#include "OSUT3Analysis/AnaTools/interface/BtagSFWeight.h" |
53 |
|
#include "OSUT3Analysis/AnaTools/interface/StopCTauWeight.h" |
54 |
|
|
55 |
|
using namespace std; |
56 |
|
|
57 |
< |
class OSUAnalysis : public edm::EDAnalyzer |
57 |
> |
class OSUAnalysis : public edm::EDProducer |
58 |
|
{ |
59 |
|
public: |
60 |
|
OSUAnalysis (const edm::ParameterSet &); |
61 |
|
~OSUAnalysis (); |
62 |
|
|
63 |
< |
void analyze (const edm::Event &, const edm::EventSetup &); |
63 |
> |
void produce (edm::Event &, const edm::EventSetup &); |
64 |
|
bool evaluateComparison (double, string, double); |
65 |
|
bool evaluateComparison (string, string, string); |
66 |
|
bool evaluateTriggers (vector<string>, vector<string>, const BNtriggerCollection*); |
73 |
|
double valueLookup (const BNelectron* object1, const BNelectron* object2, string variable, string function, string &stringValue); |
74 |
|
double valueLookup (const BNelectron* object1, const BNmuon* object2, string variable, string function, string &stringValue); |
75 |
|
double valueLookup (const BNelectron* object1, const BNjet* object2, string variable, string function, string &stringValue); |
76 |
+ |
double valueLookup (const BNelectron* object1, const BNphoton* object2, string variable, string function, string &stringValue); |
77 |
+ |
double valueLookup (const BNmuon* object1, const BNphoton* object2, string variable, string function, string &stringValue); |
78 |
+ |
double valueLookup (const BNphoton* object1, const BNjet* object2, string variable, string function, string &stringValue); |
79 |
|
double valueLookup (const BNelectron* object1, const BNtrack* object2, string variable, string function, string &stringValue); |
80 |
|
double valueLookup (const BNmuon* object1, const BNjet* object2, string variable, string function, string &stringValue); |
81 |
+ |
double valueLookup (const BNmet* object1, const BNjet* object2, string variable, string function, string &stringValue); |
82 |
|
double valueLookup (const BNmuon* object1, const BNtrack* object2, string variable, string function, string &stringValue); |
83 |
|
double valueLookup (const BNmuon* object1, const BNtau* object2, string variable, string function, string &stringValue); |
84 |
|
double valueLookup (const BNtau* object1, const BNtau* object2, string variable, string function, string &stringValue); |
121 |
|
//string holds input collection type |
122 |
|
//outer vector corresponds to each cut |
123 |
|
//inner vector corresponds to each object in input collection |
124 |
< |
//bool tells if object passes or fails cuts |
125 |
< |
typedef map<string, vector < vector<bool> > > flagMap; |
124 |
> |
//pair(bool) first bool counts towards the event passing, second bool determines whether to plot the object |
125 |
> |
typedef map<string, vector<vector<pair<bool,bool> > > > flagMap; |
126 |
> |
|
127 |
> |
typedef vector<pair<bool,bool> > flagPair; |
128 |
|
|
129 |
|
//counterMap: |
130 |
|
//string holds input collection type |
159 |
|
string datasetType_; |
160 |
|
vector<edm::ParameterSet> channels_; |
161 |
|
vector<edm::ParameterSet> histogramSets_; |
162 |
+ |
bool useEDMFormat_; |
163 |
|
vector<edm::ParameterSet> treeBranchSets_; |
164 |
|
bool plotAllObjectsInPassingEvents_; |
165 |
|
bool doPileupReweighting_; |
166 |
|
bool applyLeptonSF_; |
167 |
+ |
bool applyBtagSF_; |
168 |
+ |
int minBtag_; |
169 |
+ |
int maxBtag_; |
170 |
|
bool printEventInfo_; |
171 |
+ |
bool printAllTriggers_; |
172 |
|
bool useTrackCaloRhoCorr_; // to use the calo-based rho correction for the by-hand calculation of the track isolation energy |
173 |
|
vector<double> stopCTau_; |
174 |
|
bool GetPlotsAfterEachCut_; |
202 |
|
edm::Handle<double> rhokt6CaloJetsHandle_; |
203 |
|
|
204 |
|
flagMap cumulativeFlags; |
205 |
+ |
flagMap vetoFlags; |
206 |
|
|
207 |
|
vector<vector<map<string, TH1D*>>> oneDHists_; |
208 |
|
vector<vector<map<string, TH2D*>>> twoDHists_; |
239 |
|
vector<double> cutValues; |
240 |
|
vector<string> cutStringValues; |
241 |
|
vector<string> logicalOperators;//and, or |
242 |
< |
int numSubcuts; |
242 |
> |
int numSubcuts; |
243 |
|
int numberRequired; |
244 |
|
string eventComparativeOperator; |
245 |
|
string name; |
246 |
+ |
bool isVeto; |
247 |
|
}; |
248 |
|
|
249 |
|
struct channel { |
265 |
|
double muonScaleFactor_; |
266 |
|
ElectronSFWeight *electronSFWeight_; |
267 |
|
double electronScaleFactor_; |
268 |
+ |
BtagSFWeight *bTagSFWeight_; |
269 |
+ |
double bTagScaleFactor_; |
270 |
|
|
271 |
|
StopCTauWeight *stopCTauWeight_; |
272 |
|
double stopCTauScaleFactor_; |
273 |
|
|
274 |
|
template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string); |
275 |
< |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, vector<bool>, vector<bool>, string); |
275 |
> |
template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, flagPair, flagPair, string); |
276 |
> |
|
277 |
> |
template <class InputCollection> void assignTreeBranch(BranchSpecs brSpecs, InputCollection inputCollection, flagPair flags); |
278 |
> |
template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, flagPair, double); |
279 |
> |
template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, flagPair, flagPair, flagPair, double); |
280 |
> |
template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, flagPair, double); |
281 |
> |
template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, flagPair, flagPair, flagPair, double); |
282 |
> |
bool getPreviousCumulativeFlags(uint currentCutIndex, flagMap &individualFlags, string obj1Type, uint object1, string flagType); |
283 |
> |
|
284 |
|
|
262 |
– |
template <class InputCollection> void assignTreeBranch(BranchSpecs brSpecs, InputCollection inputCollection, vector<bool> flags); |
263 |
– |
template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, vector<bool>, double); |
264 |
– |
template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
265 |
– |
template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, vector<bool>, double); |
266 |
– |
template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double); |
267 |
– |
bool getPreviousCumulativeFlags(uint currentCutIndex, flagMap &individualFlags, string obj1Type, uint object1); |
285 |
|
|
286 |
|
template <class InputObject> int getGenMatchedParticleIndex(InputObject); |
287 |
|
int getPdgIdBinValue(int); |