CMS 3D CMS Logo

IsoTrig.cc
Go to the documentation of this file.
1 // -*- C++ -*-//
2 // Package: IsoTrig
3 // Class: IsoTrig
4 //
12 //
13 // Original Author: Ruchi Gupta
14 // Created: Fri May 25 12:02:48 CDT 2012
15 // $Id$
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // Root objects
23 #include "TROOT.h"
24 #include "TH1.h"
25 #include "TH2.h"
26 #include "TSystem.h"
27 #include "TFile.h"
28 #include "TProfile.h"
29 #include "TDirectory.h"
30 #include "TTree.h"
31 #include "TMath.h"
32 
33 // user include files
39 
41 
53 //Tracks
55 // Vertices
59 //Triggers
65 
76 
84 
87 
90 
93 
95 
96 class IsoTrig : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
97 public:
98  explicit IsoTrig(const edm::ParameterSet &);
99  ~IsoTrig() override;
100 
101  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
102 
103 private:
104  void analyze(const edm::Event &, const edm::EventSetup &) override;
105  void beginJob() override;
106  void endJob() override;
107  void beginRun(edm::Run const &, edm::EventSetup const &) override;
108  void endRun(edm::Run const &, edm::EventSetup const &) override {}
109 
110  void clearMipCutTreeVectors();
113  math::XYZTLorentzVector &Trkcand,
114  std::vector<double> &PixMaxP,
115  double &TrkMaxP,
116  bool &selTk);
118  math::XYZTLorentzVector &Trkcand,
119  double &EmipNFcand,
120  double &EmipTrkcand,
121  double &mindR,
122  double &mindP1,
123  std::vector<bool> &Flags,
124  double hCone);
126  void studyTiming(const edm::Event &theEvent);
129  void studyTrigger(edm::Handle<reco::TrackCollection> &, std::vector<reco::TrackCollection::const_iterator> &);
130  void studyIsolation(edm::Handle<reco::TrackCollection> &, std::vector<reco::TrackCollection::const_iterator> &);
131  void chgIsolation(double &etaTriggered,
132  double &phiTriggered,
133  edm::Handle<reco::TrackCollection> &trkCollection,
134  const edm::Event &theEvent);
136  void fillHist(int, math::XYZTLorentzVector &);
138  void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool);
139  void fillEnergy(int, int, double, double, math::XYZTLorentzVector &);
146  std::pair<double, double> etaPhiTrigger();
147  std::pair<double, double> GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ);
148  double getDistInCM(double eta1, double phi1, double eta2, double phi2);
149 
150  // ----------member data ---------------------------
152  const std::vector<std::string> trigNames_;
154  const std::vector<edm::InputTag> pixelTracksSources_;
157  const int verbosity_;
158  const std::vector<double> pixelIsolationConeSizeAtEC_;
163  double rEB_, zEE_, bfVal_;
167  const double cutCharge_, cutNeutral_;
168  const int minRunNo_, maxRunNo_;
186  std::vector<edm::EDGetTokenT<reco::TrackCollection>> tok_pixtks_;
187 
188  std::vector<reco::TrackRef> pixelTrackRefsHB_, pixelTrackRefsHE_;
197 
198  std::map<unsigned int, unsigned int> trigList_;
199  std::map<unsigned int, const std::pair<int, int>> trigPreList_;
200  bool changed_;
201  double pLimits_[6];
204  std::vector<double> *t_timeL2Prod;
205  std::vector<int> *t_nPixCand;
206  std::vector<int> *t_nPixSeed;
207  std::vector<int> *t_nGoodTk;
208 
209  std::vector<double> *t_TrkhCone;
210  std::vector<double> *t_TrkP;
211  std::vector<bool> *t_TrkselTkFlag;
212  std::vector<bool> *t_TrkqltyFlag;
213  std::vector<bool> *t_TrkMissFlag;
214  std::vector<bool> *t_TrkPVFlag;
215  std::vector<bool> *t_TrkNuIsolFlag;
216 
217  std::vector<double> *t_PixcandP;
218  std::vector<double> *t_PixcandPt;
219  std::vector<double> *t_PixcandEta;
220  std::vector<double> *t_PixcandPhi;
221  std::vector<std::vector<double>> *t_PixcandMaxP;
222  std::vector<double> *t_PixTrkcandP;
223  std::vector<double> *t_PixTrkcandPt;
224  std::vector<double> *t_PixTrkcandEta;
225  std::vector<double> *t_PixTrkcandPhi;
226  std::vector<double> *t_PixTrkcandMaxP;
227  std::vector<bool> *t_PixTrkcandselTk;
228 
229  std::vector<double> *t_NFcandP;
230  std::vector<double> *t_NFcandPt;
231  std::vector<double> *t_NFcandEta;
232  std::vector<double> *t_NFcandPhi;
233  std::vector<double> *t_NFcandEmip;
234  std::vector<double> *t_NFTrkcandP;
235  std::vector<double> *t_NFTrkcandPt;
236  std::vector<double> *t_NFTrkcandEta;
237  std::vector<double> *t_NFTrkcandPhi;
238  std::vector<double> *t_NFTrkcandEmip;
239  std::vector<double> *t_NFTrkMinDR;
240  std::vector<double> *t_NFTrkMinDP1;
241  std::vector<bool> *t_NFTrkselTkFlag;
242  std::vector<bool> *t_NFTrkqltyFlag;
243  std::vector<bool> *t_NFTrkMissFlag;
244  std::vector<bool> *t_NFTrkPVFlag;
245  std::vector<bool> *t_NFTrkPropFlag;
246  std::vector<bool> *t_NFTrkChgIsoFlag;
247  std::vector<bool> *t_NFTrkNeuIsoFlag;
248  std::vector<bool> *t_NFTrkMipFlag;
249  std::vector<double> *t_ECone;
250 
251  TH1D *h_EnIn, *h_EnOut;
256  TH1D *h_p[20], *h_pt[20], *h_eta[20], *h_phi[20];
257  TH1D *h_dEtaL1[2], *h_dPhiL1[2], *h_dRL1[2];
258  TH1D *h_dEta[9], *h_dPhi[9], *h_dPt[9], *h_dP[9];
259  TH1D *h_dinvPt[9], *h_mindR[9], *h_eMip[2];
260  TH1D *h_eMaxNearP[2], *h_eNeutIso[2];
261  TH1D *h_etaCalibTracks[5][2][2], *h_etaMipTracks[5][2][2];
262  TH1D *h_eHcal[5][6][48], *h_eCalo[5][6][48];
264  std::vector<math::XYZTLorentzVector> vec_[3];
265 };
266 
268  : hltPrescaleProvider_(iConfig, consumesCollector(), *this),
269  trigNames_(iConfig.getUntrackedParameter<std::vector<std::string>>("Triggers")),
270  pixCandTag_(iConfig.getUntrackedParameter<edm::InputTag>("pixCandTag")),
271  l1CandTag_(iConfig.getUntrackedParameter<edm::InputTag>("l1CandTag")),
272  l2CandTag_(iConfig.getUntrackedParameter<edm::InputTag>("l2CandTag")),
273  pixelTracksSources_(iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("pixelTracksSources")),
274  doL2L3_(iConfig.getUntrackedParameter<bool>("doL2L3", true)),
275  doTiming_(iConfig.getUntrackedParameter<bool>("doTimingTree", true)),
276  doMipCutTree_(iConfig.getUntrackedParameter<bool>("doMipCutTree", true)),
277  doTrkResTree_(iConfig.getUntrackedParameter<bool>("doTrkResTree", true)),
278  doChgIsolTree_(iConfig.getUntrackedParameter<bool>("doChgIsolTree", true)),
279  doStudyIsol_(iConfig.getUntrackedParameter<bool>("doStudyIsol", true)),
280  verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)),
281  pixelIsolationConeSizeAtEC_(iConfig.getUntrackedParameter<std::vector<double>>("pixelIsolationConeSizeAtEC")),
282  minPTrackValue_(iConfig.getUntrackedParameter<double>("minPTrackValue")),
283  vtxCutSeed_(iConfig.getUntrackedParameter<double>("vertexCutSeed")),
284  vtxCutIsol_(iConfig.getUntrackedParameter<double>("vertexCutIsol")),
285  tauUnbiasCone_(iConfig.getUntrackedParameter<double>("tauUnbiasCone")),
286  prelimCone_(iConfig.getUntrackedParameter<double>("prelimCone")),
287  theTrackQuality_(iConfig.getUntrackedParameter<std::string>("trackQuality", "highPurity")),
288  processName_(iConfig.getUntrackedParameter<std::string>("processName", "HLT")),
289  dr_L1_(iConfig.getUntrackedParameter<double>("isolationL1", 1.0)),
290  a_coneR_(iConfig.getUntrackedParameter<double>("coneRadius", 34.98)),
291  a_charIsoR_(a_coneR_ + 28.9),
292  a_neutIsoR_(a_charIsoR_ * 0.726),
293  a_mipR_(iConfig.getUntrackedParameter<double>("coneRadiusMIP", 14.0)),
294  a_neutR1_(iConfig.getUntrackedParameter<double>("coneRadiusNeut1", 21.0)),
295  a_neutR2_(iConfig.getUntrackedParameter<double>("coneRadiusNeut2", 29.0)),
296  cutMip_(iConfig.getUntrackedParameter<double>("cutMIP", 1.0)),
297  cutCharge_(iConfig.getUntrackedParameter<double>("chargeIsolation", 2.0)),
298  cutNeutral_(iConfig.getUntrackedParameter<double>("neutralIsolation", 2.0)),
299  minRunNo_(iConfig.getUntrackedParameter<int>("minRun")),
300  maxRunNo_(iConfig.getUntrackedParameter<int>("maxRun")),
301  changed_(false),
302  t_timeL2Prod(nullptr),
303  t_nPixCand(nullptr),
304  t_nPixSeed(nullptr),
305  t_nGoodTk(nullptr),
306  t_TrkhCone(nullptr),
307  t_TrkP(nullptr),
308  t_TrkselTkFlag(nullptr),
309  t_TrkqltyFlag(nullptr),
310  t_TrkMissFlag(nullptr),
311  t_TrkPVFlag(nullptr),
312  t_TrkNuIsolFlag(nullptr),
313  t_PixcandP(nullptr),
314  t_PixcandPt(nullptr),
315  t_PixcandEta(nullptr),
316  t_PixcandPhi(nullptr),
317  t_PixcandMaxP(nullptr),
318  t_PixTrkcandP(nullptr),
319  t_PixTrkcandPt(nullptr),
320  t_PixTrkcandEta(nullptr),
321  t_PixTrkcandPhi(nullptr),
322  t_PixTrkcandMaxP(nullptr),
323  t_PixTrkcandselTk(nullptr),
324  t_NFcandP(nullptr),
325  t_NFcandPt(nullptr),
326  t_NFcandEta(nullptr),
327  t_NFcandPhi(nullptr),
328  t_NFcandEmip(nullptr),
329  t_NFTrkcandP(nullptr),
330  t_NFTrkcandPt(nullptr),
331  t_NFTrkcandEta(nullptr),
332  t_NFTrkcandPhi(nullptr),
333  t_NFTrkcandEmip(nullptr),
334  t_NFTrkMinDR(nullptr),
335  t_NFTrkMinDP1(nullptr),
336  t_NFTrkselTkFlag(nullptr),
337  t_NFTrkqltyFlag(nullptr),
338  t_NFTrkMissFlag(nullptr),
339  t_NFTrkPVFlag(nullptr),
340  t_NFTrkPropFlag(nullptr),
341  t_NFTrkChgIsoFlag(nullptr),
342  t_NFTrkNeuIsoFlag(nullptr),
343  t_NFTrkMipFlag(nullptr),
344  t_ECone(nullptr) {
345  usesResource(TFileService::kSharedResource);
346 
347  //now do whatever initialization is needed
349  selectionParameters_.minPt = iConfig.getUntrackedParameter<double>("minTrackPt", 10.0);
350  selectionParameters_.minQuality = trackQuality_;
351  selectionParameters_.maxDxyPV = iConfig.getUntrackedParameter<double>("maxDxyPV", 0.2);
352  selectionParameters_.maxDzPV = iConfig.getUntrackedParameter<double>("maxDzPV", 5.0);
353  selectionParameters_.maxChi2 = iConfig.getUntrackedParameter<double>("maxChi2", 5.0);
354  selectionParameters_.maxDpOverP = iConfig.getUntrackedParameter<double>("maxDpOverP", 0.1);
355  selectionParameters_.minOuterHit = iConfig.getUntrackedParameter<int>("minOuterHit", 4);
356  selectionParameters_.minLayerCrossed = iConfig.getUntrackedParameter<int>("minLayerCrossed", 8);
357  selectionParameters_.maxInMiss = iConfig.getUntrackedParameter<int>("maxInMiss", 0);
358  selectionParameters_.maxOutMiss = iConfig.getUntrackedParameter<int>("maxOutMiss", 0);
359 
360  // define tokens for access
361  tok_lumi_ = consumes<LumiDetails, edm::InLumi>(edm::InputTag("lumiProducer"));
362  edm::InputTag triggerEvent_("hltTriggerSummaryAOD", "", processName_);
363  tok_trigEvt_ = consumes<trigger::TriggerEvent>(triggerEvent_);
364  edm::InputTag theTriggerResultsLabel("TriggerResults", "", processName_);
365  tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel);
366  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
367  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
368  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
369  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
370  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
371  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
372  tok_pixtk_ = consumes<reco::IsolatedPixelTrackCandidateCollection>(pixCandTag_);
373  tok_l1cand_ = consumes<trigger::TriggerFilterObjectWithRefs>(l1CandTag_);
374  tok_l2cand_ = consumes<reco::IsolatedPixelTrackCandidateCollection>(l2CandTag_);
375  if (doTiming_) {
376  tok_verthb_ = consumes<reco::VertexCollection>(edm::InputTag("hltHITPixelVerticesHB"));
377  tok_verthe_ = consumes<reco::VertexCollection>(edm::InputTag("hltHITPixelVerticesHB"));
378  tok_hlt_ = consumes<trigger::TriggerFilterObjectWithRefs>(edm::InputTag("hltL1sL1SingleJet68"));
379  tok_SeedingLayerHB_ = consumes<SeedingLayerSetsHits>(edm::InputTag("hltPixelLayerTripletsHITHB"));
380  tok_SeedingLayerHE_ = consumes<SeedingLayerSetsHits>(edm::InputTag("hltPixelLayerTripletsHITHE"));
381  tok_SiPixelRecHits_ = consumes<SiPixelRecHitCollection>(edm::InputTag("hltSiPixelRecHits"));
382  }
383  if (doChgIsolTree_) {
384  for (unsigned int k = 0; k < pixelTracksSources_.size(); ++k) {
385  // edm::InputTag pix (pixelTracksSources_[k],"",processName_);
386  // tok_pixtks_.push_back(consumes<reco::TrackCollection>(pix));
387  tok_pixtks_.push_back(consumes<reco::TrackCollection>(pixelTracksSources_[k]));
388  }
389  }
390  if (verbosity_ >= 0) {
391  edm::LogVerbatim("IsoTrack") << "Parameters read from config file \n"
392  << "\t minPt " << selectionParameters_.minPt << "\t theTrackQuality "
393  << theTrackQuality_ << "\t minQuality " << selectionParameters_.minQuality
394  << "\t maxDxyPV " << selectionParameters_.maxDxyPV << "\t maxDzPV "
396  << "\t maxDpOverP " << selectionParameters_.maxDpOverP << "\t minOuterHit "
397  << selectionParameters_.minOuterHit << "\t minLayerCrossed "
398  << selectionParameters_.minLayerCrossed << "\t maxInMiss "
399  << selectionParameters_.maxInMiss << "\t maxOutMiss "
400  << selectionParameters_.maxOutMiss << "\t a_coneR " << a_coneR_ << "\t a_charIsoR "
401  << a_charIsoR_ << "\t a_neutIsoR " << a_neutIsoR_ << "\t a_mipR " << a_mipR_
402  << "\t a_neutR " << a_neutR1_ << ":" << a_neutR2_ << "\t cuts (MIP " << cutMip_
403  << " : Charge " << cutCharge_ << " : Neutral " << cutNeutral_ << ")";
404  edm::LogVerbatim("IsoTrack") << "Charge Isolation parameters:"
405  << "\t minPTrackValue " << minPTrackValue_ << "\t vtxCutSeed " << vtxCutSeed_
406  << "\t vtxCutIsol " << vtxCutIsol_ << "\t tauUnbiasCone " << tauUnbiasCone_
407  << "\t prelimCone " << prelimCone_ << "\t pixelIsolationConeSizeAtEC";
408  for (unsigned int k = 0; k < pixelIsolationConeSizeAtEC_.size(); ++k)
409  edm::LogVerbatim("IsoTrack") << "[" << k << "] " << pixelIsolationConeSizeAtEC_[k];
410  }
411  double pl[] = {20, 30, 40, 60, 80, 120};
412  for (int i = 0; i < 6; ++i)
413  pLimits_[i] = pl[i];
414  rEB_ = 123.8;
415  zEE_ = 317.0;
416 }
417 
419  // do anything here that needs to be done at desctruction time
420  // (e.g. close files, deallocate resources etc.)
421  if (t_timeL2Prod)
422  delete t_timeL2Prod;
423  if (t_nPixCand)
424  delete t_nPixCand;
425  if (t_nPixSeed)
426  delete t_nPixSeed;
427  if (t_nGoodTk)
428  delete t_nGoodTk;
429  if (t_TrkhCone)
430  delete t_TrkhCone;
431  if (t_TrkP)
432  delete t_TrkP;
433  if (t_TrkselTkFlag)
434  delete t_TrkselTkFlag;
435  if (t_TrkqltyFlag)
436  delete t_TrkqltyFlag;
437  if (t_TrkMissFlag)
438  delete t_TrkMissFlag;
439  if (t_TrkPVFlag)
440  delete t_TrkPVFlag;
441  if (t_TrkNuIsolFlag)
442  delete t_TrkNuIsolFlag;
443  if (t_PixcandP)
444  delete t_PixcandP;
445  if (t_PixcandPt)
446  delete t_PixcandPt;
447  if (t_PixcandEta)
448  delete t_PixcandEta;
449  if (t_PixcandPhi)
450  delete t_PixcandPhi;
451  if (t_PixcandMaxP)
452  delete t_PixcandMaxP;
453  if (t_PixTrkcandP)
454  delete t_PixTrkcandP;
455  if (t_PixTrkcandPt)
456  delete t_PixTrkcandPt;
457  if (t_PixTrkcandEta)
458  delete t_PixTrkcandEta;
459  if (t_PixTrkcandPhi)
460  delete t_PixTrkcandPhi;
461  if (t_PixTrkcandMaxP)
462  delete t_PixTrkcandMaxP;
463  if (t_PixTrkcandselTk)
464  delete t_PixTrkcandselTk;
465  if (t_NFcandP)
466  delete t_NFcandP;
467  if (t_NFcandPt)
468  delete t_NFcandPt;
469  if (t_NFcandEta)
470  delete t_NFcandEta;
471  if (t_NFcandPhi)
472  delete t_NFcandPhi;
473  if (t_NFcandEmip)
474  delete t_NFcandEmip;
475  if (t_NFTrkcandP)
476  delete t_NFTrkcandP;
477  if (t_NFTrkcandPt)
478  delete t_NFTrkcandPt;
479  if (t_NFTrkcandEta)
480  delete t_NFTrkcandEta;
481  if (t_NFTrkcandPhi)
482  delete t_NFTrkcandPhi;
483  if (t_NFTrkcandEmip)
484  delete t_NFTrkcandEmip;
485  if (t_NFTrkMinDR)
486  delete t_NFTrkMinDR;
487  if (t_NFTrkMinDP1)
488  delete t_NFTrkMinDP1;
489  if (t_NFTrkselTkFlag)
490  delete t_NFTrkselTkFlag;
491  if (t_NFTrkqltyFlag)
492  delete t_NFTrkqltyFlag;
493  if (t_NFTrkMissFlag)
494  delete t_NFTrkMissFlag;
495  if (t_NFTrkPVFlag)
496  delete t_NFTrkPVFlag;
497  if (t_NFTrkPropFlag)
498  delete t_NFTrkPropFlag;
499  if (t_NFTrkChgIsoFlag)
500  delete t_NFTrkChgIsoFlag;
501  if (t_NFTrkNeuIsoFlag)
502  delete t_NFTrkNeuIsoFlag;
503  if (t_NFTrkMipFlag)
504  delete t_NFTrkMipFlag;
505  if (t_ECone)
506  delete t_ECone;
507 }
508 
510  std::vector<std::string> triggers = {"HLT_IsoTrackHB"};
511  std::vector<edm::InputTag> tags = {edm::InputTag("hltHITPixelTracksHB"), edm::InputTag("hltHITPixelTracksHE")};
512  std::vector<double> cones = {35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 63.9, 70.0};
514  desc.addUntracked<std::vector<std::string>>("Triggers", triggers);
515  desc.addUntracked<edm::InputTag>("pixCandTag", edm::InputTag(" "));
516  desc.addUntracked<edm::InputTag>("l1CandTag", edm::InputTag("hltL1sV0SingleJet60"));
517  desc.addUntracked<edm::InputTag>("l2CandTag", edm::InputTag("isolEcalPixelTrackProd"));
518  desc.addUntracked<bool>("doL2L3", false);
519  desc.addUntracked<bool>("doTimingTree", false);
520  desc.addUntracked<bool>("doMipCutTree", false);
521  desc.addUntracked<bool>("doTrkResTree", true);
522  desc.addUntracked<bool>("doChgIsolTree", false);
523  desc.addUntracked<bool>("doStudyIsol", false);
524  desc.addUntracked<int>("verbosity", 0);
525  desc.addUntracked<std::string>("processName", "HLT");
526  desc.addUntracked<std::string>("trackQuality", "highPurity");
527  desc.addUntracked<double>("minTrackPt", 10.0);
528  desc.addUntracked<double>("maxDxyPV", 0.02);
529  desc.addUntracked<double>("maxDzPV", 0.02);
530  desc.addUntracked<double>("maxChi2", 5.0);
531  desc.addUntracked<double>("maxDpOverP", 0.1);
532  desc.addUntracked<int>("minOuterHit", 4);
533  desc.addUntracked<int>("minLayerCrossed", 8);
534  desc.addUntracked<int>("maxInMiss", 0);
535  desc.addUntracked<int>("maxOutMiss", 0);
536  desc.addUntracked<double>("isolationL1", 1.0);
537  desc.addUntracked<double>("coneRadius", 34.98);
538  desc.addUntracked<double>("coneRadiusMIP", 14.0);
539  desc.addUntracked<double>("coneRadiusNeut1", 21.0);
540  desc.addUntracked<double>("coneRadiusNeut2", 29.0);
541  desc.addUntracked<double>("cutMIP", 1.0);
542  desc.addUntracked<double>("chargeIsolation", 2.0);
543  desc.addUntracked<double>("neutralIsolation", 2.0);
544  desc.addUntracked<int>("minRun", 190456);
545  desc.addUntracked<int>("maxRun", 203002);
546  desc.addUntracked<std::vector<edm::InputTag>>("pixelTracksSources", tags);
547  desc.addUntracked<std::vector<double>>("pixelIsolationConeSizeAtEC", cones);
548  desc.addUntracked<double>("minPTrackValue", 0.0);
549  desc.addUntracked<double>("vertexCutSeed", 101.0);
550  desc.addUntracked<double>("vertexCutIsol", 101.0);
551  desc.addUntracked<double>("tauUnbiasCone", 1.2);
552  desc.addUntracked<double>("prelimCone", 1.0);
553  desc.add<unsigned int>("stageL1Trigger", 1);
554  descriptions.add("isoTrigDefault", desc);
555 }
556 
557 void IsoTrig::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
558  if (verbosity_ % 10 > 0)
559  edm::LogVerbatim("IsoTrack") << "Event starts====================================";
560 
561  int RunNo = iEvent.id().run();
562 
564 
566  iSetup.get<CaloGeometryRecord>().get(pG_);
568  GlobalVector BField = bField->inTesla(GlobalPoint(0, 0, 0));
569  bfVal_ = BField.mag();
570 
572  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
573  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
574  if (!triggerEventHandle.isValid()) {
575  edm::LogWarning("IsoTrack") << "Error! Can't get the product hltTriggerSummaryAOD";
576 
577  } else {
578  triggerEvent = *(triggerEventHandle.product());
579  }
580  const trigger::TriggerObjectCollection &TOC(triggerEvent.getObjects());
583  iEvent.getByToken(tok_trigRes_, triggerResults);
584 
586  iEvent.getByToken(tok_genTrack_, trkCollection);
587 
588  iEvent.getByToken(tok_EB_, barrelRecHitsHandle_);
589  iEvent.getByToken(tok_EE_, endcapRecHitsHandle_);
590 
591  iEvent.getByToken(tok_hbhe_, hbhe_);
592 
593  iEvent.getByToken(tok_recVtx_, recVtxs_);
594  iEvent.getByToken(tok_bs_, beamSpotH_);
595  if (!recVtxs_->empty() && !((*recVtxs_)[0].isFake())) {
596  leadPV_ = math::XYZPoint((*recVtxs_)[0].x(), (*recVtxs_)[0].y(), (*recVtxs_)[0].z());
597  } else if (beamSpotH_.isValid()) {
599  }
600 
601  if ((verbosity_ / 100) % 10 > 0) {
602  edm::LogVerbatim("IsoTrack") << "Primary Vertex " << leadPV_;
603  if (beamSpotH_.isValid())
604  edm::LogVerbatim("IsoTrack") << "Beam Spot " << beamSpotH_->position();
605  }
606  pixelTrackRefsHE_.clear();
607  pixelTrackRefsHB_.clear();
608  for (unsigned int iPix = 0; iPix < pixelTracksSources_.size(); iPix++) {
610  iEvent.getByToken(tok_pixtks_[iPix], iPixCol);
611  if (iPixCol.isValid()) {
612  for (reco::TrackCollection::const_iterator pit = iPixCol->begin(); pit != iPixCol->end(); pit++) {
613  if (iPix == 0)
614  pixelTrackRefsHB_.push_back(reco::TrackRef(iPixCol, pit - iPixCol->begin()));
615  pixelTrackRefsHE_.push_back(reco::TrackRef(iPixCol, pit - iPixCol->begin()));
616  }
617  }
618  }
619  if (doTiming_)
620  getGoodTracks(iEvent, trkCollection);
621 
622  for (unsigned int ifilter = 0; ifilter < triggerEvent.sizeFilters(); ++ifilter) {
623  std::string FilterNames[7] = {"hltL1sL1SingleJet68",
624  "hltIsolPixelTrackL2FilterHE",
625  "ecalIsolPixelTrackFilterHE",
626  "hltIsolPixelTrackL3FilterHE",
627  "hltIsolPixelTrackL2FilterHB",
628  "ecalIsolPixelTrackFilterHB",
629  "hltIsolPixelTrackL3FilterHB"};
630  std::string label = triggerEvent.filterTag(ifilter).label();
631  for (int i = 0; i < 7; i++) {
632  if (label == FilterNames[i])
633  h_Filters->Fill(i);
634  }
635  }
636  edm::InputTag lumiProducer("LumiProducer", "", "RECO");
638  iEvent.getLuminosityBlock().getByToken(tok_lumi_, Lumid);
639  float mybxlumi = -1;
640  if (Lumid.isValid())
641  mybxlumi = Lumid->lumiValue(LumiDetails::kOCC1, iEvent.bunchCrossing()) * 6.37;
642  if (verbosity_ % 10 > 0)
643  edm::LogVerbatim("IsoTrack") << "RunNo " << RunNo << " EvtNo " << iEvent.id().event() << " Lumi "
644  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << " mybxlumi "
645  << mybxlumi;
646  if (!triggerResults.isValid()) {
647  edm::LogWarning("IsoTrack") << "Error! Can't get the product triggerResults";
648  // std::shared_ptr<cms::Exception> const & error = triggerResults.whyFailed();
649  // edm::LogWarning(error->category()) << error->what();
650  } else {
651  std::vector<std::string> modules;
652  h_nHLT->Fill(triggerResults->size());
653  const edm::TriggerNames &triggerNames = iEvent.triggerNames(*triggerResults);
654 
655  const std::vector<std::string> &triggerNames_ = triggerNames.triggerNames();
656  if (verbosity_ % 10 > 1)
657  edm::LogVerbatim("IsoTrack") << "number of HLTs " << triggerNames_.size();
658  int hlt(-1), preL1(-1), preHLT(-1), prescale(-1);
659  for (unsigned int i = 0; i < triggerResults->size(); i++) {
660  unsigned int triggerindx = hltConfig.triggerIndex(triggerNames_[i]);
661  const std::vector<std::string> &moduleLabels(hltConfig.moduleLabels(triggerindx));
662 
663  for (unsigned int in = 0; in < trigNames_.size(); ++in) {
664  // if (triggerNames_[i].find(trigNames_[in].c_str())!=std::string::npos || triggerNames_[i]==" ") {
665  if (triggerNames_[i].find(trigNames_[in]) != std::string::npos) {
666  if (verbosity_ % 10 > 0)
667  edm::LogVerbatim("IsoTrack") << "trigger that i want " << triggerNames_[i] << " accept "
668  << triggerResults->accept(i);
669  hlt = triggerResults->accept(i);
670  h_HLT->Fill(hlt);
671  // if (hlt>0 || triggerNames_[i]==" ") {
672  if (hlt > 0) {
674  iEvent.getByToken(tok_pixtk_, Pixcands);
676  iEvent.getByToken(tok_l1cand_, L1cands);
677 
678  const std::pair<int, int> prescales(hltPrescaleProvider_.prescaleValues(iEvent, iSetup, triggerNames_[i]));
679  preL1 = prescales.first;
680  preHLT = prescales.second;
681  prescale = preL1 * preHLT;
682  if (verbosity_ % 10 > 0)
683  edm::LogVerbatim("IsoTrack")
684  << triggerNames_[i] << " accept " << hlt << " preL1 " << preL1 << " preHLT " << preHLT;
685  for (int iv = 0; iv < 3; ++iv)
686  vec_[iv].clear();
687  if (trigList_.find(RunNo) != trigList_.end()) {
688  trigList_[RunNo] += 1;
689  } else {
690  trigList_.insert(std::pair<unsigned int, unsigned int>(RunNo, 1));
691  trigPreList_.insert(std::pair<unsigned int, std::pair<int, int>>(RunNo, prescales));
692  }
693  //loop over all trigger filters in event (i.e. filters passed)
694  for (unsigned int ifilter = 0; ifilter < triggerEvent.sizeFilters(); ++ifilter) {
695  std::vector<int> Keys;
696  std::string label = triggerEvent.filterTag(ifilter).label();
697  //loop over keys to objects passing this filter
698  for (unsigned int imodule = 0; imodule < moduleLabels.size(); imodule++) {
699  if (label.find(moduleLabels[imodule]) != std::string::npos) {
700  if (verbosity_ % 10 > 0)
701  edm::LogVerbatim("IsoTrack") << "FILTERNAME " << label;
702  for (unsigned int ifiltrKey = 0; ifiltrKey < triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) {
703  Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]);
704  const trigger::TriggerObject &TO(TOC[Keys[ifiltrKey]]);
705  math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy());
706  if (label.find("L2Filter") != std::string::npos) {
707  vec_[1].push_back(v4);
708  } else if (label.find("L3Filter") != std::string::npos) {
709  vec_[2].push_back(v4);
710  } else {
711  vec_[0].push_back(v4);
712  h_L1ObjEnergy->Fill(TO.energy());
713  }
714  if (verbosity_ % 10 > 0)
715  edm::LogVerbatim("IsoTrack") << "key " << ifiltrKey << " : pt " << TO.pt() << " eta " << TO.eta()
716  << " phi " << TO.phi() << " mass " << TO.mass() << " Id " << TO.id();
717  }
718  }
719  }
720  }
721  std::vector<reco::TrackCollection::const_iterator> goodTks;
722  if (doL2L3_) {
723  h_nL3Objs->Fill(vec_[2].size());
724  studyTrigger(trkCollection, goodTks);
725  } else {
726  if (trkCollection.isValid()) {
727  reco::TrackCollection::const_iterator trkItr;
728  for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++)
729  goodTks.push_back(trkItr);
730  }
731  }
732  // Now study isolation etc
733  if (doStudyIsol_)
734  studyIsolation(trkCollection, goodTks);
735  if (doTrkResTree_)
736  StudyTrkEbyP(trkCollection);
737 
738  std::pair<double, double> etaphi = etaPhiTrigger();
740  iEvent.getByToken(tok_l2cand_, L2cands);
741  if (!L2cands.isValid()) {
742  if (verbosity_ % 10 > 0)
743  edm::LogVerbatim("IsoTrack") << " trigCand is not valid ";
744  } else {
745  if (doMipCutTree_)
746  studyMipCut(trkCollection, L2cands);
747  }
748  if (!pixelTracksSources_.empty())
749  if (doChgIsolTree_ && !pixelTrackRefsHE_.empty())
750  chgIsolation(etaphi.first, etaphi.second, trkCollection, iEvent);
751  }
752  break;
753  }
754  }
755  }
756  h_PreL1->Fill(preL1);
757  h_PreHLT->Fill(preHLT);
758  h_Pre->Fill(prescale);
759  h_PreL1wt->Fill(preL1, mybxlumi);
760  h_PreHLTwt->Fill(preHLT, mybxlumi);
761 
762  // check if trigger names in (new) config
763  // edm::LogVerbatim("IsoTrack") << "changed " << changed_;
764  if (changed_) {
765  changed_ = false;
766  if ((verbosity_ / 10) % 10 > 1) {
767  edm::LogVerbatim("IsoTrack") << "New trigger menu found !!!";
768  const unsigned int n(hltConfig.size());
769  for (unsigned itrig = 0; itrig < triggerNames_.size(); itrig++) {
770  unsigned int triggerindx = hltConfig.triggerIndex(triggerNames_[itrig]);
771  if (triggerindx >= n)
772  edm::LogVerbatim("IsoTrack") << triggerNames_[itrig] << " " << triggerindx << " does not exist in"
773  << " the current menu";
774  else
775  edm::LogVerbatim("IsoTrack") << triggerNames_[itrig] << " " << triggerindx << " exists";
776  }
777  }
778  }
779  }
780  if (doTiming_)
782 }
783 
785  t_PixcandP->clear();
786  t_PixcandPt->clear();
787  t_PixcandEta->clear();
788  t_PixcandPhi->clear();
789  for (unsigned int i = 0; i < t_PixcandMaxP->size(); i++)
790  t_PixcandMaxP[i].clear();
791  t_PixcandMaxP->clear();
792  t_PixTrkcandP->clear();
793  t_PixTrkcandPt->clear();
794  t_PixTrkcandEta->clear();
795  t_PixTrkcandPhi->clear();
796  t_PixTrkcandMaxP->clear();
797  t_PixTrkcandselTk->clear();
798 }
799 
801  t_NFcandP->clear();
802  t_NFcandPt->clear();
803  t_NFcandEta->clear();
804  t_NFcandPhi->clear();
805  t_NFcandEmip->clear();
806  t_NFTrkcandP->clear();
807  t_NFTrkcandPt->clear();
808  t_NFTrkcandEta->clear();
809  t_NFTrkcandPhi->clear();
810  t_NFTrkcandEmip->clear();
811  t_NFTrkMinDR->clear();
812  t_NFTrkMinDP1->clear();
813  t_NFTrkselTkFlag->clear();
814  t_NFTrkqltyFlag->clear();
815  t_NFTrkMissFlag->clear();
816  t_NFTrkPVFlag->clear();
817  t_NFTrkPropFlag->clear();
818  t_NFTrkChgIsoFlag->clear();
819  t_NFTrkNeuIsoFlag->clear();
820  t_NFTrkMipFlag->clear();
821  t_ECone->clear();
822 }
823 
825  math::XYZTLorentzVector &Trkcand,
826  std::vector<double> &PixMaxP,
827  double &TrkMaxP,
828  bool &selTk) {
829  t_PixcandP->push_back(Pixcand.r());
830  t_PixcandPt->push_back(Pixcand.pt());
831  t_PixcandEta->push_back(Pixcand.eta());
832  t_PixcandPhi->push_back(Pixcand.phi());
833  t_PixcandMaxP->push_back(PixMaxP);
834  t_PixTrkcandP->push_back(Trkcand.r());
835  t_PixTrkcandPt->push_back(Trkcand.pt());
836  t_PixTrkcandEta->push_back(Trkcand.eta());
837  t_PixTrkcandPhi->push_back(Trkcand.phi());
838  t_PixTrkcandMaxP->push_back(TrkMaxP);
839  t_PixTrkcandselTk->push_back(selTk);
840 }
841 
843  math::XYZTLorentzVector &Trkcand,
844  double &EmipNFcand,
845  double &EmipTrkcand,
846  double &mindR,
847  double &mindP1,
848  std::vector<bool> &Flags,
849  double hCone) {
850  t_NFcandP->push_back(NFcand.r());
851  t_NFcandPt->push_back(NFcand.pt());
852  t_NFcandEta->push_back(NFcand.eta());
853  t_NFcandPhi->push_back(NFcand.phi());
854  t_NFcandEmip->push_back(EmipNFcand);
855  t_NFTrkcandP->push_back(Trkcand.r());
856  t_NFTrkcandPt->push_back(Trkcand.pt());
857  t_NFTrkcandEta->push_back(Trkcand.eta());
858  t_NFTrkcandPhi->push_back(Trkcand.phi());
859  t_NFTrkcandEmip->push_back(EmipTrkcand);
860  t_NFTrkMinDR->push_back(mindR);
861  t_NFTrkMinDP1->push_back(mindP1);
862  t_NFTrkselTkFlag->push_back(Flags[0]);
863  t_NFTrkqltyFlag->push_back(Flags[1]);
864  t_NFTrkMissFlag->push_back(Flags[2]);
865  t_NFTrkPVFlag->push_back(Flags[3]);
866  t_NFTrkPropFlag->push_back(Flags[4]);
867  t_NFTrkChgIsoFlag->push_back(Flags[5]);
868  t_NFTrkNeuIsoFlag->push_back(Flags[6]);
869  t_NFTrkMipFlag->push_back(Flags[7]);
870  t_ECone->push_back(hCone);
871 }
872 
874  char hname[100], htit[100];
875  std::string levels[20] = {"L1", "L2", "L3", "Reco", "RecoMatch", "RecoNoMatch",
876  "L2Match", "L2NoMatch", "L3Match", "L3NoMatch", "HLTTrk", "HLTGoodTrk",
877  "HLTIsoTrk", "HLTMip", "HLTSelect", "nonHLTTrk", "nonHLTGoodTrk", "nonHLTIsoTrk",
878  "nonHLTMip", "nonHLTSelect"};
879  if (doTiming_) {
880  TimingTree_ = fs_->make<TTree>("TimingTree", "TimingTree");
881  t_timeL2Prod = new std::vector<double>();
882  t_nPixCand = new std::vector<int>();
883  t_nPixSeed = new std::vector<int>();
884  t_nGoodTk = new std::vector<int>();
885 
886  TimingTree_->Branch("t_timeL2Prod", "std::vector<double>", &t_timeL2Prod);
887  TimingTree_->Branch("t_nPixCand", "std::vector<int>", &t_nPixCand);
888  TimingTree_->Branch("t_nPixSeed", "std::vector<int>", &t_nPixSeed);
889  TimingTree_->Branch("t_nGoodTk", "std::vector<int>", &t_nGoodTk);
890  }
891  if (doTrkResTree_) {
892  TrkResTree_ = fs_->make<TTree>("TrkRestree", "TrkResTree");
893  t_TrkhCone = new std::vector<double>();
894  t_TrkP = new std::vector<double>();
895  t_TrkselTkFlag = new std::vector<bool>();
896  t_TrkqltyFlag = new std::vector<bool>();
897  t_TrkMissFlag = new std::vector<bool>();
898  t_TrkPVFlag = new std::vector<bool>();
899  t_TrkNuIsolFlag = new std::vector<bool>();
900 
901  TrkResTree_->Branch("t_TrkhCone", "std::vector<double>", &t_TrkhCone);
902  TrkResTree_->Branch("t_TrkP", "std::vector<double>", &t_TrkP);
903  TrkResTree_->Branch("t_TrkselTkFlag", "std::vector<bool>", &t_TrkselTkFlag);
904  TrkResTree_->Branch("t_TrkqltyFlag", "std::vector<bool>", &t_TrkqltyFlag);
905  TrkResTree_->Branch("t_TrkMissFlag", "std::vector<bool>", &t_TrkMissFlag);
906  TrkResTree_->Branch("t_TrkPVFlag", "std::vector<bool>", &t_TrkPVFlag);
907  TrkResTree_->Branch("t_TrkNuIsolFlag", "std::vector<bool>", &t_TrkNuIsolFlag);
908  }
909  if (doChgIsolTree_) {
910  ChgIsolnTree_ = fs_->make<TTree>("ChgIsolnTree", "ChgIsolnTree");
911  t_PixcandP = new std::vector<double>();
912  t_PixcandPt = new std::vector<double>();
913  t_PixcandEta = new std::vector<double>();
914  t_PixcandPhi = new std::vector<double>();
915  t_PixcandMaxP = new std::vector<std::vector<double>>();
916  t_PixTrkcandP = new std::vector<double>();
917  t_PixTrkcandPt = new std::vector<double>();
918  t_PixTrkcandEta = new std::vector<double>();
919  t_PixTrkcandPhi = new std::vector<double>();
920  t_PixTrkcandMaxP = new std::vector<double>();
921  t_PixTrkcandselTk = new std::vector<bool>();
922 
923  ChgIsolnTree_->Branch("t_PixcandP", "std::vector<double>", &t_PixcandP);
924  ChgIsolnTree_->Branch("t_PixcandPt", "std::vector<double>", &t_PixcandPt);
925  ChgIsolnTree_->Branch("t_PixcandEta", "std::vector<double>", &t_PixcandEta);
926  ChgIsolnTree_->Branch("t_PixcandPhi", "std::vector<double>", &t_PixcandPhi);
927  ChgIsolnTree_->Branch("t_PixcandMaxP", "std::vector<std::vector<double> >", &t_PixcandMaxP);
928  ChgIsolnTree_->Branch("t_PixTrkcandP", "std::vector<double>", &t_PixTrkcandP);
929  ChgIsolnTree_->Branch("t_PixTrkcandPt", "std::vector<double>", &t_PixTrkcandPt);
930  ChgIsolnTree_->Branch("t_PixTrkcandEta", "std::vector<double>", &t_PixTrkcandEta);
931  ChgIsolnTree_->Branch("t_PixTrkcandPhi", "std::vector<double>", &t_PixTrkcandPhi);
932  ChgIsolnTree_->Branch("t_PixTrkcandMaxP", "std::vector<double>", &t_PixTrkcandMaxP);
933  ChgIsolnTree_->Branch("t_PixTrkcandselTk", "std::vector<bool>", &t_PixTrkcandselTk);
934  }
935  if (doMipCutTree_) {
936  MipCutTree_ = fs_->make<TTree>("MipCutTree", "MipCutTree");
937  t_NFcandP = new std::vector<double>();
938  t_NFcandPt = new std::vector<double>();
939  t_NFcandEta = new std::vector<double>();
940  t_NFcandPhi = new std::vector<double>();
941  t_NFcandEmip = new std::vector<double>();
942  t_NFTrkcandP = new std::vector<double>();
943  t_NFTrkcandPt = new std::vector<double>();
944  t_NFTrkcandEta = new std::vector<double>();
945  t_NFTrkcandPhi = new std::vector<double>();
946  t_NFTrkcandEmip = new std::vector<double>();
947  t_NFTrkMinDR = new std::vector<double>();
948  t_NFTrkMinDP1 = new std::vector<double>();
949  t_NFTrkselTkFlag = new std::vector<bool>();
950  t_NFTrkqltyFlag = new std::vector<bool>();
951  t_NFTrkMissFlag = new std::vector<bool>();
952  t_NFTrkPVFlag = new std::vector<bool>();
953  t_NFTrkPropFlag = new std::vector<bool>();
954  t_NFTrkChgIsoFlag = new std::vector<bool>();
955  t_NFTrkNeuIsoFlag = new std::vector<bool>();
956  t_NFTrkMipFlag = new std::vector<bool>();
957  t_ECone = new std::vector<double>();
958 
959  MipCutTree_->Branch("t_NFcandP", "std::vector<double>", &t_NFcandP);
960  MipCutTree_->Branch("t_NFcandPt", "std::vector<double>", &t_NFcandPt);
961  MipCutTree_->Branch("t_NFcandEta", "std::vector<double>", &t_NFcandEta);
962  MipCutTree_->Branch("t_NFcandPhi", "std::vector<double>", &t_NFcandPhi);
963  MipCutTree_->Branch("t_NFcandEmip", "std::vector<double>", &t_NFcandEmip);
964  MipCutTree_->Branch("t_NFTrkcandP", "std::vector<double>", &t_NFTrkcandP);
965  MipCutTree_->Branch("t_NFTrkcandPt", "std::vector<double>", &t_NFTrkcandPt);
966  MipCutTree_->Branch("t_NFTrkcandEta", "std::vector<double>", &t_NFTrkcandEta);
967  MipCutTree_->Branch("t_NFTrkcandPhi", "std::vector<double>", &t_NFTrkcandPhi);
968  MipCutTree_->Branch("t_NFTrkcandEmip", "std::vector<double>", &t_NFTrkcandEmip);
969  MipCutTree_->Branch("t_NFTrkMinDR", "std::vector<double>", &t_NFTrkMinDR);
970  MipCutTree_->Branch("t_NFTrkMinDP1", "std::vector<double>", &t_NFTrkMinDP1);
971  MipCutTree_->Branch("t_NFTrkselTkFlag", "std::vector<bool>", &t_NFTrkselTkFlag);
972  MipCutTree_->Branch("t_NFTrkqltyFlag", "std::vector<bool>", &t_NFTrkqltyFlag);
973  MipCutTree_->Branch("t_NFTrkMissFlag", "std::vector<bool>", &t_NFTrkMissFlag);
974  MipCutTree_->Branch("t_NFTrkPVFlag", "std::vector<bool>", &t_NFTrkPVFlag);
975  MipCutTree_->Branch("t_NFTrkPropFlag", "std::vector<bool>", &t_NFTrkPropFlag);
976  MipCutTree_->Branch("t_NFTrkChgIsoFlag", "std::vector<bool>", &t_NFTrkChgIsoFlag);
977  MipCutTree_->Branch("t_NFTrkNeuIsoFlag", "std::vector<bool>", &t_NFTrkNeuIsoFlag);
978  MipCutTree_->Branch("t_NFTrkMipFlag", "std::vector<bool>", &t_NFTrkMipFlag);
979  MipCutTree_->Branch("t_ECone", "std::vector<double>", &t_ECone);
980  }
981  h_Filters = fs_->make<TH1I>("h_Filters", "Filter Accepts", 10, 0, 10);
982  std::string FilterNames[7] = {"hltL1sL1SingleJet68",
983  "hltIsolPixelTrackL2FilterHE",
984  "ecalIsolPixelTrackFilterHE",
985  "hltIsolPixelTrackL3FilterHE",
986  "hltIsolPixelTrackL2FilterHB",
987  "ecalIsolPixelTrackFilterHB",
988  "hltIsolPixelTrackL3FilterHB"};
989  for (int i = 0; i < 7; i++) {
990  h_Filters->GetXaxis()->SetBinLabel(i + 1, FilterNames[i].c_str());
991  }
992 
993  h_nHLT = fs_->make<TH1I>("h_nHLT", "Size of trigger Names", 1000, 1, 1000);
994  h_HLT = fs_->make<TH1I>("h_HLT", "HLT accept", 3, -1, 2);
995  h_PreL1 = fs_->make<TH1I>("h_PreL1", "L1 Prescale", 500, 0, 500);
996  h_PreHLT = fs_->make<TH1I>("h_PreHLT", "HLT Prescale", 50, 0, 50);
997  h_Pre = fs_->make<TH1I>("h_Pre", "Prescale", 3000, 0, 3000);
998 
999  h_PreL1wt = fs_->make<TH1D>("h_PreL1wt", "Weighted L1 Prescale", 500, 0, 500);
1000  h_PreHLTwt = fs_->make<TH1D>("h_PreHLTwt", "Weighted HLT Prescale", 500, 0, 100);
1001  h_L1ObjEnergy = fs_->make<TH1D>("h_L1ObjEnergy", "Energy of L1Object", 500, 0.0, 500.0);
1002 
1003  h_EnIn = fs_->make<TH1D>("h_EnInEcal", "EnergyIn Ecal", 200, 0.0, 20.0);
1004  h_EnOut = fs_->make<TH1D>("h_EnOutEcal", "EnergyOut Ecal", 200, 0.0, 20.0);
1005  h_MipEnMatch =
1006  fs_->make<TH2D>("h_MipEnMatch", "MipEn: HLT level vs Reco Level (Matched)", 200, 0.0, 20.0, 200, 0.0, 20.0);
1007  h_MipEnNoMatch = fs_->make<TH2D>(
1008  "h_MipEnNoMatch", "MipEn: HLT level vs Reco Level (No Match Found)", 200, 0.0, 20.0, 200, 0.0, 20.0);
1009 
1010  if (doL2L3_) {
1011  h_nL3Objs = fs_->make<TH1I>("h_nL3Objs", "Number of L3 objects", 10, 0, 10);
1012 
1013  std::string pairs[9] = {"L2L3",
1014  "L2L3Match",
1015  "L2L3NoMatch",
1016  "L3Reco",
1017  "L3RecoMatch",
1018  "L3RecoNoMatch",
1019  "NewFilterReco",
1020  "NewFilterRecoMatch",
1021  "NewFilterRecoNoMatch"};
1022  for (int ipair = 0; ipair < 9; ipair++) {
1023  sprintf(hname, "h_dEta%s", pairs[ipair].c_str());
1024  sprintf(htit, "#Delta#eta for %s", pairs[ipair].c_str());
1025  h_dEta[ipair] = fs_->make<TH1D>(hname, htit, 200, -10.0, 10.0);
1026  h_dEta[ipair]->GetXaxis()->SetTitle("d#eta");
1027 
1028  sprintf(hname, "h_dPhi%s", pairs[ipair].c_str());
1029  sprintf(htit, "#Delta#phi for %s", pairs[ipair].c_str());
1030  h_dPhi[ipair] = fs_->make<TH1D>(hname, htit, 140, -7.0, 7.0);
1031  h_dPhi[ipair]->GetXaxis()->SetTitle("d#phi");
1032 
1033  sprintf(hname, "h_dPt%s", pairs[ipair].c_str());
1034  sprintf(htit, "#Delta dp_{T} for %s objects", pairs[ipair].c_str());
1035  h_dPt[ipair] = fs_->make<TH1D>(hname, htit, 400, -200.0, 200.0);
1036  h_dPt[ipair]->GetXaxis()->SetTitle("dp_{T} (GeV)");
1037 
1038  sprintf(hname, "h_dP%s", pairs[ipair].c_str());
1039  sprintf(htit, "#Delta p for %s objects", pairs[ipair].c_str());
1040  h_dP[ipair] = fs_->make<TH1D>(hname, htit, 400, -200.0, 200.0);
1041  h_dP[ipair]->GetXaxis()->SetTitle("dP (GeV)");
1042 
1043  sprintf(hname, "h_dinvPt%s", pairs[ipair].c_str());
1044  sprintf(htit, "#Delta (1/p_{T}) for %s objects", pairs[ipair].c_str());
1045  h_dinvPt[ipair] = fs_->make<TH1D>(hname, htit, 500, -0.4, 0.1);
1046  h_dinvPt[ipair]->GetXaxis()->SetTitle("d(1/p_{T})");
1047  sprintf(hname, "h_mindR%s", pairs[ipair].c_str());
1048  sprintf(htit, "min(#Delta R) for %s objects", pairs[ipair].c_str());
1049  h_mindR[ipair] = fs_->make<TH1D>(hname, htit, 500, 0.0, 1.0);
1050  h_mindR[ipair]->GetXaxis()->SetTitle("dR");
1051  }
1052 
1053  for (int lvl = 0; lvl < 2; lvl++) {
1054  sprintf(hname, "h_dEtaL1%s", levels[lvl + 1].c_str());
1055  sprintf(htit, "#Delta#eta for L1 and %s objects", levels[lvl + 1].c_str());
1056  h_dEtaL1[lvl] = fs_->make<TH1D>(hname, htit, 400, -10.0, 10.0);
1057 
1058  sprintf(hname, "h_dPhiL1%s", levels[lvl + 1].c_str());
1059  sprintf(htit, "#Delta#phi for L1 and %s objects", levels[lvl + 1].c_str());
1060  h_dPhiL1[lvl] = fs_->make<TH1D>(hname, htit, 280, -7.0, 7.0);
1061 
1062  sprintf(hname, "h_dRL1%s", levels[lvl + 1].c_str());
1063  sprintf(htit, "#Delta R for L1 and %s objects", levels[lvl + 1].c_str());
1064  h_dRL1[lvl] = fs_->make<TH1D>(hname, htit, 100, 0.0, 10.0);
1065  }
1066  }
1067 
1068  int levmin = (doL2L3_ ? 0 : 10);
1069  for (int ilevel = levmin; ilevel < 20; ilevel++) {
1070  sprintf(hname, "h_p%s", levels[ilevel].c_str());
1071  sprintf(htit, "p for %s objects", levels[ilevel].c_str());
1072  h_p[ilevel] = fs_->make<TH1D>(hname, htit, 100, 0.0, 500.0);
1073  h_p[ilevel]->GetXaxis()->SetTitle("p (GeV)");
1074 
1075  sprintf(hname, "h_pt%s", levels[ilevel].c_str());
1076  sprintf(htit, "p_{T} for %s objects", levels[ilevel].c_str());
1077  h_pt[ilevel] = fs_->make<TH1D>(hname, htit, 100, 0.0, 500.0);
1078  h_pt[ilevel]->GetXaxis()->SetTitle("p_{T} (GeV)");
1079 
1080  sprintf(hname, "h_eta%s", levels[ilevel].c_str());
1081  sprintf(htit, "#eta for %s objects", levels[ilevel].c_str());
1082  h_eta[ilevel] = fs_->make<TH1D>(hname, htit, 100, -5.0, 5.0);
1083  h_eta[ilevel]->GetXaxis()->SetTitle("#eta");
1084 
1085  sprintf(hname, "h_phi%s", levels[ilevel].c_str());
1086  sprintf(htit, "#phi for %s objects", levels[ilevel].c_str());
1087  h_phi[ilevel] = fs_->make<TH1D>(hname, htit, 70, -3.5, 3.50);
1088  h_phi[ilevel]->GetXaxis()->SetTitle("#phi");
1089  }
1090 
1091  std::string cuts[2] = {"HLTMatched", "HLTNotMatched"};
1092  std::string cuts2[2] = {"All", "Away from L1"};
1093  for (int icut = 0; icut < 2; icut++) {
1094  sprintf(hname, "h_eMip%s", cuts[icut].c_str());
1095  sprintf(htit, "eMip for %s tracks", cuts[icut].c_str());
1096  h_eMip[icut] = fs_->make<TH1D>(hname, htit, 200, 0.0, 10.0);
1097  h_eMip[icut]->GetXaxis()->SetTitle("E_{Mip} (GeV)");
1098 
1099  sprintf(hname, "h_eMaxNearP%s", cuts[icut].c_str());
1100  sprintf(htit, "eMaxNearP for %s tracks", cuts[icut].c_str());
1101  h_eMaxNearP[icut] = fs_->make<TH1D>(hname, htit, 240, -2.0, 10.0);
1102  h_eMaxNearP[icut]->GetXaxis()->SetTitle("E_{MaxNearP} (GeV)");
1103 
1104  sprintf(hname, "h_eNeutIso%s", cuts[icut].c_str());
1105  sprintf(htit, "eNeutIso for %s ", cuts[icut].c_str());
1106  h_eNeutIso[icut] = fs_->make<TH1D>(hname, htit, 200, 0.0, 10.0);
1107  h_eNeutIso[icut]->GetXaxis()->SetTitle("E_{NeutIso} (GeV)");
1108 
1109  for (int kcut = 0; kcut < 2; ++kcut) {
1110  for (int lim = 0; lim < 5; ++lim) {
1111  sprintf(hname, "h_etaCalibTracks%sCut%dLim%d", cuts[icut].c_str(), kcut, lim);
1112  sprintf(htit,
1113  "#eta for %s isolated MIP tracks (%4.1f < p < %5.1f Gev/c %s)",
1114  cuts[icut].c_str(),
1115  pLimits_[lim],
1116  pLimits_[lim + 1],
1117  cuts2[kcut].c_str());
1118  h_etaCalibTracks[lim][icut][kcut] = fs_->make<TH1D>(hname, htit, 60, -30.0, 30.0);
1119  h_etaCalibTracks[lim][icut][kcut]->GetXaxis()->SetTitle("i#eta");
1120 
1121  sprintf(hname, "h_etaMipTracks%sCut%dLim%d", cuts[icut].c_str(), kcut, lim);
1122  sprintf(htit,
1123  "#eta for %s charge isolated MIP tracks (%4.1f < p < %5.1f Gev/c %s)",
1124  cuts[icut].c_str(),
1125  pLimits_[lim],
1126  pLimits_[lim + 1],
1127  cuts2[kcut].c_str());
1128  h_etaMipTracks[lim][icut][kcut] = fs_->make<TH1D>(hname, htit, 60, -30.0, 30.0);
1129  h_etaMipTracks[lim][icut][kcut]->GetXaxis()->SetTitle("i#eta");
1130  }
1131  }
1132  }
1133 
1134  std::string ecut1[3] = {"all", "HLTMatched", "HLTNotMatched"};
1135  std::string ecut2[2] = {"without", "with"};
1136  int etac[48] = {-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16,
1137  -17, -18, -19, -20, -21, -22, -23, -24, 1, 2, 3, 4, 5, 6, 7, 8,
1138  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};
1139  for (int icut = 0; icut < 6; icut++) {
1140  // int i1 = (icut>3 ? 1 : 0);
1141  int i1 = (icut > 2 ? 1 : 0);
1142  int i2 = icut - i1 * 3;
1143  for (int kcut = 0; kcut < 48; kcut++) {
1144  for (int lim = 0; lim < 5; ++lim) {
1145  sprintf(hname, "h_eta%dEnHcal%s%s%d", etac[kcut], ecut1[i2].c_str(), ecut2[i1].c_str(), lim);
1146  sprintf(htit,
1147  "HCAL energy for #eta=%d for %s tracks (p=%4.1f:%5.1f Gev) %s neutral isolation",
1148  etac[kcut],
1149  ecut1[i2].c_str(),
1150  pLimits_[lim],
1151  pLimits_[lim + 1],
1152  ecut2[i1].c_str());
1153  h_eHcal[lim][icut][kcut] = fs_->make<TH1D>(hname, htit, 750, 0.0, 150.0);
1154  h_eHcal[lim][icut][kcut]->GetXaxis()->SetTitle("Energy (GeV)");
1155  sprintf(hname, "h_eta%dEnCalo%s%s%d", etac[kcut], ecut1[i2].c_str(), ecut2[i1].c_str(), lim);
1156  sprintf(htit,
1157  "Calorimter energy for #eta=%d for %s tracks (p=%4.1f:%5.1f Gev) %s neutral isolation",
1158  etac[kcut],
1159  ecut1[i2].c_str(),
1160  pLimits_[lim],
1161  pLimits_[lim + 1],
1162  ecut2[i1].c_str());
1163  h_eCalo[lim][icut][kcut] = fs_->make<TH1D>(hname, htit, 750, 0.0, 150.0);
1164  h_eCalo[lim][icut][kcut]->GetXaxis()->SetTitle("Energy (GeV)");
1165  }
1166  }
1167  }
1168 }
1169 
1170 // ------------ method called once each job just after ending the event loop ------------
1172  unsigned int preL1, preHLT;
1173  std::map<unsigned int, unsigned int>::iterator itr;
1174  std::map<unsigned int, const std::pair<int, int>>::iterator itrPre;
1175  edm::LogWarning("IsoTrack") << trigNames_.size() << "Triggers were run. RunNo vs HLT accepts for";
1176  for (unsigned int i = 0; i < trigNames_.size(); ++i)
1177  edm::LogWarning("IsoTrack") << "[" << i << "]: " << trigNames_[i];
1178  unsigned int n = maxRunNo_ - minRunNo_ + 1;
1179  g_Pre = fs_->make<TH1I>("h_PrevsRN", "PreScale Vs Run Number", n, minRunNo_, maxRunNo_);
1180  g_PreL1 = fs_->make<TH1I>("h_PreL1vsRN", "L1 PreScale Vs Run Number", n, minRunNo_, maxRunNo_);
1181  g_PreHLT = fs_->make<TH1I>("h_PreHLTvsRN", "HLT PreScale Vs Run Number", n, minRunNo_, maxRunNo_);
1182  g_Accepts = fs_->make<TH1I>("h_HLTAcceptsvsRN", "HLT Accepts Vs Run Number", n, minRunNo_, maxRunNo_);
1183 
1184  for (itr = trigList_.begin(), itrPre = trigPreList_.begin(); itr != trigList_.end(); itr++, itrPre++) {
1185  preL1 = (itrPre->second).first;
1186  preHLT = (itrPre->second).second;
1187  edm::LogVerbatim("IsoTrack") << itr->first << " " << itr->second << " " << itrPre->first << " " << preL1 << " "
1188  << preHLT;
1189  g_Accepts->Fill(itr->first, itr->second);
1190  g_PreL1->Fill(itr->first, preL1);
1191  g_PreHLT->Fill(itr->first, preHLT);
1192  g_Pre->Fill(itr->first, preL1 * preHLT);
1193  }
1194 }
1195 
1196 void IsoTrig::beginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) {
1197  edm::LogWarning("IsoTrack") << "Run " << iRun.run() << " hltconfig.init "
1198  << hltPrescaleProvider_.init(iRun, iSetup, processName_, changed_);
1199 }
1200 
1202  t_TrkselTkFlag->clear();
1203  t_TrkqltyFlag->clear();
1204  t_TrkMissFlag->clear();
1205  t_TrkPVFlag->clear();
1206  t_TrkNuIsolFlag->clear();
1207  t_TrkhCone->clear();
1208  t_TrkP->clear();
1209 
1210  if (!trkCollection.isValid()) {
1211  edm::LogVerbatim("IsoTrack") << "trkCollection.isValid is false";
1212  } else {
1213  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1214  const MagneticField *bField = bFieldH_.product();
1215  const CaloGeometry *geo = pG_.product();
1216  std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1217  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections1, ((verbosity_ / 100) % 10 > 2));
1218  unsigned int nTracks = 0;
1219  int nRH_eMipDR = 0, nNearTRKs = 0;
1220  std::vector<bool> selFlags;
1221  for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1222  double conehmaxNearP = 0, hCone = 0, eMipDR = 0.0;
1223  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1224  if (verbosity_ % 10 > 0)
1225  edm::LogVerbatim("IsoTrack") << "track no. " << nTracks << " p(): " << pTrack->p();
1226  if (pTrack->p() > 20) {
1227  math::XYZTLorentzVector v2(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
1228  eMipDR = spr::eCone_ecal(geo,
1231  trkDetItr->pointHCAL,
1232  trkDetItr->pointECAL,
1233  a_mipR_,
1234  trkDetItr->directionECAL,
1235  nRH_eMipDR);
1236  bool selectTk = spr::goodTrack(pTrack, leadPV_, selectionParameters_, ((verbosity_ / 100) % 10 > 1));
1238  oneCutParameters.maxDxyPV = 10;
1239  oneCutParameters.maxDzPV = 100;
1240  oneCutParameters.maxInMiss = 2;
1241  oneCutParameters.maxOutMiss = 2;
1242  bool qltyFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1243  oneCutParameters = selectionParameters_;
1244  oneCutParameters.maxDxyPV = 10;
1245  oneCutParameters.maxDzPV = 100;
1246  bool qltyMissFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1247  oneCutParameters = selectionParameters_;
1248  oneCutParameters.maxInMiss = 2;
1249  oneCutParameters.maxOutMiss = 2;
1250  bool qltyPVFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1251  if ((verbosity_ / 1000) % 10 > 1)
1252  edm::LogVerbatim("IsoTrack") << "sel " << selectTk << "ntracks " << nTracks << " a_charIsoR " << a_charIsoR_
1253  << " nNearTRKs " << nNearTRKs;
1254  conehmaxNearP = spr::chargeIsolationCone(
1255  nTracks, trkCaloDirections1, a_charIsoR_, nNearTRKs, ((verbosity_ / 100) % 10 > 1));
1256  if ((verbosity_ / 1000) % 10 > 1)
1257  edm::LogVerbatim("IsoTrack") << "coneh " << conehmaxNearP << "ok " << trkDetItr->okECAL << " "
1258  << trkDetItr->okHCAL;
1259  double e1 = spr::eCone_ecal(geo,
1262  trkDetItr->pointHCAL,
1263  trkDetItr->pointECAL,
1264  a_neutR1_,
1265  trkDetItr->directionECAL,
1266  nRH_eMipDR);
1267  double e2 = spr::eCone_ecal(geo,
1270  trkDetItr->pointHCAL,
1271  trkDetItr->pointECAL,
1272  a_neutR2_,
1273  trkDetItr->directionECAL,
1274  nRH_eMipDR);
1275  double e_inCone = e2 - e1;
1276  bool chgIsolFlag = (conehmaxNearP < cutCharge_);
1277  bool mipFlag = (eMipDR < cutMip_);
1278  bool neuIsolFlag = (e_inCone < cutNeutral_);
1279  bool trkpropFlag = ((trkDetItr->okECAL) && (trkDetItr->okHCAL));
1280  selFlags.clear();
1281  selFlags.push_back(selectTk);
1282  selFlags.push_back(qltyFlag);
1283  selFlags.push_back(qltyMissFlag);
1284  selFlags.push_back(qltyPVFlag);
1285  if (verbosity_ % 10 > 0)
1286  edm::LogVerbatim("IsoTrack") << "emip: " << eMipDR << "<" << cutMip_ << "(" << mipFlag << ")"
1287  << " ; ok: " << trkDetItr->okECAL << "/" << trkDetItr->okHCAL
1288  << " ; chgiso: " << conehmaxNearP << "<" << cutCharge_ << "(" << chgIsolFlag
1289  << ")";
1290 
1291  if (chgIsolFlag && mipFlag && trkpropFlag) {
1292  double distFromHotCell = -99.0;
1293  int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1294  GlobalPoint gposHotCell(0., 0., 0.);
1295  std::vector<DetId> coneRecHitDetIds;
1296  hCone = spr::eCone_hcal(geo,
1297  hbhe_,
1298  trkDetItr->pointHCAL,
1299  trkDetItr->pointECAL,
1300  a_coneR_,
1301  trkDetItr->directionHCAL,
1302  nRecHitsCone,
1303  coneRecHitDetIds,
1304  distFromHotCell,
1305  ietaHotCell,
1306  iphiHotCell,
1307  gposHotCell,
1308  -1);
1309  // push vectors into the Tree
1310  t_TrkselTkFlag->push_back(selFlags[0]);
1311  t_TrkqltyFlag->push_back(selFlags[1]);
1312  t_TrkMissFlag->push_back(selFlags[2]);
1313  t_TrkPVFlag->push_back(selFlags[3]);
1314  t_TrkNuIsolFlag->push_back(neuIsolFlag);
1315  t_TrkhCone->push_back(hCone);
1316  t_TrkP->push_back(pTrack->p());
1317  }
1318  }
1319  }
1320  if (verbosity_ % 10 > 0)
1321  edm::LogVerbatim("IsoTrack") << "Filling " << t_TrkP->size() << " tracks in TrkRestree out of " << nTracks;
1322  }
1323  TrkResTree_->Fill();
1324 }
1325 
1326 void IsoTrig::studyTiming(const edm::Event &theEvent) {
1327  t_timeL2Prod->clear();
1328  t_nPixCand->clear();
1329  t_nPixSeed->clear();
1330 
1331  if (verbosity_ % 10 > 0) {
1332  edm::Handle<SeedingLayerSetsHits> hblayers, helayers;
1333  theEvent.getByToken(tok_SeedingLayerHB_, hblayers);
1334  theEvent.getByToken(tok_SeedingLayerHE_, helayers);
1335  const SeedingLayerSetsHits *layershb = hblayers.product();
1336  const SeedingLayerSetsHits *layershe = helayers.product();
1337  edm::LogVerbatim("IsoTrack") << "size of Seeding TripletLayers hb/he " << layershb->size() << "/"
1338  << layershe->size();
1340  theEvent.getByToken(tok_SiPixelRecHits_, rchts);
1341  const SiPixelRecHitCollection *rechits = rchts.product();
1342  edm::LogVerbatim("IsoTrack") << "size of SiPixelRechits " << rechits->size();
1343  }
1344  int nCandHB = pixelTrackRefsHB_.size(), nCandHE = pixelTrackRefsHE_.size();
1345  int nSeedHB = 0, nSeedHE = 0;
1346 
1347  if (nCandHE > 0) {
1348  edm::Handle<reco::VertexCollection> pVertHB, pVertHE;
1349  theEvent.getByToken(tok_verthb_, pVertHB);
1350  theEvent.getByToken(tok_verthe_, pVertHE);
1352  theEvent.getByToken(tok_l1cand_, l1trigobj);
1353 
1354  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1tauobjref;
1355  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1jetobjref;
1356  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1forjetobjref;
1357 
1358  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
1359  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
1360  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
1361 
1362  double ptTriggered = -10;
1363  double etaTriggered = -100;
1364  double phiTriggered = -100;
1365  for (unsigned int p = 0; p < l1tauobjref.size(); p++) {
1366  if (l1tauobjref[p]->pt() > ptTriggered) {
1367  ptTriggered = l1tauobjref[p]->pt();
1368  phiTriggered = l1tauobjref[p]->phi();
1369  etaTriggered = l1tauobjref[p]->eta();
1370  }
1371  }
1372  for (unsigned int p = 0; p < l1jetobjref.size(); p++) {
1373  if (l1jetobjref[p]->pt() > ptTriggered) {
1374  ptTriggered = l1jetobjref[p]->pt();
1375  phiTriggered = l1jetobjref[p]->phi();
1376  etaTriggered = l1jetobjref[p]->eta();
1377  }
1378  }
1379  for (unsigned int p = 0; p < l1forjetobjref.size(); p++) {
1380  if (l1forjetobjref[p]->pt() > ptTriggered) {
1381  ptTriggered = l1forjetobjref[p]->pt();
1382  phiTriggered = l1forjetobjref[p]->phi();
1383  etaTriggered = l1forjetobjref[p]->eta();
1384  }
1385  }
1386  for (unsigned iS = 0; iS < pixelTrackRefsHE_.size(); iS++) {
1387  reco::VertexCollection::const_iterator vitSel;
1388  double minDZ = 100;
1389  bool vtxMatch;
1390  for (reco::VertexCollection::const_iterator vit = pVertHE->begin(); vit != pVertHE->end(); vit++) {
1391  if (fabs(pixelTrackRefsHE_[iS]->dz(vit->position())) < minDZ) {
1392  minDZ = fabs(pixelTrackRefsHE_[iS]->dz(vit->position()));
1393  vitSel = vit;
1394  }
1395  }
1396  //cut on dYX:
1397  if ((fabs(pixelTrackRefsHE_[iS]->dxy(vitSel->position())) < vtxCutSeed_) || (minDZ == 100))
1398  vtxMatch = true;
1399 
1400  //select tracks not matched to triggered L1 jet
1401  double R = deltaR(etaTriggered, phiTriggered, pixelTrackRefsHE_[iS]->eta(), pixelTrackRefsHE_[iS]->phi());
1402  if (R > tauUnbiasCone_ && vtxMatch)
1403  nSeedHE++;
1404  }
1405  for (unsigned iS = 0; iS < pixelTrackRefsHB_.size(); iS++) {
1406  reco::VertexCollection::const_iterator vitSel;
1407  double minDZ = 100;
1408  bool vtxMatch(false);
1409  for (reco::VertexCollection::const_iterator vit = pVertHB->begin(); vit != pVertHB->end(); vit++) {
1410  if (fabs(pixelTrackRefsHB_[iS]->dz(vit->position())) < minDZ) {
1411  minDZ = fabs(pixelTrackRefsHB_[iS]->dz(vit->position()));
1412  vitSel = vit;
1413  }
1414  }
1415  //cut on dYX:
1416  if ((fabs(pixelTrackRefsHB_[iS]->dxy(vitSel->position())) < 101.0) || (minDZ == 100))
1417  vtxMatch = true;
1418 
1419  //select tracks not matched to triggered L1 jet
1420  double R = deltaR(etaTriggered, phiTriggered, pixelTrackRefsHB_[iS]->eta(), pixelTrackRefsHB_[iS]->phi());
1421  if (R > 1.2 && vtxMatch)
1422  nSeedHB++;
1423  }
1424 
1425  if (verbosity_ % 10 > 0) {
1426  edm::LogVerbatim("IsoTrack") << "(HB/HE) nCand: " << nCandHB << "/" << nCandHE << "nSeed: " << nSeedHB << "/"
1427  << nSeedHE;
1428  }
1429  }
1430  t_nPixSeed->push_back(nSeedHB);
1431  t_nPixSeed->push_back(nSeedHE);
1432  t_nPixCand->push_back(nCandHB);
1433  t_nPixCand->push_back(nCandHE);
1434 
1435  TimingTree_->Fill();
1436 }
1440  if (verbosity_ % 10 > 0)
1441  edm::LogVerbatim("IsoTrack") << "inside studymipcut";
1442  if (!trkCollection.isValid()) {
1443  edm::LogWarning("IsoTrack") << "trkCollection.isValid is false";
1444  } else {
1445  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1446  const MagneticField *bField = bFieldH_.product();
1447  const CaloGeometry *geo = pG_.product();
1448  std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1449  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections1, ((verbosity_ / 100) % 10 > 2));
1450  if (verbosity_ % 10 > 0)
1451  edm::LogVerbatim("IsoTrack") << "Number of L2cands:" << L2cands->size() << " to be matched to something out of "
1452  << trkCaloDirections1.size() << " reco tracks";
1453  for (unsigned int i = 0; i < L2cands->size(); i++) {
1456  double enIn = candref->energyIn();
1457  h_EnIn->Fill(candref->energyIn());
1458  h_EnOut->Fill(candref->energyOut());
1460  candref->track()->px(), candref->track()->py(), candref->track()->pz(), candref->track()->p());
1461  if (verbosity_ % 10 > 1)
1462  edm::LogVerbatim("IsoTrack") << "HLT Level Candidate eta/phi/pt/enIn:" << candref->track()->eta() << "/"
1463  << candref->track()->phi() << "/" << candref->track()->pt() << "/"
1464  << candref->energyIn();
1465  math::XYZTLorentzVector mindRvec;
1466  double mindR = 999.9, mindP1 = 999.9, eMipDR = 0.0;
1467  std::vector<bool> selFlags;
1468  unsigned int nTracks = 0;
1469  double conehmaxNearP = 0, hCone = 0;
1470  for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1471  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1472  math::XYZTLorentzVector v2(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
1473  double dr = dR(v1, v2);
1474  double dp1 = std::abs(1. / v1.r() - 1. / v2.r());
1475  if (verbosity_ % 1000 > 0)
1476  edm::LogVerbatim("IsoTrack") << "This recotrack(eta/phi/pt) " << pTrack->eta() << "/" << pTrack->phi() << "/"
1477  << pTrack->pt() << " has dr/dp= " << dr << "/" << dp1;
1478  if (dr < mindR) {
1479  mindR = dr;
1480  mindP1 = dp1;
1481  mindRvec = v2;
1482  int nRH_eMipDR = 0, nNearTRKs = 0;
1483  eMipDR = spr::eCone_ecal(geo,
1486  trkDetItr->pointHCAL,
1487  trkDetItr->pointECAL,
1488  a_mipR_,
1489  trkDetItr->directionECAL,
1490  nRH_eMipDR);
1491  bool selectTk = spr::goodTrack(pTrack, leadPV_, selectionParameters_, ((verbosity_ / 100) % 10 > 1));
1493  oneCutParameters.maxDxyPV = 10;
1494  oneCutParameters.maxDzPV = 100;
1495  oneCutParameters.maxInMiss = 2;
1496  oneCutParameters.maxOutMiss = 2;
1497  bool qltyFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1498  oneCutParameters = selectionParameters_;
1499  oneCutParameters.maxDxyPV = 10;
1500  oneCutParameters.maxDzPV = 100;
1501  bool qltyMissFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1502  oneCutParameters = selectionParameters_;
1503  oneCutParameters.maxInMiss = 2;
1504  oneCutParameters.maxOutMiss = 2;
1505  bool qltyPVFlag = spr::goodTrack(pTrack, leadPV_, oneCutParameters, ((verbosity_ / 100) % 10 > 1));
1506  conehmaxNearP = spr::chargeIsolationCone(
1507  nTracks, trkCaloDirections1, a_charIsoR_, nNearTRKs, ((verbosity_ / 100) % 10 > 1));
1508  double e1 = spr::eCone_ecal(geo,
1511  trkDetItr->pointHCAL,
1512  trkDetItr->pointECAL,
1513  a_neutR1_,
1514  trkDetItr->directionECAL,
1515  nRH_eMipDR);
1516  double e2 = spr::eCone_ecal(geo,
1519  trkDetItr->pointHCAL,
1520  trkDetItr->pointECAL,
1521  a_neutR2_,
1522  trkDetItr->directionECAL,
1523  nRH_eMipDR);
1524  double e_inCone = e2 - e1;
1525  bool chgIsolFlag = (conehmaxNearP < cutCharge_);
1526  bool mipFlag = (eMipDR < cutMip_);
1527  bool neuIsolFlag = (e_inCone < cutNeutral_);
1528  bool trkpropFlag = ((trkDetItr->okECAL) && (trkDetItr->okHCAL));
1529  selFlags.clear();
1530  selFlags.push_back(selectTk);
1531  selFlags.push_back(qltyFlag);
1532  selFlags.push_back(qltyMissFlag);
1533  selFlags.push_back(qltyPVFlag);
1534  selFlags.push_back(trkpropFlag);
1535  selFlags.push_back(chgIsolFlag);
1536  selFlags.push_back(neuIsolFlag);
1537  selFlags.push_back(mipFlag);
1538  double distFromHotCell = -99.0;
1539  int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1540  GlobalPoint gposHotCell(0., 0., 0.);
1541  std::vector<DetId> coneRecHitDetIds;
1542  hCone = spr::eCone_hcal(geo,
1543  hbhe_,
1544  trkDetItr->pointHCAL,
1545  trkDetItr->pointECAL,
1546  a_coneR_,
1547  trkDetItr->directionHCAL,
1548  nRecHitsCone,
1549  coneRecHitDetIds,
1550  distFromHotCell,
1551  ietaHotCell,
1552  iphiHotCell,
1553  gposHotCell,
1554  -1);
1555  }
1556  }
1557  pushMipCutTreeVecs(v1, mindRvec, enIn, eMipDR, mindR, mindP1, selFlags, hCone);
1558  fillDifferences(6, v1, mindRvec, (verbosity_ % 10 > 0));
1559  if (mindR >= 0.05) {
1560  fillDifferences(8, v1, mindRvec, (verbosity_ % 10 > 0));
1561  h_MipEnNoMatch->Fill(candref->energyIn(), eMipDR);
1562  } else {
1563  fillDifferences(7, v1, mindRvec, (verbosity_ % 10 > 0));
1564  h_MipEnMatch->Fill(candref->energyIn(), eMipDR);
1565  }
1566  }
1567  }
1568  MipCutTree_->Fill();
1569 }
1570 
1572  std::vector<reco::TrackCollection::const_iterator> &goodTks) {
1573  if (verbosity_ % 10 > 0)
1574  edm::LogVerbatim("IsoTrack") << "Inside StudyTrigger";
1576  for (int j = 0; j < 3; j++) {
1577  for (unsigned int k = 0; k < vec_[j].size(); k++) {
1578  if (verbosity_ % 10 > 0)
1579  edm::LogVerbatim("IsoTrack") << "vec[" << j << "][" << k << "] pt " << vec_[j][k].pt() << " eta "
1580  << vec_[j][k].eta() << " phi " << vec_[j][k].phi();
1581  fillHist(j, vec_[j][k]);
1582  }
1583  }
1584 
1585  double deta, dphi, dr;
1587  for (int lvl = 1; lvl < 3; lvl++) {
1588  for (unsigned int i = 0; i < vec_[lvl].size(); i++) {
1589  deta = dEta(vec_[0][0], vec_[lvl][i]);
1590  dphi = dPhi(vec_[0][0], vec_[lvl][i]);
1591  dr = dR(vec_[0][0], vec_[lvl][i]);
1592  if (verbosity_ % 10 > 1)
1593  edm::LogVerbatim("IsoTrack") << "lvl " << lvl << " i " << i << " deta " << deta << " dphi " << dphi << " dR "
1594  << dr;
1595  h_dEtaL1[lvl - 1]->Fill(deta);
1596  h_dPhiL1[lvl - 1]->Fill(dphi);
1597  h_dRL1[lvl - 1]->Fill(std::sqrt(dr));
1598  }
1599  }
1600 
1601  math::XYZTLorentzVector mindRvec;
1602  double mindR;
1603  for (unsigned int k = 0; k < vec_[2].size(); ++k) {
1605  mindR = 999.9;
1606  if (verbosity_ % 10 > 1)
1607  edm::LogVerbatim("IsoTrack") << "L3obj: pt " << vec_[2][k].pt() << " eta " << vec_[2][k].eta() << " phi "
1608  << vec_[2][k].phi();
1609  for (unsigned int j = 0; j < vec_[1].size(); j++) {
1610  dr = dR(vec_[2][k], vec_[1][j]);
1611  if (dr < mindR) {
1612  mindR = dr;
1613  mindRvec = vec_[1][j];
1614  }
1615  }
1616  fillDifferences(0, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1617  if (mindR < 0.03) {
1618  fillDifferences(1, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1619  fillHist(6, mindRvec);
1620  fillHist(8, vec_[2][k]);
1621  } else {
1622  fillDifferences(2, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1623  fillHist(7, mindRvec);
1624  fillHist(9, vec_[2][k]);
1625  }
1626 
1628  mindR = 999.9;
1629  if (verbosity_ % 10 > 0)
1630  edm::LogVerbatim("IsoTrack") << "Now Matching L3 track with reco: L3 Track (eta, phi) " << vec_[2][k].eta() << ":"
1631  << vec_[2][k].phi() << " L2 Track " << mindRvec.eta() << ":" << mindRvec.phi()
1632  << " dR " << mindR;
1633  reco::TrackCollection::const_iterator goodTk = trkCollection->end();
1634  if (trkCollection.isValid()) {
1635  double mindP(9999.9);
1636  reco::TrackCollection::const_iterator trkItr;
1637  for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++) {
1638  math::XYZTLorentzVector v4(trkItr->px(), trkItr->py(), trkItr->pz(), trkItr->p());
1639  double deltaR = dR(v4, vec_[2][k]);
1640  double dp = std::abs(v4.r() / vec_[2][k].r() - 1.0);
1641  if (deltaR < mindR) {
1642  mindR = deltaR;
1643  mindP = dp;
1644  mindRvec = v4;
1645  goodTk = trkItr;
1646  }
1647  if ((verbosity_ / 10) % 10 > 1 && deltaR < 1.0)
1648  edm::LogVerbatim("IsoTrack") << "reco track: pt " << v4.pt() << " eta " << v4.eta() << " phi " << v4.phi()
1649  << " DR " << deltaR;
1650  }
1651  if (verbosity_ % 10 > 0)
1652  edm::LogVerbatim("IsoTrack") << "Now Matching at Reco level in step 1 DR: " << mindR << ":" << mindP
1653  << " eta:phi " << mindRvec.eta() << ":" << mindRvec.phi();
1654  if (mindR < 0.03 && mindP > 0.1) {
1655  for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++) {
1656  math::XYZTLorentzVector v4(trkItr->px(), trkItr->py(), trkItr->pz(), trkItr->p());
1657  double deltaR = dR(v4, vec_[2][k]);
1658  double dp = std::abs(v4.r() / vec_[2][k].r() - 1.0);
1659  if (dp < mindP && deltaR < 0.03) {
1660  mindR = deltaR;
1661  mindP = dp;
1662  mindRvec = v4;
1663  goodTk = trkItr;
1664  }
1665  }
1666  if (verbosity_ % 10 > 0)
1667  edm::LogVerbatim("IsoTrack") << "Now Matching at Reco level in step 2 DR: " << mindR << ":" << mindP
1668  << " eta:phi " << mindRvec.eta() << ":" << mindRvec.phi();
1669  }
1670  fillDifferences(3, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1671  fillHist(3, mindRvec);
1672  if (mindR < 0.03) {
1673  fillDifferences(4, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1674  fillHist(4, mindRvec);
1675  } else {
1676  fillDifferences(5, vec_[2][k], mindRvec, (verbosity_ % 10 > 0));
1677  fillHist(5, mindRvec);
1678  }
1679  if (goodTk != trkCollection->end())
1680  goodTks.push_back(goodTk);
1681  }
1682  }
1683 }
1684 
1686  std::vector<reco::TrackCollection::const_iterator> &goodTks) {
1687  if (trkCollection.isValid()) {
1688  // get handles to calogeometry and calotopology
1689  const CaloGeometry *geo = pG_.product();
1690  const MagneticField *bField = bFieldH_.product();
1691  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
1692  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections, ((verbosity_ / 100) % 10 > 2));
1693 
1694  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1695  if ((verbosity_ / 1000) % 10 > 1) {
1696  edm::LogVerbatim("IsoTrack") << "n of barrelRecHitsHandle " << barrelRecHitsHandle_->size();
1698  ++hit) {
1699  edm::LogVerbatim("IsoTrack") << "hit : detid(ieta,iphi) " << (EBDetId)(hit->id()) << " time " << hit->time()
1700  << " energy " << hit->energy();
1701  }
1702  edm::LogVerbatim("IsoTrack") << "n of endcapRecHitsHandle " << endcapRecHitsHandle_->size();
1704  ++hit) {
1705  edm::LogVerbatim("IsoTrack") << "hit : detid(ieta,iphi) " << (EEDetId)(hit->id()) << " time " << hit->time()
1706  << " energy " << hit->energy();
1707  }
1708  edm::LogVerbatim("IsoTrack") << "n of hbhe " << hbhe_->size();
1709  for (HBHERecHitCollection::const_iterator hit = hbhe_->begin(); hit != hbhe_->end(); ++hit) {
1710  edm::LogVerbatim("IsoTrack") << "hit : detid(ieta,iphi) " << hit->id() << " time " << hit->time() << " energy "
1711  << hit->energy();
1712  }
1713  }
1714  unsigned int nTracks = 0, ngoodTk = 0, nselTk = 0;
1715  int ieta = 999;
1716  for (trkDetItr = trkCaloDirections.begin(); trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) {
1717  bool l3Track = (std::find(goodTks.begin(), goodTks.end(), trkDetItr->trkItr) != goodTks.end());
1718  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1719  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
1720  bool selectTk = spr::goodTrack(pTrack, leadPV_, selectionParameters_, ((verbosity_ / 100) % 10 > 1));
1721  double eMipDR = 9999., e_inCone = 0, conehmaxNearP = 0, mindR = 999.9, hCone = 0;
1722  if (trkDetItr->okHCAL) {
1723  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
1724  ieta = detId.ieta();
1725  }
1726  for (unsigned k = 0; k < vec_[0].size(); ++k) {
1727  double deltaR = dR(v4, vec_[0][k]);
1728  if (deltaR < mindR)
1729  mindR = deltaR;
1730  }
1731  if ((verbosity_ / 100) % 10 > 1)
1732  edm::LogVerbatim("IsoTrack") << "Track ECAL " << trkDetItr->okECAL << " HCAL " << trkDetItr->okHCAL << " Flag "
1733  << selectTk;
1734  if (selectTk && trkDetItr->okECAL && trkDetItr->okHCAL) {
1735  ngoodTk++;
1736  int nRH_eMipDR = 0, nNearTRKs = 0;
1737  double e1 = spr::eCone_ecal(geo,
1740  trkDetItr->pointHCAL,
1741  trkDetItr->pointECAL,
1742  a_neutR1_,
1743  trkDetItr->directionECAL,
1744  nRH_eMipDR);
1745  double e2 = spr::eCone_ecal(geo,
1748  trkDetItr->pointHCAL,
1749  trkDetItr->pointECAL,
1750  a_neutR2_,
1751  trkDetItr->directionECAL,
1752  nRH_eMipDR);
1753  eMipDR = spr::eCone_ecal(geo,
1756  trkDetItr->pointHCAL,
1757  trkDetItr->pointECAL,
1758  a_mipR_,
1759  trkDetItr->directionECAL,
1760  nRH_eMipDR);
1761  conehmaxNearP =
1762  spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR_, nNearTRKs, ((verbosity_ / 100) % 10 > 1));
1763  e_inCone = e2 - e1;
1764  double distFromHotCell = -99.0;
1765  int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1766  GlobalPoint gposHotCell(0., 0., 0.);
1767  std::vector<DetId> coneRecHitDetIds;
1768  hCone = spr::eCone_hcal(geo,
1769  hbhe_,
1770  trkDetItr->pointHCAL,
1771  trkDetItr->pointECAL,
1772  a_coneR_,
1773  trkDetItr->directionHCAL,
1774  nRecHitsCone,
1775  coneRecHitDetIds,
1776  distFromHotCell,
1777  ietaHotCell,
1778  iphiHotCell,
1779  gposHotCell,
1780  -1);
1781  if (eMipDR < 1.0)
1782  nselTk++;
1783  }
1784  if (l3Track) {
1785  fillHist(10, v4);
1786  if (selectTk) {
1787  fillHist(11, v4);
1788  fillCuts(0, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR > dr_L1_));
1789  if (conehmaxNearP < cutCharge_) {
1790  fillHist(12, v4);
1791  if (eMipDR < cutMip_) {
1792  fillHist(13, v4);
1793  fillEnergy(1, ieta, hCone, eMipDR, v4);
1794  fillEnergy(0, ieta, hCone, eMipDR, v4);
1795  if (e_inCone < cutNeutral_) {
1796  fillHist(14, v4);
1797  fillEnergy(4, ieta, hCone, eMipDR, v4);
1798  fillEnergy(3, ieta, hCone, eMipDR, v4);
1799  }
1800  }
1801  }
1802  }
1803  } else if (doL2L3_) {
1804  fillHist(15, v4);
1805  if (selectTk) {
1806  fillHist(16, v4);
1807  fillCuts(1, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR > dr_L1_));
1808  if (conehmaxNearP < cutCharge_) {
1809  fillHist(17, v4);
1810  if (eMipDR < cutMip_) {
1811  fillHist(18, v4);
1812  fillEnergy(2, ieta, hCone, eMipDR, v4);
1813  fillEnergy(0, ieta, hCone, eMipDR, v4);
1814  if (e_inCone < cutNeutral_) {
1815  fillHist(19, v4);
1816  fillEnergy(5, ieta, hCone, eMipDR, v4);
1817  fillEnergy(3, ieta, hCone, eMipDR, v4);
1818  }
1819  }
1820  }
1821  }
1822  }
1823  }
1824  // edm::LogVerbatim("IsoTrack") << "Number of tracks selected offline " << nselTk;
1825  }
1826 }
1827 
1828 void IsoTrig::chgIsolation(double &etaTriggered,
1829  double &phiTriggered,
1830  edm::Handle<reco::TrackCollection> &trkCollection,
1831  const edm::Event &theEvent) {
1833  if (verbosity_ % 10 > 0)
1834  edm::LogVerbatim("IsoTrack") << "Inside chgIsolation() with eta/phi Triggered: " << etaTriggered << "/"
1835  << phiTriggered;
1836  std::vector<double> maxP;
1837 
1838  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1839  const MagneticField *bField = bFieldH_.product();
1840  const CaloGeometry *geo = pG_.product();
1841  std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1842  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections1, ((verbosity_ / 100) % 10 > 2));
1843  if (verbosity_ % 10 > 0)
1844  edm::LogVerbatim("IsoTrack") << "Propagated TrkCollection";
1845  for (unsigned int k = 0; k < pixelIsolationConeSizeAtEC_.size(); ++k)
1846  maxP.push_back(0);
1847  unsigned i = pixelTrackRefsHE_.size();
1848  std::vector<std::pair<unsigned int, std::pair<double, double>>> VecSeedsatEC;
1849  //loop to select isolated tracks
1850  for (unsigned iS = 0; iS < pixelTrackRefsHE_.size(); iS++) {
1851  if (pixelTrackRefsHE_[iS]->p() > minPTrackValue_) {
1852  bool vtxMatch = false;
1853  //associate to vertex (in Z)
1854  unsigned int ivSel = recVtxs_->size();
1855  double minDZ = 100;
1856  for (unsigned int iv = 0; iv < recVtxs_->size(); ++iv) {
1857  if (fabs(pixelTrackRefsHE_[iS]->dz((*recVtxs_)[iv].position())) < minDZ) {
1858  minDZ = fabs(pixelTrackRefsHE_[iS]->dz((*recVtxs_)[iv].position()));
1859  ivSel = iv;
1860  }
1861  }
1862  //cut on dYX:
1863  if (ivSel == recVtxs_->size()) {
1864  vtxMatch = true;
1865  } else if (fabs(pixelTrackRefsHE_[iS]->dxy((*recVtxs_)[ivSel].position())) < vtxCutSeed_) {
1866  vtxMatch = true;
1867  }
1868  //select tracks not matched to triggered L1 jet
1869  double R = deltaR(etaTriggered, phiTriggered, pixelTrackRefsHE_[iS]->eta(), pixelTrackRefsHE_[iS]->phi());
1870  if (R > tauUnbiasCone_ && vtxMatch) {
1871  //propagate seed track to ECAL surface:
1872  std::pair<double, double> seedCooAtEC;
1873  // in case vertex is found:
1874  if (minDZ != 100)
1875  seedCooAtEC = GetEtaPhiAtEcal(pixelTrackRefsHE_[iS]->eta(),
1876  pixelTrackRefsHE_[iS]->phi(),
1877  pixelTrackRefsHE_[iS]->pt(),
1878  pixelTrackRefsHE_[iS]->charge(),
1879  (*recVtxs_)[ivSel].z());
1880  //in case vertex is not found:
1881  else
1882  seedCooAtEC = GetEtaPhiAtEcal(pixelTrackRefsHE_[iS]->eta(),
1883  pixelTrackRefsHE_[iS]->phi(),
1884  pixelTrackRefsHE_[iS]->pt(),
1885  pixelTrackRefsHE_[iS]->charge(),
1886  0);
1887  VecSeedsatEC.push_back(std::make_pair(iS, seedCooAtEC));
1888  }
1889  }
1890  }
1891  for (unsigned int l = 0; l < VecSeedsatEC.size(); l++) {
1892  unsigned int iSeed = VecSeedsatEC[l].first;
1894  pixelTrackRefsHE_[iSeed]->py(),
1895  pixelTrackRefsHE_[iSeed]->pz(),
1896  pixelTrackRefsHE_[iSeed]->p());
1897 
1898  for (unsigned int j = 0; j < VecSeedsatEC.size(); j++) {
1899  unsigned int iSurr = VecSeedsatEC[j].first;
1900  if (iSeed != iSurr) {
1901  //define preliminary cone around seed track impact point from which tracks will be extrapolated:
1902  // edm::Ref<reco::IsolatedPixelTrackCandidateCollection> cand2ref =
1903  // edm::Ref<reco::IsolatedPixelTrackCandidateCollection>(L2cands, iSurr);
1904  if (deltaR(pixelTrackRefsHE_[iSeed]->eta(),
1905  pixelTrackRefsHE_[iSeed]->phi(),
1906  pixelTrackRefsHE_[iSurr]->eta(),
1907  pixelTrackRefsHE_[iSurr]->phi()) < prelimCone_) {
1908  unsigned int ivSel = recVtxs_->size();
1909  double minDZ2 = 100;
1910  for (unsigned int iv = 0; iv < recVtxs_->size(); ++iv) {
1911  if (fabs(pixelTrackRefsHE_[iSurr]->dz((*recVtxs_)[iv].position())) < minDZ2) {
1912  minDZ2 = fabs(pixelTrackRefsHE_[iSurr]->dz((*recVtxs_)[iv].position()));
1913  ivSel = iv;
1914  }
1915  }
1916  //cut ot dXY:
1917  if (minDZ2 == 100 || fabs(pixelTrackRefsHE_[iSurr]->dxy((*recVtxs_)[ivSel].position())) < vtxCutIsol_) {
1918  //calculate distance at ECAL surface and update isolation:
1919  double dist = getDistInCM(VecSeedsatEC[i].second.first,
1920  VecSeedsatEC[i].second.second,
1921  VecSeedsatEC[j].second.first,
1922  VecSeedsatEC[j].second.second);
1923  for (unsigned int k = 0; k < pixelIsolationConeSizeAtEC_.size(); ++k) {
1924  if (dist < pixelIsolationConeSizeAtEC_[k]) {
1925  if (pixelTrackRefsHE_[iSurr]->p() > maxP[k])
1926  maxP[k] = pixelTrackRefsHE_[iSurr]->p();
1927  }
1928  }
1929  }
1930  }
1931  }
1932  }
1933 
1934  double conehmaxNearP = -1;
1935  bool selectTk = false;
1936  double mindR = 999.9;
1937  int nTracks = 0;
1938  math::XYZTLorentzVector mindRvec;
1939  for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1940  int nNearTRKs = 0;
1941  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1942  math::XYZTLorentzVector v2(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
1943  double dr = dR(v1, v2);
1944  if (dr < mindR) {
1945  selectTk = spr::goodTrack(pTrack, leadPV_, selectionParameters_, ((verbosity_ / 100) % 10 > 1));
1946  conehmaxNearP = spr::chargeIsolationCone(
1947  nTracks, trkCaloDirections1, a_charIsoR_, nNearTRKs, ((verbosity_ / 100) % 10 > 1));
1948  mindR = dr;
1949  mindRvec = v2;
1950  }
1951  }
1952  pushChgIsolnTreeVecs(v1, mindRvec, maxP, conehmaxNearP, selectTk);
1953  }
1954  ChgIsolnTree_->Fill();
1955 }
1956 
1958  t_nGoodTk->clear();
1959  std::vector<int> nGood(4, 0);
1960  if (trkCollection.isValid()) {
1961  // get handles to calogeometry and calotopology
1962  const CaloGeometry *geo = pG_.product();
1963  const MagneticField *bField = bFieldH_.product();
1964  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
1965  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections, ((verbosity_ / 100) % 10 > 2));
1966 
1967  // get the trigger jet
1969  iEvent.getByToken(tok_l1cand_, l1trigobj);
1970 
1971  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1tauobjref;
1972  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
1973  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1jetobjref;
1974  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
1975  std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1forjetobjref;
1976  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
1977 
1978  double ptTriggered(-10), etaTriggered(-100), phiTriggered(-100);
1979  for (unsigned int p = 0; p < l1tauobjref.size(); p++) {
1980  if (l1tauobjref[p]->pt() > ptTriggered) {
1981  ptTriggered = l1tauobjref[p]->pt();
1982  phiTriggered = l1tauobjref[p]->phi();
1983  etaTriggered = l1tauobjref[p]->eta();
1984  }
1985  }
1986  for (unsigned int p = 0; p < l1jetobjref.size(); p++) {
1987  if (l1jetobjref[p]->pt() > ptTriggered) {
1988  ptTriggered = l1jetobjref[p]->pt();
1989  phiTriggered = l1jetobjref[p]->phi();
1990  etaTriggered = l1jetobjref[p]->eta();
1991  }
1992  }
1993  for (unsigned int p = 0; p < l1forjetobjref.size(); p++) {
1994  if (l1forjetobjref[p]->pt() > ptTriggered) {
1995  ptTriggered = l1forjetobjref[p]->pt();
1996  phiTriggered = l1forjetobjref[p]->phi();
1997  etaTriggered = l1forjetobjref[p]->eta();
1998  }
1999  }
2000  double pTriggered = ptTriggered * cosh(etaTriggered);
2001  math::XYZTLorentzVector pTrigger(
2002  ptTriggered * cos(phiTriggered), ptTriggered * sin(phiTriggered), pTriggered * tanh(etaTriggered), pTriggered);
2003 
2004  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
2005  unsigned int nTracks(0);
2006  for (trkDetItr = trkCaloDirections.begin(); trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) {
2007  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
2008  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
2009  bool selectTk = spr::goodTrack(pTrack, leadPV_, selectionParameters_, ((verbosity_ / 100) % 10 > 1));
2010  double mindR = dR(v4, pTrigger);
2011  if ((verbosity_ / 100) % 10 > 1)
2012  edm::LogVerbatim("IsoTrack") << "Track ECAL " << trkDetItr->okECAL << " HCAL " << trkDetItr->okHCAL << " Flag "
2013  << selectTk;
2014  if (selectTk && trkDetItr->okECAL && trkDetItr->okHCAL && mindR > 1.0) {
2015  int nRH_eMipDR(0), nNearTRKs(0);
2016  double eMipDR = spr::eCone_ecal(geo,
2019  trkDetItr->pointHCAL,
2020  trkDetItr->pointECAL,
2021  a_mipR_,
2022  trkDetItr->directionECAL,
2023  nRH_eMipDR);
2024  double conehmaxNearP =
2025  spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR_, nNearTRKs, ((verbosity_ / 100) % 10 > 1));
2026  if (conehmaxNearP < 2.0 && eMipDR < 1.0) {
2027  if (pTrack->p() >= 20 && pTrack->p() < 30) {
2028  ++nGood[0];
2029  } else if (pTrack->p() >= 30 && pTrack->p() < 40) {
2030  ++nGood[1];
2031  } else if (pTrack->p() >= 40 && pTrack->p() < 60) {
2032  ++nGood[2];
2033  } else if (pTrack->p() >= 60 && pTrack->p() < 100) {
2034  ++nGood[3];
2035  }
2036  }
2037  }
2038  }
2039  }
2040 
2041  for (unsigned int ii = 0; ii < nGood.size(); ++ii)
2042  t_nGoodTk->push_back(nGood[ii]);
2043 }
2044 
2046  h_p[indx]->Fill(vec.r());
2047  h_pt[indx]->Fill(vec.pt());
2048  h_eta[indx]->Fill(vec.eta());
2049  h_phi[indx]->Fill(vec.phi());
2050 }
2051 
2053  double dr = dR(vec1, vec2);
2054  double deta = dEta(vec1, vec2);
2055  double dphi = dPhi(vec1, vec2);
2056  double dpt = dPt(vec1, vec2);
2057  double dp = dP(vec1, vec2);
2058  double dinvpt = dinvPt(vec1, vec2);
2059  h_dEta[indx]->Fill(deta);
2060  h_dPhi[indx]->Fill(dphi);
2061  h_dPt[indx]->Fill(dpt);
2062  h_dP[indx]->Fill(dp);
2063  h_dinvPt[indx]->Fill(dinvpt);
2064  h_mindR[indx]->Fill(dr);
2065  if (debug)
2066  edm::LogVerbatim("IsoTrack") << "mindR for index " << indx << " is " << dr << " deta " << deta << " dphi " << dphi
2067  << " dpt " << dpt << " dinvpt " << dinvpt;
2068 }
2069 
2071  int indx, double eMipDR, double conehmaxNearP, double e_inCone, math::XYZTLorentzVector &vec, int ieta, bool cut) {
2072  h_eMip[indx]->Fill(eMipDR);
2073  h_eMaxNearP[indx]->Fill(conehmaxNearP);
2074  h_eNeutIso[indx]->Fill(e_inCone);
2075  if ((conehmaxNearP < cutCharge_) && (eMipDR < cutMip_)) {
2076  for (int lim = 0; lim < 5; ++lim) {
2077  if ((vec.r() > pLimits_[lim]) && (vec.r() <= pLimits_[lim + 1])) {
2078  h_etaMipTracks[lim][indx][0]->Fill((double)(ieta));
2079  if (cut)
2080  h_etaMipTracks[lim][indx][1]->Fill((double)(ieta));
2081  if (e_inCone < cutNeutral_) {
2082  h_etaCalibTracks[lim][indx][0]->Fill((double)(ieta));
2083  if (cut)
2084  h_etaCalibTracks[lim][indx][1]->Fill((double)(ieta));
2085  }
2086  }
2087  }
2088  }
2089 }
2090 
2091 void IsoTrig::fillEnergy(int indx, int ieta, double hCone, double eMipDR, math::XYZTLorentzVector &vec) {
2092  int kk(-1);
2093  if (ieta > 0 && ieta < 25)
2094  kk = 23 + ieta;
2095  else if (ieta > -25 && ieta < 0)
2096  kk = -(ieta + 1);
2097  if (kk >= 0 && eMipDR > 0.01 && hCone > 1.0) {
2098  for (int lim = 0; lim < 5; ++lim) {
2099  if ((vec.r() > pLimits_[lim]) && (vec.r() <= pLimits_[lim + 1])) {
2100  h_eHcal[lim][indx][kk]->Fill(hCone);
2101  h_eCalo[lim][indx][kk]->Fill(hCone + eMipDR);
2102  }
2103  }
2104  }
2105 }
2106 
2108 
2110  double phi1 = vec1.phi();
2111  if (phi1 < 0)
2112  phi1 += 2.0 * M_PI;
2113  double phi2 = vec2.phi();
2114  if (phi2 < 0)
2115  phi2 += 2.0 * M_PI;
2116  double dphi = phi1 - phi2;
2117  if (dphi > M_PI)
2118  dphi -= 2. * M_PI;
2119  else if (dphi < -M_PI)
2120  dphi += 2. * M_PI;
2121  return dphi;
2122 }
2123 
2125  double deta = dEta(vec1, vec2);
2126  double dphi = dPhi(vec1, vec2);
2127  return std::sqrt(deta * deta + dphi * dphi);
2128 }
2129 
2131 
2133  return (std::abs(vec1.r() - vec2.r()));
2134 }
2135 
2137  return ((1 / vec1.pt()) - (1 / vec2.pt()));
2138 }
2139 
2140 std::pair<double, double> IsoTrig::etaPhiTrigger() {
2141  double eta(0), phi(0), ptmax(0);
2142  for (unsigned int k = 0; k < vec_[0].size(); ++k) {
2143  if (k == 0) {
2144  eta = vec_[0][k].eta();
2145  phi = vec_[0][k].phi();
2146  ptmax = vec_[0][k].pt();
2147  } else if (vec_[0][k].pt() > ptmax) {
2148  eta = vec_[0][k].eta();
2149  phi = vec_[0][k].phi();
2150  ptmax = vec_[0][k].pt();
2151  }
2152  }
2153  return std::pair<double, double>(eta, phi);
2154 }
2155 
2156 std::pair<double, double> IsoTrig::GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ) {
2157  double deltaPhi = 0;
2158  double etaEC = 100;
2159  double phiEC = 100;
2160 
2161  double Rcurv = 9999999;
2162  if (bfVal_ != 0)
2163  Rcurv = pT * 33.3 * 100 / (bfVal_ * 10); //r(m)=pT(GeV)*33.3/B(kG)
2164 
2165  double ecDist = zEE_;
2166  double ecRad = rEB_; //radius of ECAL barrel (cm)
2167  double theta = 2 * atan(exp(-etaIP));
2168  double zNew = 0;
2169  if (theta > 0.5 * M_PI)
2170  theta = M_PI - theta;
2171  if (fabs(etaIP) < 1.479) {
2172  if ((0.5 * ecRad / Rcurv) > 1) {
2173  etaEC = 10000;
2174  deltaPhi = 0;
2175  } else {
2176  deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
2177  double alpha1 = 2 * asin(0.5 * ecRad / Rcurv);
2178  double z = ecRad / tan(theta);
2179  if (etaIP > 0)
2180  zNew = z * (Rcurv * alpha1) / ecRad + vtxZ; //new z-coordinate of track
2181  else
2182  zNew = -z * (Rcurv * alpha1) / ecRad + vtxZ; //new z-coordinate of track
2183  double zAbs = fabs(zNew);
2184  if (zAbs < ecDist) {
2185  etaEC = -log(tan(0.5 * atan(ecRad / zAbs)));
2186  deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
2187  }
2188  if (zAbs > ecDist) {
2189  zAbs = (fabs(etaIP) / etaIP) * ecDist;
2190  double Zflight = fabs(zAbs - vtxZ);
2191  double alpha = (Zflight * ecRad) / (z * Rcurv);
2192  double Rec = 2 * Rcurv * sin(alpha / 2);
2193  deltaPhi = -charge * alpha / 2;
2194  etaEC = -log(tan(0.5 * atan(Rec / ecDist)));
2195  }
2196  }
2197  } else {
2198  zNew = (fabs(etaIP) / etaIP) * ecDist;
2199  double Zflight = fabs(zNew - vtxZ);
2200  double Rvirt = fabs(Zflight * tan(theta));
2201  double Rec = 2 * Rcurv * sin(Rvirt / (2 * Rcurv));
2202  deltaPhi = -(charge) * (Rvirt / (2 * Rcurv));
2203  etaEC = -log(tan(0.5 * atan(Rec / ecDist)));
2204  }
2205 
2206  if (zNew < 0)
2207  etaEC = -etaEC;
2208  phiEC = phiIP + deltaPhi;
2209 
2210  if (phiEC < -M_PI)
2211  phiEC += 2 * M_PI;
2212  if (phiEC > M_PI)
2213  phiEC -= 2 * M_PI;
2214 
2215  std::pair<double, double> retVal(etaEC, phiEC);
2216  return retVal;
2217 }
2218 
2219 double IsoTrig::getDistInCM(double eta1, double phi1, double eta2, double phi2) {
2220  double Rec;
2221  double theta1 = 2 * atan(exp(-eta1));
2222  double theta2 = 2 * atan(exp(-eta2));
2223  if (fabs(eta1) < 1.479)
2224  Rec = rEB_; //radius of ECAL barrel
2225  else if (fabs(eta1) > 1.479 && fabs(eta1) < 7.0)
2226  Rec = tan(theta1) * zEE_; //distance from IP to ECAL endcap
2227  else
2228  return 1000;
2229 
2230  //|vect| times tg of acos(scalar product)
2231  double angle =
2232  acos((sin(theta1) * sin(theta2) * (sin(phi1) * sin(phi2) + cos(phi1) * cos(phi2)) + cos(theta1) * cos(theta2)));
2233  if (angle < 0.5 * M_PI)
2234  return fabs((Rec / sin(theta1)) * tan(angle));
2235  else
2236  return 1000;
2237 }
2238 
2239 //define this as a plug-in
Vector3DBase
Definition: Vector3DBase.h:8
trigger::TriggerObject::phi
float phi() const
Definition: TriggerObject.h:54
IsoTrig::t_nPixCand
std::vector< int > * t_nPixCand
Definition: IsoTrig.cc:205
spr::trackSelectionParameters::maxDxyPV
double maxDxyPV
Definition: TrackSelection.h:22
IsoTrig::t_NFTrkMinDR
std::vector< double > * t_NFTrkMinDR
Definition: IsoTrig.cc:239
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
IsoTrig::tok_lumi_
edm::EDGetTokenT< LumiDetails > tok_lumi_
Definition: IsoTrig.cc:169
IsoTrig::h_eCalo
TH1D * h_eCalo[5][6][48]
Definition: IsoTrig.cc:262
IsoTrig::studyTiming
void studyTiming(const edm::Event &theEvent)
Definition: IsoTrig.cc:1326
IsoTrig::pLimits_
double pLimits_[6]
Definition: IsoTrig.cc:201
IsoTrig
Definition: IsoTrig.cc:96
IsoTrig::h_EnOut
TH1D * h_EnOut
Definition: IsoTrig.cc:251
DDAxes::y
IsoTrig::t_ECone
std::vector< double > * t_ECone
Definition: IsoTrig.cc:249
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
IsoTrig::t_NFTrkcandPt
std::vector< double > * t_NFTrkcandPt
Definition: IsoTrig.cc:235
IsoTrig::t_nGoodTk
std::vector< int > * t_nGoodTk
Definition: IsoTrig.cc:207
IsoTrig::l1CandTag_
const edm::InputTag l1CandTag_
Definition: IsoTrig.cc:153
electrons_cff.bool
bool
Definition: electrons_cff.py:393
IsoTrig::t_PixcandPt
std::vector< double > * t_PixcandPt
Definition: IsoTrig.cc:218
EDAnalyzer.h
IsoTrig::h_eta
TH1D * h_eta[20]
Definition: IsoTrig.cc:256
IsoTrig::h_pt
TH1D * h_pt[20]
Definition: IsoTrig.cc:256
mps_fire.i
i
Definition: mps_fire.py:428
IsoTrig::pushChgIsolnTreeVecs
void pushChgIsolnTreeVecs(math::XYZTLorentzVector &Pixcand, math::XYZTLorentzVector &Trkcand, std::vector< double > &PixMaxP, double &TrkMaxP, bool &selTk)
Definition: IsoTrig.cc:824
IsoTrig::h_MipEnMatch
TH2D * h_MipEnMatch
Definition: IsoTrig.cc:252
IsoTrig::h_dPhi
TH1D * h_dPhi[9]
Definition: IsoTrig.cc:258
IsoTrig::beginJob
void beginJob() override
Definition: IsoTrig.cc:873
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
LogMessageMonitor_cff.modules
modules
Definition: LogMessageMonitor_cff.py:7
MessageLogger.h
IsoTrig::TimingTree_
TTree * TimingTree_
Definition: IsoTrig.cc:203
funct::false
false
Definition: Factorize.h:29
IsoTrig::h_dPhiL1
TH1D * h_dPhiL1[2]
Definition: IsoTrig.cc:257
IsoTrig::tok_bs_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
Definition: IsoTrig.cc:175
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
IsoTrig::pixelTrackRefsHB_
std::vector< reco::TrackRef > pixelTrackRefsHB_
Definition: IsoTrig.cc:188
IsoTrig::t_nPixSeed
std::vector< int > * t_nPixSeed
Definition: IsoTrig.cc:206
IsoTrig::h_PreHLTwt
TH1D * h_PreHLTwt
Definition: IsoTrig.cc:255
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
edm::Handle::product
T const * product() const
Definition: Handle.h:70
IsoTrig::dEta
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2107
IsoTrig::t_NFcandP
std::vector< double > * t_NFcandP
Definition: IsoTrig.cc:229
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
IsoTrig::h_eNeutIso
TH1D * h_eNeutIso[2]
Definition: IsoTrig.cc:260
ESHandle.h
TriggerResults.h
vec1
std::vector< double > vec1
Definition: HCALResponse.h:15
IsoTrig::tok_hbhe_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: IsoTrig.cc:178
spr::trackSelectionParameters::maxDzPV
double maxDzPV
Definition: TrackSelection.h:22
IsoTrig::h_Pre
TH1I * h_Pre
Definition: IsoTrig.cc:254
IsoTrig::g_Accepts
TH1I * g_Accepts
Definition: IsoTrig.cc:263
IsoTrig::vtxCutSeed_
const double vtxCutSeed_
Definition: IsoTrig.cc:159
IsoTrig::t_NFcandEmip
std::vector< double > * t_NFcandEmip
Definition: IsoTrig.cc:233
spr::trackSelectionParameters::maxChi2
double maxChi2
Definition: TrackSelection.h:22
IsoTrig::h_etaMipTracks
TH1D * h_etaMipTracks[5][2][2]
Definition: IsoTrig.cc:261
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
SeedingLayerSetsHits::size
unsigned short size() const
Get the number of SeedingLayerSets.
Definition: SeedingLayerSetsHits.h:199
reco::TrackBase::p
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
trigger::TriggerL1ForJet
Definition: TriggerTypeDefs.h:34
IsoTrig::changed_
bool changed_
Definition: IsoTrig.cc:200
EcalSeverityLevelAlgoRcd.h
edm::Run
Definition: Run.h:45
zMuMuMuonUserData.alpha
alpha
zGenParticlesMatch = cms.InputTag(""),
Definition: zMuMuMuonUserData.py:9
TriggerEvent.h
IsoTrig::GetEtaPhiAtEcal
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
Definition: IsoTrig.cc:2156
IsoTrig::l2CandTag_
const edm::InputTag l2CandTag_
Definition: IsoTrig.cc:153
IsoTrig::doStudyIsol_
const bool doStudyIsol_
Definition: IsoTrig.cc:156
edm::EDGetTokenT< LumiDetails >
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
IsoTrig::t_TrkqltyFlag
std::vector< bool > * t_TrkqltyFlag
Definition: IsoTrig.cc:212
HLTPrescaleProvider::hltConfigProvider
HLTConfigProvider const & hltConfigProvider() const
Definition: HLTPrescaleProvider.h:52
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
IsoTrig::t_NFTrkPVFlag
std::vector< bool > * t_NFTrkPVFlag
Definition: IsoTrig.cc:244
EBDetId
Definition: EBDetId.h:17
TrackBase.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
IsoTrig::t_NFcandEta
std::vector< double > * t_NFcandEta
Definition: IsoTrig.cc:231
IsoTrig::t_NFTrkChgIsoFlag
std::vector< bool > * t_NFTrkChgIsoFlag
Definition: IsoTrig.cc:246
IsoTrig::fs_
edm::Service< TFileService > fs_
Definition: IsoTrig.cc:202
HLTPrescaleProvider::prescaleValues
std::pair< TL1, THLT > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
Definition: HLTPrescaleProvider.h:72
IsoTrig::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: IsoTrig.cc:509
IsoTrig::h_eMaxNearP
TH1D * h_eMaxNearP[2]
Definition: IsoTrig.cc:260
IsoTrig::recVtxs_
edm::Handle< reco::VertexCollection > recVtxs_
Definition: IsoTrig.cc:195
IsoTrig::t_NFTrkselTkFlag
std::vector< bool > * t_NFTrkselTkFlag
Definition: IsoTrig.cc:241
IsoTrig::tok_verthb_
edm::EDGetTokenT< reco::VertexCollection > tok_verthb_
Definition: IsoTrig.cc:179
IsoTrig::rEB_
double rEB_
Definition: IsoTrig.cc:163
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
IsoTrig::getDistInCM
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
Definition: IsoTrig.cc:2219
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
IsoTrig::fillDifferences
void fillDifferences(int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
Definition: IsoTrig.cc:2052
reco::TrackBase::TrackQuality
TrackQuality
track quality
Definition: TrackBase.h:150
TriggerTypeDefs.h
IsoTrig::processName_
const std::string processName_
Definition: IsoTrig.cc:162
IsoTrig::tok_trigEvt_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
Definition: IsoTrig.cc:170
IsoTrig::zEE_
double zEE_
Definition: IsoTrig.cc:163
IsoTrig::a_charIsoR_
const double a_charIsoR_
Definition: IsoTrig.cc:165
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
IsoTrig::pG_
edm::ESHandle< CaloGeometry > pG_
Definition: IsoTrig.cc:190
IsoTrig::t_PixcandP
std::vector< double > * t_PixcandP
Definition: IsoTrig.cc:217
IsoTrig::pixCandTag_
const edm::InputTag pixCandTag_
Definition: IsoTrig.cc:153
TriggerFilterObjectWithRefs.h
reco::TrackBase::px
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
LumiDetails::kOCC1
Definition: LumiDetails.h:26
spr::goodTrack
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
Definition: TrackSelection.cc:10
IsoTrig::h_Filters
TH1I * h_Filters
Definition: IsoTrig.cc:254
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
IsoTrig::dr_L1_
const double dr_L1_
Definition: IsoTrig.cc:165
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
IsolatedPixelTrackCandidate.h
IsoTrig::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: IsoTrig.cc:557
IsoTrig::endJob
void endJob() override
Definition: IsoTrig.cc:1171
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
ProducerES_cfi.BField
BField
Definition: ProducerES_cfi.py:83
IsoTrig::t_TrkNuIsolFlag
std::vector< bool > * t_TrkNuIsolFlag
Definition: IsoTrig.cc:215
vec2
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:41
IsoTrig::t_timeL2Prod
std::vector< double > * t_timeL2Prod
Definition: IsoTrig.cc:204
edm::Handle< reco::TrackCollection >
IsoTrig::IsoTrig
IsoTrig(const edm::ParameterSet &)
Definition: IsoTrig.cc:267
IsoTrig::h_dPt
TH1D * h_dPt[9]
Definition: IsoTrig.cc:258
edm::RunBase::run
RunNumber_t run() const
Definition: RunBase.h:40
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
IsoTrig::t_NFTrkMipFlag
std::vector< bool > * t_NFTrkMipFlag
Definition: IsoTrig.cc:248
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:452
IsoTrig::h_EnIn
TH1D * h_EnIn
Definition: IsoTrig.cc:251
edm::Ref< TrackCollection >
IsoTrig::h_MipEnNoMatch
TH2D * h_MipEnNoMatch
Definition: IsoTrig.cc:252
IsoTrig::g_PreHLT
TH1I * g_PreHLT
Definition: IsoTrig.cc:263
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
IsoTrig::fillHist
void fillHist(int, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2045
IsoTrig::tok_verthe_
edm::EDGetTokenT< reco::VertexCollection > tok_verthe_
Definition: IsoTrig.cc:179
IsoTrig::t_NFTrkNeuIsoFlag
std::vector< bool > * t_NFTrkNeuIsoFlag
Definition: IsoTrig.cc:247
IsoTrig::g_Pre
TH1I * g_Pre
Definition: IsoTrig.cc:263
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
IsoTrig::leadPV_
math::XYZPoint leadPV_
Definition: IsoTrig.cc:196
IsoTrig::tok_SiPixelRecHits_
edm::EDGetTokenT< SiPixelRecHitCollection > tok_SiPixelRecHits_
Definition: IsoTrig.cc:182
MakerMacros.h
trigger::TriggerObject::py
float py() const
Definition: TriggerObject.h:58
IsoTrig::t_NFTrkcandEmip
std::vector< double > * t_NFTrkcandEmip
Definition: IsoTrig.cc:238
IsoTrig::cutCharge_
const double cutCharge_
Definition: IsoTrig.cc:167
trigger::TriggerObject::pt
float pt() const
Definition: TriggerObject.h:52
CaloGeometry
Definition: CaloGeometry.h:21
debug
#define debug
Definition: HDRShower.cc:19
IsoTrig::~IsoTrig
~IsoTrig() override
Definition: IsoTrig.cc:418
IsoTrig::t_NFTrkcandPhi
std::vector< double > * t_NFTrkcandPhi
Definition: IsoTrig.cc:237
IsoTrig::h_nHLT
TH1I * h_nHLT
Definition: IsoTrig.cc:253
IsoTrig::clearMipCutTreeVectors
void clearMipCutTreeVectors()
Definition: IsoTrig.cc:800
IsoTrig::trigPreList_
std::map< unsigned int, const std::pair< int, int > > trigPreList_
Definition: IsoTrig.cc:199
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Track.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TrackFwd.h
RecoMuonValidator_cfi.maxP
maxP
Definition: RecoMuonValidator_cfi.py:34
SeedingLayerSetsHits.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BeamSpot.h
IsoTrig::pixelIsolationConeSizeAtEC_
const std::vector< double > pixelIsolationConeSizeAtEC_
Definition: IsoTrig.cc:158
IsoTrig::tok_recVtx_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: IsoTrig.cc:174
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::TrackBase::py
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
IsoTrig::StudyTrkEbyP
void StudyTrkEbyP(edm::Handle< reco::TrackCollection > &trkCollection)
Definition: IsoTrig.cc:1201
IsoTrig::trigNames_
const std::vector< std::string > trigNames_
Definition: IsoTrig.cc:152
IsoTrig::h_nL3Objs
TH1I * h_nL3Objs
Definition: IsoTrig.cc:254
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
IsoTrig::doTiming_
const bool doTiming_
Definition: IsoTrig.cc:155
IsoTrig::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:1196
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:157
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
Service.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
PVValHelper::pT
Definition: PVValidationHelpers.h:70
IsoTrig::fillEnergy
void fillEnergy(int, int, double, double, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2091
ChargeIsolation.h
IsoTrig::t_PixTrkcandPt
std::vector< double > * t_PixTrkcandPt
Definition: IsoTrig.cc:223
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
IsoTrig::tok_SeedingLayerHE_
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerHE_
Definition: IsoTrig.cc:181
HLT_FULL_cff.eta2
eta2
Definition: HLT_FULL_cff.py:9542
DDAxes::z
reco::Track
Definition: Track.h:27
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
IsoTrig::t_PixTrkcandEta
std::vector< double > * t_PixTrkcandEta
Definition: IsoTrig.cc:224
LumiDetails::lumiValue
float lumiValue(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:72
IsoTrig::t_NFcandPhi
std::vector< double > * t_NFcandPhi
Definition: IsoTrig.cc:232
spr::trackSelectionParameters::minPt
double minPt
Definition: TrackSelection.h:20
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
IsoTrig::dinvPt
double dinvPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2136
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
spr::trackSelectionParameters
Definition: TrackSelection.h:12
spr::trackSelectionParameters::minOuterHit
int minOuterHit
Definition: TrackSelection.h:23
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
IsoTrig::tok_hlt_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
Definition: IsoTrig.cc:172
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
trigger::TriggerObject::px
float px() const
Definition: TriggerObject.h:57
dqmdumpme.k
k
Definition: dqmdumpme.py:60
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
IsoTrig::hbhe_
edm::Handle< HBHERecHitCollection > hbhe_
Definition: IsoTrig.cc:191
Point3DBase< float, GlobalTag >
IsoTrig::t_PixTrkcandP
std::vector< double > * t_PixTrkcandP
Definition: IsoTrig.cc:222
IsoTrig::h_PreL1
TH1I * h_PreL1
Definition: IsoTrig.cc:253
eECALMatrix.h
spr::chargeIsolationCone
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
Definition: ChargeIsolation.cc:288
eCone.h
IsoTrig::tok_trigRes_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
Definition: IsoTrig.cc:171
EcalSeverityLevelAlgo.h
RefToBase.h
IsoTrig::studyMipCut
void studyMipCut(edm::Handle< reco::TrackCollection > &trkCollection, edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &L2cands)
Definition: IsoTrig.cc:1437
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
trigger::TriggerObject
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
IsoTrig::t_NFTrkqltyFlag
std::vector< bool > * t_NFTrkqltyFlag
Definition: IsoTrig.cc:242
EEDetId
Definition: EEDetId.h:14
spr::trackSelectionParameters::maxDpOverP
double maxDpOverP
Definition: TrackSelection.h:22
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
IsoTrig::a_neutR2_
const double a_neutR2_
Definition: IsoTrig.cc:166
spr::trackSelectionParameters::minLayerCrossed
int minLayerCrossed
Definition: TrackSelection.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
IsoTrig::g_PreL1
TH1I * g_PreL1
Definition: IsoTrig.cc:263
TFileService.h
HLT_FULL_cff.eta1
eta1
Definition: HLT_FULL_cff.py:9541
IsoTrig::doL2L3_
const bool doL2L3_
Definition: IsoTrig.cc:155
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
trigger::TriggerObject::energy
float energy() const
Definition: TriggerObject.h:61
funct::true
true
Definition: Factorize.h:173
SiPixelRecHitCollection.h
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
CaloSubdetectorGeometry.h
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
IsoTrig::h_mindR
TH1D * h_mindR[9]
Definition: IsoTrig.cc:259
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
clear
void clear(HadCaloObj &c)
Definition: data.h:124
IsoTrig::h_phi
TH1D * h_phi[20]
Definition: IsoTrig.cc:256
IsoTrig::h_eMip
TH1D * h_eMip[2]
Definition: IsoTrig.cc:259
Event.h
LumiDetails.h
IsoTrig::theTrackQuality_
std::string theTrackQuality_
Definition: IsoTrig.cc:161
IsoTrig::cutMip_
const double cutMip_
Definition: IsoTrig.cc:166
IsoTrig::chgIsolation
void chgIsolation(double &etaTriggered, double &phiTriggered, edm::Handle< reco::TrackCollection > &trkCollection, const edm::Event &theEvent)
Definition: IsoTrig.cc:1828
IsoTrig::a_neutR1_
const double a_neutR1_
Definition: IsoTrig.cc:166
TrackSelection.h
hltrates_dqm_sourceclient-live_cfg.prescales
prescales
Definition: hltrates_dqm_sourceclient-live_cfg.py:90
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
recoMuon::in
Definition: RecoMuonEnumerators.h:6
spr::trackSelectionParameters::maxOutMiss
int maxOutMiss
Definition: TrackSelection.h:24
IsoTrig::t_PixTrkcandMaxP
std::vector< double > * t_PixTrkcandMaxP
Definition: IsoTrig.cc:226
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
trigger::TriggerObject::id
int id() const
getters
Definition: TriggerObject.h:51
CaloTopologyRecord.h
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
LorentzVector.h
IsoTrig::t_NFTrkcandEta
std::vector< double > * t_NFTrkcandEta
Definition: IsoTrig.cc:236
HcalDetId
Definition: HcalDetId.h:12
edm::Service< TFileService >
spr::eCone_hcal
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, int useRaw=0, bool debug=false)
createfilelist.int
int
Definition: createfilelist.py:10
TriggerNames.h
iEvent
int iEvent
Definition: GenABIO.cc:224
IsoTrig::verbosity_
const int verbosity_
Definition: IsoTrig.cc:157
IsoTrig::t_NFTrkMissFlag
std::vector< bool > * t_NFTrkMissFlag
Definition: IsoTrig.cc:243
IsoTrig::t_NFTrkMinDP1
std::vector< double > * t_NFTrkMinDP1
Definition: IsoTrig.cc:240
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
IsoTrig::dP
double dP(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2132
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
IsoTrig::h_dRL1
TH1D * h_dRL1[2]
Definition: IsoTrig.cc:257
trigger::TriggerObject::eta
float eta() const
Definition: TriggerObject.h:53
IsoTrig::pixelTracksSources_
const std::vector< edm::InputTag > pixelTracksSources_
Definition: IsoTrig.cc:154
IsoTrig::h_dinvPt
TH1D * h_dinvPt[9]
Definition: IsoTrig.cc:259
HLTPrescaleProvider
Definition: HLTPrescaleProvider.h:38
MagneticField.h
IsoTrig::tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: IsoTrig.cc:177
IsoTrig::doChgIsolTree_
const bool doChgIsolTree_
Definition: IsoTrig.cc:156
edm::EventSetup
Definition: EventSetup.h:57
IsoTrig::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: IsoTrig.cc:108
IsoTrig::h_HLT
TH1I * h_HLT
Definition: IsoTrig.cc:253
IsoTrig::h_PreL1wt
TH1D * h_PreL1wt
Definition: IsoTrig.cc:255
IsoTrig::tok_l2cand_
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_l2cand_
Definition: IsoTrig.cc:185
IsoTrig::h_dEta
TH1D * h_dEta[9]
Definition: IsoTrig.cc:258
IsoTrig::maxRunNo_
const int maxRunNo_
Definition: IsoTrig.cc:168
IsoTrig::h_dP
TH1D * h_dP[9]
Definition: IsoTrig.cc:258
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
IsoTrig::minRunNo_
const int minRunNo_
Definition: IsoTrig.cc:168
IsoTrig::doMipCutTree_
const bool doMipCutTree_
Definition: IsoTrig.cc:155
HLTConfigProvider.h
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
get
#define get
HitPattern.h
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
prescale
Definition: PrescaleEventFilter.cc:32
spr::trackSelectionParameters::minQuality
reco::TrackBase::TrackQuality minQuality
Definition: TrackSelection.h:21
IsoTrig::t_NFTrkPropFlag
std::vector< bool > * t_NFTrkPropFlag
Definition: IsoTrig.cc:245
IsoTrig::t_PixTrkcandPhi
std::vector< double > * t_PixTrkcandPhi
Definition: IsoTrig.cc:225
IsoTrig::a_coneR_
const double a_coneR_
Definition: IsoTrig.cc:165
IsoTrig::fillCuts
void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool)
Definition: IsoTrig.cc:2070
HLTPrescaleProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
Definition: HLTPrescaleProvider.cc:21
IsoTrig::bfVal_
double bfVal_
Definition: IsoTrig.cc:163
TriggerObject.h
IsoTrig::MipCutTree_
TTree * MipCutTree_
Definition: IsoTrig.cc:203
IsoTrig::minPTrackValue_
const double minPTrackValue_
Definition: IsoTrig.cc:159
IsoTrig::prelimCone_
const double prelimCone_
Definition: IsoTrig.cc:160
IsoTrig::pixelTrackRefsHE_
std::vector< reco::TrackRef > pixelTrackRefsHE_
Definition: IsoTrig.cc:188
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
IsoTrig::t_PixcandPhi
std::vector< double > * t_PixcandPhi
Definition: IsoTrig.cc:220
IsoTrig::t_PixcandEta
std::vector< double > * t_PixcandEta
Definition: IsoTrig.cc:219
IsoTrig::tauUnbiasCone_
const double tauUnbiasCone_
Definition: IsoTrig.cc:160
CaloTopology.h
IsoTrig::h_L1ObjEnergy
TH1D * h_L1ObjEnergy
Definition: IsoTrig.cc:255
IsoTrig::dR
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2124
IsoTrig::t_TrkPVFlag
std::vector< bool > * t_TrkPVFlag
Definition: IsoTrig.cc:214
spr::propagateCALO
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
Definition: CaloPropagateTrack.cc:141
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
IsoTrig::tok_genTrack_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: IsoTrig.cc:173
VertexFwd.h
IsoTrig::beamSpotH_
edm::Handle< reco::BeamSpot > beamSpotH_
Definition: IsoTrig.cc:194
DDAxes::phi
CaloSubdetectorTopology.h
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
IsoTrig::t_TrkMissFlag
std::vector< bool > * t_TrkMissFlag
Definition: IsoTrig.cc:213
IsoTrig::pushMipCutTreeVecs
void pushMipCutTreeVecs(math::XYZTLorentzVector &NFcand, math::XYZTLorentzVector &Trkcand, double &EmipNFcand, double &EmipTrkcand, double &mindR, double &mindP1, std::vector< bool > &Flags, double hCone)
Definition: IsoTrig.cc:842
HcalTopology.h
edmNew::DetSetVector
Definition: DetSetNew.h:13
EcalTrigTowerConstituentsMap.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
muonTiming_cfi.ptmax
ptmax
Definition: muonTiming_cfi.py:22
IsoTrig::endcapRecHitsHandle_
edm::Handle< EcalRecHitCollection > endcapRecHitsHandle_
Definition: IsoTrig.cc:193
HLTConfigProvider
Definition: HLTConfigProvider.h:29
std
Definition: JetResolutionObject.h:76
trigger::TriggerObject::pz
float pz() const
Definition: TriggerObject.h:59
IsoTrig::dPt
double dPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2130
IsoTrig::hltPrescaleProvider_
HLTPrescaleProvider hltPrescaleProvider_
Definition: IsoTrig.cc:151
IsoTrig::cutNeutral_
const double cutNeutral_
Definition: IsoTrig.cc:167
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
IsoTrig::t_NFTrkcandP
std::vector< double > * t_NFTrkcandP
Definition: IsoTrig.cc:234
IsoTrig::tok_pixtk_
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_pixtk_
Definition: IsoTrig.cc:183
PVValHelper::dz
Definition: PVValidationHelpers.h:50
Frameworkfwd.h
trigger::TriggerL1TauJet
Definition: TriggerTypeDefs.h:35
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CaloPropagateTrack.h
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
spr::trackSelectionParameters::maxInMiss
int maxInMiss
Definition: TrackSelection.h:24
IsoTrig::getGoodTracks
void getGoodTracks(const edm::Event &, edm::Handle< reco::TrackCollection > &)
Definition: IsoTrig.cc:1957
IsoTrig::tok_pixtks_
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tok_pixtks_
Definition: IsoTrig.cc:186
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
IsoTrig::studyIsolation
void studyIsolation(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1685
CaloGeometry.h
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
IsoTrig::t_TrkP
std::vector< double > * t_TrkP
Definition: IsoTrig.cc:210
edm::TriggerNames
Definition: TriggerNames.h:55
IsoTrig::vec_
std::vector< math::XYZTLorentzVector > vec_[3]
Definition: IsoTrig.cc:264
Point3D.h
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
IsoTrig::t_PixTrkcandselTk
std::vector< bool > * t_PixTrkcandselTk
Definition: IsoTrig.cc:227
HLTPrescaleProvider.h
IsoTrig::h_PreHLT
TH1I * h_PreHLT
Definition: IsoTrig.cc:253
HltComparatorCreateWorkflow.hltConfig
hltConfig
Definition: HltComparatorCreateWorkflow.py:161
HcalRecHitCollections.h
IsoTrig::h_eHcal
TH1D * h_eHcal[5][6][48]
Definition: IsoTrig.cc:262
IsoTrig::studyTrigger
void studyTrigger(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
Definition: IsoTrig.cc:1571
IsoTrig::h_etaCalibTracks
TH1D * h_etaCalibTracks[5][2][2]
Definition: IsoTrig.cc:261
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
IsoTrig::barrelRecHitsHandle_
edm::Handle< EcalRecHitCollection > barrelRecHitsHandle_
Definition: IsoTrig.cc:192
IsoTrig::vtxCutIsol_
const double vtxCutIsol_
Definition: IsoTrig.cc:159
IsoTrig::t_TrkselTkFlag
std::vector< bool > * t_TrkselTkFlag
Definition: IsoTrig.cc:211
IsoTrig::tok_l1cand_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_l1cand_
Definition: IsoTrig.cc:184
IsoTrig::a_mipR_
const double a_mipR_
Definition: IsoTrig.cc:166
reco::TrackBase::pz
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:646
IsoTrig::dPhi
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
Definition: IsoTrig.cc:2109
IsoTrig::t_PixcandMaxP
std::vector< std::vector< double > > * t_PixcandMaxP
Definition: IsoTrig.cc:221
IsoTrig::t_TrkhCone
std::vector< double > * t_TrkhCone
Definition: IsoTrig.cc:209
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
IsoTrig::TrkResTree_
TTree * TrkResTree_
Definition: IsoTrig.cc:203
IsoTrig::doTrkResTree_
const bool doTrkResTree_
Definition: IsoTrig.cc:156
trigger::TriggerL1CenJet
Definition: TriggerTypeDefs.h:33
IsoTrig::bFieldH_
edm::ESHandle< MagneticField > bFieldH_
Definition: IsoTrig.cc:189
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
IsoTrig::h_dEtaL1
TH1D * h_dEtaL1[2]
Definition: IsoTrig.cc:257
edm::Event
Definition: Event.h:73
spr::eCone_ecal
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
IsoTrig::ChgIsolnTree_
TTree * ChgIsolnTree_
Definition: IsoTrig.cc:203
IsoTrig::h_p
TH1D * h_p[20]
Definition: IsoTrig.cc:256
MagneticField
Definition: MagneticField.h:19
IsoTrig::tok_EB_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: IsoTrig.cc:176
edm::Log
Definition: MessageLogger.h:70
dttmaxenums::R
Definition: DTTMax.h:29
fastmath::etaphi
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:162
IsoTrig::clearChgIsolnTreeVectors
void clearChgIsolnTreeVectors()
Definition: IsoTrig.cc:784
cuy.ii
ii
Definition: cuy.py:590
trigger::TriggerObject::mass
float mass() const
Definition: TriggerObject.h:55
edm::InputTag
Definition: InputTag.h:15
IsoTrig::selectionParameters_
spr::trackSelectionParameters selectionParameters_
Definition: IsoTrig.cc:164
L1GlobalTriggerReadoutRecord.h
label
const char * label
Definition: PFTauDecayModeTools.cc:11
IsoTrig::etaPhiTrigger
std::pair< double, double > etaPhiTrigger()
Definition: IsoTrig.cc:2140
jets_cff.levels
levels
Definition: jets_cff.py:21
EcalChannelStatusRcd.h
IsoTrig::trigList_
std::map< unsigned int, unsigned int > trigList_
Definition: IsoTrig.cc:198
hit
Definition: SiStripHitEffFromCalibTree.cc:88
IsoTrig::a_neutIsoR_
const double a_neutIsoR_
Definition: IsoTrig.cc:165
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
spclusmultlumicorr_cfi.lumiProducer
lumiProducer
Definition: spclusmultlumicorr_cfi.py:11
IsoTrig::t_NFcandPt
std::vector< double > * t_NFcandPt
Definition: IsoTrig.cc:230
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
ValidationMatrix.hlt
hlt
Definition: ValidationMatrix.py:459
IsoTrig::tok_SeedingLayerHB_
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerHB_
Definition: IsoTrig.cc:180