CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTBJet.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <algorithm>
3 #include <utility>
4 #include <cstring>
5 #include <boost/foreach.hpp>
6 
7 #include <TTree.h>
8 
13 
17 
19 
20 static const size_t kMaxBJets = 10;
21 
22 #include "HLTMessages.h"
23 
25 {
26  // set of variables for uncorrected L2 jets
27  NohBJetL2 = 0;
28  ohBJetL2Energy = new float[kMaxBJets];
29  ohBJetL2Et = new float[kMaxBJets];
30  ohBJetL2Pt = new float[kMaxBJets];
31  ohBJetL2Eta = new float[kMaxBJets];
32  ohBJetL2Phi = new float[kMaxBJets];
33 
34  // set of variables for corrected L2 jets
37  ohBJetL2CorrectedEt = new float[kMaxBJets];
38  ohBJetL2CorrectedPt = new float[kMaxBJets];
39  ohBJetL2CorrectedEta = new float[kMaxBJets];
40  ohBJetL2CorrectedPhi = new float[kMaxBJets];
41 
42  // set of variables for corrected L2 jets L1FastJet
49 
50  // set of variables for uncorrected L2 jets
51  NohpfBJetL2 = 0;
52  ohpfBJetL2Energy = new float[kMaxBJets];
53  ohpfBJetL2Et = new float[kMaxBJets];
54  ohpfBJetL2Pt = new float[kMaxBJets];
55  ohpfBJetL2Eta = new float[kMaxBJets];
56  ohpfBJetL2Phi = new float[kMaxBJets];
57 
58  // set of variables for lifetime-based b-tag
59  ohBJetIPL25Tag = new float[kMaxBJets];
60  ohBJetIPL3Tag = new float[kMaxBJets];
61 
62  // set of variables for lifetime-based b-tag L1FastJet
64  ohBJetIPL3TagL1FastJet = new float[kMaxBJets];
65 
66  // set of variables for lifetime-based b-tag PF jets
67  ohpfBJetIPL3Tag = new float[kMaxBJets];
68 
69  // set of variables for lifetime-based b-tag Single Track
74 
75  // set of variables for b-tagging performance measurements
76  // SoftMuonbyDR
77  ohBJetPerfL25Tag = new int[kMaxBJets]; // do not optimize
78  ohBJetPerfL3Tag = new int[kMaxBJets]; // do not optimize
79  // set of variables for b-tagging performance measurements L1FastJet
80  // SoftMuonbyDR
81  ohBJetPerfL25TagL1FastJet = new int[kMaxBJets]; // do not optimize
82  ohBJetPerfL3TagL1FastJet = new int[kMaxBJets]; // do not optimize
83 }
84 
86 {
87  NohBJetL2 = 0;
89  std::memset(ohBJetL2Energy, '\0', kMaxBJets * sizeof(float));
90  std::memset(ohBJetL2Et, '\0', kMaxBJets * sizeof(float));
91  std::memset(ohBJetL2Et, '\0', kMaxBJets * sizeof(float));
92  std::memset(ohBJetL2Pt, '\0', kMaxBJets * sizeof(float));
93  std::memset(ohBJetL2Eta, '\0', kMaxBJets * sizeof(float));
94  std::memset(ohBJetL2Phi, '\0', kMaxBJets * sizeof(float));
95  std::memset(ohBJetL2CorrectedEnergy, '\0', kMaxBJets * sizeof(float));
96  std::memset(ohBJetL2CorrectedEt, '\0', kMaxBJets * sizeof(float));
97  std::memset(ohBJetL2CorrectedPt, '\0', kMaxBJets * sizeof(float));
98  std::memset(ohBJetL2CorrectedEta, '\0', kMaxBJets * sizeof(float));
99  std::memset(ohBJetL2CorrectedPhi, '\0', kMaxBJets * sizeof(float));
100  std::memset(ohBJetL2CorrectedEnergyL1FastJet, '\0', kMaxBJets * sizeof(float));
101  std::memset(ohBJetL2CorrectedEtL1FastJet, '\0', kMaxBJets * sizeof(float));
102  std::memset(ohBJetL2CorrectedPtL1FastJet, '\0', kMaxBJets * sizeof(float));
103  std::memset(ohBJetL2CorrectedEtaL1FastJet, '\0', kMaxBJets * sizeof(float));
104  std::memset(ohBJetL2CorrectedPhiL1FastJet, '\0', kMaxBJets * sizeof(float));
105  std::memset(ohpfBJetL2Energy, '\0', kMaxBJets * sizeof(float));
106  std::memset(ohpfBJetL2Et, '\0', kMaxBJets * sizeof(float));
107  std::memset(ohpfBJetL2Et, '\0', kMaxBJets * sizeof(float));
108  std::memset(ohpfBJetL2Pt, '\0', kMaxBJets * sizeof(float));
109  std::memset(ohpfBJetL2Eta, '\0', kMaxBJets * sizeof(float));
110  std::memset(ohpfBJetL2Phi, '\0', kMaxBJets * sizeof(float));
111 
112  std::memset(ohBJetIPL25Tag, '\0', kMaxBJets * sizeof(float));
113  std::memset(ohBJetIPL3Tag, '\0', kMaxBJets * sizeof(float));
114  std::memset(ohBJetIPL25TagL1FastJet, '\0', kMaxBJets * sizeof(float));
115  std::memset(ohBJetIPL3TagL1FastJet, '\0', kMaxBJets * sizeof(float));
116  std::memset(ohpfBJetIPL3Tag, '\0', kMaxBJets * sizeof(float));
117 
118  std::memset(ohBJetIPL25TagSingleTrack, '\0', kMaxBJets * sizeof(float));
119  std::memset(ohBJetIPL3TagSingleTrack, '\0', kMaxBJets * sizeof(float));
120  std::memset(ohBJetIPL25TagSingleTrackL1FastJet, '\0', kMaxBJets * sizeof(float));
121  std::memset(ohBJetIPL3TagSingleTrackL1FastJet, '\0', kMaxBJets * sizeof(float));
122 
123  std::memset(ohBJetPerfL25Tag, '\0', kMaxBJets * sizeof(int));
124  std::memset(ohBJetPerfL3Tag, '\0', kMaxBJets * sizeof(int));
125  std::memset(ohBJetPerfL25TagL1FastJet, '\0', kMaxBJets * sizeof(int));
126  std::memset(ohBJetPerfL3TagL1FastJet, '\0', kMaxBJets * sizeof(int));
127 }
128 
130 {
131  delete[] ohBJetL2Energy;
132  delete[] ohBJetL2Et;
133  delete[] ohBJetL2Pt;
134  delete[] ohBJetL2Eta;
135  delete[] ohBJetL2Phi;
136  delete[] ohBJetL2CorrectedEnergy;
137  delete[] ohBJetL2CorrectedEt;
138  delete[] ohBJetL2CorrectedPt;
139  delete[] ohBJetL2CorrectedEta;
140  delete[] ohBJetL2CorrectedPhi;
146  delete[] ohpfBJetL2Energy;
147  delete[] ohpfBJetL2Et;
148  delete[] ohpfBJetL2Pt;
149  delete[] ohpfBJetL2Eta;
150  delete[] ohpfBJetL2Phi;
151  delete[] ohBJetIPL25Tag;
152  delete[] ohBJetIPL3Tag;
153  delete[] ohBJetIPL25TagL1FastJet;
154  delete[] ohBJetIPL3TagL1FastJet;
155  delete[] ohpfBJetIPL3Tag;
156  delete[] ohBJetIPL25TagSingleTrack;
157  delete[] ohBJetIPL3TagSingleTrack;
160  delete[] ohBJetPerfL25Tag;
161  delete[] ohBJetPerfL3Tag;
162  delete[] ohBJetPerfL25TagL1FastJet;
163  delete[] ohBJetPerfL3TagL1FastJet;
164 }
165 
167 {
168  // create the TTree branches
169  if (tree) {
170  tree->Branch("NohBJetL2", & NohBJetL2, "NohBJetL2/I");
171  tree->Branch("ohBJetL2Energy", ohBJetL2Energy, "ohBJetL2Energy[NohBJetL2]/F");
172  tree->Branch("ohBJetL2Et", ohBJetL2Et, "ohBJetL2Et[NohBJetL2]/F");
173  tree->Branch("ohBJetL2Pt", ohBJetL2Pt, "ohBJetL2Pt[NohBJetL2]/F");
174  tree->Branch("ohBJetL2Eta", ohBJetL2Eta, "ohBJetL2Eta[NohBJetL2]/F");
175  tree->Branch("ohBJetL2Phi", ohBJetL2Phi, "ohBJetL2Phi[NohBJetL2]/F");
176 
177  tree->Branch("NohBJetL2Corrected", & NohBJetL2Corrected, "NohBJetL2Corrected/I");
178  tree->Branch("ohBJetL2CorrectedEnergy", ohBJetL2CorrectedEnergy, "ohBJetL2CorrectedEnergy[NohBJetL2Corrected]/F");
179  tree->Branch("ohBJetL2CorrectedEt", ohBJetL2CorrectedEt, "ohBJetL2CorrectedEt[NohBJetL2Corrected]/F");
180  tree->Branch("ohBJetL2CorrectedPt", ohBJetL2CorrectedPt, "ohBJetL2CorrectedPt[NohBJetL2Corrected]/F");
181  tree->Branch("ohBJetL2CorrectedEta", ohBJetL2CorrectedEta, "ohBJetL2CorrectedEta[NohBJetL2Corrected]/F");
182  tree->Branch("ohBJetL2CorrectedPhi", ohBJetL2CorrectedPhi, "ohBJetL2CorrectedPhi[NohBJetL2Corrected]/F");
183 
184  tree->Branch("NohBJetL2CorrectedL1FastJet", & NohBJetL2CorrectedL1FastJet, "NohBJetL2CorrectedL1FastJet/I");
185  tree->Branch("ohBJetL2CorrectedEnergyL1FastJet", ohBJetL2CorrectedEnergyL1FastJet, "ohBJetL2CorrectedEnergyL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
186  tree->Branch("ohBJetL2CorrectedEtL1FastJet", ohBJetL2CorrectedEtL1FastJet, "ohBJetL2CorrectedEtL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
187  tree->Branch("ohBJetL2CorrectedPtL1FastJet", ohBJetL2CorrectedPtL1FastJet, "ohBJetL2CorrectedPtL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
188  tree->Branch("ohBJetL2CorrectedEtaL1FastJet", ohBJetL2CorrectedEtaL1FastJet, "ohBJetL2CorrectedEtaL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
189  tree->Branch("ohBJetL2CorrectedPhiL1FastJet", ohBJetL2CorrectedPhiL1FastJet, "ohBJetL2CorrectedPhiL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
190 
191  tree->Branch("NohpfBJetL2", & NohpfBJetL2, "NohpfBJetL2/I");
192  tree->Branch("ohpfBJetL2Energy", ohpfBJetL2Energy, "ohpfBJetL2Energy[NohpfBJetL2]/F");
193  tree->Branch("ohpfBJetL2Et", ohpfBJetL2Et, "ohpfBJetL2Et[NohpfBJetL2]/F");
194  tree->Branch("ohpfBJetL2Pt", ohpfBJetL2Pt, "ohpfBJetL2Pt[NohpfBJetL2]/F");
195  tree->Branch("ohpfBJetL2Eta", ohpfBJetL2Eta, "ohpfBJetL2Eta[NohpfBJetL2]/F");
196  tree->Branch("ohpfBJetL2Phi", ohpfBJetL2Phi, "ohpfBJetL2Phi[NohpfBJetL2]/F");
197 
198  tree->Branch("ohBJetIPL25Tag", ohBJetIPL25Tag, "ohBJetIPL25Tag[NohBJetL2Corrected]/F");
199  tree->Branch("ohBJetIPL3Tag", ohBJetIPL3Tag, "ohBJetIPL3Tag[NohBJetL2Corrected]/F");
200  tree->Branch("ohBJetIPL25TagL1FastJet", ohBJetIPL25TagL1FastJet, "ohBJetIPL25TagL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
201  tree->Branch("ohBJetIPL3TagL1FastJet", ohBJetIPL3TagL1FastJet, "ohBJetIPL3TagL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
202  tree->Branch("ohpfBJetIPL3Tag", ohpfBJetIPL3Tag, "ohpfBJetIPL3Tag[NohpfBJetL2]/F");
203 
204  tree->Branch("ohBJetIPL25TagSingleTrack", ohBJetIPL25TagSingleTrack, "ohBJetIPL25TagSingleTrack[NohBJetL2Corrected]/F");
205  tree->Branch("ohBJetIPL3TagSingleTrack", ohBJetIPL3TagSingleTrack, "ohBJetIPL3TagSingleTrack[NohBJetL2Corrected]/F");
206  tree->Branch("ohBJetIPL25TagSingleTrackL1FastJet", ohBJetIPL25TagSingleTrackL1FastJet, "ohBJetIPL25TagSingleTrackL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
207  tree->Branch("ohBJetIPL3TagSingleTrackL1FastJet", ohBJetIPL3TagSingleTrackL1FastJet, "ohBJetIPL3TagSingleTrackL1FastJet[NohBJetL2CorrectedL1FastJet]/F");
208 
209  tree->Branch("ohBJetPerfL25Tag", ohBJetPerfL25Tag, "ohBJetPerfL25Tag[NohBJetL2Corrected]/I");
210  tree->Branch("ohBJetPerfL3Tag", ohBJetPerfL3Tag, "ohBJetPerfL3Tag[NohBJetL2Corrected]/I");
211  tree->Branch("ohBJetPerfL25TagL1FastJet", ohBJetPerfL25TagL1FastJet, "ohBJetPerfL25TagL1FastJet[NohBJetL2CorrectedL1FastJet]/I");
212  tree->Branch("ohBJetPerfL3TagL1FastJet", ohBJetPerfL3TagL1FastJet, "ohBJetPerfL3TagL1FastJet[NohBJetL2CorrectedL1FastJet]/I");
213  }
214 }
215 
217  const edm::Handle<edm::View<reco::Jet> > & rawBJets,
218  const edm::Handle<edm::View<reco::Jet> > & correctedBJets,
219  const edm::Handle<edm::View<reco::Jet> > & correctedBJetsL1FastJet,
220  const edm::Handle<edm::View<reco::Jet> > & pfBJets,
221  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL25,
222  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL3,
223  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL25L1FastJet,
224  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL3L1FastJet,
225  const edm::Handle<reco::JetTagCollection> & lifetimePFBJetsL3,
226  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL25SingleTrack,
227  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL3SingleTrack,
228  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL25SingleTrackL1FastJet,
229  const edm::Handle<reco::JetTagCollection> & lifetimeBJetsL3SingleTrackL1FastJet,
230  const edm::Handle<reco::JetTagCollection> & performanceBJetsL25,
231  const edm::Handle<reco::JetTagCollection> & performanceBJetsL3,
232  const edm::Handle<reco::JetTagCollection> & performanceBJetsL25L1FastJet,
233  const edm::Handle<reco::JetTagCollection> & performanceBJetsL3L1FastJet,
234  TTree * tree)
235 {
236  // reset the tree variables
237  clear();
238 
239  // if the required collections are available, fill the corresponding tree branches
240  if (rawBJets.isValid())
241  analyseJets(* rawBJets);
242 
243  if (correctedBJets.isValid())
244  analyseCorrectedJets(* correctedBJets);
245 
246  if (correctedBJetsL1FastJet.isValid())
247  analyseCorrectedJetsL1FastJet(* correctedBJetsL1FastJet);
248 
249  if (pfBJets.isValid())
250  analysePFJets(* pfBJets);
251 
252  if (correctedBJets.isValid() and lifetimeBJetsL25.isValid() and lifetimeBJetsL3.isValid())
253  analyseLifetime(* correctedBJets, * lifetimeBJetsL25, * lifetimeBJetsL3);
254 
255  if (correctedBJetsL1FastJet.isValid() and lifetimeBJetsL25L1FastJet.isValid() and lifetimeBJetsL3L1FastJet.isValid())
256  analyseLifetimeL1FastJet(* correctedBJetsL1FastJet, * lifetimeBJetsL25L1FastJet, * lifetimeBJetsL3L1FastJet);
257 
258  if (pfBJets.isValid() and lifetimePFBJetsL3.isValid())
259  analyseLifetimePF(* pfBJets, * lifetimePFBJetsL3);
260 
261  if (correctedBJets.isValid() and lifetimeBJetsL25SingleTrack.isValid() and lifetimeBJetsL3SingleTrack.isValid())
262  analyseLifetimeSingleTrack(* correctedBJets, * lifetimeBJetsL25SingleTrack, * lifetimeBJetsL3SingleTrack);
263 
264  if (correctedBJetsL1FastJet.isValid() and lifetimeBJetsL25SingleTrackL1FastJet.isValid() and lifetimeBJetsL3SingleTrackL1FastJet.isValid())
265  analyseLifetimeSingleTrackL1FastJet(* correctedBJetsL1FastJet, * lifetimeBJetsL25SingleTrackL1FastJet, * lifetimeBJetsL3SingleTrackL1FastJet);
266 
267  if (correctedBJets.isValid() and performanceBJetsL25.isValid() and performanceBJetsL3.isValid())
268  analysePerformance(* correctedBJets, * performanceBJetsL25, * performanceBJetsL3);
269 
270  if (correctedBJetsL1FastJet.isValid() and performanceBJetsL25L1FastJet.isValid() and performanceBJetsL3L1FastJet.isValid())
271  analysePerformanceL1FastJet(* correctedBJetsL1FastJet, * performanceBJetsL25L1FastJet, * performanceBJetsL3L1FastJet);
272 
273 }
274 
276 {
277  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
278  // so, for the comparison, we cast back to size_t
279  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
280  NohBJetL2 = size;
281  for (size_t i = 0; i < size; ++i) {
282  ohBJetL2Energy[i] = jets[i].energy();
283  ohBJetL2Et[i] = jets[i].et();
284  ohBJetL2Pt[i] = jets[i].pt();
285  ohBJetL2Eta[i] = jets[i].eta();
286  ohBJetL2Phi[i] = jets[i].phi();
287  }
288 }
289 
291 {
292  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
293  // so, for the comparison, we cast back to size_t
294  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
296  for (size_t i = 0; i < size; ++i) {
297  ohBJetL2CorrectedEnergy[i] = jets[i].energy();
298  ohBJetL2CorrectedEt[i] = jets[i].et();
299  ohBJetL2CorrectedPt[i] = jets[i].pt();
300  ohBJetL2CorrectedEta[i] = jets[i].eta();
301  ohBJetL2CorrectedPhi[i] = jets[i].phi();
302  }
303 }
304 
306 {
307  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
308  // so, for the comparison, we cast back to size_t
309  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
311  for (size_t i = 0; i < size; ++i) {
312  ohBJetL2CorrectedEnergyL1FastJet[i] = jets[i].energy();
313  ohBJetL2CorrectedEtL1FastJet[i] = jets[i].et();
314  ohBJetL2CorrectedPtL1FastJet[i] = jets[i].pt();
315  ohBJetL2CorrectedEtaL1FastJet[i] = jets[i].eta();
316  ohBJetL2CorrectedPhiL1FastJet[i] = jets[i].phi();
317  }
318 }
319 
321 {
322  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
323  // so, for the comparison, we cast back to size_t
324  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
325  NohpfBJetL2 = size;
326  for (size_t i = 0; i < size; ++i) {
327  ohpfBJetL2Energy[i] = jets[i].energy();
328  ohpfBJetL2Et[i] = jets[i].et();
329  ohpfBJetL2Pt[i] = jets[i].pt();
330  ohpfBJetL2Eta[i] = jets[i].eta();
331  ohpfBJetL2Phi[i] = jets[i].phi();
332  }
333 }
334 
336  const edm::View<reco::Jet> & jets,
337  const reco::JetTagCollection & tagsL25,
338  const reco::JetTagCollection & tagsL3)
339 {
340  if (tagsL25.size() != jets.size()) {
341  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL25 << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
342  return;
343  }
344  if (tagsL3.size() != jets.size()) {
345  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL3 << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
346  return;
347  }
348  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
349  // so, for the comparison, we cast back to size_t
350  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
351  for (size_t i = 0; i < size; i++) {
352  ohBJetIPL25Tag[i] = tagsL25[i].second;
353  ohBJetIPL3Tag[i] = tagsL3[i].second;
354  }
355 }
356 
358  const edm::View<reco::Jet> & jets,
359  const reco::JetTagCollection & tagsL25,
360  const reco::JetTagCollection & tagsL3)
361 {
362  if (tagsL25.size() != jets.size()) {
363  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL25L1FastJet << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
364  return;
365  }
366  if (tagsL3.size() != jets.size()) {
367  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL3L1FastJet << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
368  return;
369  }
370  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
371  // so, for the comparison, we cast back to size_t
372  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
373  for (size_t i = 0; i < size; i++) {
374  ohBJetIPL25TagL1FastJet[i] = tagsL25[i].second;
375  ohBJetIPL3TagL1FastJet[i] = tagsL3[i].second;
376  }
377 }
378 
380  const edm::View<reco::Jet> & jets,
381  const reco::JetTagCollection & tagsL3)
382 {
383  if (tagsL3.size() != jets.size()) {
384  edm::LogWarning("OpenHLT") << kBTagLifetimePFBJetsL3 << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
385  return;
386  }
387  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
388  // so, for the comparison, we cast back to size_t
389  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
390  for (size_t i = 0; i < size; i++) {
391  ohpfBJetIPL3Tag[i] = tagsL3[i].second;
392  }
393 }
394 
396  const edm::View<reco::Jet> & jets,
397  const reco::JetTagCollection & tagsL25,
398  const reco::JetTagCollection & tagsL3)
399 {
400  if (tagsL25.size() != jets.size()) {
401  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL25SingleTrack << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
402  return;
403  }
404  if (tagsL3.size() != jets.size()) {
405  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL3SingleTrack << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
406  return;
407  }
408  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
409  // so, for the comparison, we cast back to size_t
410  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
411  for (size_t i = 0; i < size; i++) {
412  ohBJetIPL25TagSingleTrack[i] = tagsL25[i].second;
413  ohBJetIPL3TagSingleTrack[i] = tagsL3[i].second;
414  }
415 }
416 
418  const edm::View<reco::Jet> & jets,
419  const reco::JetTagCollection & tagsL25,
420  const reco::JetTagCollection & tagsL3)
421 {
422  if (tagsL25.size() != jets.size()) {
423  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL25SingleTrackL1FastJet << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
424  return;
425  }
426  if (tagsL3.size() != jets.size()) {
427  edm::LogWarning("OpenHLT") << kBTagLifetimeBJetsL3SingleTrackL1FastJet << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
428  return;
429  }
430  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
431  // so, for the comparison, we cast back to size_t
432  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
433  for (size_t i = 0; i < size; i++) {
434  ohBJetIPL25TagSingleTrackL1FastJet[i] = tagsL25[i].second;
435  ohBJetIPL3TagSingleTrackL1FastJet[i] = tagsL3[i].second;
436  }
437 }
438 
440  const edm::View<reco::Jet> & jets,
441  const reco::JetTagCollection & tagsL25,
442  const reco::JetTagCollection & tagsL3)
443 {
444  if (tagsL25.size() != jets.size()) {
445  edm::LogWarning("OpenHLT") << kBTagPerformanceBJetsL25 << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
446  return;
447  }
448  if (tagsL3.size() != jets.size()) {
449  edm::LogWarning("OpenHLT") << kBTagPerformanceBJetsL3 << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
450  return;
451  }
452  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
453  // so, for the comparison, we cast back to size_t
454  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
455  for (size_t i = 0; i < size; i++) {
456  ohBJetPerfL25Tag[i] = (tagsL25[i].second > 0.) ? 1 : 0;
457  ohBJetPerfL3Tag[i] = (tagsL3[i].second > 0.) ? 1 : 0;
458  }
459 }
460 
462  const edm::View<reco::Jet> & jets,
463  const reco::JetTagCollection & tagsL25,
464  const reco::JetTagCollection & tagsL3)
465 {
466  if (tagsL25.size() != jets.size()) {
467  edm::LogWarning("OpenHLT") << kBTagPerformanceBJetsL25L1FastJet << " collection has " << tagsL25.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
468  return;
469  }
470  if (tagsL3.size() != jets.size()) {
471  edm::LogWarning("OpenHLT") << kBTagPerformanceBJetsL3L1FastJet << " collection has " << tagsL3.size() << " elements, but " << jets.size() << " where expected from L2" << std::endl;
472  return;
473  }
474  // the jets need to be persistable, so .size() returns an 'unsigned int' to be stable across the architectures
475  // so, for the comparison, we cast back to size_t
476  size_t size = std::min(kMaxBJets, size_t(jets.size()) );
477  for (size_t i = 0; i < size; i++) {
478 
479  ohBJetPerfL25TagL1FastJet[i] = (tagsL25[i].second > 0.) ? 1 : 0;
480  ohBJetPerfL3TagL1FastJet[i] = (tagsL3[i].second > 0.) ? 1 : 0;
481  }
482 }
int NohpfBJetL2
Definition: HLTBJet.h:112
const char * kBTagLifetimeBJetsL25SingleTrack
Definition: HLTMessages.cc:72
float * ohBJetL2Pt
Definition: HLTBJet.h:91
int i
Definition: DBlmapReader.cc:9
void analysePerformance(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:439
int * ohBJetPerfL3TagL1FastJet
Definition: HLTBJet.h:141
float * ohBJetIPL3TagSingleTrackL1FastJet
Definition: HLTBJet.h:134
float * ohBJetL2CorrectedEtaL1FastJet
Definition: HLTBJet.h:108
float * ohBJetIPL3TagL1FastJet
Definition: HLTBJet.h:125
void analyseJets(const edm::View< reco::Jet > &jets)
Definition: HLTBJet.cc:275
void clear(void)
Definition: HLTBJet.cc:85
size_type size() const
const char * kBTagLifetimeBJetsL3SingleTrackL1FastJet
Definition: HLTMessages.cc:75
const char * kBTagLifetimeBJetsL25SingleTrackL1FastJet
Definition: HLTMessages.cc:74
float * ohBJetL2Eta
Definition: HLTBJet.h:92
void analysePerformanceL1FastJet(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:461
const char * kBTagLifetimeBJetsL3SingleTrack
Definition: HLTMessages.cc:73
float * ohBJetL2CorrectedPhiL1FastJet
Definition: HLTBJet.h:109
int NohBJetL2
Definition: HLTBJet.h:88
const char * kBTagPerformanceBJetsL25
Definition: HLTMessages.cc:78
int NohBJetL2Corrected
Definition: HLTBJet.h:96
void analyseCorrectedJets(const edm::View< reco::Jet > &jets)
Definition: HLTBJet.cc:290
float * ohBJetIPL25TagSingleTrackL1FastJet
Definition: HLTBJet.h:133
int * ohBJetPerfL3Tag
Definition: HLTBJet.h:138
void analyseLifetimeL1FastJet(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:357
float * ohpfBJetL2Energy
Definition: HLTBJet.h:113
float * ohBJetL2CorrectedEt
Definition: HLTBJet.h:98
const char * kBTagLifetimeBJetsL25
Definition: HLTMessages.cc:67
static const size_t kMaxBJets
Definition: HLTBJet.cc:20
void analyseLifetimeSingleTrackL1FastJet(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:417
float * ohBJetL2CorrectedEta
Definition: HLTBJet.h:100
const char * kBTagLifetimeBJetsL25L1FastJet
Definition: HLTMessages.cc:69
float * ohBJetL2CorrectedEnergyL1FastJet
Definition: HLTBJet.h:105
vector< PseudoJet > jets
float * ohBJetL2Et
Definition: HLTBJet.h:90
float * ohpfBJetL2Et
Definition: HLTBJet.h:114
HLTBJet()
Definition: HLTBJet.cc:24
float * ohBJetL2CorrectedPtL1FastJet
Definition: HLTBJet.h:107
T min(T a, T b)
Definition: MathUtil.h:58
const char * kBTagLifetimeBJetsL3
Definition: HLTMessages.cc:68
const char * kBTagPerformanceBJetsL3
Definition: HLTMessages.cc:79
const char * kBTagPerformanceBJetsL25L1FastJet
Definition: HLTMessages.cc:80
bool isValid() const
Definition: HandleBase.h:76
float * ohpfBJetL2Eta
Definition: HLTBJet.h:116
const char * kBTagPerformanceBJetsL3L1FastJet
Definition: HLTMessages.cc:81
void analyseLifetimePF(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:379
const char * kBTagLifetimeBJetsL3L1FastJet
Definition: HLTMessages.cc:70
const char * kBTagLifetimePFBJetsL3
Definition: HLTMessages.cc:71
void analyseLifetimeSingleTrack(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:395
void analysePFJets(const edm::View< reco::Jet > &jets)
Definition: HLTBJet.cc:320
float * ohBJetL2CorrectedEnergy
Definition: HLTBJet.h:97
void analyze(const edm::Handle< edm::View< reco::Jet > > &rawBJets, const edm::Handle< edm::View< reco::Jet > > &correctedBJets, const edm::Handle< edm::View< reco::Jet > > &correctedBJetsL1FastJet, const edm::Handle< edm::View< reco::Jet > > &pfBJets, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL25, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL3, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL25L1FastJet, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL3L1FastJet, const edm::Handle< reco::JetTagCollection > &lifetimePFBJetsL3, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL25SingleTrack, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL3SingleTrack, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL25SingleTrackL1FastJet, const edm::Handle< reco::JetTagCollection > &lifetimeBJetsL3SingleTrackL1FastJet, const edm::Handle< reco::JetTagCollection > &performanceBJetsL25, const edm::Handle< reco::JetTagCollection > &performanceBJetsL3, const edm::Handle< reco::JetTagCollection > &performanceBJetsL25L1FastJet, const edm::Handle< reco::JetTagCollection > &performanceBJetsL3L1FastJet, TTree *tree)
Definition: HLTBJet.cc:216
float * ohBJetIPL3TagSingleTrack
Definition: HLTBJet.h:132
float * ohBJetIPL3Tag
Definition: HLTBJet.h:121
float * ohBJetL2CorrectedPt
Definition: HLTBJet.h:99
int NohBJetL2CorrectedL1FastJet
Definition: HLTBJet.h:104
int * ohBJetPerfL25TagL1FastJet
Definition: HLTBJet.h:140
float * ohpfBJetIPL3Tag
Definition: HLTBJet.h:128
float * ohpfBJetL2Phi
Definition: HLTBJet.h:117
float * ohBJetIPL25TagSingleTrack
Definition: HLTBJet.h:131
float * ohBJetIPL25Tag
Definition: HLTBJet.h:120
float * ohBJetL2CorrectedPhi
Definition: HLTBJet.h:101
float * ohBJetL2Phi
Definition: HLTBJet.h:93
void setup(const edm::ParameterSet &config, TTree *tree)
Definition: HLTBJet.cc:166
void analyseLifetime(const edm::View< reco::Jet > &jets, const reco::JetTagCollection &tagsL25, const reco::JetTagCollection &tagsL3)
Definition: HLTBJet.cc:335
float * ohBJetL2Energy
Definition: HLTBJet.h:89
int * ohBJetPerfL25Tag
Definition: HLTBJet.h:137
float * ohBJetIPL25TagL1FastJet
Definition: HLTBJet.h:124
tuple size
Write out results.
void analyseCorrectedJetsL1FastJet(const edm::View< reco::Jet > &jets)
Definition: HLTBJet.cc:305
size_type size() const
~HLTBJet()
Definition: HLTBJet.cc:129
float * ohBJetL2CorrectedEtL1FastJet
Definition: HLTBJet.h:106
float * ohpfBJetL2Pt
Definition: HLTBJet.h:115