1 |
yilmaz |
1.1 |
#ifndef MNguyen_HiInclusiveJetAnalyzer_inclusiveJetAnalyzer_
|
2 |
|
|
#define MNguyen_HiInclusiveJetAnalyzer_inclusiveJetAnalyzer_
|
3 |
|
|
|
4 |
|
|
// system include files
|
5 |
|
|
#include <memory>
|
6 |
|
|
#include <string>
|
7 |
|
|
#include <iostream>
|
8 |
|
|
|
9 |
|
|
// user include files
|
10 |
|
|
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
11 |
|
|
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
12 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
13 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
14 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
15 |
|
|
|
16 |
|
|
#include "TFile.h"
|
17 |
|
|
#include "TTree.h"
|
18 |
|
|
#include "TH1.h"
|
19 |
|
|
#include "CommonTools/UtilAlgos/interface/TFileService.h"
|
20 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
21 |
|
|
|
22 |
|
|
#include "DataFormats/HeavyIonEvent/interface/CentralityProvider.h"
|
23 |
|
|
|
24 |
mnguyen |
1.3 |
#include "DataFormats/PatCandidates/interface/Jet.h"
|
25 |
|
|
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
|
26 |
yilmaz |
1.1 |
//
|
27 |
|
|
|
28 |
|
|
/**\class HiInclusiveJetAnalyzer
|
29 |
|
|
|
30 |
|
|
\author Matt Nguyen
|
31 |
|
|
\date November 2010
|
32 |
|
|
*/
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
class HiInclusiveJetAnalyzer : public edm::EDAnalyzer {
|
38 |
|
|
public:
|
39 |
|
|
|
40 |
|
|
explicit HiInclusiveJetAnalyzer(const edm::ParameterSet&);
|
41 |
|
|
|
42 |
|
|
~HiInclusiveJetAnalyzer();
|
43 |
|
|
|
44 |
|
|
virtual void analyze(const edm::Event&, const edm::EventSetup&);
|
45 |
|
|
|
46 |
|
|
virtual void beginRun(const edm::Run & r, const edm::EventSetup & c);
|
47 |
|
|
|
48 |
|
|
virtual void beginJob();
|
49 |
|
|
|
50 |
|
|
void fillL1Bits(const edm::Event &iEvent);
|
51 |
|
|
|
52 |
|
|
void fillHLTBits(const edm::Event &iEvent);
|
53 |
|
|
|
54 |
|
|
template <typename TYPE>
|
55 |
|
|
void getProduct(const std::string name, edm::Handle<TYPE> &prod,
|
56 |
|
|
const edm::Event &event) const;
|
57 |
|
|
template <typename TYPE>
|
58 |
|
|
bool getProductSafe(const std::string name, edm::Handle<TYPE> &prod,
|
59 |
|
|
const edm::Event &event) const;
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
private:
|
63 |
|
|
|
64 |
mnguyen |
1.3 |
int getPFJetMuon(const pat::Jet& pfJet, const reco::PFCandidateCollection *pfCandidateColl);
|
65 |
yilmaz |
1.1 |
|
66 |
mnguyen |
1.3 |
double getPtRel(const reco::PFCandidate lep, const pat::Jet& jet );
|
67 |
yilmaz |
1.1 |
|
68 |
mnguyen |
1.6 |
void saveDaughters( const reco::GenParticle & gen);
|
69 |
|
|
void saveDaughters( const reco::Candidate & gen);
|
70 |
|
|
|
71 |
yilmaz |
1.12 |
edm::InputTag jetTag_, vtxTag_, genjetTag_, eventInfoTag_, L1gtReadout_, pfCandidateLabel_, trackTag_, matchTag_;
|
72 |
yilmaz |
1.1 |
|
73 |
mnguyen |
1.6 |
std::vector<float> usedStringPts;
|
74 |
yilmaz |
1.1 |
|
75 |
|
|
/// verbose ?
|
76 |
|
|
bool verbose_;
|
77 |
|
|
|
78 |
|
|
bool useCentrality_;
|
79 |
|
|
bool useVtx_;
|
80 |
|
|
bool useJEC_;
|
81 |
yilmaz |
1.2 |
bool usePat_;
|
82 |
yilmaz |
1.1 |
bool isMC_;
|
83 |
yilmaz |
1.9 |
bool doTrigger_;
|
84 |
yilmaz |
1.11 |
bool useQuality_;
|
85 |
|
|
std::string trackQuality_;
|
86 |
yilmaz |
1.1 |
|
87 |
yilmaz |
1.8 |
bool doSubEvent_;
|
88 |
yilmaz |
1.4 |
double genPtMin_;
|
89 |
mnguyen |
1.3 |
bool doLifeTimeTagging_;
|
90 |
mnguyen |
1.5 |
bool doLifeTimeTaggingExtras_;
|
91 |
mnguyen |
1.7 |
bool saveBfragments_;
|
92 |
yilmaz |
1.1 |
|
93 |
yilmaz |
1.11 |
double rParam;
|
94 |
|
|
|
95 |
yilmaz |
1.1 |
TTree *t;
|
96 |
|
|
edm::Service<TFileService> fs1;
|
97 |
|
|
|
98 |
|
|
CentralityProvider * centrality_;
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
std::string hltResName_; //HLT trigger results name
|
103 |
|
|
std::vector<std::string> hltProcNames_; //HLT process name(s)
|
104 |
|
|
std::vector<std::string> hltTrgNames_; //HLT trigger name(s)
|
105 |
|
|
|
106 |
|
|
std::vector<int> hltTrgBits_; //HLT trigger bit(s)
|
107 |
|
|
std::vector<bool> hltTrgDeci_; //HLT trigger descision(s)
|
108 |
|
|
std::vector<std::string> hltTrgUsedNames_; //HLT used trigger name(s)
|
109 |
|
|
std::string hltUsedResName_; //used HLT trigger results name
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
mnguyen |
1.5 |
static const int MAXJETS = 500;
|
114 |
|
|
static const int MAXTRACKS = 5000;
|
115 |
|
|
static const int MAXHLTBITS = 5000;
|
116 |
mnguyen |
1.6 |
static const int MAXBFRAG = 500;
|
117 |
yilmaz |
1.1 |
|
118 |
|
|
struct JRA{
|
119 |
|
|
|
120 |
|
|
int nref;
|
121 |
|
|
int run;
|
122 |
|
|
int evt;
|
123 |
|
|
int lumi;
|
124 |
|
|
int bin;
|
125 |
|
|
float vx, vy, vz;
|
126 |
|
|
float b;
|
127 |
|
|
float hf;
|
128 |
|
|
|
129 |
|
|
float rawpt[MAXJETS];
|
130 |
|
|
float jtpt[MAXJETS];
|
131 |
|
|
float jteta[MAXJETS];
|
132 |
|
|
float jtphi[MAXJETS];
|
133 |
|
|
float jty[MAXJETS];
|
134 |
yilmaz |
1.2 |
float jtpu[MAXJETS];
|
135 |
|
|
|
136 |
yilmaz |
1.11 |
float trackMax[MAXJETS];
|
137 |
|
|
float trackSum[MAXJETS];
|
138 |
|
|
int trackN[MAXJETS];
|
139 |
|
|
|
140 |
|
|
float chargedMax[MAXJETS];
|
141 |
|
|
float chargedSum[MAXJETS];
|
142 |
|
|
int chargedN[MAXJETS];
|
143 |
|
|
|
144 |
|
|
float photonMax[MAXJETS];
|
145 |
|
|
float photonSum[MAXJETS];
|
146 |
|
|
int photonN[MAXJETS];
|
147 |
|
|
|
148 |
|
|
float neutralMax[MAXJETS];
|
149 |
|
|
float neutralSum[MAXJETS];
|
150 |
|
|
int neutralN[MAXJETS];
|
151 |
|
|
|
152 |
|
|
float eMax[MAXJETS];
|
153 |
|
|
float eSum[MAXJETS];
|
154 |
|
|
int eN[MAXJETS];
|
155 |
|
|
|
156 |
|
|
float muMax[MAXJETS];
|
157 |
|
|
float muSum[MAXJETS];
|
158 |
|
|
int muN[MAXJETS];
|
159 |
|
|
|
160 |
yilmaz |
1.12 |
float matchedPt[MAXJETS];
|
161 |
|
|
float matchedR[MAXJETS];
|
162 |
|
|
|
163 |
mnguyen |
1.3 |
float discr_csvMva[MAXJETS];
|
164 |
|
|
float discr_csvSimple[MAXJETS];
|
165 |
|
|
float discr_muByIp3[MAXJETS];
|
166 |
|
|
float discr_muByPt[MAXJETS];
|
167 |
|
|
float discr_prob[MAXJETS];
|
168 |
|
|
float discr_probb[MAXJETS];
|
169 |
|
|
float discr_tcHighEff[MAXJETS];
|
170 |
|
|
float discr_tcHighPur[MAXJETS];
|
171 |
|
|
|
172 |
mnguyen |
1.5 |
int nsvtx[MAXJETS];
|
173 |
|
|
int svtxntrk[MAXJETS];
|
174 |
mnguyen |
1.3 |
float svtxdl[MAXJETS];
|
175 |
|
|
float svtxdls[MAXJETS];
|
176 |
|
|
float svtxm[MAXJETS];
|
177 |
|
|
float svtxpt[MAXJETS];
|
178 |
|
|
|
179 |
mnguyen |
1.5 |
int nIPtrk[MAXJETS];
|
180 |
|
|
int nselIPtrk[MAXJETS];
|
181 |
|
|
|
182 |
mnguyen |
1.6 |
int nIP;
|
183 |
mnguyen |
1.5 |
int ipJetIndex[MAXTRACKS];
|
184 |
|
|
float ipPt[MAXTRACKS];
|
185 |
|
|
float ipProb0[MAXTRACKS];
|
186 |
|
|
float ipProb1[MAXTRACKS];
|
187 |
|
|
float ip2d[MAXTRACKS];
|
188 |
|
|
float ip2dSig[MAXTRACKS];
|
189 |
|
|
float ip3d[MAXTRACKS];
|
190 |
|
|
float ip3dSig[MAXTRACKS];
|
191 |
|
|
float ipDist2Jet[MAXTRACKS];
|
192 |
|
|
float ipDist2JetSig[MAXTRACKS];
|
193 |
|
|
float ipClosest2Jet[MAXTRACKS];
|
194 |
mnguyen |
1.3 |
|
195 |
|
|
float mue[MAXJETS];
|
196 |
|
|
float mupt[MAXJETS];
|
197 |
|
|
float mueta[MAXJETS];
|
198 |
|
|
float muphi[MAXJETS];
|
199 |
|
|
float mudr[MAXJETS];
|
200 |
|
|
float muptrel[MAXJETS];
|
201 |
|
|
int muchg[MAXJETS];
|
202 |
|
|
|
203 |
ylai |
1.10 |
float discr_fr01[MAXJETS];
|
204 |
|
|
|
205 |
yilmaz |
1.1 |
float refpt[MAXJETS];
|
206 |
|
|
float refeta[MAXJETS];
|
207 |
|
|
float refphi[MAXJETS];
|
208 |
|
|
float refy[MAXJETS];
|
209 |
|
|
float refdphijt[MAXJETS];
|
210 |
|
|
float refdrjt[MAXJETS];
|
211 |
|
|
float refparton_pt[MAXJETS];
|
212 |
mnguyen |
1.3 |
int refparton_flavor[MAXJETS];
|
213 |
|
|
int refparton_flavorForB[MAXJETS];
|
214 |
yilmaz |
1.1 |
|
215 |
|
|
float pthat;
|
216 |
mnguyen |
1.5 |
int beamId1, beamId2;
|
217 |
yilmaz |
1.1 |
int ngen;
|
218 |
|
|
int genmatchindex[MAXJETS];
|
219 |
|
|
float genpt[MAXJETS];
|
220 |
|
|
float geneta[MAXJETS];
|
221 |
|
|
float genphi[MAXJETS];
|
222 |
|
|
float geny[MAXJETS];
|
223 |
|
|
float gendphijt[MAXJETS];
|
224 |
|
|
float gendrjt[MAXJETS];
|
225 |
yilmaz |
1.8 |
int gensubid[MAXJETS];
|
226 |
yilmaz |
1.1 |
|
227 |
|
|
// hlt
|
228 |
|
|
int nHLTBit;
|
229 |
|
|
bool hltBit[MAXHLTBITS];
|
230 |
|
|
|
231 |
|
|
// l1
|
232 |
|
|
int nL1TBit;
|
233 |
|
|
bool l1TBit[MAXHLTBITS];
|
234 |
|
|
int nL1ABit;
|
235 |
|
|
bool l1ABit[MAXHLTBITS];
|
236 |
|
|
|
237 |
mnguyen |
1.6 |
int bMult;
|
238 |
|
|
int bJetIndex[MAXBFRAG];
|
239 |
|
|
int bStatus[MAXBFRAG];
|
240 |
|
|
int bPdg[MAXBFRAG];
|
241 |
|
|
int bChg[MAXBFRAG];
|
242 |
|
|
float bVx[MAXBFRAG];
|
243 |
|
|
float bVy[MAXBFRAG];
|
244 |
|
|
float bVz[MAXBFRAG];
|
245 |
|
|
float bPt[MAXBFRAG];
|
246 |
|
|
float bEta[MAXBFRAG];
|
247 |
|
|
float bPhi[MAXBFRAG];
|
248 |
|
|
|
249 |
mnguyen |
1.3 |
|
250 |
yilmaz |
1.1 |
};
|
251 |
|
|
|
252 |
|
|
JRA jets_;
|
253 |
|
|
|
254 |
|
|
};
|
255 |
|
|
|
256 |
|
|
#endif
|