1 |
#ifndef SELECTION_UTILFUNCS
|
2 |
#define SELECTION_UTILFUNCS
|
3 |
|
4 |
// System headers
|
5 |
//
|
6 |
#include <vector> // STL vector class
|
7 |
#include <iostream> // standard I/O
|
8 |
#include <iomanip> // functions to format standard I/O
|
9 |
#include <fstream> // functions for file I/O
|
10 |
#include <string> // C++ string class
|
11 |
#include <sstream> // class for parsing strings
|
12 |
#include <assert.h>
|
13 |
#include <stdlib.h>
|
14 |
#include <getopt.h>
|
15 |
using namespace std;
|
16 |
|
17 |
//
|
18 |
// ROOT headers
|
19 |
//
|
20 |
#include <TROOT.h> // access to gROOT, entry point to ROOT system
|
21 |
#include <TClonesArray.h> // ROOT array class
|
22 |
#include <TFile.h>
|
23 |
#include <TH1F.h>
|
24 |
#include "TRegexp.h"
|
25 |
|
26 |
#include "FactorizedJetCorrector.h"
|
27 |
#include "JetCorrectorParameters.h"
|
28 |
|
29 |
#include "PFJetCol.h"
|
30 |
#include "JetIDMVA.h"
|
31 |
#include "JetSelection.h"
|
32 |
#include "MuonTools.h"
|
33 |
#include "ElectronTools.h"
|
34 |
#include "RunLumiRangeMap.h"
|
35 |
|
36 |
//
|
37 |
// ntuple format headers
|
38 |
//
|
39 |
#include "Vertex.h"
|
40 |
#include "PFCandidateCol.h"
|
41 |
|
42 |
#include "GenInfoStruct.h"
|
43 |
#include "ParseArgs.h"
|
44 |
#include "EventData.h"
|
45 |
#include "WeightStruct.h"
|
46 |
#include "PileupInfoCol.h"
|
47 |
#include "EfficiencyWeightsInterface.h"
|
48 |
|
49 |
using namespace mithep;
|
50 |
|
51 |
void increment(map<TString, map<TString,int>* > &counterMap, TString cutName, int z1type=0, int z2type=0);
|
52 |
bool setPV(ControlFlags &ctrl,
|
53 |
const mithep::Array<mithep::Vertex> * vtxArr,
|
54 |
const mithep::Vertex* &vtx);
|
55 |
|
56 |
void writeEntries(ControlFlags ctrl, unsigned total_unskimmed);
|
57 |
void getEATargets(ControlFlags &ctrl, mithep::MuonTools::EMuonEffectiveAreaTarget &eraMu, mithep::ElectronTools::EElectronEffectiveAreaTarget &eraEle);
|
58 |
unsigned makePFnoPUArray(const mithep::Array<PFCandidate> * fPFCandidates,
|
59 |
vector<bool> &pfNoPileUpFlag,
|
60 |
const mithep::Array<mithep::Vertex> * vtxArr );
|
61 |
void setEfficiencyWeights(ControlFlags &ctrl,
|
62 |
unsigned era,
|
63 |
EventData & evtdat,
|
64 |
std::bitset<1024> triggerBits,
|
65 |
mithep::TriggerTable *hltTable,
|
66 |
mithep::Array<mithep::TriggerObject> *hltObjArr,
|
67 |
mithep::TriggerObjectsTable *fTrigObjs,
|
68 |
WeightStruct & weights ) ;
|
69 |
void initEvtRhoMap(map<unsigned,float> &);
|
70 |
void setEra(string, ControlFlags&);
|
71 |
unsigned getNPU(mithep::Array<mithep::PileupInfo> *puArr, int bx=0);
|
72 |
void initPUWeights();
|
73 |
double getPUWeight(int era, TString fname, unsigned npu);
|
74 |
void initJets(ControlFlags ctrl,
|
75 |
string cmsswpath,
|
76 |
vector<TString> &fJetCorrParsv,
|
77 |
vector<JetCorrectorParameters> &correctionParameters,
|
78 |
FactorizedJetCorrector *&fJetCorrector,
|
79 |
JetIDMVA *&fJetIDMVA);
|
80 |
int getGenSampleType(TString ofname);
|
81 |
TString getChannel(int z1type, int z2type);
|
82 |
float weightTruePileupSummer12toMoriond(float input);
|
83 |
// PU weight functions from Mangano:
|
84 |
float weightTruePileupV07toIchep52X(float input);
|
85 |
float weightTruePileupV07toHcp53X(float input);
|
86 |
float weightTruePileupV10toIchep53X(float input);
|
87 |
float weightTruePileupV10toHcp53X(float input);
|
88 |
float weightTrue2011(float input);
|
89 |
float weightTrue2011to2012(float input);
|
90 |
#endif
|