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