CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StudyHLT.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 #include <string>
4 
5 // Root objects
6 #include "TH1.h"
7 #include "TH2.h"
8 #include "TTree.h"
9 
10 // user include files
17 
20 
39 
48 
56 
63 
64 class StudyHLT : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::SharedResources> {
65 
66 public:
67  explicit StudyHLT(const edm::ParameterSet&);
68  ~StudyHLT();
69 
70  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
71 
72 private:
73  virtual void analyze(edm::Event const&, edm::EventSetup const&) override;
74  virtual void beginJob() override;
75  virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
76  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
77  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
78  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
79 
80  void clear();
81  void fillTrack(int, double, double, double, double);
82  void fillIsolation(int, double, double, double);
83  void fillEnergy(int, int, double, double, double, double, double);
85  int trackPID(const reco::Track* ,
87 
88  // ----------member data ---------------------------
89  static const int nPBin=10, nEtaBin=4, nPVBin=4;
94  std::vector<std::string> trigNames_, HLTNames_;
96  std::vector<double> puWeights_;
100 
112 
115  TH2I *h_nHLTvsRN;
116  std::vector<TH1I*> h_HLTAccepts;
117  TH1D *h_p[nPVBin+12], *h_pt[nPVBin+12];
118  TH1D *h_eta[nPVBin+12], *h_phi[nPVBin+12];
119  TH1I *h_ntrk[2];
120  TH1D *h_maxNearP[2], *h_ene1[2], *h_ene2[2], *h_ediff[2];
121  TH1D *h_energy[nPVBin+8][nPBin][nEtaBin][6];
122  TTree *tree_;
124  double pBin[nPBin+1];
127  std::vector<std::string> tr_TrigName;
128  std::vector<double> tr_TrkPt, tr_TrkP, tr_TrkEta, tr_TrkPhi;
129  std::vector<double> tr_MaxNearP31X31, tr_MaxNearHcalP7x7;
130  std::vector<double> tr_H3x3, tr_H5x5, tr_H7x7;
131  std::vector<double> tr_FE7x7P, tr_FE11x11P, tr_FE15x15P;
132  std::vector<bool> tr_SE7x7P, tr_SE11x11P, tr_SE15x15P;
133  std::vector<int> tr_iEta, tr_TrkID;
134 };
135 
136 StudyHLT::StudyHLT(const edm::ParameterSet& iConfig) : nRun(0) {
137 
138  usesResource("TFileService");
139 
140  verbosity_ = iConfig.getUntrackedParameter<int>("Verbosity",0);
141  trigNames_ = iConfig.getUntrackedParameter<std::vector<std::string> >("Triggers");
142  theTrackQuality_ = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
144  selectionParameters_.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
146  selectionParameters_.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
147  selectionParameters_.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
148  selectionParameters_.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
149  selectionParameters_.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
150  selectionParameters_.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
151  selectionParameters_.minLayerCrossed= iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
152  selectionParameters_.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
153  selectionParameters_.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
154  minTrackP_ = iConfig.getUntrackedParameter<double>("MinTrackP", 1.0);
155  maxTrackEta_ = iConfig.getUntrackedParameter<double>("MaxTrackEta", 2.5);
156  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
157  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
158  tMinH_ = iConfig.getUntrackedParameter<double>("TimeMinCutHCAL", -500.);
159  tMaxH_ = iConfig.getUntrackedParameter<double>("TimeMaxCutHCAL", 500.);
160  isItAOD_ = iConfig.getUntrackedParameter<bool>("IsItAOD", false);
161  doTree_ = iConfig.getUntrackedParameter<bool>("DoTree", false);
162  puWeights_ = iConfig.getUntrackedParameter<std::vector<double> >("PUWeights");
163  triggerEvent_ = edm::InputTag("hltTriggerSummaryAOD","","HLT");
164  theTriggerResultsLabel_ = edm::InputTag("TriggerResults","","HLT");
165 
166  // define tokens for access
167  tok_lumi = consumes<LumiDetails, edm::InLumi>(edm::InputTag("lumiProducer"));
168  tok_trigEvt = consumes<trigger::TriggerEvent>(triggerEvent_);
169  tok_trigRes = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
170  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
171  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
172  tok_parts_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("ParticleSource"));
173 
174  if (isItAOD_) {
175  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
176  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
177  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
178  } else {
179  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
180  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
181  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
182  }
183  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
184 
185  edm::LogInfo("IsoTrack") << "Verbosity " << verbosity_ << " with "
186  << trigNames_.size() << " triggers:";
187  for (unsigned int k=0; k<trigNames_.size(); ++k)
188  edm::LogInfo("IsoTrack") << " [" << k << "] " << trigNames_[k];
189  edm::LogInfo("IsoTrack") << "TrackQuality " << theTrackQuality_ << " Minpt "
190  << selectionParameters_.minPt << " maxDxy "
191  << selectionParameters_.maxDxyPV << " maxDz "
192  << selectionParameters_.maxDzPV << " maxChi2 "
193  << selectionParameters_.maxChi2 << " maxDp/p "
194  << selectionParameters_.maxDpOverP << " minOuterHit "
195  << selectionParameters_.minOuterHit << " minLayerCrossed "
196  << selectionParameters_.minLayerCrossed << " maxInMiss "
197  << selectionParameters_.maxInMiss << " maxOutMiss "
198  << selectionParameters_.maxOutMiss << " minTrackP "
199  << minTrackP_ << " maxTrackEta " << maxTrackEta_
200  << " tMinE_ " << tMinE_ << " tMaxE " << tMaxE_
201  << " tMinH_ " << tMinH_ << " tMaxH_ " << tMaxH_
202  << " isItAOD " << isItAOD_ << " doTree " << doTree_;
203 
204  double pBins[nPBin+1] = {1.0,2.0,3.0,4.0,5.0,6.0,7.0,9.0,11.0,15.0,20.0};
205  int etaBins[nEtaBin+1] = {1, 7, 13, 17, 23};
206  int pvBins[nPVBin+1] = {1, 2, 3, 5, 100};
207  for (int i=0; i<=nPBin; ++i) pBin[i] = pBins[i];
208  for (int i=0; i<=nEtaBin; ++i) etaBin[i] = etaBins[i];
209  for (int i=0; i<=nPVBin; ++i) pvBin[i] = pvBins[i];
210 
211  firstEvent_ = true;
212  changed_ = false;
213 }
214 
216 
217 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
219  //The following says we do not know what parameters are allowed so do no validation
220  // Please change this to state exactly what you do use, even if it is no parameters
222  desc.setUnknown();
223  descriptions.addDefault(desc);
224 }
225 
226 void StudyHLT::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) {
227  clear();
228  if (verbosity_ > 0)
229  edm::LogInfo("IsoTrack") << "Event starts====================================";
230  int RunNo = iEvent.id().run();
231  int EvtNo = iEvent.id().event();
232  int Lumi = iEvent.luminosityBlock();
233  int Bunch = iEvent.bunchCrossing();
234 
235  std::string newNames[5]={"HLT","PixelTracks_Multiplicity","HLT_Physics_","HLT_JetE","HLT_ZeroBias"};
236  int newAccept[5];
237  for (int i=0; i<5; ++i) newAccept[i] = 0;
238  float mybxlumi=-1;
239  /*
240  edm::Handle<LumiDetails> Lumid;
241  iEvent.getLuminosityBlock().getByToken(tok_lumi,Lumid);
242  if (Lumid.isValid()) mybxlumi=Lumid->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
243  */
244  if (verbosity_ > 0)
245  edm::LogInfo("IsoTrack") << "RunNo " << RunNo << " EvtNo " << EvtNo
246  << " Lumi " << Lumi << " Bunch " << Bunch
247  << " mybxlumi " << mybxlumi;
248 
249  trigger::TriggerEvent triggerEvent;
250  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
251  iEvent.getByToken(tok_trigEvt,triggerEventHandle);
252 
253  bool ok(false);
254  if (!triggerEventHandle.isValid()) {
255  edm::LogWarning("IsoTrack") << "Error! Can't get the product "
256  << triggerEvent_.label();
257  } else {
258  triggerEvent = *(triggerEventHandle.product());
259 
262  iEvent.getByToken(tok_trigRes, triggerResults);
263 
264  if (triggerResults.isValid()) {
265  h_nHLT->Fill(triggerResults->size());
266  h_nHLTvsRN->Fill(RunNo, triggerResults->size());
267 
268  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
269  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
270  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
271  // unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[iHLT]);
272  // const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
273  int ipos=-1;
274  std::string newtriggerName = truncate_str(triggerNames_[iHLT]);
275  for (unsigned int i=0; i<HLTNames_.size(); ++i) {
276  if (newtriggerName == HLTNames_[i]) {
277  ipos = i+1;
278  break;
279  }
280  }
281  if (ipos < 0) {
282  HLTNames_.push_back(newtriggerName);
283  ipos = (int)(HLTNames_.size());
284  if (ipos <= h_HLTAccept->GetNbinsX())
285  h_HLTAccept->GetXaxis()->SetBinLabel(ipos,newtriggerName.c_str());
286  }
287  if ((int)(iHLT+1) > h_HLTAccepts[nRun]->GetNbinsX()) {
288  edm::LogInfo("IsoTrack") << "Wrong trigger " << RunNo << " Event "
289  << EvtNo << " Hlt " << iHLT;
290  } else {
291  if (firstEvent_) h_HLTAccepts[nRun]->GetXaxis()->SetBinLabel(iHLT+1, newtriggerName.c_str());
292  }
293  int hlt = triggerResults->accept(iHLT);
294  if (hlt) {
295  h_HLTAccepts[nRun]->Fill(iHLT+1);
296  h_HLTAccept->Fill(ipos);
297  }
298  if (trigNames_.size() < 1) {
299  ok = true;
300  } else {
301  for (unsigned int i=0; i<trigNames_.size(); ++i) {
302  if (newtriggerName.find(trigNames_[i].c_str())!=std::string::npos) {
303  if (verbosity_%10 > 0)
304  edm::LogInfo("IsoTrack") << newtriggerName;
305  if (hlt > 0) {
306  ok = true;
307  tr_TrigName.push_back(newtriggerName);
308  }
309  }
310  }
311  for (int i=0; i<5; ++i) {
312  if (newtriggerName.find(newNames[i].c_str())!=std::string::npos) {
313  if (verbosity_%10 > 0)
314  edm::LogInfo("IsoTrack") << "[" << i << "] " << newNames[i]
315  << " : " << newtriggerName;
316  if (hlt > 0) newAccept[i] = 1;
317  }
318  }
319  }
320  }
321  int iflg(0), indx(1);
322  for (int i=0; i<5; ++i) {
323  iflg += (indx*newAccept[i]); indx *= 2;
324  }
325  h_HLTCorr->Fill(iflg);
326  }
327  }
328 
329  //Look at the tracks
330  if (ok) {
331  h_goodRun->Fill(RunNo);
332  tr_goodRun = RunNo;
333  // get handles to calogeometry and calotopology
335  iSetup.get<CaloGeometryRecord>().get(pG);
336  const CaloGeometry* geo = pG.product();
337 
338  edm::ESHandle<CaloTopology> theCaloTopology;
339  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
340  const CaloTopology *caloTopology = theCaloTopology.product();
341 
343  iSetup.get<HcalRecNumberingRecord>().get(htopo);
344  const HcalTopology* theHBHETopology = htopo.product();
345 
347  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
348  const MagneticField *bField = bFieldH.product();
349 
351  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
352  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
353 
355  iEvent.getByToken(tok_recVtx_,recVtxs);
356  int ntrk(0), ngoodPV(0), nPV(-1);
357  int nvtxs = (int)(recVtxs->size());
358  for (int ind=0; ind<nvtxs; ind++) {
359  if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > 4) ngoodPV++;
360  }
361  for (int i=0; i<nPVBin; ++i) {
362  if (ngoodPV >= pvBin[i] && ngoodPV < pvBin[i+1]) {
363  nPV = i; break;
364  }
365  }
366 
367  tr_eventWeight = 1.0;
369  iEvent.getByToken(tok_ew_, genEventInfo);
370  if (genEventInfo.isValid()) tr_eventWeight = genEventInfo->weight();
371 
372  if ((verbosity_/10)%10 > 0)
373  edm::LogInfo("IsoTrack") << "Number of vertices: " << nvtxs
374  << " Good " << ngoodPV << " Bin " << nPV
375  << " Event weight " << tr_eventWeight;
376  h_numberPV->Fill(nvtxs,tr_eventWeight);
377  h_goodPV->Fill(ngoodPV,tr_eventWeight);
378  tr_goodPV = ngoodPV;
379 
380  if (puWeights_.size() > 0) {
381  int npbin = h_goodPV->FindBin(ngoodPV);
382  if (npbin > 0 && npbin <= (int)(puWeights_.size()))
383  tr_eventWeight *= puWeights_[npbin-1];
384  else
385  tr_eventWeight = 0;
386  }
387 
388  //=== genParticle information
390  iEvent.getByToken(tok_parts_, genParticles);
391 
393  iEvent.getByToken(tok_genTrack_, trkCollection);
394  reco::TrackCollection::const_iterator trkItr;
395  for (trkItr=trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr,++ntrk) {
396  const reco::Track* pTrack = &(*trkItr);
397  double pt1 = pTrack->pt();
398  double p1 = pTrack->p();
399  double eta1 = pTrack->momentum().eta();
400  double phi1 = pTrack->momentum().phi();
402  fillTrack(0, pt1,p1,eta1,phi1);
403  if (quality) fillTrack(1, pt1,p1,eta1,phi1);
404  }
405  h_ntrk[0]->Fill(ntrk,tr_eventWeight);
406 
407  std::vector<spr::propagatedTrackID> trkCaloDets;
408  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDets, ((verbosity_/100)%10 > 0));
409  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
410  for (trkDetItr = trkCaloDets.begin(),ntrk=0; trkDetItr != trkCaloDets.end(); trkDetItr++,ntrk++) {
411  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
412  double pt1 = pTrack->pt();
413  double p1 = pTrack->p();
414  double eta1 = pTrack->momentum().eta();
415  double phi1 = pTrack->momentum().phi();
416  if ((verbosity_/10)%10 > 0)
417  edm::LogInfo("IsoTrack") << "track: p " << p1 << " pt " << pt1
418  << " eta " << eta1 << " phi " << phi1
419  << " okEcal " << trkDetItr->okECAL;
420  fillTrack(2, pt1,p1,eta1,phi1);
421  if (pt1>minTrackP_ && std::abs(eta1)<maxTrackEta_ && trkDetItr->okECAL) {
422  fillTrack(3, pt1,p1,eta1,phi1);
423  double maxNearP31x31 = spr::chargeIsolationEcal(ntrk, trkCaloDets, geo, caloTopology, 15, 15, ((verbosity_/1000)%10 > 0));
424 
426  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
427 
428  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
429  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
430  iEvent.getByToken(tok_EB_,barrelRecHitsHandle);
431  iEvent.getByToken(tok_EE_,endcapRecHitsHandle);
432  // get ECal Tranverse Profile
433  std::pair<double, bool> e7x7P, e11x11P, e15x15P;
434  const DetId isoCell = trkDetItr->detIdECAL;
435  e7x7P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
436  e11x11P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
437  e15x15P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
438 
439  double maxNearHcalP7x7 = spr::chargeIsolationHcal(ntrk, trkCaloDets, theHBHETopology, 3,3, ((verbosity_/1000)%10 > 0));
440  int ieta(0);
441  double h3x3(0), h5x5(0), h7x7(0);
442  fillIsolation(0, maxNearP31x31,e11x11P.first,e15x15P.first);
443  if ((verbosity_/10)%10 > 0)
444  edm::LogInfo("IsoTrack") << "Accepted Tracks reaching Ecal maxNearP31x31 "
445  << maxNearP31x31 << " e11x11P "
446  << e11x11P.first << " e15x15P "
447  << e15x15P.first << " okHCAL "
448  << trkDetItr->okHCAL;
449 
450  int trackID = trackPID(pTrack,genParticles);
451  if (trkDetItr->okHCAL) {
453  iEvent.getByToken(tok_hbhe_, hbhe);
454  const DetId ClosestCell(trkDetItr->detIdHCAL);
455  ieta = ((HcalDetId)(ClosestCell)).ietaAbs();
456  h3x3 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,1,1, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0));
457  h5x5 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,2,2, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0) );
458  h7x7 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,3,3, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0) );
459  fillIsolation(1, maxNearHcalP7x7,h5x5,h7x7);
460  if ((verbosity_/10)%10 > 0)
461  edm::LogInfo("IsoTrack") << "Tracks Reaching Hcal maxNearHcalP7x7/h5x5/h7x7 "
462  << maxNearHcalP7x7 << "/" << h5x5 << "/" << h7x7;
463  tr_TrkPt.push_back(pt1);
464  tr_TrkP.push_back(p1);
465  tr_TrkEta.push_back(eta1);
466  tr_TrkPhi.push_back(phi1);
467  tr_TrkID.push_back(trackID);
468  tr_MaxNearP31X31.push_back(maxNearP31x31);
469  tr_MaxNearHcalP7x7.push_back(maxNearHcalP7x7);
470  tr_FE7x7P.push_back(e7x7P.first);
471  tr_FE11x11P.push_back(e11x11P.first);
472  tr_FE15x15P.push_back(e15x15P.first);
473  tr_SE7x7P.push_back(e7x7P.second);
474  tr_SE11x11P.push_back(e11x11P.second);
475  tr_SE15x15P.push_back(e15x15P.second);
476  tr_iEta.push_back(ieta);
477  tr_H3x3.push_back(h3x3);
478  tr_H5x5.push_back(h5x5);
479  tr_H7x7.push_back(h7x7);
480 
481  if (maxNearP31x31 < 0) {
482  fillTrack(4, pt1,p1,eta1,phi1);
483  fillEnergy(0,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
484  if (maxNearHcalP7x7 < 0) {
485  fillTrack(5, pt1,p1,eta1,phi1);
486  fillEnergy(1,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
487  if ((e11x11P.second) && (e15x15P.second) &&
488  (e15x15P.first-e11x11P.first)<2.0) {
489  fillTrack(6, pt1,p1,eta1,phi1);
490  fillEnergy(2,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
491  if (h7x7-h5x5 < 2.0) {
492  fillTrack(7, pt1,p1,eta1,phi1);
493  fillEnergy(3,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
494  if (nPV >= 0) {
495  fillTrack(nPV+8, pt1,p1,eta1,phi1);
496  fillEnergy(nPV+4,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
497  }
498  if (trackID > 0) {
499  fillTrack(nPVBin+trackID+7, pt1,p1,eta1,phi1);
500  fillEnergy(nPVBin+trackID+3,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
501  }
502  }
503  }
504  }
505  }
506  }
507  }
508  }
509  h_ntrk[1]->Fill(ntrk,tr_eventWeight);
510  if (tr_TrkPt.size() > 0 && doTree_) tree_->Fill();
511  }
512  firstEvent_ = false;
513 }
514 
516  // Book histograms
517  h_nHLT = fs_->make<TH1I>("h_nHLT" , "size of trigger Names", 1000, 0, 1000);
518  h_HLTAccept = fs_->make<TH1I>("h_HLTAccept", "HLT Accepts for all runs", 500, 0, 500);
519  for (int i=1; i<=500; ++i) h_HLTAccept->GetXaxis()->SetBinLabel(i," ");
520  h_nHLTvsRN = fs_->make<TH2I>("h_nHLTvsRN" , "size of trigger Names vs RunNo", 2168, 190949, 193116, 100, 400, 500);
521  h_HLTCorr = fs_->make<TH1I>("h_HLTCorr", "Correlation among different paths", 100, 0, 100);
522  h_numberPV = fs_->make<TH1I>("h_numberPV", "Number of Primary Vertex", 100, 0, 100);
523  h_goodPV = fs_->make<TH1I>("h_goodPV", "Number of good Primary Vertex", 100, 0, 100);
524  h_goodRun = fs_->make<TH1I>("h_goodRun","Number of accepted events for Run", 4000, 190000, 1940000);
525  char hname[50], htit[200];
526  std::string CollectionNames[2] = {"Reco", "Propagated"};
527  for (unsigned int i=0; i<2; i++) {
528  sprintf(hname, "h_nTrk_%s", CollectionNames[i].c_str());
529  sprintf(htit, "Number of %s tracks", CollectionNames[i].c_str());
530  h_ntrk[i] = fs_->make<TH1I>(hname, htit, 500, 0, 500);
531  }
532  std::string TrkNames[8] = {"All", "Quality", "NoIso", "okEcal", "EcalCharIso", "HcalCharIso", "EcalNeutIso", "HcalNeutIso"};
533  std::string particle[4] = {"Electron", "Pion", "Kaon", "Proton"};
534  for (unsigned int i=0; i<8+nPVBin+4; i++) {
535  if (i < 8) {
536  sprintf(hname, "h_pt_%s", TrkNames[i].c_str());
537  sprintf(htit, "p_{T} of %s tracks", TrkNames[i].c_str());
538  } else if (i < 8+nPVBin) {
539  sprintf(hname, "h_pt_%s_%d", TrkNames[7].c_str(), i-8);
540  sprintf(htit, "p_{T} of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin[i-8], pvBin[i-7]-1);
541  } else {
542  sprintf(hname, "h_pt_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
543  sprintf(htit, "p_{T} of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
544  }
545  h_pt[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
546  h_pt[i]->Sumw2();
547 
548  if (i < 8) {
549  sprintf(hname, "h_p_%s", TrkNames[i].c_str());
550  sprintf(htit, "Momentum of %s tracks", TrkNames[i].c_str());
551  } else if (i < 8+nPVBin) {
552  sprintf(hname, "h_p_%s_%d", TrkNames[7].c_str(), i-8);
553  sprintf(htit, "Momentum of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin[i-8], pvBin[i-7]-1);
554  } else {
555  sprintf(hname, "h_p_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
556  sprintf(htit, "Momentum of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
557  }
558  h_p[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
559  h_p[i]->Sumw2();
560 
561  if (i < 8) {
562  sprintf(hname, "h_eta_%s", TrkNames[i].c_str());
563  sprintf(htit, "Eta of %s tracks", TrkNames[i].c_str());
564  } else if (i < 8+nPVBin) {
565  sprintf(hname, "h_eta_%s_%d", TrkNames[7].c_str(), i-8);
566  sprintf(htit, "Eta of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin[i-8], pvBin[i-7]-1);
567  } else {
568  sprintf(hname, "h_eta_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
569  sprintf(htit, "Eta of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
570  }
571  h_eta[i] = fs_->make<TH1D>(hname, htit, 60, -3.0, 3.0);
572  h_eta[i]->Sumw2();
573 
574  if (i < 8) {
575  sprintf(hname, "h_phi_%s", TrkNames[i].c_str());
576  sprintf(htit, "Phi of %s tracks", TrkNames[i].c_str());
577  } else if (i < 8+nPVBin) {
578  sprintf(hname, "h_phi_%s_%d", TrkNames[7].c_str(), i-8);
579  sprintf(htit, "Phi of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin[i-8], pvBin[i-7]-1);
580  } else {
581  sprintf(hname, "h_phi_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
582  sprintf(htit, "Phi of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin].c_str());
583  }
584  h_phi[i] = fs_->make<TH1D>(hname, htit, 100, -3.15, 3.15);
585  h_phi[i]->Sumw2();
586  }
587  std::string IsolationNames[2] = {"Ecal", "Hcal"};
588  for (unsigned int i=0; i<2; i++) {
589  sprintf(hname, "h_maxNearP_%s", IsolationNames[i].c_str());
590  sprintf(htit, "Energy in ChargeIso region for %s", IsolationNames[i].c_str());
591  h_maxNearP[i] = fs_->make<TH1D>(hname, htit, 120, -1.5, 10.5);
592  h_maxNearP[i]->Sumw2();
593 
594  sprintf(hname, "h_ene1_%s", IsolationNames[i].c_str());
595  sprintf(htit, "Energy in smaller cone for %s", IsolationNames[i].c_str());
596  h_ene1[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
597  h_ene1[i]->Sumw2();
598 
599  sprintf(hname, "h_ene2_%s", IsolationNames[i].c_str());
600  sprintf(htit, "Energy in bigger cone for %s", IsolationNames[i].c_str());
601  h_ene2[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
602  h_ene2[i]->Sumw2();
603 
604  sprintf(hname, "h_ediff_%s", IsolationNames[i].c_str());
605  sprintf(htit, "Energy in NeutralIso region for %s", IsolationNames[i].c_str());
606  h_ediff[i] = fs_->make<TH1D>(hname, htit, 100, -0.5, 19.5);
607  h_ediff[i]->Sumw2();
608  }
609  std::string energyNames[6]={"E_{7x7}", "H_{3x3}", "(E_{7x7}+H_{3x3})",
610  "E_{11x11}", "H_{5x5}", "{E_{11x11}+H_{5x5})"};
611  for (int i=0; i<4+nPVBin+4; ++i) {
612  for (int ip=0; ip<nPBin; ++ip) {
613  for (int ie=0; ie<nEtaBin; ++ie) {
614  for (int j=0; j<6; ++j) {
615  sprintf(hname, "h_energy_%d_%d_%d_%d", i, ip, ie, j);
616  if (i < 4) {
617  sprintf(htit,"%s/p (p=%4.1f:%4.1f; i#eta=%d:%d) for tracks with %s",
618  energyNames[j].c_str(),pBin[ip],pBin[ip+1],etaBin[ie],
619  (etaBin[ie+1]-1), TrkNames[i+4].c_str());
620  } else if (i < 4+nPVBin) {
621  sprintf(htit,"%s/p (p=%4.1f:%4.1f, i#eta=%d:%d, PV=%d:%d) for tracks with %s",
622  energyNames[j].c_str(),pBin[ip],pBin[ip+1],etaBin[ie],
623  (etaBin[ie+1]-1), pvBin[i-4], pvBin[i-3],
624  TrkNames[7].c_str());
625  } else {
626  sprintf(htit,"%s/p (p=%4.1f:%4.1f, i#eta=%d:%d %s) for tracks with %s",
627  energyNames[j].c_str(),pBin[ip],pBin[ip+1],etaBin[ie],
628  (etaBin[ie+1]-1), particle[i-4-nPVBin].c_str(),
629  TrkNames[7].c_str());
630  }
631  h_energy[i][ip][ie][j] = fs_->make<TH1D>(hname, htit, 500, -0.1, 4.9);
632  h_energy[i][ip][ie][j]->Sumw2();
633  }
634  }
635  }
636  }
637 
638  // Now the tree
639  if (doTree_) {
640  tree_ = fs_->make<TTree>("testTree", "new HLT Tree");
641  tree_->Branch("tr_goodRun", &tr_goodRun, "tr_goodRun/I");
642  tree_->Branch("tr_goodPV", &tr_goodPV, "tr_goodPV/I");
643  tree_->Branch("tr_eventWeight", &tr_eventWeight, "tr_eventWeight/D");
644  tree_->Branch("tr_tr_TrigName", &tr_TrigName);
645  tree_->Branch("tr_TrkPt", &tr_TrkPt);
646  tree_->Branch("tr_TrkP", &tr_TrkP);
647  tree_->Branch("tr_TrkEta", &tr_TrkEta);
648  tree_->Branch("tr_TrkPhi", &tr_TrkPhi);
649  tree_->Branch("tr_TrkID", &tr_TrkID);
650  tree_->Branch("tr_MaxNearP31X31", &tr_MaxNearP31X31);
651  tree_->Branch("tr_MaxNearHcalP7x7", &tr_MaxNearHcalP7x7);
652  tree_->Branch("tr_FE7x7P", &tr_FE7x7P);
653  tree_->Branch("tr_FE11x11P", &tr_FE11x11P);
654  tree_->Branch("tr_FE15x15P", &tr_FE15x15P);
655  tree_->Branch("tr_SE7x7P", &tr_SE7x7P);
656  tree_->Branch("tr_SE11x11P", &tr_SE11x11P);
657  tree_->Branch("tr_SE15x15P", &tr_SE15x15P);
658  tree_->Branch("tr_H3x3", &tr_H3x3);
659  tree_->Branch("tr_H5x5", &tr_H5x5);
660  tree_->Branch("tr_H7x7", &tr_H7x7);
661  tree_->Branch("tr_iEta", &tr_iEta);
662  }
663 }
664 
665 // ------------ method called when starting to processes a run ------------
666 void StudyHLT::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
667  char hname[100], htit[400];
668  edm::LogInfo("IsoTrack") << "Run[" << nRun << "] " << iRun.run() << " hltconfig.init "
669  << hltConfig_.init(iRun,iSetup,"HLT",changed_);
670  sprintf(hname, "h_HLTAccepts_%i", iRun.run());
671  sprintf(htit, "HLT Accepts for Run No %i", iRun.run());
672  TH1I *hnew = fs_->make<TH1I>(hname, htit, 500, 0, 500);
673  for (int i=1; i<=500; ++i) hnew->GetXaxis()->SetBinLabel(i," ");
674  h_HLTAccepts.push_back(hnew);
675  edm::LogInfo("IsoTrack") << "beginrun " << iRun.run();
676  firstEvent_ = true;
677  changed_ = false;
678 }
679 
680 // ------------ method called when ending the processing of a run ------------
681 void StudyHLT::endRun(edm::Run const& iRun, edm::EventSetup const&) {
682  nRun++;
683  edm::LogInfo("IsoTrack") << "endrun[" << nRun << "] " << iRun.run();
684 }
685 
686 // ------------ method called when starting to processes a luminosity block ------------
688 // ------------ method called when ending the processing of a luminosity block ------------
690 
692  tr_TrigName.clear();
693  tr_TrkPt.clear(); tr_TrkP.clear(); tr_TrkEta.clear(); tr_TrkPhi.clear();
694  tr_TrkID.clear(); tr_MaxNearP31X31.clear(); tr_MaxNearHcalP7x7.clear();
695  tr_FE7x7P.clear(); tr_FE11x11P.clear(); tr_FE15x15P.clear();
696  tr_SE7x7P.clear(); tr_SE11x11P.clear(); tr_SE15x15P.clear();
697  tr_H3x3.clear(); tr_H5x5.clear(); tr_H7x7.clear();
698  tr_iEta.clear();
699 }
700 
701 void StudyHLT::fillTrack(int i, double pt, double p, double eta, double phi){
702  h_pt[i]->Fill(pt,tr_eventWeight);
703  h_p[i]->Fill(p,tr_eventWeight);
704  h_eta[i]->Fill(eta,tr_eventWeight);
705  h_phi[i]->Fill(phi,tr_eventWeight);
706 }
707 
708 void StudyHLT::fillIsolation(int i, double emaxnearP, double eneutIso1, double eneutIso2){
709  h_maxNearP[i]->Fill(emaxnearP,tr_eventWeight);
710  h_ene1[i]->Fill(eneutIso1,tr_eventWeight);
711  h_ene2[i]->Fill(eneutIso2,tr_eventWeight);
712  h_ediff[i]->Fill(eneutIso2-eneutIso1,tr_eventWeight);
713 }
714 
715 void StudyHLT::fillEnergy(int flag, int ieta, double p, double enEcal1,
716  double enHcal1, double enEcal2, double enHcal2) {
717  int ip(-1), ie(-1);
718  for (int i=0; i<nPBin; ++i) {
719  if (p >= pBin[i] && p < pBin[i+1]) { ip = i; break; }
720  }
721  for (int i=0; i<nEtaBin; ++i) {
722  if (ieta >= etaBin[i] && ieta < etaBin[i+1]) { ie = i; break; }
723  }
724  if (ip >= 0 && ie >= 0 && enEcal1 > 0.02 && enHcal1 > 0.1) {
725  h_energy[flag][ip][ie][0]->Fill(enEcal1/p,tr_eventWeight);
726  h_energy[flag][ip][ie][1]->Fill(enHcal1/p,tr_eventWeight);
727  h_energy[flag][ip][ie][2]->Fill((enEcal1+enHcal1)/p,tr_eventWeight);
728  h_energy[flag][ip][ie][3]->Fill(enEcal2/p,tr_eventWeight);
729  h_energy[flag][ip][ie][4]->Fill(enHcal2/p,tr_eventWeight);
730  h_energy[flag][ip][ie][5]->Fill((enEcal2+enHcal2)/p,tr_eventWeight);
731  }
732 }
733 
735  std::string truncated_str(str);
736  int length = str.length();
737  for (int i=0; i<length-2; i++){
738  if (str[i]=='_' && str[i+1]=='v' && isdigit(str.at(i+2))) {
739  int z = i+1;
740  truncated_str = str.substr(0,z);
741  }
742  }
743  return(truncated_str);
744 }
745 
747  int id(0);
748  if (genParticles.isValid()) {
749  unsigned int indx;
750  reco::GenParticleCollection::const_iterator p;
751  double mindR(999.9);
752  for (p=genParticles->begin(),indx=0; p!=genParticles->end(); ++p,++indx) {
753  int pdgId = std::abs(p->pdgId());
754  int idx = (pdgId == 11) ? 1 :
755  ((pdgId == 211) ? 2 : ((pdgId == 321) ? 3 : ((pdgId == 2212) ? 4 : 0)));
756  if (idx > 0) {
757  double dEta = pTrack->eta() - p->momentum().Eta();
758  double phi1 = pTrack->phi();
759  double phi2 = p->momentum().Phi();
760  if (phi1 < 0) phi1 += 2.0*M_PI;
761  if (phi2 < 0) phi2 += 2.0*M_PI;
762  double dPhi = phi1-phi2;
763  if (dPhi > M_PI) dPhi -= 2.*M_PI;
764  else if (dPhi < -M_PI) dPhi += 2.*M_PI;
765  double dR = sqrt(dEta*dEta+dPhi*dPhi);
766  if (dR < mindR) {
767  mindR = dR; id = idx;
768  }
769  }
770  }
771  }
772  return id;
773 }
774 
776 
RunNumber_t run() const
Definition: EventID.h:39
void fillEnergy(int, int, double, double, double, double, double)
Definition: StudyHLT.cc:715
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: StudyHLT.cc:109
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > tr_TrkPt
Definition: StudyHLT.cc:128
int i
Definition: DBlmapReader.cc:9
std::vector< double > tr_H3x3
Definition: StudyHLT.cc:130
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:234
TH1I * h_HLTCorr
Definition: StudyHLT.cc:113
edm::InputTag triggerEvent_
Definition: StudyHLT.cc:101
bool firstEvent_
Definition: StudyHLT.cc:99
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
TH1I * h_numberPV
Definition: StudyHLT.cc:113
TH1I * h_nHLT
Definition: StudyHLT.cc:113
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:226
RunNumber_t run() const
Definition: RunBase.h:40
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::vector< double > tr_MaxNearP31X31
Definition: StudyHLT.cc:129
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: StudyHLT.cc:689
TH1I * h_ntrk[2]
Definition: StudyHLT.cc:119
TH1D * h_energy[nPVBin+8][nPBin][nEtaBin][6]
Definition: StudyHLT.cc:121
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
TrackQuality
track quality
Definition: TrackBase.h:151
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.cc:116
std::vector< std::string > tr_TrigName
Definition: StudyHLT.cc:127
std::vector< bool > tr_SE7x7P
Definition: StudyHLT.cc:132
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
Definition: StudyHLT.cc:111
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
Definition: StudyHLT.cc:105
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
static const int nPVBin
Definition: StudyHLT.cc:89
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
double tMaxH_
Definition: StudyHLT.cc:98
TH1I * h_HLTAccept
Definition: StudyHLT.cc:113
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
std::vector< std::string > HLTNames_
Definition: StudyHLT.cc:94
int verbosity_
Definition: StudyHLT.cc:92
int pvBin[nPVBin+1]
Definition: StudyHLT.cc:123
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
std::vector< std::string > trigNames_
Definition: StudyHLT.cc:94
std::vector< double > tr_TrkEta
Definition: StudyHLT.cc:128
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: StudyHLT.cc:106
TH1I * h_goodRun
Definition: StudyHLT.cc:114
virtual void beginJob() override
Definition: StudyHLT.cc:515
TH1D * h_ene2[2]
Definition: StudyHLT.cc:120
void fillIsolation(int, double, double, double)
Definition: StudyHLT.cc:708
bool changed_
Definition: StudyHLT.cc:99
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: StudyHLT.cc:110
tuple trackQuality
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
double pBin[nPBin+1]
Definition: StudyHLT.cc:124
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< int > tr_iEta
Definition: StudyHLT.cc:133
spr::trackSelectionParameters selectionParameters_
Definition: StudyHLT.cc:93
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: StudyHLT.cc:107
void fillTrack(int, double, double, double, double)
Definition: StudyHLT.cc:701
static const int nEtaBin
Definition: StudyHLT.cc:89
tuple quality
[pTError/pT]*max(1,normChi2) &lt;= ptErrorCut
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
std::vector< double > puWeights_
Definition: StudyHLT.cc:96
~StudyHLT()
Definition: StudyHLT.cc:215
std::vector< double > tr_MaxNearHcalP7x7
Definition: StudyHLT.cc:129
std::string truncate_str(const std::string &)
Definition: StudyHLT.cc:734
int nRun
Definition: StudyHLT.cc:123
TH1D * h_phi[nPVBin+12]
Definition: StudyHLT.cc:118
T sqrt(T t)
Definition: SSEVec.h:18
TH1D * h_ene1[2]
Definition: StudyHLT.cc:120
double pt() const
track transverse momentum
Definition: TrackBase.h:616
usesResource(TFileService::kSharedResource)
TH1D * h_pt[nPVBin+12]
Definition: StudyHLT.cc:117
TH1D * h_p[nPVBin+12]
Definition: StudyHLT.cc:117
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
int tr_goodRun
Definition: StudyHLT.cc:125
HLTConfigProvider hltConfig_
Definition: StudyHLT.cc:90
std::vector< bool > tr_SE11x11P
Definition: StudyHLT.cc:132
static std::string const triggerResults
Definition: EdmProvDump.cc:41
double minTrackP_
Definition: StudyHLT.cc:97
bool isValid() const
Definition: HandleBase.h:75
TH1D * h_ediff[2]
Definition: StudyHLT.cc:120
int tr_goodPV
Definition: StudyHLT.cc:125
std::vector< double > tr_FE11x11P
Definition: StudyHLT.cc:131
#define M_PI
Definition: DetId.h:18
bool isItAOD_
Definition: StudyHLT.cc:99
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
edm::InputTag theTriggerResultsLabel_
Definition: StudyHLT.cc:101
edm::Service< TFileService > fs_
Definition: StudyHLT.cc:91
TH1D * h_maxNearP[2]
Definition: StudyHLT.cc:120
T const * product() const
Definition: Handle.h:81
void clear()
Definition: StudyHLT.cc:691
TH2I * h_nHLTvsRN
Definition: StudyHLT.cc:115
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: StudyHLT.cc:108
std::vector< int > tr_TrkID
Definition: StudyHLT.cc:133
int trackPID(const reco::Track *, const edm::Handle< reco::GenParticleCollection > &)
Definition: StudyHLT.cc:746
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
TTree * tree_
Definition: StudyHLT.cc:122
TH1I * h_goodPV
Definition: StudyHLT.cc:114
edm::EDGetTokenT< LumiDetails > tok_lumi
Definition: StudyHLT.cc:102
bool doTree_
Definition: StudyHLT.cc:99
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
Geom::Phi< T > phi() const
std::vector< double > tr_H7x7
Definition: StudyHLT.cc:130
std::string const & label() const
Definition: InputTag.h:36
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:666
std::vector< double > tr_FE15x15P
Definition: StudyHLT.cc:131
edm::EventID id() const
Definition: EventBase.h:58
double p1[4]
Definition: TauolaWrapper.h:89
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: StudyHLT.cc:104
std::string theTrackQuality_
Definition: StudyHLT.cc:95
double tr_eventWeight
Definition: StudyHLT.cc:126
reco::TrackBase::TrackQuality minQuality
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: StudyHLT.cc:218
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: StudyHLT.cc:687
int etaBin[nEtaBin+1]
Definition: StudyHLT.cc:123
StudyHLT(const edm::ParameterSet &)
Definition: StudyHLT.cc:136
static const int nPBin
Definition: StudyHLT.cc:89
double tMinE_
Definition: StudyHLT.cc:98
std::vector< double > tr_FE7x7P
Definition: StudyHLT.cc:131
TH1D * h_eta[nPVBin+12]
Definition: StudyHLT.cc:118
std::vector< double > tr_TrkPhi
Definition: StudyHLT.cc:128
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
std::vector< double > tr_TrkP
Definition: StudyHLT.cc:128
std::vector< bool > tr_SE15x15P
Definition: StudyHLT.cc:132
std::vector< double > tr_H5x5
Definition: StudyHLT.cc:130
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: StudyHLT.cc:681
Definition: Run.h:42
double tMinH_
Definition: StudyHLT.cc:98
double tMaxE_
Definition: StudyHLT.cc:98
double maxTrackEta_
Definition: StudyHLT.cc:97
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: StudyHLT.cc:103
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)