CMS 3D CMS Logo

IsolatedTracksNxN.cc
Go to the documentation of this file.
1 // -*- C++ -*
2 //
3 // Package: IsolatedParticles
4 // Class: IsolatedTracksNxN
5 //
13 //
14 // Original Author: Seema Sharma
15 // Created: Mon Aug 10 15:30:40 CST 2009
16 //
17 //
18 
19 // system include files
20 #include <cmath>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 // user include files
27 #include <Math/GenVector/VectorUtil.h>
28 
29 // root objects
30 #include "TROOT.h"
31 #include "TSystem.h"
32 #include "TFile.h"
33 #include "TH1F.h"
34 #include "TH2F.h"
35 #include "TProfile.h"
36 #include "TDirectory.h"
37 #include "TTree.h"
38 
47 
49 //L1 trigger Menus etc
58 
63 // muons and tracks
68 // Vertices
72 // Calorimeters
79 // Trigger
87 //L1 objects
94 // Jets in the event
98 
107 // TFile Service
110 
111 // ecal / hcal
119 
122 
126 
127 // SimHit + SimTrack
133 
134 // track associator
139 
140 class IsolatedTracksNxN : public edm::one::EDAnalyzer<edm::one::SharedResources> {
141 public:
142  explicit IsolatedTracksNxN(const edm::ParameterSet &);
143  ~IsolatedTracksNxN() override;
144 
145  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
146 
147 private:
148  void beginJob() override;
149  void analyze(const edm::Event &, const edm::EventSetup &) override;
150  void endJob() override;
151 
152  void printTrack(const reco::Track *pTrack);
153 
154  void bookHistograms();
155 
156  double deltaPhi(double v1, double v2);
157  double deltaR(double eta1, double phi1, double eta2, double phi2);
158 
159  void clearTreeVectors();
160 
161 private:
162  std::unique_ptr<L1GtUtils> m_l1GtUtils;
163  static constexpr size_t nL1BitsMax = 128;
165 
166  // map of trig bit, algo name and num events passed
167  std::map<std::pair<unsigned int, std::string>, int> l1AlgoMap_;
168  std::vector<unsigned int> m_triggerMaskAlgoTrig;
169 
170  const bool doMC_, writeAllTracks_;
171  const int myverbose_;
172  const double pvTracksPtMin_;
173  const int debugTrks_;
175  const double minTrackP_, maxTrackEta_;
177  const double tMinE_, tMaxE_, tMinH_, tMaxH_;
178  bool initL1_;
180 
184 
188 
191 
195 
203 
204  static constexpr size_t NPBins = 15;
205  static constexpr size_t NEtaBins = 3;
207 
212  TH1F *h_nTracks;
219 
220  TTree *tree_;
221 
224  std::vector<std::string> *t_L1AlgoNames;
225  std::vector<int> *t_L1PreScale;
226  int t_L1Decision[128];
227 
228  std::vector<double> *t_L1CenJetPt, *t_L1CenJetEta, *t_L1CenJetPhi;
229  std::vector<double> *t_L1FwdJetPt, *t_L1FwdJetEta, *t_L1FwdJetPhi;
230  std::vector<double> *t_L1TauJetPt, *t_L1TauJetEta, *t_L1TauJetPhi;
231  std::vector<double> *t_L1MuonPt, *t_L1MuonEta, *t_L1MuonPhi;
232  std::vector<double> *t_L1IsoEMPt, *t_L1IsoEMEta, *t_L1IsoEMPhi;
234  std::vector<double> *t_L1METPt, *t_L1METEta, *t_L1METPhi;
235 
236  std::vector<double> *t_PVx, *t_PVy, *t_PVz, *t_PVTracksSumPt;
239  std::vector<int> *t_PVNTracksHP, *t_PVNTracksHPWt;
240 
241  std::vector<double> *t_jetPt, *t_jetEta, *t_jetPhi;
242  std::vector<double> *t_nTrksJetCalo, *t_nTrksJetVtx;
243 
245  std::vector<double> *t_trackPtAll;
247 
248  std::vector<double> *t_trackP, *t_trackPt, *t_trackEta, *t_trackPhi;
250  std::vector<double> *t_trackDxy, *t_trackDxyBS, *t_trackDz, *t_trackDzBS;
251  std::vector<double> *t_trackDxyPV, *t_trackDzPV;
252  std::vector<double> *t_trackChiSq;
253  std::vector<int> *t_trackPVIdx;
254 
255  std::vector<int> *t_NLayersCrossed, *t_trackNOuterHits;
256  std::vector<int> *t_trackHitsTOB, *t_trackHitsTEC;
263  std::vector<double> *t_trackOutPosOutHitDr, *t_trackL;
264 
265  std::vector<double> *t_maxNearP31x31;
266  std::vector<double> *t_maxNearP21x21;
267  std::vector<int> *t_ecalSpike11x11;
268 
269  std::vector<double> *t_e7x7, *t_e9x9, *t_e11x11, *t_e15x15;
275 
276  std::vector<double> *t_esimPdgId, *t_simTrackP, *t_trkEcalEne;
277  std::vector<double> *t_esim7x7, *t_esim9x9, *t_esim11x11, *t_esim15x15;
283 
285  std::vector<double> *t_h3x3, *t_h5x5, *t_h7x7;
286  std::vector<double> *t_h3x3Sig, *t_h5x5Sig, *t_h7x7Sig;
287  std::vector<int> *t_infoHcal;
288 
289  std::vector<double> *t_trkHcalEne;
290  std::vector<double> *t_hsim3x3, *t_hsim5x5, *t_hsim7x7;
292  std::vector<double> *t_hsim3x3Rest, *t_hsim5x5Rest, *t_hsim7x7Rest;
296 };
297 
298 static const bool useL1EventSetup(true);
299 static const bool useL1GtTriggerMenuLite(true);
300 
302  : trackerHitAssociatorConfig_(consumesCollector()),
303  doMC_(iConfig.getUntrackedParameter<bool>("doMC", false)),
304  writeAllTracks_(iConfig.getUntrackedParameter<bool>("writeAllTracks", false)),
305  myverbose_(iConfig.getUntrackedParameter<int>("verbosity", 5)),
306  pvTracksPtMin_(iConfig.getUntrackedParameter<double>("pvTracksPtMin", 1.0)),
307  debugTrks_(iConfig.getUntrackedParameter<int>("debugTracks", 0)),
308  printTrkHitPattern_(iConfig.getUntrackedParameter<bool>("printTrkHitPattern", false)),
309  minTrackP_(iConfig.getUntrackedParameter<double>("minTrackP", 1.0)),
310  maxTrackEta_(iConfig.getUntrackedParameter<double>("maxTrackEta", 5.0)),
311  debugL1Info_(iConfig.getUntrackedParameter<bool>("debugL1Info", false)),
312  L1TriggerAlgoInfo_(iConfig.getUntrackedParameter<bool>("l1TriggerAlgoInfo", false)),
313  tMinE_(iConfig.getUntrackedParameter<double>("timeMinCutECAL", -500.)),
314  tMaxE_(iConfig.getUntrackedParameter<double>("timeMaxCutECAL", 500.)),
315  tMinH_(iConfig.getUntrackedParameter<double>("timeMinCutHCAL", -500.)),
316  tMaxH_(iConfig.getUntrackedParameter<double>("timeMaxCutHCAL", 500.)),
317  t_L1AlgoNames(nullptr),
318  t_L1PreScale(nullptr),
319  t_L1CenJetPt(nullptr),
320  t_L1CenJetEta(nullptr),
321  t_L1CenJetPhi(nullptr),
322  t_L1FwdJetPt(nullptr),
323  t_L1FwdJetEta(nullptr),
324  t_L1FwdJetPhi(nullptr),
325  t_L1TauJetPt(nullptr),
326  t_L1TauJetEta(nullptr),
327  t_L1TauJetPhi(nullptr),
328  t_L1MuonPt(nullptr),
329  t_L1MuonEta(nullptr),
330  t_L1MuonPhi(nullptr),
331  t_L1IsoEMPt(nullptr),
332  t_L1IsoEMEta(nullptr),
333  t_L1IsoEMPhi(nullptr),
334  t_L1NonIsoEMPt(nullptr),
335  t_L1NonIsoEMEta(nullptr),
336  t_L1NonIsoEMPhi(nullptr),
337  t_L1METPt(nullptr),
338  t_L1METEta(nullptr),
339  t_L1METPhi(nullptr),
340  t_PVx(nullptr),
341  t_PVy(nullptr),
342  t_PVz(nullptr),
343  t_PVTracksSumPt(nullptr),
344  t_PVTracksSumPtWt(nullptr),
345  t_PVTracksSumPtHP(nullptr),
346  t_PVTracksSumPtHPWt(nullptr),
347  t_PVisValid(nullptr),
348  t_PVNTracks(nullptr),
349  t_PVNTracksWt(nullptr),
350  t_PVndof(nullptr),
351  t_PVNTracksHP(nullptr),
352  t_PVNTracksHPWt(nullptr),
353  t_jetPt(nullptr),
354  t_jetEta(nullptr),
355  t_jetPhi(nullptr),
356  t_nTrksJetCalo(nullptr),
357  t_nTrksJetVtx(nullptr),
358  t_trackPAll(nullptr),
359  t_trackEtaAll(nullptr),
360  t_trackPhiAll(nullptr),
361  t_trackPdgIdAll(nullptr),
362  t_trackPtAll(nullptr),
363  t_trackDxyAll(nullptr),
364  t_trackDzAll(nullptr),
365  t_trackDxyPVAll(nullptr),
366  t_trackDzPVAll(nullptr),
367  t_trackChiSqAll(nullptr),
368  t_trackP(nullptr),
369  t_trackPt(nullptr),
370  t_trackEta(nullptr),
371  t_trackPhi(nullptr),
372  t_trackEcalEta(nullptr),
373  t_trackEcalPhi(nullptr),
374  t_trackHcalEta(nullptr),
375  t_trackHcalPhi(nullptr),
376  t_trackDxy(nullptr),
377  t_trackDxyBS(nullptr),
378  t_trackDz(nullptr),
379  t_trackDzBS(nullptr),
380  t_trackDxyPV(nullptr),
381  t_trackDzPV(nullptr),
382  t_trackChiSq(nullptr),
383  t_trackPVIdx(nullptr),
384  t_NLayersCrossed(nullptr),
385  t_trackNOuterHits(nullptr),
386  t_trackHitsTOB(nullptr),
387  t_trackHitsTEC(nullptr),
388  t_trackHitInMissTOB(nullptr),
389  t_trackHitInMissTEC(nullptr),
390  t_trackHitInMissTIB(nullptr),
391  t_trackHitInMissTID(nullptr),
392  t_trackHitInMissTIBTID(nullptr),
393  t_trackHitOutMissTOB(nullptr),
394  t_trackHitOutMissTEC(nullptr),
395  t_trackHitOutMissTIB(nullptr),
396  t_trackHitOutMissTID(nullptr),
397  t_trackHitOutMissTOBTEC(nullptr),
398  t_trackHitInMeasTOB(nullptr),
399  t_trackHitInMeasTEC(nullptr),
400  t_trackHitInMeasTIB(nullptr),
401  t_trackHitInMeasTID(nullptr),
402  t_trackHitOutMeasTOB(nullptr),
403  t_trackHitOutMeasTEC(nullptr),
404  t_trackHitOutMeasTIB(nullptr),
405  t_trackHitOutMeasTID(nullptr),
406  t_trackOutPosOutHitDr(nullptr),
407  t_trackL(nullptr),
408  t_maxNearP31x31(nullptr),
409  t_maxNearP21x21(nullptr),
410  t_ecalSpike11x11(nullptr),
411  t_e7x7(nullptr),
412  t_e9x9(nullptr),
413  t_e11x11(nullptr),
414  t_e15x15(nullptr),
415  t_e7x7_10Sig(nullptr),
416  t_e9x9_10Sig(nullptr),
417  t_e11x11_10Sig(nullptr),
418  t_e15x15_10Sig(nullptr),
419  t_e7x7_15Sig(nullptr),
420  t_e9x9_15Sig(nullptr),
421  t_e11x11_15Sig(nullptr),
422  t_e15x15_15Sig(nullptr),
423  t_e7x7_20Sig(nullptr),
424  t_e9x9_20Sig(nullptr),
425  t_e11x11_20Sig(nullptr),
426  t_e15x15_20Sig(nullptr),
427  t_e7x7_25Sig(nullptr),
428  t_e9x9_25Sig(nullptr),
429  t_e11x11_25Sig(nullptr),
430  t_e15x15_25Sig(nullptr),
431  t_e7x7_30Sig(nullptr),
432  t_e9x9_30Sig(nullptr),
433  t_e11x11_30Sig(nullptr),
434  t_e15x15_30Sig(nullptr),
435  t_esimPdgId(nullptr),
436  t_simTrackP(nullptr),
437  t_trkEcalEne(nullptr),
438  t_esim7x7(nullptr),
439  t_esim9x9(nullptr),
440  t_esim11x11(nullptr),
441  t_esim15x15(nullptr),
442  t_esim7x7Matched(nullptr),
443  t_esim9x9Matched(nullptr),
444  t_esim11x11Matched(nullptr),
445  t_esim15x15Matched(nullptr),
446  t_esim7x7Rest(nullptr),
447  t_esim9x9Rest(nullptr),
448  t_esim11x11Rest(nullptr),
449  t_esim15x15Rest(nullptr),
450  t_esim7x7Photon(nullptr),
451  t_esim9x9Photon(nullptr),
452  t_esim11x11Photon(nullptr),
453  t_esim15x15Photon(nullptr),
454  t_esim7x7NeutHad(nullptr),
455  t_esim9x9NeutHad(nullptr),
456  t_esim11x11NeutHad(nullptr),
457  t_esim15x15NeutHad(nullptr),
458  t_esim7x7CharHad(nullptr),
459  t_esim9x9CharHad(nullptr),
460  t_esim11x11CharHad(nullptr),
461  t_esim15x15CharHad(nullptr),
462  t_maxNearHcalP3x3(nullptr),
463  t_maxNearHcalP5x5(nullptr),
464  t_maxNearHcalP7x7(nullptr),
465  t_h3x3(nullptr),
466  t_h5x5(nullptr),
467  t_h7x7(nullptr),
468  t_h3x3Sig(nullptr),
469  t_h5x5Sig(nullptr),
470  t_h7x7Sig(nullptr),
471  t_infoHcal(nullptr),
472  t_trkHcalEne(nullptr),
473  t_hsim3x3(nullptr),
474  t_hsim5x5(nullptr),
475  t_hsim7x7(nullptr),
476  t_hsim3x3Matched(nullptr),
477  t_hsim5x5Matched(nullptr),
478  t_hsim7x7Matched(nullptr),
479  t_hsim3x3Rest(nullptr),
480  t_hsim5x5Rest(nullptr),
481  t_hsim7x7Rest(nullptr),
482  t_hsim3x3Photon(nullptr),
483  t_hsim5x5Photon(nullptr),
484  t_hsim7x7Photon(nullptr),
485  t_hsim3x3NeutHad(nullptr),
486  t_hsim5x5NeutHad(nullptr),
487  t_hsim7x7NeutHad(nullptr),
488  t_hsim3x3CharHad(nullptr),
489  t_hsim5x5CharHad(nullptr),
490  t_hsim7x7CharHad(nullptr) {
491  if (L1TriggerAlgoInfo_) {
492  m_l1GtUtils = std::make_unique<L1GtUtils>(
494  }
495 
496  usesResource(TFileService::kSharedResource);
497 
498  //now do what ever initialization is needed
499 
500  edm::InputTag L1extraTauJetSource_ = iConfig.getParameter<edm::InputTag>("l1extraTauJetSource");
501  edm::InputTag L1extraCenJetSource_ = iConfig.getParameter<edm::InputTag>("l1extraCenJetSource");
502  edm::InputTag L1extraFwdJetSource_ = iConfig.getParameter<edm::InputTag>("l1extraFwdJetSource");
503  edm::InputTag L1extraMuonSource_ = iConfig.getParameter<edm::InputTag>("l1extraMuonSource");
504  edm::InputTag L1extraIsoEmSource_ = iConfig.getParameter<edm::InputTag>("l1extraIsoEmSource");
505  edm::InputTag L1extraNonIsoEmSource_ = iConfig.getParameter<edm::InputTag>("l1extraNonIsoEmSource");
506  edm::InputTag L1GTReadoutRcdSource_ = iConfig.getParameter<edm::InputTag>("l1GTReadoutRcdSource");
507  edm::InputTag L1GTObjectMapRcdSource_ = iConfig.getParameter<edm::InputTag>("l1GTObjectMapRcdSource");
508  edm::InputTag JetSrc_ = iConfig.getParameter<edm::InputTag>("jetSource");
509  edm::InputTag JetExtender_ = iConfig.getParameter<edm::InputTag>("jetExtender");
510  edm::InputTag HBHERecHitSource_ = iConfig.getParameter<edm::InputTag>("hbheRecHitSource");
511 
512  // define tokens for access
513  tok_L1extTauJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraTauJetSource_);
514  tok_L1extCenJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraCenJetSource_);
515  tok_L1extFwdJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraFwdJetSource_);
516  tok_L1extMu_ = consumes<l1extra::L1MuonParticleCollection>(L1extraMuonSource_);
517  tok_L1extIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraIsoEmSource_);
518  tok_L1extNoIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraNonIsoEmSource_);
519  tok_jets_ = consumes<reco::CaloJetCollection>(JetSrc_);
520  tok_hbhe_ = consumes<HBHERecHitCollection>(HBHERecHitSource_);
521 
522  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
523  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
524  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
525  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
526  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
527 
528  tok_simTk_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
529  tok_simVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
530  tok_caloEB_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEB"));
531  tok_caloEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE"));
532  tok_caloHH_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"));
533 
534  if (myverbose_ >= 0) {
535  edm::LogVerbatim("IsoTrack") << "Parameters read from config file \n"
536  << " doMC " << doMC_ << "\t myverbose " << myverbose_ << "\t minTrackP "
537  << minTrackP_ << "\t maxTrackEta " << maxTrackEta_ << "\t tMinE " << tMinE_
538  << "\t tMaxE " << tMaxE_ << "\t tMinH " << tMinH_ << "\t tMaxH " << tMaxH_
539  << "\n debugL1Info " << debugL1Info_ << "\t L1TriggerAlgoInfo " << L1TriggerAlgoInfo_
540  << "\n";
541  }
542 }
543 
545  delete t_PVx;
546  delete t_PVy;
547  delete t_PVz;
548  delete t_PVisValid;
549  delete t_PVndof;
550  delete t_PVNTracks;
551  delete t_PVNTracksWt;
552  delete t_PVTracksSumPt;
553  delete t_PVTracksSumPtWt;
554  delete t_PVNTracksHP;
555  delete t_PVNTracksHPWt;
556  delete t_PVTracksSumPtHP;
557  delete t_PVTracksSumPtHPWt;
558  delete t_L1AlgoNames;
559  delete t_L1PreScale;
560  delete t_L1CenJetPt;
561  delete t_L1CenJetEta;
562  delete t_L1CenJetPhi;
563  delete t_L1FwdJetPt;
564  delete t_L1FwdJetEta;
565  delete t_L1FwdJetPhi;
566  delete t_L1TauJetPt;
567  delete t_L1TauJetEta;
568  delete t_L1TauJetPhi;
569  delete t_L1MuonPt;
570  delete t_L1MuonEta;
571  delete t_L1MuonPhi;
572  delete t_L1IsoEMPt;
573  delete t_L1IsoEMEta;
574  delete t_L1IsoEMPhi;
575  delete t_L1NonIsoEMPt;
576  delete t_L1NonIsoEMEta;
577  delete t_L1NonIsoEMPhi;
578  delete t_L1METPt;
579  delete t_L1METEta;
580  delete t_L1METPhi;
581  delete t_jetPt;
582  delete t_jetEta;
583  delete t_jetPhi;
584  delete t_nTrksJetCalo;
585  delete t_nTrksJetVtx;
586  delete t_trackPAll;
587  delete t_trackEtaAll;
588  delete t_trackPhiAll;
589  delete t_trackPdgIdAll;
590  delete t_trackPtAll;
591  delete t_trackDxyAll;
592  delete t_trackDzAll;
593  delete t_trackDxyPVAll;
594  delete t_trackDzPVAll;
595  delete t_trackChiSqAll;
596  delete t_trackP;
597  delete t_trackPt;
598  delete t_trackEta;
599  delete t_trackPhi;
600  delete t_trackEcalEta;
601  delete t_trackEcalPhi;
602  delete t_trackHcalEta;
603  delete t_trackHcalPhi;
604  delete t_trackNOuterHits;
605  delete t_NLayersCrossed;
606  delete t_trackDxy;
607  delete t_trackDxyBS;
608  delete t_trackDz;
609  delete t_trackDzBS;
610  delete t_trackDxyPV;
611  delete t_trackDzPV;
612  delete t_trackPVIdx;
613  delete t_trackChiSq;
614  delete t_trackHitsTOB;
615  delete t_trackHitsTEC;
616  delete t_trackHitInMissTOB;
617  delete t_trackHitInMissTEC;
618  delete t_trackHitInMissTIB;
619  delete t_trackHitInMissTID;
620  delete t_trackHitInMissTIBTID;
621  delete t_trackHitOutMissTOB;
622  delete t_trackHitOutMissTEC;
623  delete t_trackHitOutMissTIB;
624  delete t_trackHitOutMissTID;
626  delete t_trackHitInMeasTOB;
627  delete t_trackHitInMeasTEC;
628  delete t_trackHitInMeasTIB;
629  delete t_trackHitInMeasTID;
630  delete t_trackHitOutMeasTOB;
631  delete t_trackHitOutMeasTEC;
632  delete t_trackHitOutMeasTIB;
633  delete t_trackHitOutMeasTID;
634  delete t_trackOutPosOutHitDr;
635  delete t_trackL;
636  delete t_maxNearP31x31;
637  delete t_maxNearP21x21;
638  delete t_ecalSpike11x11;
639  delete t_e7x7;
640  delete t_e9x9;
641  delete t_e11x11;
642  delete t_e15x15;
643  delete t_e7x7_10Sig;
644  delete t_e9x9_10Sig;
645  delete t_e11x11_10Sig;
646  delete t_e15x15_10Sig;
647  delete t_e7x7_15Sig;
648  delete t_e9x9_15Sig;
649  delete t_e11x11_15Sig;
650  delete t_e15x15_15Sig;
651  delete t_e7x7_20Sig;
652  delete t_e9x9_20Sig;
653  delete t_e11x11_20Sig;
654  delete t_e15x15_20Sig;
655  delete t_e7x7_25Sig;
656  delete t_e9x9_25Sig;
657  delete t_e11x11_25Sig;
658  delete t_e15x15_25Sig;
659  delete t_e7x7_30Sig;
660  delete t_e9x9_30Sig;
661  delete t_e11x11_30Sig;
662  delete t_e15x15_30Sig;
663  delete t_esim7x7;
664  delete t_esim9x9;
665  delete t_esim11x11;
666  delete t_esim15x15;
667  delete t_esim7x7Matched;
668  delete t_esim9x9Matched;
669  delete t_esim11x11Matched;
670  delete t_esim15x15Matched;
671  delete t_esim7x7Rest;
672  delete t_esim9x9Rest;
673  delete t_esim11x11Rest;
674  delete t_esim15x15Rest;
675  delete t_esim7x7Photon;
676  delete t_esim9x9Photon;
677  delete t_esim11x11Photon;
678  delete t_esim15x15Photon;
679  delete t_esim7x7NeutHad;
680  delete t_esim9x9NeutHad;
681  delete t_esim11x11NeutHad;
682  delete t_esim15x15NeutHad;
683  delete t_esim7x7CharHad;
684  delete t_esim9x9CharHad;
685  delete t_esim11x11CharHad;
686  delete t_esim15x15CharHad;
687  delete t_trkEcalEne;
688  delete t_simTrackP;
689  delete t_esimPdgId;
690  delete t_maxNearHcalP3x3;
691  delete t_maxNearHcalP5x5;
692  delete t_maxNearHcalP7x7;
693  delete t_h3x3;
694  delete t_h5x5;
695  delete t_h7x7;
696  delete t_h3x3Sig;
697  delete t_h5x5Sig;
698  delete t_h7x7Sig;
699  delete t_infoHcal;
700  delete t_trkHcalEne;
701  delete t_hsim3x3;
702  delete t_hsim5x5;
703  delete t_hsim7x7;
704  delete t_hsim3x3Matched;
705  delete t_hsim5x5Matched;
706  delete t_hsim7x7Matched;
707  delete t_hsim3x3Rest;
708  delete t_hsim5x5Rest;
709  delete t_hsim7x7Rest;
710  delete t_hsim3x3Photon;
711  delete t_hsim5x5Photon;
712  delete t_hsim7x7Photon;
713  delete t_hsim3x3NeutHad;
714  delete t_hsim5x5NeutHad;
715  delete t_hsim7x7NeutHad;
716  delete t_hsim3x3CharHad;
717  delete t_hsim5x5CharHad;
718  delete t_hsim7x7CharHad;
719 }
720 
723  desc.addUntracked<bool>("doMC", false);
724  desc.addUntracked<bool>("writeAllTracks", false);
725  desc.addUntracked<int>("verbosity", 1);
726  desc.addUntracked<double>("pvTracksPtMin", 0.200);
727  desc.addUntracked<int>("debugTracks", 0);
728  desc.addUntracked<bool>("printTrkHitPattern", true);
729  desc.addUntracked<double>("minTrackP", 1.0);
730  desc.addUntracked<double>("maxTrackEta", 2.6);
731  desc.addUntracked<bool>("debugL1Info", false);
732  desc.addUntracked<bool>("l1TriggerAlgoInfo", false);
733  desc.add<edm::InputTag>("l1extraTauJetSource", edm::InputTag("l1extraParticles", "Tau"));
734  desc.add<edm::InputTag>("l1extraCenJetSource", edm::InputTag("l1extraParticles", "Central"));
735  desc.add<edm::InputTag>("l1extraFwdJetSource", edm::InputTag("l1extraParticles", "Forward"));
736  desc.add<edm::InputTag>("l1extraMuonSource", edm::InputTag("l1extraParticles"));
737  desc.add<edm::InputTag>("l1extraIsoEmSource", edm::InputTag("l1extraParticles", "Isolated"));
738  desc.add<edm::InputTag>("l1extraNonIsoEmSource", edm::InputTag("l1extraParticles", "NonIsolated"));
739  desc.add<edm::InputTag>("l1GTReadoutRcdSource", edm::InputTag("gtDigis"));
740  desc.add<edm::InputTag>("l1GTObjectMapRcdSource", edm::InputTag("hltL1GtObjectMap"));
741  desc.add<edm::InputTag>("jetSource", edm::InputTag("iterativeCone5CaloJets"));
742  desc.add<edm::InputTag>("jetExtender", edm::InputTag("iterativeCone5JetExtender"));
743  desc.add<edm::InputTag>("hbheRecHitSource", edm::InputTag("hbhereco"));
744  desc.addUntracked<double>("maxNearTrackPT", 1.0);
745  desc.addUntracked<double>("timeMinCutECAL", -500.0);
746  desc.addUntracked<double>("timeMaxCutECAL", 500.0);
747  desc.addUntracked<double>("timeMinCutHCAL", -500.0);
748  desc.addUntracked<double>("timeMaxCutHCAL", 500.0);
749  descriptions.add("isolatedTracksNxN", desc);
750 }
751 
753  bool haveIsoTrack = false;
754 
756  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
757  const MagneticField *bField = bFieldH.product();
758 
760 
761  t_RunNo = iEvent.id().run();
762  t_EvtNo = iEvent.id().event();
763  t_Lumi = iEvent.luminosityBlock();
764  t_Bunch = iEvent.bunchCrossing();
765 
766  ++nEventProc_;
767 
769  iEvent.getByToken(tok_genTrack_, trkCollection);
770  if (debugTrks_ > 1) {
771  edm::LogVerbatim("IsoTrack") << "Track Collection: ";
772  edm::LogVerbatim("IsoTrack") << "Number of Tracks " << trkCollection->size();
773  }
774  std::string theTrackQuality = "highPurity";
775  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
776 
777  //===================== save L1 Trigger information =======================
778  if (L1TriggerAlgoInfo_) {
779  m_l1GtUtils->getL1GtRunCache(iEvent, iSetup, useL1EventSetup, useL1GtTriggerMenuLite);
780 
781  int iErrorCode = -1;
782  int l1ConfCode = -1;
783  const bool l1Conf = m_l1GtUtils->availableL1Configuration(iErrorCode, l1ConfCode);
784  if (!l1Conf) {
785  edm::LogVerbatim("IsoTrack")
786  << "\nL1 configuration code:" << l1ConfCode << "\nNo valid L1 trigger configuration available."
787  << "\nSee text above for error code interpretation"
788  << "\nNo return here, in order to test each method, protected against configuration error.";
789  }
790 
791  const L1GtTriggerMenu *m_l1GtMenu = m_l1GtUtils->ptrL1TriggerMenuEventSetup(iErrorCode);
792  const AlgorithmMap &algorithmMap = m_l1GtMenu->gtAlgorithmMap();
793  const std::string &menuName = m_l1GtMenu->gtTriggerMenuName();
794 
795  if (!initL1_) {
796  initL1_ = true;
797  edm::LogVerbatim("IsoTrack") << "menuName " << menuName;
798  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
799  std::string algName = itAlgo->first;
800  int algBitNumber = (itAlgo->second).algoBitNumber();
801  l1AlgoMap_.insert(std::pair<std::pair<unsigned int, std::string>, int>(
802  std::pair<unsigned int, std::string>(algBitNumber, algName), 0));
803  }
804  std::map<std::pair<unsigned int, std::string>, int>::iterator itr;
805  for (itr = l1AlgoMap_.begin(); itr != l1AlgoMap_.end(); itr++) {
806  edm::LogVerbatim("IsoTrack") << " ********** " << (itr->first).first << " " << (itr->first).second << " "
807  << itr->second;
808  }
809  }
810 
811  std::vector<int> algbits;
812  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
813  std::string algName = itAlgo->first;
814  int algBitNumber = (itAlgo->second).algoBitNumber();
815  bool decision = m_l1GtUtils->decision(iEvent, itAlgo->first, iErrorCode);
816  int preScale = m_l1GtUtils->prescaleFactor(iEvent, itAlgo->first, iErrorCode);
817 
818  // save the algo names which fired
819  if (decision) {
820  l1AlgoMap_[std::pair<unsigned int, std::string>(algBitNumber, algName)] += 1;
821  h_L1AlgoNames->Fill(algBitNumber);
822  t_L1AlgoNames->push_back(itAlgo->first);
823  t_L1PreScale->push_back(preScale);
824  t_L1Decision[algBitNumber] = 1;
825  algbits.push_back(algBitNumber);
826  }
827  }
828 
829  if (debugL1Info_) {
830  for (unsigned int ii = 0; ii < t_L1AlgoNames->size(); ii++) {
831  edm::LogVerbatim("IsoTrack") << ii << " " << (*t_L1AlgoNames)[ii] << " " << (*t_L1PreScale)[ii] << " "
832  << algbits[ii];
833  }
834  for (int i = 0; i < 128; ++i) {
835  edm::LogVerbatim("IsoTrack") << "L1Decision: " << i << ":" << t_L1Decision[i];
836  }
837  }
838 
839  // L1Taus
841  iEvent.getByToken(tok_L1extTauJet_, l1TauHandle);
842  l1extra::L1JetParticleCollection::const_iterator itr;
843  int iL1Obj = 0;
844  for (itr = l1TauHandle->begin(), iL1Obj = 0; itr != l1TauHandle->end(); ++itr, iL1Obj++) {
845  if (iL1Obj < 1) {
846  t_L1TauJetPt->push_back(itr->pt());
847  t_L1TauJetEta->push_back(itr->eta());
848  t_L1TauJetPhi->push_back(itr->phi());
849  }
850  if (debugL1Info_) {
851  edm::LogVerbatim("IsoTrack") << "tauJ p/pt " << itr->momentum() << " " << itr->pt() << " eta/phi "
852  << itr->eta() << " " << itr->phi();
853  }
854  }
855 
856  // L1 Central Jets
858  iEvent.getByToken(tok_L1extCenJet_, l1CenJetHandle);
859  for (itr = l1CenJetHandle->begin(), iL1Obj = 0; itr != l1CenJetHandle->end(); ++itr, iL1Obj++) {
860  if (iL1Obj < 1) {
861  t_L1CenJetPt->push_back(itr->pt());
862  t_L1CenJetEta->push_back(itr->eta());
863  t_L1CenJetPhi->push_back(itr->phi());
864  }
865  if (debugL1Info_) {
866  edm::LogVerbatim("IsoTrack") << "cenJ p/pt " << itr->momentum() << " " << itr->pt() << " eta/phi "
867  << itr->eta() << " " << itr->phi();
868  }
869  }
870 
871  // L1 Forward Jets
873  iEvent.getByToken(tok_L1extFwdJet_, l1FwdJetHandle);
874  for (itr = l1FwdJetHandle->begin(), iL1Obj = 0; itr != l1FwdJetHandle->end(); ++itr, iL1Obj++) {
875  if (iL1Obj < 1) {
876  t_L1FwdJetPt->push_back(itr->pt());
877  t_L1FwdJetEta->push_back(itr->eta());
878  t_L1FwdJetPhi->push_back(itr->phi());
879  }
880  if (debugL1Info_) {
881  edm::LogVerbatim("IsoTrack") << "fwdJ p/pt " << itr->momentum() << " " << itr->pt() << " eta/phi "
882  << itr->eta() << " " << itr->phi();
883  }
884  }
885 
886  // L1 Isolated EM onjects
887  l1extra::L1EmParticleCollection::const_iterator itrEm;
889  iEvent.getByToken(tok_L1extIsoEm_, l1IsoEmHandle);
890  for (itrEm = l1IsoEmHandle->begin(), iL1Obj = 0; itrEm != l1IsoEmHandle->end(); ++itrEm, iL1Obj++) {
891  if (iL1Obj < 1) {
892  t_L1IsoEMPt->push_back(itrEm->pt());
893  t_L1IsoEMEta->push_back(itrEm->eta());
894  t_L1IsoEMPhi->push_back(itrEm->phi());
895  }
896  if (debugL1Info_) {
897  edm::LogVerbatim("IsoTrack") << "isoEm p/pt " << itrEm->momentum() << " " << itrEm->pt() << " eta/phi "
898  << itrEm->eta() << " " << itrEm->phi();
899  }
900  }
901 
902  // L1 Non-Isolated EM onjects
904  iEvent.getByToken(tok_L1extNoIsoEm_, l1NonIsoEmHandle);
905  for (itrEm = l1NonIsoEmHandle->begin(), iL1Obj = 0; itrEm != l1NonIsoEmHandle->end(); ++itrEm, iL1Obj++) {
906  if (iL1Obj < 1) {
907  t_L1NonIsoEMPt->push_back(itrEm->pt());
908  t_L1NonIsoEMEta->push_back(itrEm->eta());
909  t_L1NonIsoEMPhi->push_back(itrEm->phi());
910  }
911  if (debugL1Info_) {
912  edm::LogVerbatim("IsoTrack") << "nonIsoEm p/pt " << itrEm->momentum() << " " << itrEm->pt() << " eta/phi "
913  << itrEm->eta() << " " << itrEm->phi();
914  }
915  }
916 
917  // L1 Muons
918  l1extra::L1MuonParticleCollection::const_iterator itrMu;
920  iEvent.getByToken(tok_L1extMu_, l1MuHandle);
921  for (itrMu = l1MuHandle->begin(), iL1Obj = 0; itrMu != l1MuHandle->end(); ++itrMu, iL1Obj++) {
922  if (iL1Obj < 1) {
923  t_L1MuonPt->push_back(itrMu->pt());
924  t_L1MuonEta->push_back(itrMu->eta());
925  t_L1MuonPhi->push_back(itrMu->phi());
926  }
927  if (debugL1Info_) {
928  edm::LogVerbatim("IsoTrack") << "l1muon p/pt " << itrMu->momentum() << " " << itrMu->pt() << " eta/phi "
929  << itrMu->eta() << " " << itrMu->phi();
930  }
931  }
932  }
933 
934  //============== store the information about all the Non-Fake vertices ===============
935 
937  iEvent.getByToken(tok_recVtx_, recVtxs);
938 
939  std::vector<reco::Track> svTracks;
940  math::XYZPoint leadPV(0, 0, 0);
941  double sumPtMax = -1.0;
942  for (unsigned int ind = 0; ind < recVtxs->size(); ind++) {
943  if (!((*recVtxs)[ind].isFake())) {
944  double vtxTrkSumPt = 0.0, vtxTrkSumPtWt = 0.0;
945  int vtxTrkNWt = 0;
946  double vtxTrkSumPtHP = 0.0, vtxTrkSumPtHPWt = 0.0;
947  int vtxTrkNHP = 0, vtxTrkNHPWt = 0;
948 
949  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
950 
951  for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack != (*recVtxs)[ind].tracks_end(); vtxTrack++) {
952  if ((*vtxTrack)->pt() < pvTracksPtMin_)
953  continue;
954 
955  bool trkQuality = (*vtxTrack)->quality(trackQuality_);
956 
957  vtxTrkSumPt += (*vtxTrack)->pt();
958 
959  vtxTrkSumPt += (*vtxTrack)->pt();
960  if (trkQuality) {
961  vtxTrkSumPtHP += (*vtxTrack)->pt();
962  vtxTrkNHP++;
963  }
964 
965  double weight = (*recVtxs)[ind].trackWeight(*vtxTrack);
966  h_PVTracksWt->Fill(weight);
967  if (weight > 0.5) {
968  vtxTrkSumPtWt += (*vtxTrack)->pt();
969  vtxTrkNWt++;
970  if (trkQuality) {
971  vtxTrkSumPtHPWt += (*vtxTrack)->pt();
972  vtxTrkNHPWt++;
973  }
974  }
975  }
976 
977  if (vtxTrkSumPt > sumPtMax) {
978  sumPtMax = vtxTrkSumPt;
979  leadPV = math::XYZPoint((*recVtxs)[ind].x(), (*recVtxs)[ind].y(), (*recVtxs)[ind].z());
980  }
981 
982  t_PVx->push_back((*recVtxs)[ind].x());
983  t_PVy->push_back((*recVtxs)[ind].y());
984  t_PVz->push_back((*recVtxs)[ind].z());
985  t_PVisValid->push_back((*recVtxs)[ind].isValid());
986  t_PVNTracks->push_back((*recVtxs)[ind].tracksSize());
987  t_PVndof->push_back((*recVtxs)[ind].ndof());
988  t_PVNTracksWt->push_back(vtxTrkNWt);
989  t_PVTracksSumPt->push_back(vtxTrkSumPt);
990  t_PVTracksSumPtWt->push_back(vtxTrkSumPtWt);
991 
992  t_PVNTracksHP->push_back(vtxTrkNHP);
993  t_PVNTracksHPWt->push_back(vtxTrkNHPWt);
994  t_PVTracksSumPtHP->push_back(vtxTrkSumPtHP);
995  t_PVTracksSumPtHPWt->push_back(vtxTrkSumPtHPWt);
996 
997  if (myverbose_ == 4) {
998  edm::LogVerbatim("IsoTrack") << "PV " << ind << " isValid " << (*recVtxs)[ind].isValid() << " isFake "
999  << (*recVtxs)[ind].isFake() << " hasRefittedTracks() " << ind << " "
1000  << (*recVtxs)[ind].hasRefittedTracks() << " refittedTrksSize "
1001  << (*recVtxs)[ind].refittedTracks().size() << " tracksSize() "
1002  << (*recVtxs)[ind].tracksSize() << " sumPt " << vtxTrkSumPt;
1003  }
1004  } // if vtx is not Fake
1005  } // loop over PVs
1006  //===================================================================================
1007 
1008  // Get the beamspot
1009  edm::Handle<reco::BeamSpot> beamSpotH;
1010  iEvent.getByToken(tok_bs_, beamSpotH);
1011  math::XYZPoint bspot;
1012  bspot = (beamSpotH.isValid()) ? beamSpotH->position() : math::XYZPoint(0, 0, 0);
1013 
1014  //=====================================================================
1015 
1017  iEvent.getByToken(tok_jets_, jets);
1018  // edm::Handle<reco::JetExtendedAssociation::Container> jetExtender;
1019  // iEvent.getByLabel(JetExtender_,jetExtender);
1020 
1021  for (unsigned int ijet = 0; ijet < (*jets).size(); ijet++) {
1022  t_jetPt->push_back((*jets)[ijet].pt());
1023  t_jetEta->push_back((*jets)[ijet].eta());
1024  t_jetPhi->push_back((*jets)[ijet].phi());
1025  t_nTrksJetVtx->push_back(-1.0);
1026  t_nTrksJetCalo->push_back(-1.0);
1027  }
1028 
1029  //===================================================================================
1030 
1031  // get handles to calogeometry and calotopology
1033  iSetup.get<CaloGeometryRecord>().get(pG);
1034  const CaloGeometry *geo = pG.product();
1035 
1036  edm::ESHandle<CaloTopology> theCaloTopology;
1037  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
1038  const CaloTopology *caloTopology = theCaloTopology.product();
1039 
1041  iSetup.get<HcalRecNumberingRecord>().get(htopo);
1042  const HcalTopology *theHBHETopology = htopo.product();
1043 
1044  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
1045  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
1046  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
1047  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
1048 
1049  // Retrieve the good/bad ECAL channels from the DB
1050  edm::ESHandle<EcalChannelStatus> ecalChStatus;
1051  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
1052  const EcalChannelStatus *theEcalChStatus = ecalChStatus.product();
1053 
1054  // Retrieve trigger tower map
1056  iSetup.get<IdealGeometryRecord>().get(hTtmap);
1057  const EcalTrigTowerConstituentsMap &ttMap = *hTtmap;
1058 
1060  iEvent.getByToken(tok_hbhe_, hbhe);
1061  if (!hbhe.isValid()) {
1062  ++nbad_;
1063  if (nbad_ < 10)
1064  edm::LogVerbatim("IsoTrack") << "No HBHE rechit collection";
1065  return;
1066  }
1067  const HBHERecHitCollection Hithbhe = *(hbhe.product());
1068 
1069  //get Handles to SimTracks and SimHits
1071  if (doMC_)
1072  iEvent.getByToken(tok_simTk_, SimTk);
1073 
1075  if (doMC_)
1076  iEvent.getByToken(tok_simVtx_, SimVtx);
1077 
1078  //get Handles to PCaloHitContainers of eb/ee/hbhe
1080  if (doMC_)
1081  iEvent.getByToken(tok_caloEB_, pcaloeb);
1082 
1084  if (doMC_)
1085  iEvent.getByToken(tok_caloEE_, pcaloee);
1086 
1088  if (doMC_)
1089  iEvent.getByToken(tok_caloHH_, pcalohh);
1090 
1091  //associates tracker rechits/simhits to a track
1092  std::unique_ptr<TrackerHitAssociator> associate;
1093  if (doMC_)
1095 
1096  //===================================================================================
1097 
1098  h_nTracks->Fill(trkCollection->size());
1099 
1100  int nTracks = 0;
1101 
1102  t_nTracks = trkCollection->size();
1103 
1104  // get the list of DetIds closest to the impact point of track on surface calorimeters
1105  std::vector<spr::propagatedTrackID> trkCaloDets;
1106  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDets, false);
1107  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
1108 
1109  if (myverbose_ > 2) {
1110  for (trkDetItr = trkCaloDets.begin(); trkDetItr != trkCaloDets.end(); trkDetItr++) {
1111  edm::LogVerbatim("IsoTrack") << trkDetItr->trkItr->p() << " " << trkDetItr->trkItr->eta() << " "
1112  << trkDetItr->okECAL << " " << trkDetItr->okHCAL;
1113  if (trkDetItr->okECAL) {
1114  if (trkDetItr->detIdECAL.subdetId() == EcalBarrel)
1115  edm::LogVerbatim("IsoTrack") << (EBDetId)trkDetItr->detIdECAL;
1116  else
1117  edm::LogVerbatim("IsoTrack") << (EEDetId)trkDetItr->detIdECAL;
1118  }
1119  if (trkDetItr->okHCAL)
1120  edm::LogVerbatim("IsoTrack") << (HcalDetId)trkDetItr->detIdHCAL;
1121  }
1122  }
1123 
1124  int nvtxTracks = 0;
1125  for (trkDetItr = trkCaloDets.begin(), nTracks = 0; trkDetItr != trkCaloDets.end(); trkDetItr++, nTracks++) {
1126  const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1127 
1128  // find vertex index the track is associated with
1129  int pVtxTkId = -1;
1130  for (unsigned int ind = 0; ind < recVtxs->size(); ind++) {
1131  if (!((*recVtxs)[ind].isFake())) {
1132  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
1133  for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack != (*recVtxs)[ind].tracks_end(); vtxTrack++) {
1134  const edm::RefToBase<reco::Track> pvtxTrack = (*vtxTrack);
1135  if (pTrack == pvtxTrack.get()) {
1136  pVtxTkId = ind;
1137  break;
1138  if (myverbose_ > 2) {
1139  if (pTrack->pt() > 1.0) {
1140  edm::LogVerbatim("IsoTrack") << "Debug the track association with vertex ";
1141  edm::LogVerbatim("IsoTrack") << pTrack << " " << pvtxTrack.get();
1142  edm::LogVerbatim("IsoTrack")
1143  << " trkVtxIndex " << nvtxTracks << " vtx " << ind << " pt " << pTrack->pt() << " eta "
1144  << pTrack->eta() << " " << pTrack->pt() - pvtxTrack->pt() << " "
1145  << pTrack->eta() - pvtxTrack->eta();
1146  nvtxTracks++;
1147  }
1148  }
1149  }
1150  }
1151  }
1152  }
1153 
1154  const reco::HitPattern &hitp = pTrack->hitPattern();
1155  int nLayersCrossed = hitp.trackerLayersWithMeasurement();
1156  int nOuterHits = hitp.stripTOBLayersWithMeasurement() + hitp.stripTECLayersWithMeasurement();
1157 
1158  bool ifGood = pTrack->quality(trackQuality_);
1159  double pt1 = pTrack->pt();
1160  double p1 = pTrack->p();
1161  double eta1 = pTrack->momentum().eta();
1162  double phi1 = pTrack->momentum().phi();
1163  double etaEcal1 = trkDetItr->etaECAL;
1164  double phiEcal1 = trkDetItr->phiECAL;
1165  double etaHcal1 = trkDetItr->etaHCAL;
1166  double phiHcal1 = trkDetItr->phiHCAL;
1167  double dxy1 = pTrack->dxy();
1168  double dz1 = pTrack->dz();
1169  double chisq1 = pTrack->normalizedChi2();
1170  double dxybs1 = beamSpotH.isValid() ? pTrack->dxy(bspot) : pTrack->dxy();
1171  double dzbs1 = beamSpotH.isValid() ? pTrack->dz(bspot) : pTrack->dz();
1172  double dxypv1 = pTrack->dxy();
1173  double dzpv1 = pTrack->dz();
1174  if (pVtxTkId >= 0) {
1175  math::XYZPoint thisTkPV =
1176  math::XYZPoint((*recVtxs)[pVtxTkId].x(), (*recVtxs)[pVtxTkId].y(), (*recVtxs)[pVtxTkId].z());
1177  dxypv1 = pTrack->dxy(thisTkPV);
1178  dzpv1 = pTrack->dz(thisTkPV);
1179  }
1180 
1181  h_recEtaPt_0->Fill(eta1, pt1);
1182  h_recEtaP_0->Fill(eta1, p1);
1183  h_recPt_0->Fill(pt1);
1184  h_recP_0->Fill(p1);
1185  h_recEta_0->Fill(eta1);
1186  h_recPhi_0->Fill(phi1);
1187 
1188  if (ifGood && nLayersCrossed > 7) {
1189  h_recEtaPt_1->Fill(eta1, pt1);
1190  h_recEtaP_1->Fill(eta1, p1);
1191  h_recPt_1->Fill(pt1);
1192  h_recP_1->Fill(p1);
1193  h_recEta_1->Fill(eta1);
1194  h_recPhi_1->Fill(phi1);
1195  }
1196 
1197  if (!ifGood)
1198  continue;
1199 
1200  if (writeAllTracks_ && p1 > 2.0 && nLayersCrossed > 7) {
1201  t_trackPAll->push_back(p1);
1202  t_trackEtaAll->push_back(eta1);
1203  t_trackPhiAll->push_back(phi1);
1204  t_trackPtAll->push_back(pt1);
1205  t_trackDxyAll->push_back(dxy1);
1206  t_trackDzAll->push_back(dz1);
1207  t_trackDxyPVAll->push_back(dxypv1);
1208  t_trackDzPVAll->push_back(dzpv1);
1209  t_trackChiSqAll->push_back(chisq1);
1210  }
1211  if (doMC_) {
1212  edm::SimTrackContainer::const_iterator matchedSimTrkAll =
1213  spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, *associate, false);
1214  if (writeAllTracks_ && matchedSimTrkAll != SimTk->end())
1215  t_trackPdgIdAll->push_back(matchedSimTrkAll->type());
1216  }
1217 
1218  if (pt1 > minTrackP_ && std::abs(eta1) < maxTrackEta_ && trkDetItr->okECAL) {
1219  double maxNearP31x31 = 999.0, maxNearP25x25 = 999.0, maxNearP21x21 = 999.0, maxNearP15x15 = 999.0;
1220  maxNearP31x31 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 15, 15);
1221  maxNearP25x25 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 12, 12);
1222  maxNearP21x21 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 10, 10);
1223  maxNearP15x15 = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 7, 7);
1224 
1225  int iTrkEtaBin = -1, iTrkMomBin = -1;
1226  for (unsigned int ieta = 0; ieta < NEtaBins; ieta++) {
1228  iTrkEtaBin = ieta;
1229  }
1230  for (unsigned int ipt = 0; ipt < NPBins; ipt++) {
1231  if (p1 > genPartPBins[ipt] && p1 < genPartPBins[ipt + 1])
1232  iTrkMomBin = ipt;
1233  }
1234  if (iTrkMomBin >= 0 && iTrkEtaBin >= 0) {
1235  h_maxNearP31x31[iTrkMomBin][iTrkEtaBin]->Fill(maxNearP31x31);
1236  h_maxNearP25x25[iTrkMomBin][iTrkEtaBin]->Fill(maxNearP25x25);
1237  h_maxNearP21x21[iTrkMomBin][iTrkEtaBin]->Fill(maxNearP21x21);
1238  h_maxNearP15x15[iTrkMomBin][iTrkEtaBin]->Fill(maxNearP15x15);
1239  }
1240  if (maxNearP31x31 < 0.0 && nLayersCrossed > 7 && nOuterHits > 4) {
1241  h_recEtaPt_2->Fill(eta1, pt1);
1242  h_recEtaP_2->Fill(eta1, p1);
1243  h_recPt_2->Fill(pt1);
1244  h_recP_2->Fill(p1);
1245  h_recEta_2->Fill(eta1);
1246  h_recPhi_2->Fill(phi1);
1247  }
1248 
1249  // if charge isolated in ECAL, store the further quantities
1250  if (maxNearP31x31 < 1.0) {
1251  haveIsoTrack = true;
1252 
1253  // get the matching simTrack
1254  double simTrackP = -1;
1255  if (doMC_) {
1256  edm::SimTrackContainer::const_iterator matchedSimTrk =
1257  spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, *associate, false);
1258  if (matchedSimTrk != SimTk->end())
1259  simTrackP = matchedSimTrk->momentum().P();
1260  }
1261 
1263  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
1264 
1265  // get ECal Tranverse Profile
1266  std::pair<double, bool> e7x7P, e9x9P, e11x11P, e15x15P;
1267  std::pair<double, bool> e7x7_10SigP, e9x9_10SigP, e11x11_10SigP, e15x15_10SigP;
1268  std::pair<double, bool> e7x7_15SigP, e9x9_15SigP, e11x11_15SigP, e15x15_15SigP;
1269  std::pair<double, bool> e7x7_20SigP, e9x9_20SigP, e11x11_20SigP, e15x15_20SigP;
1270  std::pair<double, bool> e7x7_25SigP, e9x9_25SigP, e11x11_25SigP, e15x15_25SigP;
1271  std::pair<double, bool> e7x7_30SigP, e9x9_30SigP, e11x11_30SigP, e15x15_30SigP;
1272 
1273  spr::caloSimInfo simInfo3x3, simInfo5x5, simInfo7x7, simInfo9x9;
1274  spr::caloSimInfo simInfo11x11, simInfo13x13, simInfo15x15, simInfo21x21, simInfo25x25, simInfo31x31;
1275  double trkEcalEne = 0;
1276 
1277  const DetId isoCell = trkDetItr->detIdECAL;
1278  e7x7P = spr::eECALmatrix(isoCell,
1279  barrelRecHitsHandle,
1280  endcapRecHitsHandle,
1281  *theEcalChStatus,
1282  geo,
1283  caloTopology,
1284  sevlv.product(),
1285  3,
1286  3,
1287  -100.0,
1288  -100.0,
1289  tMinE_,
1290  tMaxE_);
1291  e9x9P = spr::eECALmatrix(isoCell,
1292  barrelRecHitsHandle,
1293  endcapRecHitsHandle,
1294  *theEcalChStatus,
1295  geo,
1296  caloTopology,
1297  sevlv.product(),
1298  4,
1299  4,
1300  -100.0,
1301  -100.0,
1302  tMinE_,
1303  tMaxE_);
1304  e11x11P = spr::eECALmatrix(isoCell,
1305  barrelRecHitsHandle,
1306  endcapRecHitsHandle,
1307  *theEcalChStatus,
1308  geo,
1309  caloTopology,
1310  sevlv.product(),
1311  5,
1312  5,
1313  -100.0,
1314  -100.0,
1315  tMinE_,
1316  tMaxE_);
1317  e15x15P = spr::eECALmatrix(isoCell,
1318  barrelRecHitsHandle,
1319  endcapRecHitsHandle,
1320  *theEcalChStatus,
1321  geo,
1322  caloTopology,
1323  sevlv.product(),
1324  7,
1325  7,
1326  -100.0,
1327  -100.0,
1328  tMinE_,
1329  tMaxE_);
1330 
1331  e7x7_10SigP = spr::eECALmatrix(isoCell,
1332  barrelRecHitsHandle,
1333  endcapRecHitsHandle,
1334  *theEcalChStatus,
1335  geo,
1336  caloTopology,
1337  sevlv.product(),
1338  3,
1339  3,
1340  0.030,
1341  0.150,
1342  tMinE_,
1343  tMaxE_);
1344  e9x9_10SigP = spr::eECALmatrix(isoCell,
1345  barrelRecHitsHandle,
1346  endcapRecHitsHandle,
1347  *theEcalChStatus,
1348  geo,
1349  caloTopology,
1350  sevlv.product(),
1351  4,
1352  4,
1353  0.030,
1354  0.150,
1355  tMinE_,
1356  tMaxE_);
1357  e11x11_10SigP = spr::eECALmatrix(isoCell,
1358  barrelRecHitsHandle,
1359  endcapRecHitsHandle,
1360  *theEcalChStatus,
1361  geo,
1362  caloTopology,
1363  sevlv.product(),
1364  5,
1365  5,
1366  0.030,
1367  0.150,
1368  tMinE_,
1369  tMaxE_);
1370  e15x15_10SigP = spr::eECALmatrix(isoCell,
1371  barrelRecHitsHandle,
1372  endcapRecHitsHandle,
1373  *theEcalChStatus,
1374  geo,
1375  caloTopology,
1376  sevlv.product(),
1377  7,
1378  7,
1379  0.030,
1380  0.150,
1381  tMinE_,
1382  tMaxE_);
1383 
1384  e7x7_15SigP = spr::eECALmatrix(isoCell,
1385  barrelRecHitsHandle,
1386  endcapRecHitsHandle,
1387  *theEcalChStatus,
1388  geo,
1389  caloTopology,
1390  sevlv.product(),
1391  ttMap,
1392  3,
1393  3,
1394  0.20,
1395  0.45,
1396  tMinE_,
1397  tMaxE_);
1398  e9x9_15SigP = spr::eECALmatrix(isoCell,
1399  barrelRecHitsHandle,
1400  endcapRecHitsHandle,
1401  *theEcalChStatus,
1402  geo,
1403  caloTopology,
1404  sevlv.product(),
1405  ttMap,
1406  4,
1407  4,
1408  0.20,
1409  0.45,
1410  tMinE_,
1411  tMaxE_);
1412  e11x11_15SigP = spr::eECALmatrix(isoCell,
1413  barrelRecHitsHandle,
1414  endcapRecHitsHandle,
1415  *theEcalChStatus,
1416  geo,
1417  caloTopology,
1418  sevlv.product(),
1419  ttMap,
1420  5,
1421  5,
1422  0.20,
1423  0.45,
1424  tMinE_,
1425  tMaxE_);
1426  e15x15_15SigP = spr::eECALmatrix(isoCell,
1427  barrelRecHitsHandle,
1428  endcapRecHitsHandle,
1429  *theEcalChStatus,
1430  geo,
1431  caloTopology,
1432  sevlv.product(),
1433  ttMap,
1434  7,
1435  7,
1436  0.20,
1437  0.45,
1438  tMinE_,
1439  tMaxE_,
1440  false);
1441 
1442  e7x7_20SigP = spr::eECALmatrix(isoCell,
1443  barrelRecHitsHandle,
1444  endcapRecHitsHandle,
1445  *theEcalChStatus,
1446  geo,
1447  caloTopology,
1448  sevlv.product(),
1449  3,
1450  3,
1451  0.060,
1452  0.300,
1453  tMinE_,
1454  tMaxE_);
1455  e9x9_20SigP = spr::eECALmatrix(isoCell,
1456  barrelRecHitsHandle,
1457  endcapRecHitsHandle,
1458  *theEcalChStatus,
1459  geo,
1460  caloTopology,
1461  sevlv.product(),
1462  4,
1463  4,
1464  0.060,
1465  0.300,
1466  tMinE_,
1467  tMaxE_);
1468  e11x11_20SigP = spr::eECALmatrix(isoCell,
1469  barrelRecHitsHandle,
1470  endcapRecHitsHandle,
1471  *theEcalChStatus,
1472  geo,
1473  caloTopology,
1474  sevlv.product(),
1475  5,
1476  5,
1477  0.060,
1478  0.300,
1479  tMinE_,
1480  tMaxE_);
1481  e15x15_20SigP = spr::eECALmatrix(isoCell,
1482  barrelRecHitsHandle,
1483  endcapRecHitsHandle,
1484  *theEcalChStatus,
1485  geo,
1486  caloTopology,
1487  sevlv.product(),
1488  7,
1489  7,
1490  0.060,
1491  0.300,
1492  tMinE_,
1493  tMaxE_);
1494 
1495  e7x7_25SigP = spr::eECALmatrix(isoCell,
1496  barrelRecHitsHandle,
1497  endcapRecHitsHandle,
1498  *theEcalChStatus,
1499  geo,
1500  caloTopology,
1501  sevlv.product(),
1502  3,
1503  3,
1504  0.075,
1505  0.375,
1506  tMinE_,
1507  tMaxE_);
1508  e9x9_25SigP = spr::eECALmatrix(isoCell,
1509  barrelRecHitsHandle,
1510  endcapRecHitsHandle,
1511  *theEcalChStatus,
1512  geo,
1513  caloTopology,
1514  sevlv.product(),
1515  4,
1516  4,
1517  0.075,
1518  0.375,
1519  tMinE_,
1520  tMaxE_);
1521  e11x11_25SigP = spr::eECALmatrix(isoCell,
1522  barrelRecHitsHandle,
1523  endcapRecHitsHandle,
1524  *theEcalChStatus,
1525  geo,
1526  caloTopology,
1527  sevlv.product(),
1528  5,
1529  5,
1530  0.075,
1531  0.375,
1532  tMinE_,
1533  tMaxE_);
1534  e15x15_25SigP = spr::eECALmatrix(isoCell,
1535  barrelRecHitsHandle,
1536  endcapRecHitsHandle,
1537  *theEcalChStatus,
1538  geo,
1539  caloTopology,
1540  sevlv.product(),
1541  7,
1542  7,
1543  0.075,
1544  0.375,
1545  tMinE_,
1546  tMaxE_);
1547 
1548  e7x7_30SigP = spr::eECALmatrix(isoCell,
1549  barrelRecHitsHandle,
1550  endcapRecHitsHandle,
1551  *theEcalChStatus,
1552  geo,
1553  caloTopology,
1554  sevlv.product(),
1555  3,
1556  3,
1557  0.090,
1558  0.450,
1559  tMinE_,
1560  tMaxE_);
1561  e9x9_30SigP = spr::eECALmatrix(isoCell,
1562  barrelRecHitsHandle,
1563  endcapRecHitsHandle,
1564  *theEcalChStatus,
1565  geo,
1566  caloTopology,
1567  sevlv.product(),
1568  4,
1569  4,
1570  0.090,
1571  0.450,
1572  tMinE_,
1573  tMaxE_);
1574  e11x11_30SigP = spr::eECALmatrix(isoCell,
1575  barrelRecHitsHandle,
1576  endcapRecHitsHandle,
1577  *theEcalChStatus,
1578  geo,
1579  caloTopology,
1580  sevlv.product(),
1581  5,
1582  5,
1583  0.090,
1584  0.450,
1585  tMinE_,
1586  tMaxE_);
1587  e15x15_30SigP = spr::eECALmatrix(isoCell,
1588  barrelRecHitsHandle,
1589  endcapRecHitsHandle,
1590  *theEcalChStatus,
1591  geo,
1592  caloTopology,
1593  sevlv.product(),
1594  7,
1595  7,
1596  0.090,
1597  0.450,
1598  tMinE_,
1599  tMaxE_);
1600  if (myverbose_ == 2) {
1601  edm::LogVerbatim("IsoTrack") << "clean ecal rechit ";
1602  edm::LogVerbatim("IsoTrack") << "e7x7 " << e7x7P.first << " e9x9 " << e9x9P.first << " e11x11 "
1603  << e11x11P.first << " e15x15 " << e15x15P.first;
1604  edm::LogVerbatim("IsoTrack") << "e7x7_10Sig " << e7x7_10SigP.first << " e11x11_10Sig " << e11x11_10SigP.first
1605  << " e15x15_10Sig " << e15x15_10SigP.first;
1606  }
1607 
1608  if (doMC_) {
1609  // check the energy from SimHits
1611  iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 1, 1, simInfo3x3);
1613  iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 2, 2, simInfo5x5);
1615  iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 3, 3, simInfo7x7);
1617  iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 4, 4, simInfo9x9);
1619  isoCell,
1620  geo,
1621  caloTopology,
1622  pcaloeb,
1623  pcaloee,
1624  SimTk,
1625  SimVtx,
1626  pTrack,
1627  *associate,
1628  5,
1629  5,
1630  simInfo11x11);
1632  isoCell,
1633  geo,
1634  caloTopology,
1635  pcaloeb,
1636  pcaloee,
1637  SimTk,
1638  SimVtx,
1639  pTrack,
1640  *associate,
1641  6,
1642  6,
1643  simInfo13x13);
1645  isoCell,
1646  geo,
1647  caloTopology,
1648  pcaloeb,
1649  pcaloee,
1650  SimTk,
1651  SimVtx,
1652  pTrack,
1653  *associate,
1654  7,
1655  7,
1656  simInfo15x15,
1657  150.0,
1658  false);
1660  isoCell,
1661  geo,
1662  caloTopology,
1663  pcaloeb,
1664  pcaloee,
1665  SimTk,
1666  SimVtx,
1667  pTrack,
1668  *associate,
1669  10,
1670  10,
1671  simInfo21x21);
1673  isoCell,
1674  geo,
1675  caloTopology,
1676  pcaloeb,
1677  pcaloee,
1678  SimTk,
1679  SimVtx,
1680  pTrack,
1681  *associate,
1682  12,
1683  12,
1684  simInfo25x25);
1686  isoCell,
1687  geo,
1688  caloTopology,
1689  pcaloeb,
1690  pcaloee,
1691  SimTk,
1692  SimVtx,
1693  pTrack,
1694  *associate,
1695  15,
1696  15,
1697  simInfo31x31);
1698 
1699  trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate);
1700  if (myverbose_ == 1) {
1701  edm::LogVerbatim("IsoTrack") << "Track momentum " << pt1;
1702  edm::LogVerbatim("IsoTrack") << "ecal siminfo ";
1703  edm::LogVerbatim("IsoTrack") << "simInfo3x3: eTotal " << simInfo3x3.eTotal << " eMatched "
1704  << simInfo3x3.eMatched << " eRest " << simInfo3x3.eRest << " eGamma "
1705  << simInfo3x3.eGamma << " eNeutralHad " << simInfo3x3.eNeutralHad
1706  << " eChargedHad " << simInfo3x3.eChargedHad;
1707  edm::LogVerbatim("IsoTrack") << "simInfo5x5: eTotal " << simInfo5x5.eTotal << " eMatched "
1708  << simInfo5x5.eMatched << " eRest " << simInfo5x5.eRest << " eGamma "
1709  << simInfo5x5.eGamma << " eNeutralHad " << simInfo5x5.eNeutralHad
1710  << " eChargedHad " << simInfo5x5.eChargedHad;
1711  edm::LogVerbatim("IsoTrack") << "simInfo7x7: eTotal " << simInfo7x7.eTotal << " eMatched "
1712  << simInfo7x7.eMatched << " eRest " << simInfo7x7.eRest << " eGamma "
1713  << simInfo7x7.eGamma << " eNeutralHad " << simInfo7x7.eNeutralHad
1714  << " eChargedHad " << simInfo7x7.eChargedHad;
1715  edm::LogVerbatim("IsoTrack") << "simInfo9x9: eTotal " << simInfo9x9.eTotal << " eMatched "
1716  << simInfo9x9.eMatched << " eRest " << simInfo9x9.eRest << " eGamma "
1717  << simInfo9x9.eGamma << " eNeutralHad " << simInfo9x9.eNeutralHad
1718  << " eChargedHad " << simInfo9x9.eChargedHad;
1719  edm::LogVerbatim("IsoTrack") << "simInfo11x11: eTotal " << simInfo11x11.eTotal << " eMatched "
1720  << simInfo11x11.eMatched << " eRest " << simInfo11x11.eRest << " eGamma "
1721  << simInfo11x11.eGamma << " eNeutralHad " << simInfo11x11.eNeutralHad
1722  << " eChargedHad " << simInfo11x11.eChargedHad;
1723  edm::LogVerbatim("IsoTrack") << "simInfo15x15: eTotal " << simInfo15x15.eTotal << " eMatched "
1724  << simInfo15x15.eMatched << " eRest " << simInfo15x15.eRest << " eGamma "
1725  << simInfo15x15.eGamma << " eNeutralHad " << simInfo15x15.eNeutralHad
1726  << " eChargedHad " << simInfo15x15.eChargedHad;
1727  edm::LogVerbatim("IsoTrack") << "simInfo31x31: eTotal " << simInfo31x31.eTotal << " eMatched "
1728  << simInfo31x31.eMatched << " eRest " << simInfo31x31.eRest << " eGamma "
1729  << simInfo31x31.eGamma << " eNeutralHad " << simInfo31x31.eNeutralHad
1730  << " eChargedHad " << simInfo31x31.eChargedHad;
1731  edm::LogVerbatim("IsoTrack") << "trkEcalEne" << trkEcalEne;
1732  }
1733  }
1734 
1735  // ======= Get HCAL information
1736  double hcalScale = 1.0;
1737  if (std::abs(pTrack->eta()) < 1.4) {
1738  hcalScale = 120.0;
1739  } else {
1740  hcalScale = 135.0;
1741  }
1742 
1743  double maxNearHcalP3x3 = -1, maxNearHcalP5x5 = -1, maxNearHcalP7x7 = -1;
1744  maxNearHcalP3x3 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 1, 1);
1745  maxNearHcalP5x5 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 2, 2);
1746  maxNearHcalP7x7 = spr::chargeIsolationHcal(nTracks, trkCaloDets, theHBHETopology, 3, 3);
1747 
1748  double h3x3 = 0, h5x5 = 0, h7x7 = 0;
1749  double h3x3Sig = 0, h5x5Sig = 0, h7x7Sig = 0;
1750  double trkHcalEne = 0;
1751  spr::caloSimInfo hsimInfo3x3, hsimInfo5x5, hsimInfo7x7;
1752 
1753  if (trkDetItr->okHCAL) {
1754  const DetId ClosestCell(trkDetItr->detIdHCAL);
1755  // bool includeHO=false, bool algoNew=true, bool debug=false
1756  h3x3 = spr::eHCALmatrix(
1757  theHBHETopology, ClosestCell, hbhe, 1, 1, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_);
1758  h5x5 = spr::eHCALmatrix(
1759  theHBHETopology, ClosestCell, hbhe, 2, 2, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_);
1760  h7x7 = spr::eHCALmatrix(
1761  theHBHETopology, ClosestCell, hbhe, 3, 3, false, true, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_);
1762  h3x3Sig = spr::eHCALmatrix(
1763  theHBHETopology, ClosestCell, hbhe, 1, 1, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_, tMaxH_);
1764  h5x5Sig = spr::eHCALmatrix(
1765  theHBHETopology, ClosestCell, hbhe, 2, 2, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_, tMaxH_);
1766  h7x7Sig = spr::eHCALmatrix(
1767  theHBHETopology, ClosestCell, hbhe, 3, 3, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_, tMaxH_);
1768 
1769  if (myverbose_ == 2) {
1770  edm::LogVerbatim("IsoTrack") << "HCAL 3x3 " << h3x3 << " " << h3x3Sig << " 5x5 " << h5x5 << " " << h5x5Sig
1771  << " 7x7 " << h7x7 << " " << h7x7Sig;
1772  }
1773 
1774  if (doMC_) {
1776  iEvent, theHBHETopology, ClosestCell, geo, pcalohh, SimTk, SimVtx, pTrack, *associate, 1, 1, hsimInfo3x3);
1778  iEvent, theHBHETopology, ClosestCell, geo, pcalohh, SimTk, SimVtx, pTrack, *associate, 2, 2, hsimInfo5x5);
1780  theHBHETopology,
1781  ClosestCell,
1782  geo,
1783  pcalohh,
1784  SimTk,
1785  SimVtx,
1786  pTrack,
1787  *associate,
1788  3,
1789  3,
1790  hsimInfo7x7,
1791  150.0,
1792  false,
1793  false);
1794  trkHcalEne = spr::eCaloSimInfo(iEvent, geo, pcalohh, SimTk, SimVtx, pTrack, *associate);
1795  if (myverbose_ == 1) {
1796  edm::LogVerbatim("IsoTrack") << "Hcal siminfo ";
1797  edm::LogVerbatim("IsoTrack")
1798  << "hsimInfo3x3: eTotal " << hsimInfo3x3.eTotal << " eMatched " << hsimInfo3x3.eMatched << " eRest "
1799  << hsimInfo3x3.eRest << " eGamma " << hsimInfo3x3.eGamma << " eNeutralHad " << hsimInfo3x3.eNeutralHad
1800  << " eChargedHad " << hsimInfo3x3.eChargedHad;
1801  edm::LogVerbatim("IsoTrack")
1802  << "hsimInfo5x5: eTotal " << hsimInfo5x5.eTotal << " eMatched " << hsimInfo5x5.eMatched << " eRest "
1803  << hsimInfo5x5.eRest << " eGamma " << hsimInfo5x5.eGamma << " eNeutralHad " << hsimInfo5x5.eNeutralHad
1804  << " eChargedHad " << hsimInfo5x5.eChargedHad;
1805  edm::LogVerbatim("IsoTrack")
1806  << "hsimInfo7x7: eTotal " << hsimInfo7x7.eTotal << " eMatched " << hsimInfo7x7.eMatched << " eRest "
1807  << hsimInfo7x7.eRest << " eGamma " << hsimInfo7x7.eGamma << " eNeutralHad " << hsimInfo7x7.eNeutralHad
1808  << " eChargedHad " << hsimInfo7x7.eChargedHad;
1809  edm::LogVerbatim("IsoTrack") << "trkHcalEne " << trkHcalEne;
1810  }
1811  }
1812 
1813  // debug the ecal and hcal matrix
1814  if (myverbose_ == 4) {
1815  edm::LogVerbatim("IsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event();
1816  std::vector<std::pair<DetId, double> > v7x7 =
1817  spr::eHCALmatrixCell(theHBHETopology, ClosestCell, hbhe, 3, 3, false, false);
1818  double sumv = 0.0;
1819 
1820  for (unsigned int iv = 0; iv < v7x7.size(); iv++) {
1821  sumv += v7x7[iv].second;
1822  }
1823  edm::LogVerbatim("IsoTrack") << "h7x7 " << h7x7 << " v7x7 " << sumv << " in " << v7x7.size();
1824  for (unsigned int iv = 0; iv < v7x7.size(); iv++) {
1825  HcalDetId id = v7x7[iv].first;
1826  edm::LogVerbatim("IsoTrack") << " Cell " << iv << " 0x" << std::hex << v7x7[iv].first() << std::dec << " "
1827  << id << " Energy " << v7x7[iv].second;
1828  }
1829  }
1830  }
1831  if (doMC_) {
1832  trkHcalEne = spr::eCaloSimInfo(iEvent, geo, pcalohh, SimTk, SimVtx, pTrack, *associate);
1833  }
1834 
1835  // ====================================================================================================
1836  // get diff between track outermost hit position and the propagation point at outermost surface of tracker
1837  std::pair<math::XYZPoint, double> point2_TK0 = spr::propagateTrackerEnd(pTrack, bField, false);
1838  math::XYZPoint diff(pTrack->outerPosition().X() - point2_TK0.first.X(),
1839  pTrack->outerPosition().Y() - point2_TK0.first.Y(),
1840  pTrack->outerPosition().Z() - point2_TK0.first.Z());
1841  double trackOutPosOutHitDr = diff.R();
1842  double trackL = point2_TK0.second;
1843  if (myverbose_ == 5) {
1844  edm::LogVerbatim("IsoTrack") << " propagted " << point2_TK0.first << " " << point2_TK0.first.eta() << " "
1845  << point2_TK0.first.phi();
1846  edm::LogVerbatim("IsoTrack") << " outerPosition() " << pTrack->outerPosition() << " "
1847  << pTrack->outerPosition().eta() << " " << pTrack->outerPosition().phi();
1848  edm::LogVerbatim("IsoTrack") << "diff " << diff << " diffR " << diff.R() << " diffR/L "
1849  << diff.R() / point2_TK0.second;
1850  }
1851 
1852  for (unsigned int ind = 0; ind < recVtxs->size(); ind++) {
1853  if (!((*recVtxs)[ind].isFake())) {
1854  reco::Vertex::trackRef_iterator vtxTrack = (*recVtxs)[ind].tracks_begin();
1855  if (deltaR(eta1, phi1, (*vtxTrack)->eta(), (*vtxTrack)->phi()) < 0.01)
1856  t_trackPVIdx->push_back(ind);
1857  else
1858  t_trackPVIdx->push_back(-1);
1859  }
1860  }
1861 
1862  // Fill the tree Branches here
1863  t_trackPVIdx->push_back(pVtxTkId);
1864  t_trackP->push_back(p1);
1865  t_trackPt->push_back(pt1);
1866  t_trackEta->push_back(eta1);
1867  t_trackPhi->push_back(phi1);
1868  t_trackEcalEta->push_back(etaEcal1);
1869  t_trackEcalPhi->push_back(phiEcal1);
1870  t_trackHcalEta->push_back(etaHcal1);
1871  t_trackHcalPhi->push_back(phiHcal1);
1872  t_trackDxy->push_back(dxy1);
1873  t_trackDz->push_back(dz1);
1874  t_trackDxyBS->push_back(dxybs1);
1875  t_trackDzBS->push_back(dzbs1);
1876  t_trackDxyPV->push_back(dxypv1);
1877  t_trackDzPV->push_back(dzpv1);
1878  t_trackChiSq->push_back(chisq1);
1879  t_trackNOuterHits->push_back(nOuterHits);
1880  t_NLayersCrossed->push_back(nLayersCrossed);
1881 
1882  t_trackHitsTOB->push_back(hitp.stripTOBLayersWithMeasurement());
1883  t_trackHitsTEC->push_back(hitp.stripTECLayersWithMeasurement());
1890 
1897 
1906  t_trackOutPosOutHitDr->push_back(trackOutPosOutHitDr);
1907  t_trackL->push_back(trackL);
1908 
1909  t_maxNearP31x31->push_back(maxNearP31x31);
1910  t_maxNearP21x21->push_back(maxNearP21x21);
1911 
1912  t_ecalSpike11x11->push_back(e11x11P.second);
1913  t_e7x7->push_back(e7x7P.first);
1914  t_e9x9->push_back(e9x9P.first);
1915  t_e11x11->push_back(e11x11P.first);
1916  t_e15x15->push_back(e15x15P.first);
1917 
1918  t_e7x7_10Sig->push_back(e7x7_10SigP.first);
1919  t_e9x9_10Sig->push_back(e9x9_10SigP.first);
1920  t_e11x11_10Sig->push_back(e11x11_10SigP.first);
1921  t_e15x15_10Sig->push_back(e15x15_10SigP.first);
1922  t_e7x7_15Sig->push_back(e7x7_15SigP.first);
1923  t_e9x9_15Sig->push_back(e9x9_15SigP.first);
1924  t_e11x11_15Sig->push_back(e11x11_15SigP.first);
1925  t_e15x15_15Sig->push_back(e15x15_15SigP.first);
1926  t_e7x7_20Sig->push_back(e7x7_20SigP.first);
1927  t_e9x9_20Sig->push_back(e9x9_20SigP.first);
1928  t_e11x11_20Sig->push_back(e11x11_20SigP.first);
1929  t_e15x15_20Sig->push_back(e15x15_20SigP.first);
1930  t_e7x7_25Sig->push_back(e7x7_25SigP.first);
1931  t_e9x9_25Sig->push_back(e9x9_25SigP.first);
1932  t_e11x11_25Sig->push_back(e11x11_25SigP.first);
1933  t_e15x15_25Sig->push_back(e15x15_25SigP.first);
1934  t_e7x7_30Sig->push_back(e7x7_30SigP.first);
1935  t_e9x9_30Sig->push_back(e9x9_30SigP.first);
1936  t_e11x11_30Sig->push_back(e11x11_30SigP.first);
1937  t_e15x15_30Sig->push_back(e15x15_30SigP.first);
1938 
1939  if (doMC_) {
1940  t_esim7x7->push_back(simInfo7x7.eTotal);
1941  t_esim9x9->push_back(simInfo9x9.eTotal);
1942  t_esim11x11->push_back(simInfo11x11.eTotal);
1943  t_esim15x15->push_back(simInfo15x15.eTotal);
1944 
1945  t_esim7x7Matched->push_back(simInfo7x7.eMatched);
1946  t_esim9x9Matched->push_back(simInfo9x9.eMatched);
1947  t_esim11x11Matched->push_back(simInfo11x11.eMatched);
1948  t_esim15x15Matched->push_back(simInfo15x15.eMatched);
1949 
1950  t_esim7x7Rest->push_back(simInfo7x7.eRest);
1951  t_esim9x9Rest->push_back(simInfo9x9.eRest);
1952  t_esim11x11Rest->push_back(simInfo11x11.eRest);
1953  t_esim15x15Rest->push_back(simInfo15x15.eRest);
1954 
1955  t_esim7x7Photon->push_back(simInfo7x7.eGamma);
1956  t_esim9x9Photon->push_back(simInfo9x9.eGamma);
1957  t_esim11x11Photon->push_back(simInfo11x11.eGamma);
1958  t_esim15x15Photon->push_back(simInfo15x15.eGamma);
1959 
1960  t_esim7x7NeutHad->push_back(simInfo7x7.eNeutralHad);
1961  t_esim9x9NeutHad->push_back(simInfo9x9.eNeutralHad);
1962  t_esim11x11NeutHad->push_back(simInfo11x11.eNeutralHad);
1963  t_esim15x15NeutHad->push_back(simInfo15x15.eNeutralHad);
1964 
1965  t_esim7x7CharHad->push_back(simInfo7x7.eChargedHad);
1966  t_esim9x9CharHad->push_back(simInfo9x9.eChargedHad);
1967  t_esim11x11CharHad->push_back(simInfo11x11.eChargedHad);
1968  t_esim15x15CharHad->push_back(simInfo15x15.eChargedHad);
1969 
1970  t_trkEcalEne->push_back(trkEcalEne);
1971  t_simTrackP->push_back(simTrackP);
1972  t_esimPdgId->push_back(simInfo11x11.pdgMatched);
1973  }
1974 
1975  t_maxNearHcalP3x3->push_back(maxNearHcalP3x3);
1976  t_maxNearHcalP5x5->push_back(maxNearHcalP5x5);
1977  t_maxNearHcalP7x7->push_back(maxNearHcalP7x7);
1978 
1979  t_h3x3->push_back(h3x3);
1980  t_h5x5->push_back(h5x5);
1981  t_h7x7->push_back(h7x7);
1982  t_h3x3Sig->push_back(h3x3Sig);
1983  t_h5x5Sig->push_back(h5x5Sig);
1984  t_h7x7Sig->push_back(h7x7Sig);
1985 
1986  t_infoHcal->push_back(trkDetItr->okHCAL);
1987  if (doMC_) {
1988  t_trkHcalEne->push_back(hcalScale * trkHcalEne);
1989 
1990  t_hsim3x3->push_back(hcalScale * hsimInfo3x3.eTotal);
1991  t_hsim5x5->push_back(hcalScale * hsimInfo5x5.eTotal);
1992  t_hsim7x7->push_back(hcalScale * hsimInfo7x7.eTotal);
1993 
1994  t_hsim3x3Matched->push_back(hcalScale * hsimInfo3x3.eMatched);
1995  t_hsim5x5Matched->push_back(hcalScale * hsimInfo5x5.eMatched);
1996  t_hsim7x7Matched->push_back(hcalScale * hsimInfo7x7.eMatched);
1997 
1998  t_hsim3x3Rest->push_back(hcalScale * hsimInfo3x3.eRest);
1999  t_hsim5x5Rest->push_back(hcalScale * hsimInfo5x5.eRest);
2000  t_hsim7x7Rest->push_back(hcalScale * hsimInfo7x7.eRest);
2001 
2002  t_hsim3x3Photon->push_back(hcalScale * hsimInfo3x3.eGamma);
2003  t_hsim5x5Photon->push_back(hcalScale * hsimInfo5x5.eGamma);
2004  t_hsim7x7Photon->push_back(hcalScale * hsimInfo7x7.eGamma);
2005 
2006  t_hsim3x3NeutHad->push_back(hcalScale * hsimInfo3x3.eNeutralHad);
2007  t_hsim5x5NeutHad->push_back(hcalScale * hsimInfo5x5.eNeutralHad);
2008  t_hsim7x7NeutHad->push_back(hcalScale * hsimInfo7x7.eNeutralHad);
2009 
2010  t_hsim3x3CharHad->push_back(hcalScale * hsimInfo3x3.eChargedHad);
2011  t_hsim5x5CharHad->push_back(hcalScale * hsimInfo5x5.eChargedHad);
2012  t_hsim7x7CharHad->push_back(hcalScale * hsimInfo7x7.eChargedHad);
2013  }
2014 
2015  } // if loosely isolated track
2016  } // check p1/eta
2017  } // loop over track collection
2018 
2019  if (haveIsoTrack)
2020  tree_->Fill();
2021 }
2022 
2023 // ----- method called once each job just before starting event loop ----
2025  nEventProc_ = 0;
2026  nbad_ = 0;
2027  initL1_ = false;
2028  double tempgen_TH[NPBins + 1] = {
2029  0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 20.0, 30.0, 50.0, 75.0, 100.0};
2030 
2031  for (unsigned int i = 0; i < NPBins + 1; i++)
2032  genPartPBins[i] = tempgen_TH[i];
2033 
2034  double tempgen_Eta[NEtaBins + 1] = {0.0, 1.131, 1.653, 2.172};
2035 
2036  for (unsigned int i = 0; i < NEtaBins + 1; i++)
2037  genPartEtaBins[i] = tempgen_Eta[i];
2038 
2039  bookHistograms();
2040 }
2041 
2042 // ----- method called once each job just after ending the event loop ----
2044  if (L1TriggerAlgoInfo_) {
2045  std::map<std::pair<unsigned int, std::string>, int>::iterator itr;
2046  for (itr = l1AlgoMap_.begin(); itr != l1AlgoMap_.end(); itr++) {
2047  edm::LogVerbatim("IsoTrack") << " ****endjob**** " << (itr->first).first << " " << (itr->first).second << " "
2048  << itr->second;
2049  int ibin = (itr->first).first;
2050  TString name((itr->first).second);
2051  h_L1AlgoNames->GetXaxis()->SetBinLabel(ibin + 1, name);
2052  }
2053  edm::LogVerbatim("IsoTrack") << "Number of Events Processed " << nEventProc_;
2054  }
2055 }
2056 
2057 //========================================================================================================
2058 
2060  t_PVx->clear();
2061  t_PVy->clear();
2062  t_PVz->clear();
2063  t_PVisValid->clear();
2064  t_PVndof->clear();
2065  t_PVNTracks->clear();
2066  t_PVNTracksWt->clear();
2067  t_PVTracksSumPt->clear();
2068  t_PVTracksSumPtWt->clear();
2069  t_PVNTracksHP->clear();
2070  t_PVNTracksHPWt->clear();
2071  t_PVTracksSumPtHP->clear();
2072  t_PVTracksSumPtHPWt->clear();
2073 
2074  for (int i = 0; i < 128; i++)
2075  t_L1Decision[i] = 0;
2076  t_L1AlgoNames->clear();
2077  t_L1PreScale->clear();
2078 
2079  t_L1CenJetPt->clear();
2080  t_L1CenJetEta->clear();
2081  t_L1CenJetPhi->clear();
2082  t_L1FwdJetPt->clear();
2083  t_L1FwdJetEta->clear();
2084  t_L1FwdJetPhi->clear();
2085  t_L1TauJetPt->clear();
2086  t_L1TauJetEta->clear();
2087  t_L1TauJetPhi->clear();
2088  t_L1MuonPt->clear();
2089  t_L1MuonEta->clear();
2090  t_L1MuonPhi->clear();
2091  t_L1IsoEMPt->clear();
2092  t_L1IsoEMEta->clear();
2093  t_L1IsoEMPhi->clear();
2094  t_L1NonIsoEMPt->clear();
2095  t_L1NonIsoEMEta->clear();
2096  t_L1NonIsoEMPhi->clear();
2097  t_L1METPt->clear();
2098  t_L1METEta->clear();
2099  t_L1METPhi->clear();
2100 
2101  t_jetPt->clear();
2102  t_jetEta->clear();
2103  t_jetPhi->clear();
2104  t_nTrksJetCalo->clear();
2105  t_nTrksJetVtx->clear();
2106 
2107  t_trackPAll->clear();
2108  t_trackEtaAll->clear();
2109  t_trackPhiAll->clear();
2110  t_trackPdgIdAll->clear();
2111  t_trackPtAll->clear();
2112  t_trackDxyAll->clear();
2113  t_trackDzAll->clear();
2114  t_trackDxyPVAll->clear();
2115  t_trackDzPVAll->clear();
2116  t_trackChiSqAll->clear();
2117 
2118  t_trackP->clear();
2119  t_trackPt->clear();
2120  t_trackEta->clear();
2121  t_trackPhi->clear();
2122  t_trackEcalEta->clear();
2123  t_trackEcalPhi->clear();
2124  t_trackHcalEta->clear();
2125  t_trackHcalPhi->clear();
2126  t_NLayersCrossed->clear();
2127  t_trackNOuterHits->clear();
2128  t_trackDxy->clear();
2129  t_trackDxyBS->clear();
2130  t_trackDz->clear();
2131  t_trackDzBS->clear();
2132  t_trackDxyPV->clear();
2133  t_trackDzPV->clear();
2134  t_trackChiSq->clear();
2135  t_trackPVIdx->clear();
2136  t_trackHitsTOB->clear();
2137  t_trackHitsTEC->clear();
2138  t_trackHitInMissTOB->clear();
2139  t_trackHitInMissTEC->clear();
2140  t_trackHitInMissTIB->clear();
2141  t_trackHitInMissTID->clear();
2142  t_trackHitInMissTIBTID->clear();
2143  t_trackHitOutMissTOB->clear();
2144  t_trackHitOutMissTEC->clear();
2145  t_trackHitOutMissTIB->clear();
2146  t_trackHitOutMissTID->clear();
2147  t_trackHitOutMissTOBTEC->clear();
2148  t_trackHitInMeasTOB->clear();
2149  t_trackHitInMeasTEC->clear();
2150  t_trackHitInMeasTIB->clear();
2151  t_trackHitInMeasTID->clear();
2152  t_trackHitOutMeasTOB->clear();
2153  t_trackHitOutMeasTEC->clear();
2154  t_trackHitOutMeasTIB->clear();
2155  t_trackHitOutMeasTID->clear();
2156  t_trackOutPosOutHitDr->clear();
2157  t_trackL->clear();
2158 
2159  t_maxNearP31x31->clear();
2160  t_maxNearP21x21->clear();
2161 
2162  t_ecalSpike11x11->clear();
2163  t_e7x7->clear();
2164  t_e9x9->clear();
2165  t_e11x11->clear();
2166  t_e15x15->clear();
2167 
2168  t_e7x7_10Sig->clear();
2169  t_e9x9_10Sig->clear();
2170  t_e11x11_10Sig->clear();
2171  t_e15x15_10Sig->clear();
2172  t_e7x7_15Sig->clear();
2173  t_e9x9_15Sig->clear();
2174  t_e11x11_15Sig->clear();
2175  t_e15x15_15Sig->clear();
2176  t_e7x7_20Sig->clear();
2177  t_e9x9_20Sig->clear();
2178  t_e11x11_20Sig->clear();
2179  t_e15x15_20Sig->clear();
2180  t_e7x7_25Sig->clear();
2181  t_e9x9_25Sig->clear();
2182  t_e11x11_25Sig->clear();
2183  t_e15x15_25Sig->clear();
2184  t_e7x7_30Sig->clear();
2185  t_e9x9_30Sig->clear();
2186  t_e11x11_30Sig->clear();
2187  t_e15x15_30Sig->clear();
2188 
2189  if (doMC_) {
2190  t_simTrackP->clear();
2191  t_esimPdgId->clear();
2192  t_trkEcalEne->clear();
2193 
2194  t_esim7x7->clear();
2195  t_esim9x9->clear();
2196  t_esim11x11->clear();
2197  t_esim15x15->clear();
2198 
2199  t_esim7x7Matched->clear();
2200  t_esim9x9Matched->clear();
2201  t_esim11x11Matched->clear();
2202  t_esim15x15Matched->clear();
2203 
2204  t_esim7x7Rest->clear();
2205  t_esim9x9Rest->clear();
2206  t_esim11x11Rest->clear();
2207  t_esim15x15Rest->clear();
2208 
2209  t_esim7x7Photon->clear();
2210  t_esim9x9Photon->clear();
2211  t_esim11x11Photon->clear();
2212  t_esim15x15Photon->clear();
2213 
2214  t_esim7x7NeutHad->clear();
2215  t_esim9x9NeutHad->clear();
2216  t_esim11x11NeutHad->clear();
2217  t_esim15x15NeutHad->clear();
2218 
2219  t_esim7x7CharHad->clear();
2220  t_esim9x9CharHad->clear();
2221  t_esim11x11CharHad->clear();
2222  t_esim15x15CharHad->clear();
2223  }
2224 
2225  t_maxNearHcalP3x3->clear();
2226  t_maxNearHcalP5x5->clear();
2227  t_maxNearHcalP7x7->clear();
2228 
2229  t_h3x3->clear();
2230  t_h5x5->clear();
2231  t_h7x7->clear();
2232  t_h3x3Sig->clear();
2233  t_h5x5Sig->clear();
2234  t_h7x7Sig->clear();
2235 
2236  t_infoHcal->clear();
2237 
2238  if (doMC_) {
2239  t_trkHcalEne->clear();
2240 
2241  t_hsim3x3->clear();
2242  t_hsim5x5->clear();
2243  t_hsim7x7->clear();
2244  t_hsim3x3Matched->clear();
2245  t_hsim5x5Matched->clear();
2246  t_hsim7x7Matched->clear();
2247  t_hsim3x3Rest->clear();
2248  t_hsim5x5Rest->clear();
2249  t_hsim7x7Rest->clear();
2250  t_hsim3x3Photon->clear();
2251  t_hsim5x5Photon->clear();
2252  t_hsim7x7Photon->clear();
2253  t_hsim3x3NeutHad->clear();
2254  t_hsim5x5NeutHad->clear();
2255  t_hsim7x7NeutHad->clear();
2256  t_hsim3x3CharHad->clear();
2257  t_hsim5x5CharHad->clear();
2258  t_hsim7x7CharHad->clear();
2259  }
2260 }
2261 
2263  char hname[100], htit[100];
2264 
2266  TFileDirectory dir = fs->mkdir("nearMaxTrackP");
2267 
2268  for (unsigned int ieta = 0; ieta < NEtaBins; ieta++) {
2269  double lowEta = -5.0, highEta = 5.0;
2270  lowEta = genPartEtaBins[ieta];
2271  highEta = genPartEtaBins[ieta + 1];
2272 
2273  for (unsigned int ipt = 0; ipt < NPBins; ipt++) {
2274  double lowP = 0.0, highP = 300.0;
2275  lowP = genPartPBins[ipt];
2276  highP = genPartPBins[ipt + 1];
2277  sprintf(hname, "h_maxNearP31x31_ptBin%i_etaBin%i", ipt, ieta);
2278  sprintf(htit, "maxNearP in 31x31 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2279  h_maxNearP31x31[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
2280  h_maxNearP31x31[ipt][ieta]->Sumw2();
2281  sprintf(hname, "h_maxNearP25x25_ptBin%i_etaBin%i", ipt, ieta);
2282  sprintf(htit, "maxNearP in 25x25 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2283  h_maxNearP25x25[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
2284  h_maxNearP25x25[ipt][ieta]->Sumw2();
2285  sprintf(hname, "h_maxNearP21x21_ptBin%i_etaBin%i", ipt, ieta);
2286  sprintf(htit, "maxNearP in 21x21 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2287  h_maxNearP21x21[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
2288  h_maxNearP21x21[ipt][ieta]->Sumw2();
2289  sprintf(hname, "h_maxNearP15x15_ptBin%i_etaBin%i", ipt, ieta);
2290  sprintf(htit, "maxNearP in 15x15 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2291  h_maxNearP15x15[ipt][ieta] = dir.make<TH1F>(hname, htit, 220, -2.0, 20.0);
2292  h_maxNearP15x15[ipt][ieta]->Sumw2();
2293  }
2294  }
2295 
2296  h_L1AlgoNames = fs->make<TH1I>("h_L1AlgoNames", "h_L1AlgoNames:Bin Labels", 128, -0.5, 127.5);
2297 
2298  // Reconstructed Tracks
2299 
2300  h_PVTracksWt = fs->make<TH1F>("h_PVTracksWt", "h_PVTracksWt", 600, -0.1, 1.1);
2301 
2302  h_nTracks = fs->make<TH1F>("h_nTracks", "h_nTracks", 1000, -0.5, 999.5);
2303 
2304  sprintf(hname, "h_recEtaPt_0");
2305  sprintf(htit, "h_recEtaPt (all tracks Eta vs pT)");
2306  h_recEtaPt_0 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2307 
2308  sprintf(hname, "h_recEtaP_0");
2309  sprintf(htit, "h_recEtaP (all tracks Eta vs pT)");
2310  h_recEtaP_0 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2311 
2312  h_recPt_0 = fs->make<TH1F>("h_recPt_0", "Pt (all tracks)", 15, genPartPBins);
2313  h_recP_0 = fs->make<TH1F>("h_recP_0", "P (all tracks)", 15, genPartPBins);
2314  h_recEta_0 = fs->make<TH1F>("h_recEta_0", "Eta (all tracks)", 60, -3.0, 3.0);
2315  h_recPhi_0 = fs->make<TH1F>("h_recPhi_0", "Phi (all tracks)", 100, -3.2, 3.2);
2316  //-------------------------
2317  sprintf(hname, "h_recEtaPt_1");
2318  sprintf(htit, "h_recEtaPt (all good tracks Eta vs pT)");
2319  h_recEtaPt_1 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2320 
2321  sprintf(hname, "h_recEtaP_1");
2322  sprintf(htit, "h_recEtaP (all good tracks Eta vs pT)");
2323  h_recEtaP_1 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2324 
2325  h_recPt_1 = fs->make<TH1F>("h_recPt_1", "Pt (all good tracks)", 15, genPartPBins);
2326  h_recP_1 = fs->make<TH1F>("h_recP_1", "P (all good tracks)", 15, genPartPBins);
2327  h_recEta_1 = fs->make<TH1F>("h_recEta_1", "Eta (all good tracks)", 60, -3.0, 3.0);
2328  h_recPhi_1 = fs->make<TH1F>("h_recPhi_1", "Phi (all good tracks)", 100, -3.2, 3.2);
2329  //-------------------------
2330  sprintf(hname, "h_recEtaPt_2");
2331  sprintf(htit, "h_recEtaPt (charge isolation Eta vs pT)");
2332  h_recEtaPt_2 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2333 
2334  sprintf(hname, "h_recEtaP_2");
2335  sprintf(htit, "h_recEtaP (charge isolation Eta vs pT)");
2336  h_recEtaP_2 = fs->make<TH2F>(hname, htit, 30, -3.0, 3.0, 15, genPartPBins);
2337 
2338  h_recPt_2 = fs->make<TH1F>("h_recPt_2", "Pt (charge isolation)", 15, genPartPBins);
2339  h_recP_2 = fs->make<TH1F>("h_recP_2", "P (charge isolation)", 15, genPartPBins);
2340  h_recEta_2 = fs->make<TH1F>("h_recEta_2", "Eta (charge isolation)", 60, -3.0, 3.0);
2341  h_recPhi_2 = fs->make<TH1F>("h_recPhi_2", "Phi (charge isolation)", 100, -3.2, 3.2);
2342 
2343  tree_ = fs->make<TTree>("tree", "tree");
2344  tree_->SetAutoSave(10000);
2345 
2346  tree_->Branch("t_EvtNo", &t_EvtNo, "t_EvtNo/I");
2347  tree_->Branch("t_RunNo", &t_RunNo, "t_RunNo/I");
2348  tree_->Branch("t_Lumi", &t_Lumi, "t_Lumi/I");
2349  tree_->Branch("t_Bunch", &t_Bunch, "t_Bunch/I");
2350 
2351  t_PVx = new std::vector<double>();
2352  t_PVy = new std::vector<double>();
2353  t_PVz = new std::vector<double>();
2354  t_PVisValid = new std::vector<int>();
2355  t_PVndof = new std::vector<int>();
2356  t_PVNTracks = new std::vector<int>();
2357  t_PVNTracksWt = new std::vector<int>();
2358  t_PVTracksSumPt = new std::vector<double>();
2359  t_PVTracksSumPtWt = new std::vector<double>();
2360  t_PVNTracksHP = new std::vector<int>();
2361  t_PVNTracksHPWt = new std::vector<int>();
2362  t_PVTracksSumPtHP = new std::vector<double>();
2363  t_PVTracksSumPtHPWt = new std::vector<double>();
2364 
2365  tree_->Branch("PVx", "std::vector<double>", &t_PVx);
2366  tree_->Branch("PVy", "std::vector<double>", &t_PVy);
2367  tree_->Branch("PVz", "std::vector<double>", &t_PVz);
2368  tree_->Branch("PVisValid", "std::vector<int>", &t_PVisValid);
2369  tree_->Branch("PVndof", "std::vector<int>", &t_PVndof);
2370  tree_->Branch("PVNTracks", "std::vector<int>", &t_PVNTracks);
2371  tree_->Branch("PVNTracksWt", "std::vector<int>", &t_PVNTracksWt);
2372  tree_->Branch("t_PVTracksSumPt", "std::vector<double>", &t_PVTracksSumPt);
2373  tree_->Branch("t_PVTracksSumPtWt", "std::vector<double>", &t_PVTracksSumPtWt);
2374  tree_->Branch("PVNTracksHP", "std::vector<int>", &t_PVNTracksHP);
2375  tree_->Branch("PVNTracksHPWt", "std::vector<int>", &t_PVNTracksHPWt);
2376  tree_->Branch("t_PVTracksSumPtHP", "std::vector<double>", &t_PVTracksSumPtHP);
2377  tree_->Branch("t_PVTracksSumPtHPWt", "std::vector<double>", &t_PVTracksSumPtHPWt);
2378 
2379  //----- L1Trigger information
2380  for (int i = 0; i < 128; i++)
2381  t_L1Decision[i] = 0;
2382  t_L1AlgoNames = new std::vector<std::string>();
2383  t_L1PreScale = new std::vector<int>();
2384  t_L1CenJetPt = new std::vector<double>();
2385  t_L1CenJetEta = new std::vector<double>();
2386  t_L1CenJetPhi = new std::vector<double>();
2387  t_L1FwdJetPt = new std::vector<double>();
2388  t_L1FwdJetEta = new std::vector<double>();
2389  t_L1FwdJetPhi = new std::vector<double>();
2390  t_L1TauJetPt = new std::vector<double>();
2391  t_L1TauJetEta = new std::vector<double>();
2392  t_L1TauJetPhi = new std::vector<double>();
2393  t_L1MuonPt = new std::vector<double>();
2394  t_L1MuonEta = new std::vector<double>();
2395  t_L1MuonPhi = new std::vector<double>();
2396  t_L1IsoEMPt = new std::vector<double>();
2397  t_L1IsoEMEta = new std::vector<double>();
2398  t_L1IsoEMPhi = new std::vector<double>();
2399  t_L1NonIsoEMPt = new std::vector<double>();
2400  t_L1NonIsoEMEta = new std::vector<double>();
2401  t_L1NonIsoEMPhi = new std::vector<double>();
2402  t_L1METPt = new std::vector<double>();
2403  t_L1METEta = new std::vector<double>();
2404  t_L1METPhi = new std::vector<double>();
2405 
2406  tree_->Branch("t_L1Decision", t_L1Decision, "t_L1Decision[128]/I");
2407  tree_->Branch("t_L1AlgoNames", "std::vector<string>", &t_L1AlgoNames);
2408  tree_->Branch("t_L1PreScale", "std::vector<int>", &t_L1PreScale);
2409  tree_->Branch("t_L1CenJetPt", "std::vector<double>", &t_L1CenJetPt);
2410  tree_->Branch("t_L1CenJetEta", "std::vector<double>", &t_L1CenJetEta);
2411  tree_->Branch("t_L1CenJetPhi", "std::vector<double>", &t_L1CenJetPhi);
2412  tree_->Branch("t_L1FwdJetPt", "std::vector<double>", &t_L1FwdJetPt);
2413  tree_->Branch("t_L1FwdJetEta", "std::vector<double>", &t_L1FwdJetEta);
2414  tree_->Branch("t_L1FwdJetPhi", "std::vector<double>", &t_L1FwdJetPhi);
2415  tree_->Branch("t_L1TauJetPt", "std::vector<double>", &t_L1TauJetPt);
2416  tree_->Branch("t_L1TauJetEta", "std::vector<double>", &t_L1TauJetEta);
2417  tree_->Branch("t_L1TauJetPhi", "std::vector<double>", &t_L1TauJetPhi);
2418  tree_->Branch("t_L1MuonPt", "std::vector<double>", &t_L1MuonPt);
2419  tree_->Branch("t_L1MuonEta", "std::vector<double>", &t_L1MuonEta);
2420  tree_->Branch("t_L1MuonPhi", "std::vector<double>", &t_L1MuonPhi);
2421  tree_->Branch("t_L1IsoEMPt", "std::vector<double>", &t_L1IsoEMPt);
2422  tree_->Branch("t_L1IsoEMEta", "std::vector<double>", &t_L1IsoEMEta);
2423  tree_->Branch("t_L1IsoEMPhi", "std::vector<double>", &t_L1IsoEMPhi);
2424  tree_->Branch("t_L1NonIsoEMPt", "std::vector<double>", &t_L1NonIsoEMPt);
2425  tree_->Branch("t_L1NonIsoEMEta", "std::vector<double>", &t_L1NonIsoEMEta);
2426  tree_->Branch("t_L1NonIsoEMPhi", "std::vector<double>", &t_L1NonIsoEMPhi);
2427  tree_->Branch("t_L1METPt", "std::vector<double>", &t_L1METPt);
2428  tree_->Branch("t_L1METEta", "std::vector<double>", &t_L1METEta);
2429  tree_->Branch("t_L1METPhi", "std::vector<double>", &t_L1METPhi);
2430 
2431  t_jetPt = new std::vector<double>();
2432  t_jetEta = new std::vector<double>();
2433  t_jetPhi = new std::vector<double>();
2434  t_nTrksJetCalo = new std::vector<double>();
2435  t_nTrksJetVtx = new std::vector<double>();
2436  tree_->Branch("t_jetPt", "std::vector<double>", &t_jetPt);
2437  tree_->Branch("t_jetEta", "std::vector<double>", &t_jetEta);
2438  tree_->Branch("t_jetPhi", "std::vector<double>", &t_jetPhi);
2439  tree_->Branch("t_nTrksJetCalo", "std::vector<double>", &t_nTrksJetCalo);
2440  tree_->Branch("t_nTrksJetVtx", "std::vector<double>", &t_nTrksJetVtx);
2441 
2442  t_trackPAll = new std::vector<double>();
2443  t_trackEtaAll = new std::vector<double>();
2444  t_trackPhiAll = new std::vector<double>();
2445  t_trackPdgIdAll = new std::vector<double>();
2446  t_trackPtAll = new std::vector<double>();
2447  t_trackDxyAll = new std::vector<double>();
2448  t_trackDzAll = new std::vector<double>();
2449  t_trackDxyPVAll = new std::vector<double>();
2450  t_trackDzPVAll = new std::vector<double>();
2451  t_trackChiSqAll = new std::vector<double>();
2452  tree_->Branch("t_trackPAll", "std::vector<double>", &t_trackPAll);
2453  tree_->Branch("t_trackPhiAll", "std::vector<double>", &t_trackPhiAll);
2454  tree_->Branch("t_trackEtaAll", "std::vector<double>", &t_trackEtaAll);
2455  tree_->Branch("t_trackPtAll", "std::vector<double>", &t_trackPtAll);
2456  tree_->Branch("t_trackDxyAll", "std::vector<double>", &t_trackDxyAll);
2457  tree_->Branch("t_trackDzAll", "std::vector<double>", &t_trackDzAll);
2458  tree_->Branch("t_trackDxyPVAll", "std::vector<double>", &t_trackDxyPVAll);
2459  tree_->Branch("t_trackDzPVAll", "std::vector<double>", &t_trackDzPVAll);
2460  tree_->Branch("t_trackChiSqAll", "std::vector<double>", &t_trackChiSqAll);
2461  //tree_->Branch("t_trackPdgIdAll", "std::vector<double>", &t_trackPdgIdAll);
2462 
2463  t_trackP = new std::vector<double>();
2464  t_trackPt = new std::vector<double>();
2465  t_trackEta = new std::vector<double>();
2466  t_trackPhi = new std::vector<double>();
2467  t_trackEcalEta = new std::vector<double>();
2468  t_trackEcalPhi = new std::vector<double>();
2469  t_trackHcalEta = new std::vector<double>();
2470  t_trackHcalPhi = new std::vector<double>();
2471  t_trackNOuterHits = new std::vector<int>();
2472  t_NLayersCrossed = new std::vector<int>();
2473  t_trackDxy = new std::vector<double>();
2474  t_trackDxyBS = new std::vector<double>();
2475  t_trackDz = new std::vector<double>();
2476  t_trackDzBS = new std::vector<double>();
2477  t_trackDxyPV = new std::vector<double>();
2478  t_trackDzPV = new std::vector<double>();
2479  t_trackPVIdx = new std::vector<int>();
2480  t_trackChiSq = new std::vector<double>();
2481  t_trackHitsTOB = new std::vector<int>();
2482  t_trackHitsTEC = new std::vector<int>();
2483  t_trackHitInMissTOB = new std::vector<int>();
2484  t_trackHitInMissTEC = new std::vector<int>();
2485  t_trackHitInMissTIB = new std::vector<int>();
2486  t_trackHitInMissTID = new std::vector<int>();
2487  t_trackHitOutMissTOB = new std::vector<int>();
2488  t_trackHitOutMissTEC = new std::vector<int>();
2489  t_trackHitOutMissTIB = new std::vector<int>();
2490  t_trackHitOutMissTID = new std::vector<int>();
2491  t_trackHitInMissTIBTID = new std::vector<int>();
2492  t_trackHitOutMissTOB = new std::vector<int>();
2493  t_trackHitOutMissTEC = new std::vector<int>();
2494  t_trackHitOutMissTIB = new std::vector<int>();
2495  t_trackHitOutMissTID = new std::vector<int>();
2496  t_trackHitOutMissTOBTEC = new std::vector<int>();
2497  t_trackHitInMeasTOB = new std::vector<int>();
2498  t_trackHitInMeasTEC = new std::vector<int>();
2499  t_trackHitInMeasTIB = new std::vector<int>();
2500  t_trackHitInMeasTID = new std::vector<int>();
2501  t_trackHitOutMeasTOB = new std::vector<int>();
2502  t_trackHitOutMeasTEC = new std::vector<int>();
2503  t_trackHitOutMeasTIB = new std::vector<int>();
2504  t_trackHitOutMeasTID = new std::vector<int>();
2505  t_trackOutPosOutHitDr = new std::vector<double>();
2506  t_trackL = new std::vector<double>();
2507 
2508  tree_->Branch("t_trackP", "std::vector<double>", &t_trackP);
2509  tree_->Branch("t_trackPt", "std::vector<double>", &t_trackPt);
2510  tree_->Branch("t_trackEta", "std::vector<double>", &t_trackEta);
2511  tree_->Branch("t_trackPhi", "std::vector<double>", &t_trackPhi);
2512  tree_->Branch("t_trackEcalEta", "std::vector<double>", &t_trackEcalEta);
2513  tree_->Branch("t_trackEcalPhi", "std::vector<double>", &t_trackEcalPhi);
2514  tree_->Branch("t_trackHcalEta", "std::vector<double>", &t_trackHcalEta);
2515  tree_->Branch("t_trackHcalPhi", "std::vector<double>", &t_trackHcalPhi);
2516 
2517  tree_->Branch("t_trackNOuterHits", "std::vector<int>", &t_trackNOuterHits);
2518  tree_->Branch("t_NLayersCrossed", "std::vector<int>", &t_NLayersCrossed);
2519  tree_->Branch("t_trackHitsTOB", "std::vector<int>", &t_trackHitsTOB);
2520  tree_->Branch("t_trackHitsTEC", "std::vector<int>", &t_trackHitsTEC);
2521  tree_->Branch("t_trackHitInMissTOB", "std::vector<int>", &t_trackHitInMissTOB);
2522  tree_->Branch("t_trackHitInMissTEC", "std::vector<int>", &t_trackHitInMissTEC);
2523  tree_->Branch("t_trackHitInMissTIB", "std::vector<int>", &t_trackHitInMissTIB);
2524  tree_->Branch("t_trackHitInMissTID", "std::vector<int>", &t_trackHitInMissTID);
2525  tree_->Branch("t_trackHitInMissTIBTID", "std::vector<int>", &t_trackHitInMissTIBTID);
2526  tree_->Branch("t_trackHitOutMissTOB", "std::vector<int>", &t_trackHitOutMissTOB);
2527  tree_->Branch("t_trackHitOutMissTEC", "std::vector<int>", &t_trackHitOutMissTEC);
2528  tree_->Branch("t_trackHitOutMissTIB", "std::vector<int>", &t_trackHitOutMissTIB);
2529  tree_->Branch("t_trackHitOutMissTID", "std::vector<int>", &t_trackHitOutMissTID);
2530  tree_->Branch("t_trackHitOutMissTOBTEC", "std::vector<int>", &t_trackHitOutMissTOBTEC);
2531  tree_->Branch("t_trackHitInMeasTOB", "std::vector<int>", &t_trackHitInMeasTOB);
2532  tree_->Branch("t_trackHitInMeasTEC", "std::vector<int>", &t_trackHitInMeasTEC);
2533  tree_->Branch("t_trackHitInMeasTIB", "std::vector<int>", &t_trackHitInMeasTIB);
2534  tree_->Branch("t_trackHitInMeasTID", "std::vector<int>", &t_trackHitInMeasTID);
2535  tree_->Branch("t_trackHitOutMeasTOB", "std::vector<int>", &t_trackHitOutMeasTOB);
2536  tree_->Branch("t_trackHitOutMeasTEC", "std::vector<int>", &t_trackHitOutMeasTEC);
2537  tree_->Branch("t_trackHitOutMeasTIB", "std::vector<int>", &t_trackHitOutMeasTIB);
2538  tree_->Branch("t_trackHitOutMeasTID", "std::vector<int>", &t_trackHitOutMeasTID);
2539  tree_->Branch("t_trackOutPosOutHitDr", "std::vector<double>", &t_trackOutPosOutHitDr);
2540  tree_->Branch("t_trackL", "std::vector<double>", &t_trackL);
2541 
2542  tree_->Branch("t_trackDxy", "std::vector<double>", &t_trackDxy);
2543  tree_->Branch("t_trackDxyBS", "std::vector<double>", &t_trackDxyBS);
2544  tree_->Branch("t_trackDz", "std::vector<double>", &t_trackDz);
2545  tree_->Branch("t_trackDzBS", "std::vector<double>", &t_trackDzBS);
2546  tree_->Branch("t_trackDxyPV", "std::vector<double>", &t_trackDxyPV);
2547  tree_->Branch("t_trackDzPV", "std::vector<double>", &t_trackDzPV);
2548  tree_->Branch("t_trackChiSq", "std::vector<double>", &t_trackChiSq);
2549  tree_->Branch("t_trackPVIdx", "std::vector<int>", &t_trackPVIdx);
2550 
2551  t_maxNearP31x31 = new std::vector<double>();
2552  t_maxNearP21x21 = new std::vector<double>();
2553 
2554  tree_->Branch("t_maxNearP31x31", "std::vector<double>", &t_maxNearP31x31);
2555  tree_->Branch("t_maxNearP21x21", "std::vector<double>", &t_maxNearP21x21);
2556 
2557  t_ecalSpike11x11 = new std::vector<int>();
2558  t_e7x7 = new std::vector<double>();
2559  t_e9x9 = new std::vector<double>();
2560  t_e11x11 = new std::vector<double>();
2561  t_e15x15 = new std::vector<double>();
2562 
2563  tree_->Branch("t_ecalSpike11x11", "std::vector<int>", &t_ecalSpike11x11);
2564  tree_->Branch("t_e7x7", "std::vector<double>", &t_e7x7);
2565  tree_->Branch("t_e9x9", "std::vector<double>", &t_e9x9);
2566  tree_->Branch("t_e11x11", "std::vector<double>", &t_e11x11);
2567  tree_->Branch("t_e15x15", "std::vector<double>", &t_e15x15);
2568 
2569  t_e7x7_10Sig = new std::vector<double>();
2570  t_e9x9_10Sig = new std::vector<double>();
2571  t_e11x11_10Sig = new std::vector<double>();
2572  t_e15x15_10Sig = new std::vector<double>();
2573  t_e7x7_15Sig = new std::vector<double>();
2574  t_e9x9_15Sig = new std::vector<double>();
2575  t_e11x11_15Sig = new std::vector<double>();
2576  t_e15x15_15Sig = new std::vector<double>();
2577  t_e7x7_20Sig = new std::vector<double>();
2578  t_e9x9_20Sig = new std::vector<double>();
2579  t_e11x11_20Sig = new std::vector<double>();
2580  t_e15x15_20Sig = new std::vector<double>();
2581  t_e7x7_25Sig = new std::vector<double>();
2582  t_e9x9_25Sig = new std::vector<double>();
2583  t_e11x11_25Sig = new std::vector<double>();
2584  t_e15x15_25Sig = new std::vector<double>();
2585  t_e7x7_30Sig = new std::vector<double>();
2586  t_e9x9_30Sig = new std::vector<double>();
2587  t_e11x11_30Sig = new std::vector<double>();
2588  t_e15x15_30Sig = new std::vector<double>();
2589 
2590  tree_->Branch("t_e7x7_10Sig", "std::vector<double>", &t_e7x7_10Sig);
2591  tree_->Branch("t_e9x9_10Sig", "std::vector<double>", &t_e9x9_10Sig);
2592  tree_->Branch("t_e11x11_10Sig", "std::vector<double>", &t_e11x11_10Sig);
2593  tree_->Branch("t_e15x15_10Sig", "std::vector<double>", &t_e15x15_10Sig);
2594  tree_->Branch("t_e7x7_15Sig", "std::vector<double>", &t_e7x7_15Sig);
2595  tree_->Branch("t_e9x9_15Sig", "std::vector<double>", &t_e9x9_15Sig);
2596  tree_->Branch("t_e11x11_15Sig", "std::vector<double>", &t_e11x11_15Sig);
2597  tree_->Branch("t_e15x15_15Sig", "std::vector<double>", &t_e15x15_15Sig);
2598  tree_->Branch("t_e7x7_20Sig", "std::vector<double>", &t_e7x7_20Sig);
2599  tree_->Branch("t_e9x9_20Sig", "std::vector<double>", &t_e9x9_20Sig);
2600  tree_->Branch("t_e11x11_20Sig", "std::vector<double>", &t_e11x11_20Sig);
2601  tree_->Branch("t_e15x15_20Sig", "std::vector<double>", &t_e15x15_20Sig);
2602  tree_->Branch("t_e7x7_25Sig", "std::vector<double>", &t_e7x7_25Sig);
2603  tree_->Branch("t_e9x9_25Sig", "std::vector<double>", &t_e9x9_25Sig);
2604  tree_->Branch("t_e11x11_25Sig", "std::vector<double>", &t_e11x11_25Sig);
2605  tree_->Branch("t_e15x15_25Sig", "std::vector<double>", &t_e15x15_25Sig);
2606  tree_->Branch("t_e7x7_30Sig", "std::vector<double>", &t_e7x7_30Sig);
2607  tree_->Branch("t_e9x9_30Sig", "std::vector<double>", &t_e9x9_30Sig);
2608  tree_->Branch("t_e11x11_30Sig", "std::vector<double>", &t_e11x11_30Sig);
2609  tree_->Branch("t_e15x15_30Sig", "std::vector<double>", &t_e15x15_30Sig);
2610 
2611  if (doMC_) {
2612  t_esim7x7 = new std::vector<double>();
2613  t_esim9x9 = new std::vector<double>();
2614  t_esim11x11 = new std::vector<double>();
2615  t_esim15x15 = new std::vector<double>();
2616 
2617  t_esim7x7Matched = new std::vector<double>();
2618  t_esim9x9Matched = new std::vector<double>();
2619  t_esim11x11Matched = new std::vector<double>();
2620  t_esim15x15Matched = new std::vector<double>();
2621 
2622  t_esim7x7Rest = new std::vector<double>();
2623  t_esim9x9Rest = new std::vector<double>();
2624  t_esim11x11Rest = new std::vector<double>();
2625  t_esim15x15Rest = new std::vector<double>();
2626 
2627  t_esim7x7Photon = new std::vector<double>();
2628  t_esim9x9Photon = new std::vector<double>();
2629  t_esim11x11Photon = new std::vector<double>();
2630  t_esim15x15Photon = new std::vector<double>();
2631 
2632  t_esim7x7NeutHad = new std::vector<double>();
2633  t_esim9x9NeutHad = new std::vector<double>();
2634  t_esim11x11NeutHad = new std::vector<double>();
2635  t_esim15x15NeutHad = new std::vector<double>();
2636 
2637  t_esim7x7CharHad = new std::vector<double>();
2638  t_esim9x9CharHad = new std::vector<double>();
2639  t_esim11x11CharHad = new std::vector<double>();
2640  t_esim15x15CharHad = new std::vector<double>();
2641 
2642  t_trkEcalEne = new std::vector<double>();
2643  t_simTrackP = new std::vector<double>();
2644  t_esimPdgId = new std::vector<double>();
2645 
2646  tree_->Branch("t_esim7x7", "std::vector<double>", &t_esim7x7);
2647  tree_->Branch("t_esim9x9", "std::vector<double>", &t_esim9x9);
2648  tree_->Branch("t_esim11x11", "std::vector<double>", &t_esim11x11);
2649  tree_->Branch("t_esim15x15", "std::vector<double>", &t_esim15x15);
2650 
2651  tree_->Branch("t_esim7x7Matched", "std::vector<double>", &t_esim7x7Matched);
2652  tree_->Branch("t_esim9x9Matched", "std::vector<double>", &t_esim9x9Matched);
2653  tree_->Branch("t_esim11x11Matched", "std::vector<double>", &t_esim11x11Matched);
2654  tree_->Branch("t_esim15x15Matched", "std::vector<double>", &t_esim15x15Matched);
2655 
2656  tree_->Branch("t_esim7x7Rest", "std::vector<double>", &t_esim7x7Rest);
2657  tree_->Branch("t_esim9x9Rest", "std::vector<double>", &t_esim9x9Rest);
2658  tree_->Branch("t_esim11x11Rest", "std::vector<double>", &t_esim11x11Rest);
2659  tree_->Branch("t_esim15x15Rest", "std::vector<double>", &t_esim15x15Rest);
2660 
2661  tree_->Branch("t_esim7x7Photon", "std::vector<double>", &t_esim7x7Photon);
2662  tree_->Branch("t_esim9x9Photon", "std::vector<double>", &t_esim9x9Photon);
2663  tree_->Branch("t_esim11x11Photon", "std::vector<double>", &t_esim11x11Photon);
2664  tree_->Branch("t_esim15x15Photon", "std::vector<double>", &t_esim15x15Photon);
2665 
2666  tree_->Branch("t_esim7x7NeutHad", "std::vector<double>", &t_esim7x7NeutHad);
2667  tree_->Branch("t_esim9x9NeutHad", "std::vector<double>", &t_esim9x9NeutHad);
2668  tree_->Branch("t_esim11x11NeutHad", "std::vector<double>", &t_esim11x11NeutHad);
2669  tree_->Branch("t_esim15x15NeutHad", "std::vector<double>", &t_esim15x15NeutHad);
2670 
2671  tree_->Branch("t_esim7x7CharHad", "std::vector<double>", &t_esim7x7CharHad);
2672  tree_->Branch("t_esim9x9CharHad", "std::vector<double>", &t_esim9x9CharHad);
2673  tree_->Branch("t_esim11x11CharHad", "std::vector<double>", &t_esim11x11CharHad);
2674  tree_->Branch("t_esim15x15CharHad", "std::vector<double>", &t_esim15x15CharHad);
2675 
2676  tree_->Branch("t_trkEcalEne", "std::vector<double>", &t_trkEcalEne);
2677  tree_->Branch("t_simTrackP", "std::vector<double>", &t_simTrackP);
2678  tree_->Branch("t_esimPdgId", "std::vector<double>", &t_esimPdgId);
2679  }
2680 
2681  t_maxNearHcalP3x3 = new std::vector<double>();
2682  t_maxNearHcalP5x5 = new std::vector<double>();
2683  t_maxNearHcalP7x7 = new std::vector<double>();
2684  t_h3x3 = new std::vector<double>();
2685  t_h5x5 = new std::vector<double>();
2686  t_h7x7 = new std::vector<double>();
2687  t_h3x3Sig = new std::vector<double>();
2688  t_h5x5Sig = new std::vector<double>();
2689  t_h7x7Sig = new std::vector<double>();
2690  t_infoHcal = new std::vector<int>();
2691 
2692  if (doMC_) {
2693  t_trkHcalEne = new std::vector<double>();
2694  t_hsim3x3 = new std::vector<double>();
2695  t_hsim5x5 = new std::vector<double>();
2696  t_hsim7x7 = new std::vector<double>();
2697  t_hsim3x3Matched = new std::vector<double>();
2698  t_hsim5x5Matched = new std::vector<double>();
2699  t_hsim7x7Matched = new std::vector<double>();
2700  t_hsim3x3Rest = new std::vector<double>();
2701  t_hsim5x5Rest = new std::vector<double>();
2702  t_hsim7x7Rest = new std::vector<double>();
2703  t_hsim3x3Photon = new std::vector<double>();
2704  t_hsim5x5Photon = new std::vector<double>();
2705  t_hsim7x7Photon = new std::vector<double>();
2706  t_hsim3x3NeutHad = new std::vector<double>();
2707  t_hsim5x5NeutHad = new std::vector<double>();
2708  t_hsim7x7NeutHad = new std::vector<double>();
2709  t_hsim3x3CharHad = new std::vector<double>();
2710  t_hsim5x5CharHad = new std::vector<double>();
2711  t_hsim7x7CharHad = new std::vector<double>();
2712  }
2713 
2714  tree_->Branch("t_maxNearHcalP3x3", "std::vector<double>", &t_maxNearHcalP3x3);
2715  tree_->Branch("t_maxNearHcalP5x5", "std::vector<double>", &t_maxNearHcalP5x5);
2716  tree_->Branch("t_maxNearHcalP7x7", "std::vector<double>", &t_maxNearHcalP7x7);
2717  tree_->Branch("t_h3x3", "std::vector<double>", &t_h3x3);
2718  tree_->Branch("t_h5x5", "std::vector<double>", &t_h5x5);
2719  tree_->Branch("t_h7x7", "std::vector<double>", &t_h7x7);
2720  tree_->Branch("t_h3x3Sig", "std::vector<double>", &t_h3x3Sig);
2721  tree_->Branch("t_h5x5Sig", "std::vector<double>", &t_h5x5Sig);
2722  tree_->Branch("t_h7x7Sig", "std::vector<double>", &t_h7x7Sig);
2723  tree_->Branch("t_infoHcal", "std::vector<int>", &t_infoHcal);
2724 
2725  if (doMC_) {
2726  tree_->Branch("t_trkHcalEne", "std::vector<double>", &t_trkHcalEne);
2727  tree_->Branch("t_hsim3x3", "std::vector<double>", &t_hsim3x3);
2728  tree_->Branch("t_hsim5x5", "std::vector<double>", &t_hsim5x5);
2729  tree_->Branch("t_hsim7x7", "std::vector<double>", &t_hsim7x7);
2730  tree_->Branch("t_hsim3x3Matched", "std::vector<double>", &t_hsim3x3Matched);
2731  tree_->Branch("t_hsim5x5Matched", "std::vector<double>", &t_hsim5x5Matched);
2732  tree_->Branch("t_hsim7x7Matched", "std::vector<double>", &t_hsim7x7Matched);
2733  tree_->Branch("t_hsim3x3Rest", "std::vector<double>", &t_hsim3x3Rest);
2734  tree_->Branch("t_hsim5x5Rest", "std::vector<double>", &t_hsim5x5Rest);
2735  tree_->Branch("t_hsim7x7Rest", "std::vector<double>", &t_hsim7x7Rest);
2736  tree_->Branch("t_hsim3x3Photon", "std::vector<double>", &t_hsim3x3Photon);
2737  tree_->Branch("t_hsim5x5Photon", "std::vector<double>", &t_hsim5x5Photon);
2738  tree_->Branch("t_hsim7x7Photon", "std::vector<double>", &t_hsim7x7Photon);
2739  tree_->Branch("t_hsim3x3NeutHad", "std::vector<double>", &t_hsim3x3NeutHad);
2740  tree_->Branch("t_hsim5x5NeutHad", "std::vector<double>", &t_hsim5x5NeutHad);
2741  tree_->Branch("t_hsim7x7NeutHad", "std::vector<double>", &t_hsim7x7NeutHad);
2742  tree_->Branch("t_hsim3x3CharHad", "std::vector<double>", &t_hsim3x3CharHad);
2743  tree_->Branch("t_hsim5x5CharHad", "std::vector<double>", &t_hsim5x5CharHad);
2744  tree_->Branch("t_hsim7x7CharHad", "std::vector<double>", &t_hsim7x7CharHad);
2745  }
2746  tree_->Branch("t_nTracks", &t_nTracks, "t_nTracks/I");
2747 }
2748 
2749 double IsolatedTracksNxN::deltaPhi(double v1, double v2) {
2750  // Computes the correctly normalized phi difference
2751  // v1, v2 = phi of object 1 and 2
2752  double diff = std::abs(v2 - v1);
2753  double corr = 2 * M_PI - diff;
2754  return ((diff < M_PI) ? diff : corr);
2755 }
2756 
2757 double IsolatedTracksNxN::deltaR(double eta1, double phi1, double eta2, double phi2) {
2758  double deta = eta1 - eta2;
2759  double dphi = deltaPhi(phi1, phi2);
2760  return std::sqrt(deta * deta + dphi * dphi);
2761 }
2762 
2764  std::string theTrackQuality = "highPurity";
2765  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
2766 
2767  edm::LogVerbatim("IsoTrack") << " Reference Point " << pTrack->referencePoint() << "\n TrackMmentum "
2768  << pTrack->momentum() << " (pt,eta,phi)(" << pTrack->pt() << "," << pTrack->eta() << ","
2769  << pTrack->phi() << ")"
2770  << " p " << pTrack->p() << "\n Normalized chi2 " << pTrack->normalizedChi2()
2771  << " charge " << pTrack->charge() << " qoverp() " << pTrack->qoverp() << "+-"
2772  << pTrack->qoverpError() << " d0 " << pTrack->d0() << "\n NValidHits "
2773  << pTrack->numberOfValidHits() << " NLostHits " << pTrack->numberOfLostHits()
2774  << " TrackQuality " << pTrack->qualityName(trackQuality_) << " "
2775  << pTrack->quality(trackQuality_);
2776 
2777  if (printTrkHitPattern_) {
2778  const reco::HitPattern &p = pTrack->hitPattern();
2779 
2780  edm::LogVerbatim("IsoTrack") << "default ";
2781  for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) {
2782  p.printHitPattern(reco::HitPattern::TRACK_HITS, i, std::cout);
2783  }
2784  edm::LogVerbatim("IsoTrack") << "trackerMissingInnerHits() ";
2785  for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i++) {
2787  }
2788  edm::LogVerbatim("IsoTrack") << "trackerMissingOuterHits() ";
2789  for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::MISSING_OUTER_HITS); i++) {
2791  }
2792 
2793  edm::LogVerbatim("IsoTrack") << "\n \t trackerLayersWithMeasurement() " << p.trackerLayersWithMeasurement()
2794  << "\n \t pixelLayersWithMeasurement() " << p.pixelLayersWithMeasurement()
2795  << "\n \t stripLayersWithMeasurement() " << p.stripLayersWithMeasurement()
2796  << "\n \t pixelBarrelLayersWithMeasurement() " << p.pixelBarrelLayersWithMeasurement()
2797  << "\n \t pixelEndcapLayersWithMeasurement() " << p.pixelEndcapLayersWithMeasurement()
2798  << "\n \t stripTIBLayersWithMeasurement() " << p.stripTIBLayersWithMeasurement()
2799  << "\n \t stripTIDLayersWithMeasurement() " << p.stripTIDLayersWithMeasurement()
2800  << "\n \t stripTOBLayersWithMeasurement() " << p.stripTOBLayersWithMeasurement()
2801  << "\n \t stripTECLayersWithMeasurement() " << p.stripTECLayersWithMeasurement();
2802  }
2803 }
2804 
2805 //define this as a plug-in
IsolatedTracksNxN::t_trackPVIdx
std::vector< int > * t_trackPVIdx
Definition: IsolatedTracksNxN.cc:253
reco::Track::outerPosition
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
IsolatedTracksNxN::IsolatedTracksNxN
IsolatedTracksNxN(const edm::ParameterSet &)
Definition: IsolatedTracksNxN.cc:301
spr::caloSimInfo::eRest
double eRest
Definition: CaloSimInfo.h:49
IsolatedTracksNxN::t_esimPdgId
std::vector< double > * t_esimPdgId
Definition: IsolatedTracksNxN.cc:276
IsolatedTracksNxN::t_trackHcalEta
std::vector< double > * t_trackHcalEta
Definition: IsolatedTracksNxN.cc:249
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
change_name.diff
diff
Definition: change_name.py:13
IsolatedTracksNxN::h_recEtaP_0
TH2F * h_recEtaP_0
Definition: IsolatedTracksNxN.cc:214
reco::HitPattern::MISSING_OUTER_HITS
Definition: HitPattern.h:155
IsolatedTracksNxN
Definition: IsolatedTracksNxN.cc:140
IsolatedTracksNxN::t_esim9x9Rest
std::vector< double > * t_esim9x9Rest
Definition: IsolatedTracksNxN.cc:279
L1GtTriggerMenu.h
CaloJetCollection.h
DDAxes::y
nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:44
IsolatedTracksNxN::t_e11x11_15Sig
std::vector< double > * t_e11x11_15Sig
Definition: IsolatedTracksNxN.cc:271
Handle.h
IsolatedTracksNxN::t_trackPhi
std::vector< double > * t_trackPhi
Definition: IsolatedTracksNxN.cc:248
IsolatedTracksNxN::t_NLayersCrossed
std::vector< int > * t_NLayersCrossed
Definition: IsolatedTracksNxN.cc:255
IsolatedTracksNxN::t_esim11x11Rest
std::vector< double > * t_esim11x11Rest
Definition: IsolatedTracksNxN.cc:279
IsolatedTracksNxN::t_trackHitInMissTIBTID
std::vector< int > * t_trackHitInMissTIBTID
Definition: IsolatedTracksNxN.cc:257
IsolatedTracksNxN::t_esim9x9CharHad
std::vector< double > * t_esim9x9CharHad
Definition: IsolatedTracksNxN.cc:282
CaloJet.h
IsolatedTracksNxN::t_L1NonIsoEMEta
std::vector< double > * t_L1NonIsoEMEta
Definition: IsolatedTracksNxN.cc:233
L1GtTriggerMenu::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: L1GtTriggerMenu.h:91
IsolatedTracksNxN::t_trkEcalEne
std::vector< double > * t_trkEcalEne
Definition: IsolatedTracksNxN.cc:276
useL1EventSetup
static const bool useL1EventSetup(true)
IsolatedTracksNxN::t_e7x7_10Sig
std::vector< double > * t_e7x7_10Sig
Definition: IsolatedTracksNxN.cc:270
electrons_cff.bool
bool
Definition: electrons_cff.py:372
EDAnalyzer.h
IsolatedTracksNxN::t_esim15x15CharHad
std::vector< double > * t_esim15x15CharHad
Definition: IsolatedTracksNxN.cc:282
mps_fire.i
i
Definition: mps_fire.py:355
reco::TrackBase::qoverpError
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:699
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
FreeTrajectoryState.h
IsolatedTracksNxN::t_hsim7x7CharHad
std::vector< double > * t_hsim7x7CharHad
Definition: IsolatedTracksNxN.cc:295
CaloNavigator.h
MessageLogger.h
IsolatedTracksNxN::t_L1METEta
std::vector< double > * t_L1METEta
Definition: IsolatedTracksNxN.cc:234
IsolatedTracksNxN::t_esim7x7CharHad
std::vector< double > * t_esim7x7CharHad
Definition: IsolatedTracksNxN.cc:282
IsolatedTracksNxN::h_L1AlgoNames
TH1I * h_L1AlgoNames
Definition: IsolatedTracksNxN.cc:210
L1GtTriggerMaskAlgoTrigRcd.h
funct::false
false
Definition: Factorize.h:34
IsolatedTracksNxN::minTrackP_
const double minTrackP_
Definition: IsolatedTracksNxN.cc:175
IsolatedTracksNxN::h_recPhi_0
TH1F * h_recPhi_0
Definition: IsolatedTracksNxN.cc:213
IsolatedTracksNxN::t_L1MuonPhi
std::vector< double > * t_L1MuonPhi
Definition: IsolatedTracksNxN.cc:231
IsolatedTracksNxN::t_trackChiSqAll
std::vector< double > * t_trackChiSqAll
Definition: IsolatedTracksNxN.cc:246
IsolatedTracksNxN::t_e15x15_10Sig
std::vector< double > * t_e15x15_10Sig
Definition: IsolatedTracksNxN.cc:270
L1GtTriggerMask.h
L1MuonParticleFwd.h
IsolatedTracksNxN::h_maxNearP21x21
TH1F * h_maxNearP21x21[NPBins][NEtaBins]
Definition: IsolatedTracksNxN.cc:208
reco::HitPattern::stripTOBLayersWithMeasurement
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:597
IsolatedTracksNxN::t_e7x7_20Sig
std::vector< double > * t_e7x7_20Sig
Definition: IsolatedTracksNxN.cc:272
IsolatedTracksNxN::t_e9x9_25Sig
std::vector< double > * t_e9x9_25Sig
Definition: IsolatedTracksNxN.cc:273
IsolatedTracksNxN::t_e11x11_25Sig
std::vector< double > * t_e11x11_25Sig
Definition: IsolatedTracksNxN.cc:273
ESHandle.h
IsolatedTracksNxN::h_PVTracksWt
TH1F * h_PVTracksWt
Definition: IsolatedTracksNxN.cc:211
spr::caloSimInfo::eMatched
double eMatched
Definition: CaloSimInfo.h:45
L1GtUtils::UseEventSetupIn::Event
IsolatedTracksNxN::t_trackDxyPVAll
std::vector< double > * t_trackDxyPVAll
Definition: IsolatedTracksNxN.cc:246
IsolatedTracksNxN::tok_caloHH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
Definition: IsolatedTracksNxN.cc:202
IsolatedTracksNxN::t_esim15x15Rest
std::vector< double > * t_esim15x15Rest
Definition: IsolatedTracksNxN.cc:279
reco::TrackBase::referencePoint
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:638
IsolatedTracksNxN::myverbose_
const int myverbose_
Definition: IsolatedTracksNxN.cc:171
reco::HitPattern::stripTIBLayersWithoutMeasurement
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:639
IsolatedTracksNxN::t_esim9x9Matched
std::vector< double > * t_esim9x9Matched
Definition: IsolatedTracksNxN.cc:278
IsolatedTracksNxN::t_hsim7x7Rest
std::vector< double > * t_hsim7x7Rest
Definition: IsolatedTracksNxN.cc:292
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
reco::TrackBase::p
double p() const
momentum vector magnitude
Definition: TrackBase.h:605
TrackDetectorAssociator.h
IsolatedTracksNxN::t_L1IsoEMPt
std::vector< double > * t_L1IsoEMPt
Definition: IsolatedTracksNxN.cc:232
EcalSeverityLevelAlgoRcd.h
L1GlobalTriggerReadoutSetupFwd.h
IsolatedTracksNxN::h_recP_2
TH1F * h_recP_2
Definition: IsolatedTracksNxN.cc:217
IsolatedTracksNxN::h_nTracks
TH1F * h_nTracks
Definition: IsolatedTracksNxN.cc:212
edm::EDGetTokenT< l1extra::L1JetParticleCollection >
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
TrackBase.h
IsolatedTracksNxN::t_maxNearP21x21
std::vector< double > * t_maxNearP21x21
Definition: IsolatedTracksNxN.cc:266
IsolatedTracksNxN::t_trackEcalPhi
std::vector< double > * t_trackEcalPhi
Definition: IsolatedTracksNxN.cc:249
IsolatedTracksNxN::t_esim7x7
std::vector< double > * t_esim7x7
Definition: IsolatedTracksNxN.cc:277
IsolatedTracksNxN::t_trackHitOutMeasTIB
std::vector< int > * t_trackHitOutMeasTIB
Definition: IsolatedTracksNxN.cc:262
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
L1GtTriggerMenuRcd.h
IsolatedTracksNxN::t_esim9x9Photon
std::vector< double > * t_esim9x9Photon
Definition: IsolatedTracksNxN.cc:280
IsolatedTracksNxN::t_L1MuonPt
std::vector< double > * t_L1MuonPt
Definition: IsolatedTracksNxN.cc:231
gather_cfg.cout
cout
Definition: gather_cfg.py:144
IsolatedTracksNxN::writeAllTracks_
const bool writeAllTracks_
Definition: IsolatedTracksNxN.cc:170
HcalTopology
Definition: HcalTopology.h:26
EBDetId.h
HLT_2018_cff.eta1
eta1
Definition: HLT_2018_cff.py:8220
EEDetId.h
IsolatedTracksNxN::tMinE_
const double tMinE_
Definition: IsolatedTracksNxN.cc:177
IsolatedTracksNxN::t_trackNOuterHits
std::vector< int > * t_trackNOuterHits
Definition: IsolatedTracksNxN.cc:255
IsolatedTracksNxN::m_l1GtUtils
std::unique_ptr< L1GtUtils > m_l1GtUtils
Definition: IsolatedTracksNxN.cc:162
IsolatedTracksNxN::t_RunNo
int t_RunNo
Definition: IsolatedTracksNxN.cc:223
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
IsolatedTracksNxN::t_trackDxy
std::vector< double > * t_trackDxy
Definition: IsolatedTracksNxN.cc:250
spr::eHCALSimInfo
std::map< std::string, double > eHCALSimInfo(const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
IsolatedTracksNxN::h_recEtaPt_0
TH2F * h_recEtaPt_0
Definition: IsolatedTracksNxN.cc:214
IsolatedTracksNxN::genPartPBins
double genPartPBins[NPBins+1]
Definition: IsolatedTracksNxN.cc:206
IsolatedTracksNxN::t_hsim5x5CharHad
std::vector< double > * t_hsim5x5CharHad
Definition: IsolatedTracksNxN.cc:295
IsolatedTracksNxN::t_L1CenJetPt
std::vector< double > * t_L1CenJetPt
Definition: IsolatedTracksNxN.cc:228
IsolatedTracksNxN::t_trackHitOutMissTEC
std::vector< int > * t_trackHitOutMissTEC
Definition: IsolatedTracksNxN.cc:259
IsolatedTracksNxN::t_esim11x11Matched
std::vector< double > * t_esim11x11Matched
Definition: IsolatedTracksNxN.cc:278
IsolatedTracksNxN::t_trkHcalEne
std::vector< double > * t_trkHcalEne
Definition: IsolatedTracksNxN.cc:289
IsolatedTracksNxN::t_trackDxyAll
std::vector< double > * t_trackDxyAll
Definition: IsolatedTracksNxN.cc:246
IsolatedTracksNxN::t_PVTracksSumPt
std::vector< double > * t_PVTracksSumPt
Definition: IsolatedTracksNxN.cc:236
HLT_2018_cff.pt1
pt1
Definition: HLT_2018_cff.py:8550
IsolatedTracksNxN::t_trackHcalPhi
std::vector< double > * t_trackHcalPhi
Definition: IsolatedTracksNxN.cc:249
IsolatedTracksNxN::t_trackPtAll
std::vector< double > * t_trackPtAll
Definition: IsolatedTracksNxN.cc:245
reco::TrackBase::TrackQuality
TrackQuality
track quality
Definition: TrackBase.h:150
L1GtTriggerMaskTechTrigRcd.h
IsolatedTracksNxN::h_recEtaPt_1
TH2F * h_recEtaPt_1
Definition: IsolatedTracksNxN.cc:216
edm::SortedCollection
Definition: SortedCollection.h:49
IsolatedTracksNxN::t_trackDxyBS
std::vector< double > * t_trackDxyBS
Definition: IsolatedTracksNxN.cc:250
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
reco::TrackBase::qualityName
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:557
IsolatedTracksNxN::t_hsim3x3Photon
std::vector< double > * t_hsim3x3Photon
Definition: IsolatedTracksNxN.cc:293
TrackerHitAssociator.h
IsolatedTracksNxN::clearTreeVectors
void clearTreeVectors()
Definition: IsolatedTracksNxN.cc:2059
IsolatedTracksNxN::t_infoHcal
std::vector< int > * t_infoHcal
Definition: IsolatedTracksNxN.cc:287
IsolatedTracksNxN::nbad_
int nbad_
Definition: IsolatedTracksNxN.cc:179
IsolatedTracksNxN::t_trackHitsTEC
std::vector< int > * t_trackHitsTEC
Definition: IsolatedTracksNxN.cc:256
IsolatedTracksNxN::t_e9x9_30Sig
std::vector< double > * t_e9x9_30Sig
Definition: IsolatedTracksNxN.cc:274
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
DDAxes::x
IsolatedTracksNxN::t_trackOutPosOutHitDr
std::vector< double > * t_trackOutPosOutHitDr
Definition: IsolatedTracksNxN.cc:263
TFileDirectory
Definition: TFileDirectory.h:24
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
IsolatedTracksNxN::t_maxNearHcalP5x5
std::vector< double > * t_maxNearHcalP5x5
Definition: IsolatedTracksNxN.cc:284
IsolatedTracksNxN::t_trackHitInMissTEC
std::vector< int > * t_trackHitInMissTEC
Definition: IsolatedTracksNxN.cc:257
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
IsolatedTracksNxN::t_trackHitInMissTOB
std::vector< int > * t_trackHitInMissTOB
Definition: IsolatedTracksNxN.cc:257
TrackerHitAssociator::Config
Definition: TrackerHitAssociator.h:57
IsolatedTracksNxN::t_esim7x7Matched
std::vector< double > * t_esim7x7Matched
Definition: IsolatedTracksNxN.cc:278
IsolatedTracksNxN::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: IsolatedTracksNxN.cc:752
EcalCondObjectContainer< EcalChannelStatusCode >
IsolatedTracksNxN::t_trackChiSq
std::vector< double > * t_trackChiSq
Definition: IsolatedTracksNxN.cc:252
edm::Handle< reco::TrackCollection >
reco::TrackBase::numberOfValidHits
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:751
IsolatedTracksNxN::t_e11x11
std::vector< double > * t_e11x11
Definition: IsolatedTracksNxN.cc:269
dqmdumpme.first
first
Definition: dqmdumpme.py:55
IsolatedTracksNxN::t_L1PreScale
std::vector< int > * t_L1PreScale
Definition: IsolatedTracksNxN.cc:225
CaloTopology
Definition: CaloTopology.h:19
IsolatedTracksNxN::t_PVy
std::vector< double > * t_PVy
Definition: IsolatedTracksNxN.cc:236
IsolatedTracksNxN::m_triggerMaskAlgoTrig
std::vector< unsigned int > m_triggerMaskAlgoTrig
Definition: IsolatedTracksNxN.cc:168
IsolatedTracksNxN::deltaPhi
double deltaPhi(double v1, double v2)
Definition: IsolatedTracksNxN.cc:2749
EcalBarrel
Definition: EcalSubdetector.h:10
EcalRecHitCollections.h
spr::caloSimInfo::eGamma
double eGamma
Definition: CaloSimInfo.h:46
IsolatedTracksNxN::t_e15x15_25Sig
std::vector< double > * t_e15x15_25Sig
Definition: IsolatedTracksNxN.cc:273
reco::HitPattern::stripTOBLayersWithoutMeasurement
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:659
IsolatedTracksNxN::t_trackHitOutMissTIB
std::vector< int > * t_trackHitOutMissTIB
Definition: IsolatedTracksNxN.cc:259
IsolatedTracksNxN::t_e9x9_10Sig
std::vector< double > * t_e9x9_10Sig
Definition: IsolatedTracksNxN.cc:270
IsolatedTracksNxN::h_recPt_1
TH1F * h_recPt_1
Definition: IsolatedTracksNxN.cc:215
IsolatedTracksNxN::t_esim11x11
std::vector< double > * t_esim11x11
Definition: IsolatedTracksNxN.cc:277
IsolatedTracksNxN::t_trackP
std::vector< double > * t_trackP
Definition: IsolatedTracksNxN.cc:248
IsolatedTracksNxN::t_L1METPhi
std::vector< double > * t_L1METPhi
Definition: IsolatedTracksNxN.cc:234
ndof
Definition: HIMultiTrackSelector.h:49
spr::caloSimInfo::eTotal
double eTotal
Definition: CaloSimInfo.h:50
IsolatedTracksNxN::NPBins
static constexpr size_t NPBins
Definition: IsolatedTracksNxN.cc:204
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:608
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
DetId
Definition: DetId.h:17
IsolatedTracksNxN::t_e11x11_20Sig
std::vector< double > * t_e11x11_20Sig
Definition: IsolatedTracksNxN.cc:272
IsolatedTracksNxN::tok_L1extNoIsoEm_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1extNoIsoEm_
Definition: IsolatedTracksNxN.cc:187
MakerMacros.h
IsolatedTracksNxN::t_L1TauJetPt
std::vector< double > * t_L1TauJetPt
Definition: IsolatedTracksNxN.cc:230
CaloGeometry
Definition: CaloGeometry.h:21
reco::HitPattern
Definition: HitPattern.h:147
FindCaloHit.h
IsolatedTracksNxN::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: IsolatedTracksNxN.cc:721
IsolatedTracksNxN::t_L1FwdJetEta
std::vector< double > * t_L1FwdJetEta
Definition: IsolatedTracksNxN.cc:229
IsolatedTracksNxN::t_trackDxyPV
std::vector< double > * t_trackDxyPV
Definition: IsolatedTracksNxN.cc:251
Track.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackFwd.h
IsolatedTracksNxN::h_recPhi_2
TH1F * h_recPhi_2
Definition: IsolatedTracksNxN.cc:217
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
IsolatedTracksNxN::t_h3x3
std::vector< double > * t_h3x3
Definition: IsolatedTracksNxN.cc:285
BeamSpot.h
CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:38
IsolatedTracksNxN::t_nTracks
int t_nTracks
Definition: IsolatedTracksNxN.cc:222
spr::eECALmatrix
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
IsolatedTracksNxN::t_esim7x7Photon
std::vector< double > * t_esim7x7Photon
Definition: IsolatedTracksNxN.cc:280
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
IsolatedTracksNxN::t_hsim5x5Photon
std::vector< double > * t_hsim5x5Photon
Definition: IsolatedTracksNxN.cc:293
reco::HitPattern::trackerLayersWithMeasurement
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:513
IsolatedTracksNxN::t_esim9x9NeutHad
std::vector< double > * t_esim9x9NeutHad
Definition: IsolatedTracksNxN.cc:281
IsolatedTracksNxN::t_trackHitInMeasTIB
std::vector< int > * t_trackHitInMeasTIB
Definition: IsolatedTracksNxN.cc:261
IsolatedTracksNxN::h_recEtaP_2
TH2F * h_recEtaP_2
Definition: IsolatedTracksNxN.cc:218
IsolatedTracksNxN::t_trackPt
std::vector< double > * t_trackPt
Definition: IsolatedTracksNxN.cc:248
spr::chargeIsolationHcal
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
Definition: ChargeIsolation.cc:114
IsolatedTracksNxN::printTrkHitPattern_
const bool printTrkHitPattern_
Definition: IsolatedTracksNxN.cc:174
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
IsolatedTracksNxN::t_e11x11_10Sig
std::vector< double > * t_e11x11_10Sig
Definition: IsolatedTracksNxN.cc:270
IsolatedTracksNxN::t_L1IsoEMEta
std::vector< double > * t_L1IsoEMEta
Definition: IsolatedTracksNxN.cc:232
Service.h
IsolatedTracksNxN::NEtaBins
static constexpr size_t NEtaBins
Definition: IsolatedTracksNxN.cc:205
PVValHelper::eta
Definition: PVValidationHelpers.h:69
IsolatedTracksNxN::t_maxNearHcalP3x3
std::vector< double > * t_maxNearHcalP3x3
Definition: IsolatedTracksNxN.cc:284
ChargeIsolation.h
IsolatedTracksNxN::t_PVNTracksHPWt
std::vector< int > * t_PVNTracksHPWt
Definition: IsolatedTracksNxN.cc:239
IsolatedTracksNxN::h_maxNearP25x25
TH1F * h_maxNearP25x25[NPBins][NEtaBins]
Definition: IsolatedTracksNxN.cc:208
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimVertex.h
IsolatedTracksNxN::~IsolatedTracksNxN
~IsolatedTracksNxN() override
Definition: IsolatedTracksNxN.cc:544
eHCALMatrix.h
DDAxes::z
reco::TrackBase::numberOfLostHits
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:754
reco::Track
Definition: Track.h:27
AlgorithmMap
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:31
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
EcalSeverityLevelAlgoRcd
Definition: EcalSeverityLevelAlgoRcd.h:12
IsolatedTracksNxN::t_trackPdgIdAll
std::vector< double > * t_trackPdgIdAll
Definition: IsolatedTracksNxN.cc:244
IsolatedTracksNxN::t_hsim3x3NeutHad
std::vector< double > * t_hsim3x3NeutHad
Definition: IsolatedTracksNxN.cc:294
IsolatedTracksNxN::t_L1NonIsoEMPhi
std::vector< double > * t_L1NonIsoEMPhi
Definition: IsolatedTracksNxN.cc:233
IsolatedTracksNxN::t_PVz
std::vector< double > * t_PVz
Definition: IsolatedTracksNxN.cc:236
IsolatedTracksNxN::t_PVNTracksWt
std::vector< int > * t_PVNTracksWt
Definition: IsolatedTracksNxN.cc:238
IsolatedTracksNxN::t_L1NonIsoEMPt
std::vector< double > * t_L1NonIsoEMPt
Definition: IsolatedTracksNxN.cc:233
IsolatedTracksNxN::t_L1Decision
int t_L1Decision[128]
Definition: IsolatedTracksNxN.cc:226
IsolatedTracksNxN::t_Lumi
int t_Lumi
Definition: IsolatedTracksNxN.cc:223
IsolatedTracksNxN::t_jetEta
std::vector< double > * t_jetEta
Definition: IsolatedTracksNxN.cc:241
IsolatedTracksNxN::tok_caloEB_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
Definition: IsolatedTracksNxN.cc:200
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:581
reco::TrackBase::dz
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:602
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
IsolatedTracksNxN::t_esim15x15NeutHad
std::vector< double > * t_esim15x15NeutHad
Definition: IsolatedTracksNxN.cc:281
IsolatedTracksNxN::t_L1AlgoNames
std::vector< std::string > * t_L1AlgoNames
Definition: IsolatedTracksNxN.cc:224
eECALMatrix.h
IsolatedTracksNxN::t_esim15x15
std::vector< double > * t_esim15x15
Definition: IsolatedTracksNxN.cc:277
IsolatedTracksNxN::t_h7x7Sig
std::vector< double > * t_h7x7Sig
Definition: IsolatedTracksNxN.cc:286
IsolatedTracksNxN::bookHistograms
void bookHistograms()
Definition: IsolatedTracksNxN.cc:2262
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
EcalSeverityLevelAlgo.h
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:620
IsolatedTracksNxN::t_trackPhiAll
std::vector< double > * t_trackPhiAll
Definition: IsolatedTracksNxN.cc:244
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
HLT_2018_cff.eta2
eta2
Definition: HLT_2018_cff.py:8221
useL1GtTriggerMenuLite
static const bool useL1GtTriggerMenuLite(true)
IsolatedTracksNxN::t_trackEtaAll
std::vector< double > * t_trackEtaAll
Definition: IsolatedTracksNxN.cc:244
EEDetId
Definition: EEDetId.h:14
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
IsolatedTracksNxN::h_recEtaP_1
TH2F * h_recEtaP_1
Definition: IsolatedTracksNxN.cc:216
L1EmParticleFwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
IsolatedTracksNxN::t_L1FwdJetPhi
std::vector< double > * t_L1FwdJetPhi
Definition: IsolatedTracksNxN.cc:229
TFileService.h
EcalTrigTowerConstituentsMap
Definition: EcalTrigTowerConstituentsMap.h:19
IsolatedTracksNxN::t_hsim7x7
std::vector< double > * t_hsim7x7
Definition: IsolatedTracksNxN.cc:290
reco::HitPattern::stripTIBLayersWithMeasurement
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:577
IsolatedTracksNxN::tok_simVtx_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
Definition: IsolatedTracksNxN.cc:199
IsolatedTracksNxN::t_PVNTracks
std::vector< int > * t_PVNTracks
Definition: IsolatedTracksNxN.cc:238
TFileService::mkdir
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
IsolatedTracksNxN::tMaxH_
const double tMaxH_
Definition: IsolatedTracksNxN.cc:177
IsolatedTracksNxN::t_nTrksJetVtx
std::vector< double > * t_nTrksJetVtx
Definition: IsolatedTracksNxN.cc:242
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
IsolatedTracksNxN::t_PVndof
std::vector< int > * t_PVndof
Definition: IsolatedTracksNxN.cc:238
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
IsolatedTracksNxN::t_PVx
std::vector< double > * t_PVx
Definition: IsolatedTracksNxN.cc:236
CaloSubdetectorGeometry.h
L1JetParticleFwd.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
IsolatedTracksNxN::nL1BitsMax
static constexpr size_t nL1BitsMax
Definition: IsolatedTracksNxN.cc:163
IsolatedTracksNxN::t_L1CenJetEta
std::vector< double > * t_L1CenJetEta
Definition: IsolatedTracksNxN.cc:228
IsolatedTracksNxN::tok_recVtx_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: IsolatedTracksNxN.cc:193
IsolatedTracksNxN::t_maxNearP31x31
std::vector< double > * t_maxNearP31x31
Definition: IsolatedTracksNxN.cc:265
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
Event.h
L1GlobalTriggerReadoutSetup.h
IsolatedTracksNxN::tok_L1extMu_
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > tok_L1extMu_
Definition: IsolatedTracksNxN.cc:185
IsolatedTracksNxN::t_e15x15_15Sig
std::vector< double > * t_e15x15_15Sig
Definition: IsolatedTracksNxN.cc:271
spr::caloSimInfo::eNeutralHad
double eNeutralHad
Definition: CaloSimInfo.h:47
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
IsolatedTracksNxN::t_hsim5x5Rest
std::vector< double > * t_hsim5x5Rest
Definition: IsolatedTracksNxN.cc:292
IsolatedTracksNxN::tok_caloEE_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
Definition: IsolatedTracksNxN.cc:201
IsolatedTracksNxN::t_hsim5x5
std::vector< double > * t_hsim5x5
Definition: IsolatedTracksNxN.cc:290
IsolatedTracksNxN::t_e15x15_30Sig
std::vector< double > * t_e15x15_30Sig
Definition: IsolatedTracksNxN.cc:274
HcalDetId.h
IsolatedTracksNxN::t_trackL
std::vector< double > * t_trackL
Definition: IsolatedTracksNxN.cc:263
IsolatedTracksNxN::t_e9x9_20Sig
std::vector< double > * t_e9x9_20Sig
Definition: IsolatedTracksNxN.cc:272
IsolatedTracksNxN::tMaxE_
const double tMaxE_
Definition: IsolatedTracksNxN.cc:177
IsolatedTracksNxN::t_hsim3x3Rest
std::vector< double > * t_hsim3x3Rest
Definition: IsolatedTracksNxN.cc:292
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:623
CaloTopologyRecord.h
MatchingSimTrack.h
IsolatedTracksNxN::t_L1IsoEMPhi
std::vector< double > * t_L1IsoEMPhi
Definition: IsolatedTracksNxN.cc:232
IsolatedTracksNxN::h_recEta_0
TH1F * h_recEta_0
Definition: IsolatedTracksNxN.cc:213
HcalDetId
Definition: HcalDetId.h:12
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
IsolatedTracksNxN::t_L1METPt
std::vector< double > * t_L1METPt
Definition: IsolatedTracksNxN.cc:234
iEvent
int iEvent
Definition: GenABIO.cc:224
IsolatedTracksNxN::t_e7x7_15Sig
std::vector< double > * t_e7x7_15Sig
Definition: IsolatedTracksNxN.cc:271
IsolatedTracksNxN::t_e9x9_15Sig
std::vector< double > * t_e9x9_15Sig
Definition: IsolatedTracksNxN.cc:271
IsolatedTracksNxN::t_esim11x11Photon
std::vector< double > * t_esim11x11Photon
Definition: IsolatedTracksNxN.cc:280
reco::TrackBase::d0
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:596
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
edm::LogVerbatim
Definition: MessageLogger.h:297
IsolatedTracksNxN::t_trackHitInMeasTOB
std::vector< int > * t_trackHitInMeasTOB
Definition: IsolatedTracksNxN.cc:261
reco::HitPattern::stripTIDLayersWithoutMeasurement
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:649
p1
double p1[4]
Definition: TauolaWrapper.h:89
IsolatedTracksNxN::t_PVTracksSumPtHP
std::vector< double > * t_PVTracksSumPtHP
Definition: IsolatedTracksNxN.cc:237
IsolatedTracksNxN::t_trackDzAll
std::vector< double > * t_trackDzAll
Definition: IsolatedTracksNxN.cc:246
MagneticField.h
IsolatedTracksNxN::t_trackHitOutMeasTID
std::vector< int > * t_trackHitOutMeasTID
Definition: IsolatedTracksNxN.cc:262
edm::EventSetup
Definition: EventSetup.h:57
IsolatedTracksNxN::t_PVTracksSumPtHPWt
std::vector< double > * t_PVTracksSumPtHPWt
Definition: IsolatedTracksNxN.cc:237
IsolatedTracksNxN::t_nTrksJetCalo
std::vector< double > * t_nTrksJetCalo
Definition: IsolatedTracksNxN.cc:242
TrackAssociatorRecord.h
L1EmParticle.h
IsolatedTracksNxN::t_trackEta
std::vector< double > * t_trackEta
Definition: IsolatedTracksNxN.cc:248
reco::TrackBase::normalizedChi2
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:578
spr::eECALSimInfo
void eECALSimInfo(const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
IsolatedTracksNxN::t_trackHitInMeasTID
std::vector< int > * t_trackHitInMeasTID
Definition: IsolatedTracksNxN.cc:261
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
get
#define get
HitPattern.h
IsolatedTracksNxN::t_hsim7x7Matched
std::vector< double > * t_hsim7x7Matched
Definition: IsolatedTracksNxN.cc:291
IsolatedTracksNxN::deltaR
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: IsolatedTracksNxN.cc:2757
reco::HitPattern::TRACK_HITS
Definition: HitPattern.h:155
IsolatedTracksNxN::t_PVisValid
std::vector< int > * t_PVisValid
Definition: IsolatedTracksNxN.cc:238
IsolatedTracksNxN::t_hsim7x7NeutHad
std::vector< double > * t_hsim7x7NeutHad
Definition: IsolatedTracksNxN.cc:294
IsolatedTracksNxN::h_recP_1
TH1F * h_recP_1
Definition: IsolatedTracksNxN.cc:215
CaloTopology.h
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
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
IsolatedTracksNxN::nEventProc_
int nEventProc_
Definition: IsolatedTracksNxN.cc:179
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
VertexFwd.h
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
IsolatedTracksNxN::t_trackHitInMissTIB
std::vector< int > * t_trackHitInMissTIB
Definition: IsolatedTracksNxN.cc:257
CaloSubdetectorTopology.h
IsolatedTracksNxN::l1AlgoMap_
std::map< std::pair< unsigned int, std::string >, int > l1AlgoMap_
Definition: IsolatedTracksNxN.cc:167
IsolatedTracksNxN::t_h3x3Sig
std::vector< double > * t_h3x3Sig
Definition: IsolatedTracksNxN.cc:286
IsolatedTracksNxN::t_trackHitOutMissTID
std::vector< int > * t_trackHitOutMissTID
Definition: IsolatedTracksNxN.cc:259
IsolatedTracksNxN::t_trackHitOutMissTOBTEC
std::vector< int > * t_trackHitOutMissTOBTEC
Definition: IsolatedTracksNxN.cc:259
reco::TrackBase::hitPattern
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:489
IsolatedTracksNxN::tok_hbhe_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: IsolatedTracksNxN.cc:190
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
IsolatedTracksNxN::t_h5x5Sig
std::vector< double > * t_h5x5Sig
Definition: IsolatedTracksNxN.cc:286
IsolatedTracksNxN::tok_EE_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: IsolatedTracksNxN.cc:197
HcalTopology.h
EcalTrigTowerConstituentsMap.h
IsolatedTracksNxN::t_esim15x15Photon
std::vector< double > * t_esim15x15Photon
Definition: IsolatedTracksNxN.cc:280
CaloSimInfo.h
IsolatedTracksNxN::endJob
void endJob() override
Definition: IsolatedTracksNxN.cc:2043
IsolatedTracksNxN::t_hsim5x5Matched
std::vector< double > * t_hsim5x5Matched
Definition: IsolatedTracksNxN.cc:291
IsolatedTracksNxN::h_recP_0
TH1F * h_recP_0
Definition: IsolatedTracksNxN.cc:213
reco::HitPattern::stripTIDLayersWithMeasurement
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:587
Ref.h
IsolatedTracksNxN::genPartEtaBins
double genPartEtaBins[NEtaBins+1]
Definition: IsolatedTracksNxN.cc:206
L1GlobalTriggerObjectMapFwd.h
IsolatedTracksNxN::t_L1CenJetPhi
std::vector< double > * t_L1CenJetPhi
Definition: IsolatedTracksNxN.cc:228
IsolatedTracksNxN::t_trackEcalEta
std::vector< double > * t_trackEcalEta
Definition: IsolatedTracksNxN.cc:249
L1MuonParticle.h
IsolatedTracksNxN::L1TriggerAlgoInfo_
const bool L1TriggerAlgoInfo_
Definition: IsolatedTracksNxN.cc:176
JetExtendedAssociation.h
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
IsolatedTracksNxN::h_maxNearP15x15
TH1F * h_maxNearP15x15[NPBins][NEtaBins]
Definition: IsolatedTracksNxN.cc:208
spr::propagateTrackerEnd
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:782
DetId.h
Frameworkfwd.h
CaloPropagateTrack.h
IsolatedTracksNxN::tok_simTk_
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
Definition: IsolatedTracksNxN.cc:198
spr::matchedSimTrack
edm::SimTrackContainer::const_iterator matchedSimTrack(const edm::Event &iEvent, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, bool debug=false)
Definition: MatchingSimTrack.cc:12
IsolatedTracksNxN::t_trackHitOutMeasTOB
std::vector< int > * t_trackHitOutMeasTOB
Definition: IsolatedTracksNxN.cc:262
L1GtUtils.h
IsolatedTracksNxN::t_hsim7x7Photon
std::vector< double > * t_hsim7x7Photon
Definition: IsolatedTracksNxN.cc:293
CaloGeometry.h
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
IsolatedTracksNxN::tok_genTrack_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: IsolatedTracksNxN.cc:192
IsolatedTracksNxN::h_recEta_1
TH1F * h_recEta_1
Definition: IsolatedTracksNxN.cc:215
IsolatedTracksNxN::t_trackHitOutMeasTEC
std::vector< int > * t_trackHitOutMeasTEC
Definition: IsolatedTracksNxN.cc:262
IsolatedTracksNxN::h_recPhi_1
TH1F * h_recPhi_1
Definition: IsolatedTracksNxN.cc:215
IsolatedTracksNxN::h_recEtaPt_2
TH2F * h_recEtaPt_2
Definition: IsolatedTracksNxN.cc:218
IsolatedTracksNxN::h_recEta_2
TH1F * h_recEta_2
Definition: IsolatedTracksNxN.cc:217
IsolatedTracksNxN::doMC_
const bool doMC_
Definition: IsolatedTracksNxN.cc:170
IsolatedTracksNxN::tok_L1extFwdJet_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extFwdJet_
Definition: IsolatedTracksNxN.cc:183
IsolatedTracksNxN::t_EvtNo
int t_EvtNo
Definition: IsolatedTracksNxN.cc:223
Point3D.h
spr::eHCALmatrixCell
std::vector< std::pair< DetId, double > > eHCALmatrixCell(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, bool debug=false)
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
IsolatedTracksNxN::t_trackHitInMissTID
std::vector< int > * t_trackHitInMissTID
Definition: IsolatedTracksNxN.cc:257
IsolatedTracksNxN::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: IsolatedTracksNxN.cc:164
spr::caloSimInfo::eChargedHad
double eChargedHad
Definition: CaloSimInfo.h:48
edm::RefToBase< reco::Track >
IsolatedTracksNxN::tMinH_
const double tMinH_
Definition: IsolatedTracksNxN.cc:177
IsolatedTracksNxN::t_e11x11_30Sig
std::vector< double > * t_e11x11_30Sig
Definition: IsolatedTracksNxN.cc:274
HcalRecHitCollections.h
IsolatedTracksNxN::t_L1TauJetEta
std::vector< double > * t_L1TauJetEta
Definition: IsolatedTracksNxN.cc:230
IsolatedTracksNxN::t_esim7x7NeutHad
std::vector< double > * t_esim7x7NeutHad
Definition: IsolatedTracksNxN.cc:281
PCaloHitContainer.h
IsolatedTracksNxN::tree_
TTree * tree_
Definition: IsolatedTracksNxN.cc:220
spr::eHCALmatrix
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)
IsolatedTracksNxN::t_trackDz
std::vector< double > * t_trackDz
Definition: IsolatedTracksNxN.cc:250
IsolatedTracksNxN::t_trackDzBS
std::vector< double > * t_trackDzBS
Definition: IsolatedTracksNxN.cc:250
IsolatedTracksNxN::t_e9x9
std::vector< double > * t_e9x9
Definition: IsolatedTracksNxN.cc:269
IsolatedTracksNxN::debugTrks_
const int debugTrks_
Definition: IsolatedTracksNxN.cc:173
IsolatedTracksNxN::pvTracksPtMin_
const double pvTracksPtMin_
Definition: IsolatedTracksNxN.cc:172
spr::caloSimInfo
Definition: CaloSimInfo.h:42
IsolatedTracksNxN::t_trackHitOutMissTOB
std::vector< int > * t_trackHitOutMissTOB
Definition: IsolatedTracksNxN.cc:259
IsolatedTracksNxN::t_esim11x11CharHad
std::vector< double > * t_esim11x11CharHad
Definition: IsolatedTracksNxN.cc:282
IsolatedTracksNxN::t_hsim3x3Matched
std::vector< double > * t_hsim3x3Matched
Definition: IsolatedTracksNxN.cc:291
IsolatedTracksNxN::printTrack
void printTrack(const reco::Track *pTrack)
Definition: IsolatedTracksNxN.cc:2763
IsolatedTracksNxN::t_trackDzPVAll
std::vector< double > * t_trackDzPVAll
Definition: IsolatedTracksNxN.cc:246
IsolatedTracksNxN::t_e15x15
std::vector< double > * t_e15x15
Definition: IsolatedTracksNxN.cc:269
IsolatedTracksNxN::t_h7x7
std::vector< double > * t_h7x7
Definition: IsolatedTracksNxN.cc:285
IsolatedTracksNxN::t_ecalSpike11x11
std::vector< int > * t_ecalSpike11x11
Definition: IsolatedTracksNxN.cc:267
Candidate.h
IsolatedTracksNxN::tok_EB_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: IsolatedTracksNxN.cc:196
IsolatedTracksNxN::t_trackPAll
std::vector< double > * t_trackPAll
Definition: IsolatedTracksNxN.cc:244
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
spr::chargeIsolationEcal
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
Definition: ChargeIsolation.cc:15
IsolatedTracksNxN::h_recPt_0
TH1F * h_recPt_0
Definition: IsolatedTracksNxN.cc:213
L1GtTriggerMenuFwd.h
IsolatedTracksNxN::t_e7x7
std::vector< double > * t_e7x7
Definition: IsolatedTracksNxN.cc:269
IsolatedTracksNxN::debugL1Info_
const bool debugL1Info_
Definition: IsolatedTracksNxN.cc:176
SimTrack.h
L1GlobalTriggerObjectMapRecord.h
ParameterSet.h
reco::HitPattern::stripTECLayersWithMeasurement
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:607
IsolatedTracksNxN::t_Bunch
int t_Bunch
Definition: IsolatedTracksNxN.cc:223
IsolatedTracksNxN::t_hsim3x3CharHad
std::vector< double > * t_hsim3x3CharHad
Definition: IsolatedTracksNxN.cc:295
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:635
IsolatedTracksNxN::t_trackHitsTOB
std::vector< int > * t_trackHitsTOB
Definition: IsolatedTracksNxN.cc:256
eHCALMatrixExtra.h
IsolatedTracksNxN::t_trackDzPV
std::vector< double > * t_trackDzPV
Definition: IsolatedTracksNxN.cc:251
IsolatedTracksNxN::t_jetPt
std::vector< double > * t_jetPt
Definition: IsolatedTracksNxN.cc:241
IsolatedTracksNxN::h_recPt_2
TH1F * h_recPt_2
Definition: IsolatedTracksNxN.cc:217
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
IsolatedTracksNxN::t_PVNTracksHP
std::vector< int > * t_PVNTracksHP
Definition: IsolatedTracksNxN.cc:239
IsolatedTracksNxN::tok_bs_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
Definition: IsolatedTracksNxN.cc:194
IsolatedTracksNxN::t_L1TauJetPhi
std::vector< double > * t_L1TauJetPhi
Definition: IsolatedTracksNxN.cc:230
edm::Event
Definition: Event.h:73
IsolatedTracksNxN::t_PVTracksSumPtWt
std::vector< double > * t_PVTracksSumPtWt
Definition: IsolatedTracksNxN.cc:237
IsolatedTracksNxN::tok_L1extIsoEm_
edm::EDGetTokenT< l1extra::L1EmParticleCollection > tok_L1extIsoEm_
Definition: IsolatedTracksNxN.cc:186
MagneticField
Definition: MagneticField.h:19
L1GlobalTriggerObjectMap.h
spr::eCaloSimInfo
void eCaloSimInfo(std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
IsolatedTracksNxN::tok_jets_
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
Definition: IsolatedTracksNxN.cc:189
L1JetParticle.h
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:593
IsolatedTracksNxN::t_esim11x11NeutHad
std::vector< double > * t_esim11x11NeutHad
Definition: IsolatedTracksNxN.cc:281
IsolatedTracksNxN::t_trackHitInMeasTEC
std::vector< int > * t_trackHitInMeasTEC
Definition: IsolatedTracksNxN.cc:261
IsolatedTracksNxN::tok_L1extTauJet_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extTauJet_
Definition: IsolatedTracksNxN.cc:181
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
SimTrackContainer.h
reco::TrackBase::quality
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:537
cuy.ii
ii
Definition: cuy.py:590
IsolatedTracksNxN::beginJob
void beginJob() override
Definition: IsolatedTracksNxN.cc:2024
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
IsolatedTracksNxN::t_L1MuonEta
std::vector< double > * t_L1MuonEta
Definition: IsolatedTracksNxN.cc:231
SimVertexContainer.h
IsolatedTracksNxN::maxTrackEta_
const double maxTrackEta_
Definition: IsolatedTracksNxN.cc:175
spr::caloSimInfo::pdgMatched
double pdgMatched
Definition: CaloSimInfo.h:44
IsolatedTracksNxN::h_maxNearP31x31
TH1F * h_maxNearP31x31[NPBins][NEtaBins]
Definition: IsolatedTracksNxN.cc:208
weight
Definition: weight.py:1
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
EcalChannelStatusRcd.h
IsolatedTracksNxN::t_esim15x15Matched
std::vector< double > * t_esim15x15Matched
Definition: IsolatedTracksNxN.cc:278
IsolatedTracksNxN::initL1_
bool initL1_
Definition: IsolatedTracksNxN.cc:178
IsolatedTracksNxN::t_e15x15_20Sig
std::vector< double > * t_e15x15_20Sig
Definition: IsolatedTracksNxN.cc:272
IsolatedTracksNxN::tok_L1extCenJet_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extCenJet_
Definition: IsolatedTracksNxN.cc:182
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
IsolatedTracksNxN::t_e7x7_30Sig
std::vector< double > * t_e7x7_30Sig
Definition: IsolatedTracksNxN.cc:274
L1GtTriggerMenu::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenu.h:187
reco::TrackBase::qoverp
double qoverp() const
q / p
Definition: TrackBase.h:584
IsolatedTracksNxN::t_e7x7_25Sig
std::vector< double > * t_e7x7_25Sig
Definition: IsolatedTracksNxN.cc:273
IsolatedTracksNxN::t_maxNearHcalP7x7
std::vector< double > * t_maxNearHcalP7x7
Definition: IsolatedTracksNxN.cc:284
reco::HitPattern::stripTECLayersWithoutMeasurement
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:669
IsolatedTracksNxN::t_esim9x9
std::vector< double > * t_esim9x9
Definition: IsolatedTracksNxN.cc:277
IsolatedTracksNxN::t_hsim5x5NeutHad
std::vector< double > * t_hsim5x5NeutHad
Definition: IsolatedTracksNxN.cc:294
IsolatedTracksNxN::t_h5x5
std::vector< double > * t_h5x5
Definition: IsolatedTracksNxN.cc:285
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
IsolatedTracksNxN::t_jetPhi
std::vector< double > * t_jetPhi
Definition: IsolatedTracksNxN.cc:241
IsolatedTracksNxN::t_L1FwdJetPt
std::vector< double > * t_L1FwdJetPt
Definition: IsolatedTracksNxN.cc:229
IsolatedTracksNxN::t_simTrackP
std::vector< double > * t_simTrackP
Definition: IsolatedTracksNxN.cc:276
IsolatedTracksNxN::t_hsim3x3
std::vector< double > * t_hsim3x3
Definition: IsolatedTracksNxN.cc:290
IsolatedTracksNxN::t_esim7x7Rest
std::vector< double > * t_esim7x7Rest
Definition: IsolatedTracksNxN.cc:279