CMS 3D CMS Logo

IsolatedTracksCone.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: IsolatedTracksCone
4 // Class: IsolatedTracksCone
5 //
6 
15 //
16 // Original Author: Jim Hirschauer (adaptation of Seema Sharma's
17 // IsolatedTracksNew)
18 // Created: Thu Nov 6 15:30:40 CST 2008
19 //
20 //
21 #define _DEBUG_QUIET
22 
25 
32 
36 
38  trackerHitAssociatorConfig_(consumesCollector()) {
39 
40  //now do what ever initialization is needed
41  doMC = iConfig.getUntrackedParameter<bool> ("DoMC", false);
42  myverbose_ = iConfig.getUntrackedParameter<int>( "Verbosity", 5 );
43  useJetTrigger_ = iConfig.getUntrackedParameter<bool>( "useJetTrigger", false);
44  drLeadJetVeto_ = iConfig.getUntrackedParameter<double>( "drLeadJetVeto", 1.2 );
45  ptMinLeadJet_ = iConfig.getUntrackedParameter<double>( "ptMinLeadJet", 15.0 );
46 
47  debugTrks_ = iConfig.getUntrackedParameter<int>("DebugTracks");
48  printTrkHitPattern_ = iConfig.getUntrackedParameter<bool>("PrintTrkHitPattern");
49 
50  minTrackP_ = iConfig.getUntrackedParameter<double>( "minTrackP", 10.0);
51  maxTrackEta_ = iConfig.getUntrackedParameter<double>( "maxTrackEta", 5.0);
52  maxNearTrackP_ = iConfig.getUntrackedParameter<double>( "maxNearTrackP", 1.0);
53 
54  debugEcalSimInfo_ = iConfig.getUntrackedParameter<int>("DebugEcalSimInfo");
55 
56  applyEcalIsolation_ = iConfig.getUntrackedParameter<bool>("ApplyEcalIsolation");
57 
58  tok_L1extTauJet_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getParameter<edm::InputTag>("L1extraTauJetSource"));
59  tok_L1extCenJet_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getParameter<edm::InputTag>("L1extraCenJetSource"));
60  tok_L1extFwdJet_ = consumes<l1extra::L1JetParticleCollection>(iConfig.getParameter<edm::InputTag>("L1extraFwdJetSource"));
61 
62  // hard coded collection access
63  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
64  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
65  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
66  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
67  tok_simTk_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
68  tok_simVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
69  tok_caloEB_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEB"));
70  tok_caloEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE"));
71  tok_caloHH_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"));
72  tok_trigger_ = consumes<edm::TriggerResults>(edm::InputTag("TriggerResults","","HLT"));
73 
74  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
76  parameters_.loadParameters( parameters, iC );
79 
80  if(myverbose_>=0) {
81  std::cout <<"Parameters read from config file \n"
82  << "myverbose_ " << myverbose_ << "\n"
83  << "useJetTrigger_ " << useJetTrigger_ << "\n"
84  << "drLeadJetVeto_ " << drLeadJetVeto_ << "\n"
85  << "minTrackP_ " << minTrackP_ << "\n"
86  << "maxTrackEta_ " << maxTrackEta_ << "\n"
87  << "maxNearTrackP_ " << maxNearTrackP_
88  << std::endl;
89  }
90 }
91 
93  delete trackAssociator_;
94 }
95 
97  const edm::EventSetup& iSetup) {
98 
99  unsigned int irun = (unsigned int)iEvent.id().run();
100  unsigned int ilum = (unsigned int)iEvent.getLuminosityBlock().luminosityBlock();
101  unsigned int ievt = (unsigned int)iEvent.id().event();
102 
103 
104 
106 
107  // check the L1 objects
108  bool L1Pass = false;
109  leadL1JetPT=-999, leadL1JetEta=-999, leadL1JetPhi=-999;
110  if( !useJetTrigger_ ) {
111  L1Pass = true;
112  } else {
114  iEvent.getByToken(tok_L1extTauJet_,l1TauHandle);
115  l1extra::L1JetParticleCollection::const_iterator itr;
116  for(itr = l1TauHandle->begin(); itr != l1TauHandle->end(); ++itr )
117  {
118  if( itr->pt()>leadL1JetPT ) {
119  leadL1JetPT = itr->pt();
120  leadL1JetEta = itr->eta();
121  leadL1JetPhi = itr->phi();
122  }
123  }
125  iEvent.getByToken(tok_L1extCenJet_,l1CenJetHandle);
126  for( itr = l1CenJetHandle->begin(); itr != l1CenJetHandle->end(); ++itr )
127  {
128  if( itr->pt()>leadL1JetPT ) {
129  leadL1JetPT = itr->pt();
130  leadL1JetEta = itr->eta();
131  leadL1JetPhi = itr->phi();
132  }
133  }
135  iEvent.getByToken(tok_L1extFwdJet_,l1FwdJetHandle);
136  for( itr = l1FwdJetHandle->begin(); itr != l1FwdJetHandle->end(); ++itr )
137  {
138  if( itr->pt()>leadL1JetPT ) {
139  leadL1JetPT = itr->pt();
140  leadL1JetEta = itr->eta();
141  leadL1JetPhi = itr->phi();
142  }
143  }
145  {
146  L1Pass = true;
147  }
148 
149  }
150 
151 
153  // Break now if L1Pass is false
155  if (!L1Pass) {
156  nEVT_failL1++;
157  // // std::cout << "L1Pass is false : " << L1Pass << std::endl;
158  // return;
159  }
160 
162  // Get the collection handles
164 
165 
167  iSetup.get<CaloGeometryRecord>().get(pG);
168  const CaloGeometry* geo = pG.product();
169  const CaloSubdetectorGeometry* gEB =
171  const CaloSubdetectorGeometry* gEE =
173  const CaloSubdetectorGeometry* gHB =
175  const CaloSubdetectorGeometry* gHE =
177 
178  edm::ESHandle<CaloTopology> theCaloTopology;
179  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
180  const CaloTopology *caloTopology = theCaloTopology.product();
181  // const CaloSubdetectorTopology* theEBTopology = theCaloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel);
182  // const CaloSubdetectorTopology* theEETopology = theCaloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap);
183 
185  iSetup.get<HcalRecNumberingRecord>().get(htopo);
186  const HcalTopology* theHBHETopology = htopo.product();
187 
188  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
189  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
190  iEvent.getByToken(tok_EB_,barrelRecHitsHandle);
191  iEvent.getByToken(tok_EE_,endcapRecHitsHandle);
192 
193  // Retrieve the good/bad ECAL channels from the DB
195  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
196  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
197 
199  iEvent.getByToken(tok_hbhe_,hbhe);
200  const HBHERecHitCollection Hithbhe = *(hbhe.product());
201 
203  iEvent.getByToken(tok_genTrack_, trkCollection);
204  reco::TrackCollection::const_iterator trkItr;
205  if(debugTrks_>1){
206  std::cout << "Track Collection: " << std::endl;
207  std::cout << "Number of Tracks " << trkCollection->size() << std::endl;
208  }
209  std::string theTrackQuality = "highPurity";
210  reco::TrackBase::TrackQuality trackQuality_=
211  reco::TrackBase::qualityByName(theTrackQuality);
212 
213  //get Handles to SimTracks and SimHits
215  if (doMC) iEvent.getByToken(tok_simTk_,SimTk);
216  edm::SimTrackContainer::const_iterator simTrkItr;
217 
219  if (doMC) iEvent.getByToken(tok_simVtx_,SimVtx);
220 
221  //get Handles to PCaloHitContainers of eb/ee/hbhe
223  if (doMC) iEvent.getByToken(tok_caloEB_, pcaloeb);
224 
226  if (doMC) iEvent.getByToken(tok_caloEE_, pcaloee);
227 
229  if (doMC) iEvent.getByToken(tok_caloHH_, pcalohh);
230 
231 
232 
234  // Get HLT_IsoTrackHB/HE Information
236 
238  iEvent.getByToken( tok_trigger_, triggerResults);
239 
240 
241 
242  std::vector<int> v_hlTriggers;
243  int hltHB(-99);
244  int hltHE(-99);
245  int hltL1Jet15 (-99);
246  int hltJet30 (-99);
247  int hltJet50 (-99);
248  int hltJet80 (-99);
249  int hltJet110 (-99);
250  int hltJet140 (-99);
251  int hltJet180 (-99);
252  int hltL1SingleEG5 (-99);
253  int hltZeroBias (-99);
254  int hltMinBiasHcal (-99);
255  int hltMinBiasEcal (-99);
256  int hltMinBiasPixel (-99);
257  int hltSingleIsoTau30_Trk5 (-99);
258  int hltDoubleLooseIsoTau15_Trk5(-99);
259 
260  if (triggerResults.isValid()) {
261 
262  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
263  // TriggerNames class triggerNames.init(*triggerResults);
264 
265 
266  for (unsigned int i=0; i<triggerResults->size(); i++){
267  // std::cout << "triggerNames.triggerName(" << i << ") = " << triggerNames.triggerName(i) << std::endl;
268  if (triggerNames.triggerName(i) == "HLT_IsoTrackHE_1E31") hltHE = triggerResults->accept(i);
269  if (triggerNames.triggerName(i) == "HLT_IsoTrackHB_1E31") hltHB = triggerResults->accept(i);
270  if (triggerNames.triggerName(i) == "HLT_L1Jet15" ) hltL1Jet15 = triggerResults->accept(i);
271  if (triggerNames.triggerName(i) == "HLT_Jet30" ) hltJet30 = triggerResults->accept(i);
272  if (triggerNames.triggerName(i) == "HLT_Jet50" ) hltJet50 = triggerResults->accept(i);
273  if (triggerNames.triggerName(i) == "HLT_Jet80" ) hltJet80 = triggerResults->accept(i);
274  if (triggerNames.triggerName(i) == "HLT_Jet110" ) hltJet110 = triggerResults->accept(i);
275  if (triggerNames.triggerName(i) == "HLT_Jet140" ) hltJet140 = triggerResults->accept(i);
276  if (triggerNames.triggerName(i) == "HLT_Jet180" ) hltJet180 = triggerResults->accept(i);
277  if (triggerNames.triggerName(i) == "HLT_L1SingleEG5" ) hltL1SingleEG5 = triggerResults->accept(i);
278  if (triggerNames.triggerName(i) == "HLT_ZeroBias" ) hltZeroBias = triggerResults->accept(i);
279  if (triggerNames.triggerName(i) == "HLT_MinBiasHcal" ) hltMinBiasHcal = triggerResults->accept(i);
280  if (triggerNames.triggerName(i) == "HLT_MinBiasEcal" ) hltMinBiasEcal = triggerResults->accept(i);
281  if (triggerNames.triggerName(i) == "HLT_MinBiasPixel" ) hltMinBiasPixel = triggerResults->accept(i);
282  if (triggerNames.triggerName(i) == "HLT_SingleIsoTau30_Trk5" ) hltSingleIsoTau30_Trk5 = triggerResults->accept(i);
283  if (triggerNames.triggerName(i) == "HLT_DoubleLooseIsoTau15_Trk5" ) hltDoubleLooseIsoTau15_Trk5 = triggerResults->accept(i);
284  }
285  }
286 
287 
288 
289 
291  // Primary loop over tracks
293  std::unique_ptr<TrackerHitAssociator> associate;
294  if (doMC) associate.reset(new TrackerHitAssociator(iEvent, trackerHitAssociatorConfig_));
295 
296 
297  nTRK = 0;
298  nRawTRK = 0;
299  nFailPt = 0;
300  nFailEta = 0;
302  nMissEcal = 0;
303  nMissHcal = 0;
304 
305  for( trkItr = trkCollection->begin();
306  trkItr != trkCollection->end(); ++trkItr)
307  {
308 
309  nRawTRK++;
310 
311  const reco::Track* pTrack = &(*trkItr);
312 
314  // Check for min Pt and max Eta P
316 
317  bool trkQual = pTrack->quality(trackQuality_);
318  bool goodPt = pTrack->p()>minTrackP_;
319  bool goodEta = std::abs(pTrack->momentum().eta())<maxTrackEta_;
320 
321  double eta1 = pTrack->momentum().eta();
322  double phi1 = pTrack->momentum().phi();
323  double pt1 = pTrack->pt();
324  double p1 = pTrack->p();
325 
326 
327  if (!goodEta){
328  nFailEta++;
329  }
330  if (!goodPt){
331  nFailPt++;
332  }
333  if (!trkQual){
335  }
336 
337  hRawPt ->Fill(pt1 );
338  hRawP ->Fill(p1 );
339  hRawEta->Fill(eta1);
340  hRawPhi->Fill(phi1);
341 
342  if( !goodEta || !goodPt || !trkQual ) continue; // Skip to next track
343 
345  // Find track trajectory
347 
348 
349  const FreeTrajectoryState fts1 =
350  trackAssociator_->getFreeTrajectoryState(iSetup, *pTrack);
351 
352 
353  TrackDetMatchInfo info1 =
354  trackAssociator_->associate(iEvent, iSetup, fts1, parameters_);
355 
356 
357 
359  // First confirm track makes it to Hcal
361 
362  if (info1.trkGlobPosAtHcal.x()==0 &&
363  info1.trkGlobPosAtHcal.y()==0 &&
364  info1.trkGlobPosAtHcal.z()==0)
365  {
366  nMissHcal++;
367  continue;
368  }
369 
370  const GlobalPoint hpoint1(info1.trkGlobPosAtHcal.x(),
371  info1.trkGlobPosAtHcal.y(),
372  info1.trkGlobPosAtHcal.z());
373 
374 
375 
377  // Get basic quantities
379 
380  const reco::HitPattern& hitp = pTrack->hitPattern();
381  int nLayersCrossed = hitp.trackerLayersWithMeasurement();
382  int nOuterHits = hitp.stripTOBLayersWithMeasurement()
383  +hitp.stripTECLayersWithMeasurement() ;
384 
385 
386  double simP = 0;
387  if (doMC) {
388  edm::SimTrackContainer::const_iterator matchedSimTrk =
389  spr::matchedSimTrack(iEvent, SimTk, SimVtx, pTrack, *associate, false);
390  simP = matchedSimTrk->momentum().P();
391  }
393  // Get Ecal Point
395 
396  const GlobalPoint point1(info1.trkGlobPosAtEcal.x(),
397  info1.trkGlobPosAtEcal.y(),
398  info1.trkGlobPosAtEcal.z());
399 
400 
401  // Sanity check that track hits Ecal
402 
403  if (info1.trkGlobPosAtEcal.x()==0 &&
404  info1.trkGlobPosAtEcal.y()==0 &&
405  info1.trkGlobPosAtEcal.z()==0)
406  {
407  std::cout << "Track doesn't reach Ecal." << std::endl;
408  nMissEcal++;
409  continue;
410  }
411 
412  // Get Track Momentum - make sure you have latest version of TrackDetMatchInfo
413 
414  GlobalVector trackMomAtEcal = info1.trkMomAtEcal;
415  GlobalVector trackMomAtHcal = info1.trkMomAtHcal;
416 
418  // If using Jet trigger, get distance from leading jet
420 
421  double drFromLeadJet = 999.0;
422  if( useJetTrigger_ ) {
423  double dphi = DeltaPhi(phi1, leadL1JetPhi);
424  double deta = eta1 - leadL1JetEta;
425  drFromLeadJet = sqrt(dphi*dphi + deta*deta);
426  }
427 
428 
430  // Define Arrays for sizes of Charge, Neut Iso Radii and
431  // Clustering Cone Radius.
433 
434  const int a_size = 7;
435  double a_coneR[a_size];
436  double a_charIsoR[a_size];
437  double a_neutIsoR[a_size];
438 
439  a_coneR[0] = 17.49; // = area of 2x2
440  a_coneR[1] = 26.23; // = area of 3x3
441  a_coneR[2] = 30.61;
442  a_coneR[3] = 34.98; // = area of 4x4
443  a_coneR[4] = 39.35;
444  a_coneR[5] = 43.72; // = area of 5x5
445  a_coneR[6] = 52.46; // = area of 6x6
446 
447  for (int i=0; i<a_size; i++){
448  a_charIsoR[i] = a_coneR[i]+28.9; // 28.9 gives 55.1 for 3x3 benchmark
449  a_neutIsoR[i] = a_charIsoR[i]*0.726; // Ecal radius = 0.726*Hcal radius
450  }
451 
453  // Do Neutral Iso in radius on Ecal surface.
455 
456  // NxN cluster
457  double e3x3=-999.0;
458  double trkEcalEne =-999.0;
460  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
461 
462  if(std::abs(point1.eta())<1.479) {
463  const DetId isoCell = gEB->getClosestCell(point1);
464  e3x3 = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv.product(),1,1).first;
465  trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate);
466  } else {
467  const DetId isoCell = gEE->getClosestCell(point1);
468  e3x3 = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv.product(),1,1).first;
469  trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate);
470  }
471 
472  // Cone cluster
473 
474  // Set up array of cone sizes for MIP cut
475  const int a_mip_size = 5;
476  double a_mipR[a_mip_size];
477  a_mipR[0] = 3.84; // = area of 3x3 ecal
478  a_mipR[1] = 14.0;
479  a_mipR[2] = 19.0;
480  a_mipR[3] = 24.0;
481  a_mipR[4] = 9.0; // = from standard analyzer
482 
483  std::vector<double> v_eDR;
484  for (int i = 0 ; i < a_size ; i++){
485  int nRH_eDR = 0;
486 
487  // Cone in ecal
488  double eDR = spr::eCone_ecal(geo,
489  barrelRecHitsHandle,
490  endcapRecHitsHandle,
491  hpoint1, point1,
492  a_neutIsoR[i],
493  trackMomAtEcal, nRH_eDR);
494  v_eDR.push_back(eDR);
495 
496  }
497 
498  std::vector<double> v_eMipDR;
499  for (int i = 0 ; i < a_mip_size ; i++){
500  int nRH_eMipDR = 0;
501  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
502  endcapRecHitsHandle,
503  hpoint1, point1,
504  a_mipR[i], trackMomAtEcal, nRH_eMipDR);
505 
506  v_eMipDR.push_back(eMipDR);
507  }
508 
509 
511  // Do charge isolation in radius at Hcal surface for 5 different
512  // radii defined above in a_charIso
514 
515  std::vector<double> v_hmaxNearP_goodTrk;
516  std::vector<double> v_hmaxNearP ;
517  std::vector<int> v_hnNearTRKs ;
518  std::vector<int> v_hnLayers_maxNearP;
519  std::vector<int> v_htrkQual_maxNearP;
520 
521  std::vector<double> v_cone_hmaxNearP_goodTrk;
522  std::vector<double> v_cone_hmaxNearP ;
523  std::vector<int> v_cone_hnNearTRKs ;
524  std::vector<int> v_cone_hnLayers_maxNearP;
525  std::vector<int> v_cone_htrkQual_maxNearP;
526 
527  for (int i = 0 ; i < a_size ; i++){
528 
529  double hmaxNearP = -999.0;
530  int hnNearTRKs = 0;
531  int hnLayers_maxNearP = 0;
532  int htrkQual_maxNearP = -1;
533  double hmaxNearP_goodTrk = -999.0;
534 
535  double conehmaxNearP = -999.0;
536  int conehnNearTRKs = 0;
537  int conehnLayers_maxNearP = 0;
538  int conehtrkQual_maxNearP = -1;
539  double conehmaxNearP_goodTrk = -999.0;
540 
541  conehmaxNearP = spr::coneChargeIsolation(iEvent, iSetup,
542  trkItr, trkCollection,
544  theTrackQuality, conehnNearTRKs,
545  conehnLayers_maxNearP,
546  conehtrkQual_maxNearP,
547  conehmaxNearP_goodTrk,
548  hpoint1, trackMomAtHcal,
549  a_charIsoR[i]);
550 
551  v_hmaxNearP_goodTrk.push_back(hmaxNearP_goodTrk);
552  v_hmaxNearP .push_back(hmaxNearP );
553  v_hnNearTRKs .push_back(hnNearTRKs );
554  v_hnLayers_maxNearP.push_back(hnLayers_maxNearP);
555  v_htrkQual_maxNearP.push_back(htrkQual_maxNearP);
556 
557  v_cone_hmaxNearP_goodTrk.push_back(conehmaxNearP_goodTrk);
558  v_cone_hmaxNearP .push_back(conehmaxNearP );
559  v_cone_hnNearTRKs .push_back(conehnNearTRKs );
560  v_cone_hnLayers_maxNearP.push_back(conehnLayers_maxNearP);
561  v_cone_htrkQual_maxNearP.push_back(conehtrkQual_maxNearP);
562 
563  }
564 
565  double h3x3=-999.0, h5x5=-999.0;
566  double hsim3x3=-999.0, hsim5x5=-999.0, trkHcalEne=-999.0;
567  std::map<std::string, double> hsimInfo3x3, hsimInfo5x5;
568  double distFromHotCell_h3x3 = -99.;
569  int ietaFromHotCell_h3x3 = -99;
570  int iphiFromHotCell_h3x3 = -99;
571  double distFromHotCell_h5x5 = -99.;
572  int ietaFromHotCell_h5x5 = -99;
573  int iphiFromHotCell_h5x5 = -99;
574 
575  GlobalPoint gPosHotCell_h3x3(0.,0.,0.);
576  GlobalPoint gPosHotCell_h5x5(0.,0.,0.);
577 
578  int nRH_h3x3(0), nRH_h5x5(0);
579 
580  // Hcal Energy Clustering
581 
582  // Get closetcell for ietaFromHotCell and iphiFromHotCell
583  DetId ClosestCell;
584  if( std::abs(pTrack->eta())<1.392 ) {
585  ClosestCell = gHB->getClosestCell(hpoint1);
586  } else {
587  ClosestCell = gHE->getClosestCell(hpoint1);
588  }
589  // Transform into HcalDetId so that I can get ieta, iphi later.
590  HcalDetId ClosestCell_HcalDetId(ClosestCell.rawId());
591 
592  // Using NxN Cluster
593  std::vector<int> v_RH_h3x3_ieta;
594  std::vector<int> v_RH_h3x3_iphi;
595  std::vector<double> v_RH_h3x3_ene;
596  std::vector<int> v_RH_h5x5_ieta;
597  std::vector<int> v_RH_h5x5_iphi;
598  std::vector<double> v_RH_h5x5_ene;
599 
600 
601  h3x3 = spr::eHCALmatrix(geo, theHBHETopology, ClosestCell, hbhe,1,1,
602  nRH_h3x3, v_RH_h3x3_ieta, v_RH_h3x3_iphi, v_RH_h3x3_ene,
603  gPosHotCell_h3x3);
604  distFromHotCell_h3x3 = spr::getDistInPlaneTrackDir(hpoint1, trackMomAtHcal, gPosHotCell_h3x3);
605 
606  h5x5 = spr::eHCALmatrix(geo, theHBHETopology, ClosestCell, hbhe,2,2,
607  nRH_h5x5, v_RH_h5x5_ieta, v_RH_h5x5_iphi, v_RH_h5x5_ene,
608  gPosHotCell_h5x5);
609  distFromHotCell_h5x5 = spr::getDistInPlaneTrackDir(hpoint1, trackMomAtHcal, gPosHotCell_h5x5);
610 
611 
612  // double heta = (double)hpoint1.eta();
613  // double hphi = (double)hpoint1.phi();
614  std::vector<int> multiplicity3x3;
615  std::vector<int> multiplicity5x5;
616  if (doMC) {
617  hsim3x3 = spr::eHCALmatrix(theHBHETopology, ClosestCell,
618  pcalohh,1,1);
619  hsim5x5 = spr::eHCALmatrix(theHBHETopology, ClosestCell,
620  pcalohh,2,2);
621 
622  hsimInfo3x3 = spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, pcalohh, SimTk, SimVtx, pTrack, *associate, 1,1, multiplicity3x3);
623  hsimInfo5x5 = spr::eHCALSimInfo(iEvent, theHBHETopology, ClosestCell, pcalohh, SimTk, SimVtx, pTrack, *associate, 2,2, multiplicity5x5);
624 
625  // Get energy from all simhits in hcal associated with iso track
626  trkHcalEne = spr::eCaloSimInfo(iEvent, geo, pcalohh, SimTk, SimVtx, pTrack, *associate);
627  }
628 
629  // Finally for cones of varying radii.
630  std::vector<double> v_hsimInfoConeMatched;
631  std::vector<double> v_hsimInfoConeRest ;
632  std::vector<double> v_hsimInfoConePhoton ;
633  std::vector<double> v_hsimInfoConeNeutHad;
634  std::vector<double> v_hsimInfoConeCharHad;
635  std::vector<double> v_hsimInfoConePdgMatched;
636  std::vector<double> v_hsimInfoConeTotal ;
637 
638  std::vector<int> v_hsimInfoConeNMatched;
639  std::vector<int> v_hsimInfoConeNTotal ;
640  std::vector<int> v_hsimInfoConeNNeutHad;
641  std::vector<int> v_hsimInfoConeNCharHad;
642  std::vector<int> v_hsimInfoConeNPhoton ;
643  std::vector<int> v_hsimInfoConeNRest ;
644 
645  std::vector<double> v_hsimCone ;
646  std::vector<double> v_hCone ;
647 
648  std::vector<int> v_nRecHitsCone ;
649  std::vector<int> v_nSimHitsCone ;
650 
651  std::vector<double> v_distFromHotCell;
652  std::vector<int> v_ietaFromHotCell;
653  std::vector<int> v_iphiFromHotCell;
654  GlobalPoint gposHotCell(0.,0.,0.);
655 
656 
657  std::vector<int> v_RH_r26_ieta;
658  std::vector<int> v_RH_r26_iphi;
659  std::vector<double> v_RH_r26_ene;
660  std::vector<int> v_RH_r44_ieta;
661  std::vector<int> v_RH_r44_iphi;
662  std::vector<double> v_RH_r44_ene;
663 
664 
665 
666  for (int i = 0 ; i < a_size ; i++){
667 
668 
669  std::map<std::string, double> hsimInfoCone;
670  double hsimCone = -999.0, hCone = -999.0;
671  double distFromHotCell = -99.0;
672  int ietaFromHotCell = -99;
673  int iphiFromHotCell = -99;
674  int ietaHotCell = -99;
675  int iphiHotCell = -99;
676  int nRecHitsCone = -999;
677  int nSimHitsCone = -999;
678 
679  std::vector<int> multiplicityCone;
680  std::vector<DetId> coneRecHitDetIds;
681  if (doMC)
682  hsimCone = spr::eCone_hcal(geo, pcalohh, hpoint1, point1,
683  a_coneR[i], trackMomAtHcal, nSimHitsCone);
684 
685  // If needed, get ieta and iphi of rechits for cones of 23.25
686  // and for hitmap for debugging
687  bool makeHitmaps = false;
688  if (a_coneR[i] == 26.23 && makeHitmaps)
689  {
690 
691  hCone = spr::eCone_hcal(geo, hbhe, hpoint1, point1,
692  a_coneR[i], trackMomAtHcal,nRecHitsCone,
693  v_RH_r26_ieta, v_RH_r26_iphi, v_RH_r26_ene,
694  coneRecHitDetIds, distFromHotCell,
695  ietaHotCell, iphiHotCell, gposHotCell);
696  }
697  else if (a_coneR[i] == 43.72 && makeHitmaps)
698  {
699 
700  hCone = spr::eCone_hcal(geo, hbhe, hpoint1, point1,
701  a_coneR[i], trackMomAtHcal,nRecHitsCone,
702  v_RH_r44_ieta, v_RH_r44_iphi, v_RH_r44_ene,
703  coneRecHitDetIds, distFromHotCell,
704  ietaHotCell, iphiHotCell, gposHotCell);
705  }
706  else
707  {
708 
709  hCone = spr::eCone_hcal(geo, hbhe, hpoint1, point1,
710  a_coneR[i], trackMomAtHcal, nRecHitsCone,
711  coneRecHitDetIds, distFromHotCell,
712  ietaHotCell, iphiHotCell, gposHotCell);
713  }
714 
715 
716 
717  if (ietaHotCell != 99){
718  ietaFromHotCell = ietaHotCell-ClosestCell_HcalDetId.ieta();
719  iphiFromHotCell = iphiHotCell-ClosestCell_HcalDetId.iphi();
720  }
721 
722  // SimHits NOT matched to RecHits
723  if (doMC) {
724  hsimInfoCone = spr::eHCALSimInfoCone(iEvent,pcalohh, SimTk, SimVtx, pTrack, *associate, geo, hpoint1, point1, a_coneR[i], trackMomAtHcal, multiplicityCone);
725 
726 
727 
728  // SimHits matched to RecHits
729  // hsimInfoCone = spr::eHCALSimInfoCone(iEvent,pcalohh, SimTk, SimVtx,
730  // pTrack, *associate,
731  // geo, hpoint1, point1,
732  // a_coneR[i], trackMomAtHcal,
733  // multiplicityCone,
734  // coneRecHitDetIds);
735 
736  v_hsimInfoConeMatched .push_back(hsimInfoCone["eMatched" ]);
737  v_hsimInfoConeRest .push_back(hsimInfoCone["eRest" ]);
738  v_hsimInfoConePhoton .push_back(hsimInfoCone["eGamma" ]);
739  v_hsimInfoConeNeutHad .push_back(hsimInfoCone["eNeutralHad"]);
740  v_hsimInfoConeCharHad .push_back(hsimInfoCone["eChargedHad"]);
741  v_hsimInfoConePdgMatched.push_back(hsimInfoCone["pdgMatched" ]);
742  v_hsimInfoConeTotal .push_back(hsimInfoCone["eTotal" ]);
743 
744  v_hsimInfoConeNMatched .push_back(multiplicityCone.at(0));
745 
746  v_hsimInfoConeNTotal .push_back(multiplicityCone.at(1));
747  v_hsimInfoConeNNeutHad .push_back(multiplicityCone.at(2));
748  v_hsimInfoConeNCharHad .push_back(multiplicityCone.at(3));
749  v_hsimInfoConeNPhoton .push_back(multiplicityCone.at(4));
750  v_hsimInfoConeNRest .push_back(multiplicityCone.at(5));
751 
752  v_hsimCone .push_back(hsimCone );
753  v_nSimHitsCone .push_back(nSimHitsCone );
754  }
755  v_hCone .push_back(hCone );
756  v_nRecHitsCone .push_back(nRecHitsCone );
757 
758  v_distFromHotCell .push_back(distFromHotCell );
759  v_ietaFromHotCell .push_back(ietaFromHotCell );
760  v_iphiFromHotCell .push_back(iphiFromHotCell );
761 
762 
763  }
764 
765 
767  // Fill Vectors that go into root file
769 
770  t_v_hnNearTRKs ->push_back(v_hnNearTRKs );
771  t_v_hnLayers_maxNearP ->push_back(v_hnLayers_maxNearP );
772  t_v_htrkQual_maxNearP ->push_back(v_htrkQual_maxNearP );
773  t_v_hmaxNearP_goodTrk ->push_back(v_hmaxNearP_goodTrk );
774  t_v_hmaxNearP ->push_back(v_hmaxNearP );
775 
776  t_v_cone_hnNearTRKs ->push_back(v_cone_hnNearTRKs );
777  t_v_cone_hnLayers_maxNearP ->push_back(v_cone_hnLayers_maxNearP);
778  t_v_cone_htrkQual_maxNearP ->push_back(v_cone_htrkQual_maxNearP);
779  t_v_cone_hmaxNearP_goodTrk ->push_back(v_cone_hmaxNearP_goodTrk);
780  t_v_cone_hmaxNearP ->push_back(v_cone_hmaxNearP );
781 
782  // t_hScale ->push_back(hScale );
783  t_trkNOuterHits ->push_back(nOuterHits );
784  t_trkNLayersCrossed ->push_back(nLayersCrossed );
785  t_dtFromLeadJet ->push_back(drFromLeadJet );
786  t_trkP ->push_back(p1 );
787  t_trkPt ->push_back(pt1 );
788  t_trkEta ->push_back(eta1 );
789  t_trkPhi ->push_back(phi1 );
790 
791  t_e3x3 ->push_back(e3x3 );
792  t_v_eDR ->push_back(v_eDR );
793  t_v_eMipDR ->push_back(v_eMipDR );
794 
795  t_h3x3 ->push_back(h3x3 );
796  t_h5x5 ->push_back(h5x5 );
797  t_nRH_h3x3 ->push_back(nRH_h3x3 );
798  t_nRH_h5x5 ->push_back(nRH_h5x5 );
799 
800  t_v_RH_h3x3_ieta ->push_back(v_RH_h3x3_ieta);
801  t_v_RH_h3x3_iphi ->push_back(v_RH_h3x3_iphi);
802  t_v_RH_h3x3_ene ->push_back(v_RH_h3x3_ene);
803  t_v_RH_h5x5_ieta ->push_back(v_RH_h5x5_ieta);
804  t_v_RH_h5x5_iphi ->push_back(v_RH_h5x5_iphi);
805  t_v_RH_h5x5_ene ->push_back(v_RH_h5x5_ene);
806 
807  if (doMC) {
808  t_simP ->push_back(simP );
809  t_hsim3x3 ->push_back(hsim3x3 );
810  t_hsim5x5 ->push_back(hsim5x5 );
811 
812  t_hsim3x3Matched ->push_back(hsimInfo3x3["eMatched"] );
813  t_hsim5x5Matched ->push_back(hsimInfo5x5["eMatched"] );
814  t_hsim3x3Rest ->push_back(hsimInfo3x3["eRest"] );
815  t_hsim5x5Rest ->push_back(hsimInfo5x5["eRest"] );
816  t_hsim3x3Photon ->push_back(hsimInfo3x3["eGamma"] );
817  t_hsim5x5Photon ->push_back(hsimInfo5x5["eGamma"] );
818  t_hsim3x3NeutHad ->push_back(hsimInfo3x3["eNeutralHad"] );
819  t_hsim5x5NeutHad ->push_back(hsimInfo5x5["eNeutralHad"] );
820  t_hsim3x3CharHad ->push_back(hsimInfo3x3["eChargedHad"] );
821  t_hsim5x5CharHad ->push_back(hsimInfo5x5["eChargedHad"] );
822  t_hsim3x3Total ->push_back(hsimInfo3x3["eTotal"] );
823  t_hsim5x5Total ->push_back(hsimInfo5x5["eTotal"] );
824  t_hsim3x3PdgMatched ->push_back(hsimInfo3x3["pdgMatched"] );
825  t_hsim5x5PdgMatched ->push_back(hsimInfo5x5["pdgMatched"] );
826 
827  t_hsim3x3NMatched ->push_back(multiplicity3x3.at(0));
828  t_hsim3x3NTotal ->push_back(multiplicity3x3.at(1));
829  t_hsim3x3NNeutHad ->push_back(multiplicity3x3.at(2));
830  t_hsim3x3NCharHad ->push_back(multiplicity3x3.at(3));
831  t_hsim3x3NPhoton ->push_back(multiplicity3x3.at(4));
832  t_hsim3x3NRest ->push_back(multiplicity3x3.at(5));
833 
834  t_hsim5x5NMatched ->push_back(multiplicity5x5.at(0));
835  t_hsim5x5NTotal ->push_back(multiplicity5x5.at(1));
836  t_hsim5x5NNeutHad ->push_back(multiplicity5x5.at(2));
837  t_hsim5x5NCharHad ->push_back(multiplicity5x5.at(3));
838  t_hsim5x5NPhoton ->push_back(multiplicity5x5.at(4));
839  t_hsim5x5NRest ->push_back(multiplicity5x5.at(5));
840  }
841 
842  t_distFromHotCell_h3x3->push_back(distFromHotCell_h3x3);
843  t_ietaFromHotCell_h3x3->push_back(ietaFromHotCell_h3x3);
844  t_iphiFromHotCell_h3x3->push_back(iphiFromHotCell_h3x3);
845  t_distFromHotCell_h5x5->push_back(distFromHotCell_h5x5);
846  t_ietaFromHotCell_h5x5->push_back(ietaFromHotCell_h5x5);
847  t_iphiFromHotCell_h5x5->push_back(iphiFromHotCell_h5x5);
848 
849  if (doMC) {
850  t_trkHcalEne ->push_back(trkHcalEne );
851  t_trkEcalEne ->push_back(trkEcalEne );
852 
853  t_v_hsimInfoConeMatched ->push_back(v_hsimInfoConeMatched );
854  t_v_hsimInfoConeRest ->push_back(v_hsimInfoConeRest );
855  t_v_hsimInfoConePhoton ->push_back(v_hsimInfoConePhoton );
856  t_v_hsimInfoConeNeutHad ->push_back(v_hsimInfoConeNeutHad );
857  t_v_hsimInfoConeCharHad ->push_back(v_hsimInfoConeCharHad );
858  t_v_hsimInfoConePdgMatched ->push_back(v_hsimInfoConePdgMatched);
859  t_v_hsimInfoConeTotal ->push_back(v_hsimInfoConeTotal );
860 
861  t_v_hsimInfoConeNMatched ->push_back(v_hsimInfoConeNMatched );
862  t_v_hsimInfoConeNTotal ->push_back(v_hsimInfoConeNTotal );
863  t_v_hsimInfoConeNNeutHad ->push_back(v_hsimInfoConeNNeutHad );
864  t_v_hsimInfoConeNCharHad ->push_back(v_hsimInfoConeNCharHad );
865  t_v_hsimInfoConeNPhoton ->push_back(v_hsimInfoConeNPhoton );
866  t_v_hsimInfoConeNRest ->push_back(v_hsimInfoConeNRest );
867 
868  t_v_hsimCone ->push_back(v_hsimCone );
869  t_v_hCone ->push_back(v_hCone );
870  t_v_nRecHitsCone->push_back(v_nRecHitsCone);
871  t_v_nSimHitsCone->push_back(v_nSimHitsCone);
872  }
873 
874 
875  t_v_distFromHotCell->push_back(v_distFromHotCell);
876  t_v_ietaFromHotCell->push_back(v_ietaFromHotCell);
877  t_v_iphiFromHotCell->push_back(v_iphiFromHotCell);
878 
879  t_v_RH_r26_ieta ->push_back(v_RH_r26_ieta);
880  t_v_RH_r26_iphi ->push_back(v_RH_r26_iphi);
881  t_v_RH_r26_ene ->push_back(v_RH_r26_ene);
882  t_v_RH_r44_ieta ->push_back(v_RH_r44_ieta);
883  t_v_RH_r44_iphi ->push_back(v_RH_r44_iphi);
884  t_v_RH_r44_ene ->push_back(v_RH_r44_ene);
885 
886 
887 
888  t_v_hlTriggers ->push_back(v_hlTriggers);
889  t_hltHB ->push_back(hltHB);
890  t_hltHE ->push_back(hltHE);
891  t_hltL1Jet15 ->push_back(hltL1Jet15 );
892  t_hltJet30 ->push_back(hltJet30 );
893  t_hltJet50 ->push_back(hltJet50 );
894  t_hltJet80 ->push_back(hltJet80 );
895  t_hltJet110 ->push_back(hltJet110 );
896  t_hltJet140 ->push_back(hltJet140 );
897  t_hltJet180 ->push_back(hltJet180 );
898  t_hltL1SingleEG5 ->push_back(hltL1SingleEG5 );
899  t_hltZeroBias ->push_back(hltZeroBias );
900  t_hltMinBiasHcal ->push_back(hltMinBiasHcal );
901  t_hltMinBiasEcal ->push_back(hltMinBiasEcal );
902  t_hltMinBiasPixel ->push_back(hltMinBiasPixel );
903  t_hltSingleIsoTau30_Trk5 ->push_back(hltSingleIsoTau30_Trk5 );
904  t_hltDoubleLooseIsoTau15_Trk5->push_back(hltDoubleLooseIsoTau15_Trk5);
905 
906  t_irun->push_back(irun);
907  t_ievt->push_back(ievt);
908  t_ilum->push_back(ilum);
909 
910  nTRK++;
911 
912 
913  } // Loop over track collection
914 
915  // std::cout << "nEVT= " << nEVT << std::endl;
916 
917  ntp->Fill();
918  nEVT++;
919 
920 }
921 
922 
923 
925 
926  // hbScale = 120.0;
927  // heScale = 135.0;
928  nEVT=0;
929  nEVT_failL1=0;
930  nTRK=0;
931 
932  double tempgen_TH[22] = { 0.0, 1.0, 2.0, 3.0, 4.0,
933  5.0, 6.0, 7.0, 8.0, 9.0,
934  10.0, 12.0, 15.0, 20.0, 25.0,
935  30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 100};
936  for(int i=0; i<22; i++) genPartPBins[i] = tempgen_TH[i];
937 
938 
939  double tempgen_Eta[5] = {0.0, 0.5, 1.1, 1.7, 2.0};
940  for(int i=0; i<5; i++) genPartEtaBins[i] = tempgen_Eta[i];
941 
942  t_v_hnNearTRKs = new std::vector<std::vector<int> > ();
943  t_v_hnLayers_maxNearP = new std::vector<std::vector<int> > ();
944  t_v_htrkQual_maxNearP = new std::vector<std::vector<int> > ();
945  t_v_hmaxNearP_goodTrk = new std::vector<std::vector<double> >();
946  t_v_hmaxNearP = new std::vector<std::vector<double> >();
947 
948  t_v_cone_hnNearTRKs = new std::vector<std::vector<int> > ();
949  t_v_cone_hnLayers_maxNearP = new std::vector<std::vector<int> > ();
950  t_v_cone_htrkQual_maxNearP = new std::vector<std::vector<int> > ();
951  t_v_cone_hmaxNearP_goodTrk = new std::vector<std::vector<double> >();
952  t_v_cone_hmaxNearP = new std::vector<std::vector<double> >();
953 
954  // t_hScale = new std::vector<double>();
955  t_trkNOuterHits = new std::vector<double>();
956  t_trkNLayersCrossed = new std::vector<double>();
957  t_dtFromLeadJet = new std::vector<double>();
958  t_trkP = new std::vector<double>();
959  t_trkPt = new std::vector<double>();
960  t_trkEta = new std::vector<double>();
961  t_trkPhi = new std::vector<double>();
962 
963  t_e3x3 = new std::vector<double>();
964  t_v_eDR = new std::vector<std::vector<double> >();
965  t_v_eMipDR = new std::vector<std::vector<double> >();
966 
967  t_h3x3 = new std::vector<double>();
968  t_h5x5 = new std::vector<double>();
969 
970  t_nRH_h3x3 = new std::vector<double>();
971  t_nRH_h5x5 = new std::vector<double>();
972 
973  if (doMC) {
974  t_simP = new std::vector<double>();
975  t_hsim3x3 = new std::vector<double>();
976  t_hsim5x5 = new std::vector<double>();
977 
978  t_hsim3x3Matched = new std::vector<double>();
979  t_hsim5x5Matched = new std::vector<double>();
980  t_hsim3x3Rest = new std::vector<double>();
981  t_hsim5x5Rest = new std::vector<double>();
982  t_hsim3x3Photon = new std::vector<double>();
983  t_hsim5x5Photon = new std::vector<double>();
984  t_hsim3x3NeutHad = new std::vector<double>();
985  t_hsim5x5NeutHad = new std::vector<double>();
986  t_hsim3x3CharHad = new std::vector<double>();
987  t_hsim5x5CharHad = new std::vector<double>();
988  t_hsim3x3PdgMatched = new std::vector<double>();
989  t_hsim5x5PdgMatched = new std::vector<double>();
990  t_hsim3x3Total = new std::vector<double>();
991  t_hsim5x5Total = new std::vector<double>();
992 
993  t_hsim3x3NMatched = new std::vector<int>();
994  t_hsim3x3NTotal = new std::vector<int>();
995  t_hsim3x3NNeutHad = new std::vector<int>();
996  t_hsim3x3NCharHad = new std::vector<int>();
997  t_hsim3x3NPhoton = new std::vector<int>();
998  t_hsim3x3NRest = new std::vector<int>();
999 
1000  t_hsim5x5NMatched = new std::vector<int>();
1001  t_hsim5x5NTotal = new std::vector<int>();
1002  t_hsim5x5NNeutHad = new std::vector<int>();
1003  t_hsim5x5NCharHad = new std::vector<int>();
1004  t_hsim5x5NPhoton = new std::vector<int>();
1005  t_hsim5x5NRest = new std::vector<int>();
1006 
1007  t_trkHcalEne = new std::vector<double>();
1008  t_trkEcalEne = new std::vector<double>();
1009  }
1010 
1011  t_distFromHotCell_h3x3 = new std::vector<double>();
1012  t_ietaFromHotCell_h3x3 = new std::vector<int>();
1013  t_iphiFromHotCell_h3x3 = new std::vector<int>();
1014  t_distFromHotCell_h5x5 = new std::vector<double>();
1015  t_ietaFromHotCell_h5x5 = new std::vector<int>();
1016  t_iphiFromHotCell_h5x5 = new std::vector<int>();
1017 
1018  if (doMC) {
1019  t_v_hsimInfoConeMatched = new std::vector<std::vector<double> >();
1020  t_v_hsimInfoConeRest = new std::vector<std::vector<double> >();
1021  t_v_hsimInfoConePhoton = new std::vector<std::vector<double> >();
1022  t_v_hsimInfoConeNeutHad = new std::vector<std::vector<double> >();
1023  t_v_hsimInfoConeCharHad = new std::vector<std::vector<double> >();
1024  t_v_hsimInfoConePdgMatched= new std::vector<std::vector<double> >();
1025  t_v_hsimInfoConeTotal = new std::vector<std::vector<double> >();
1026 
1027  t_v_hsimInfoConeNMatched = new std::vector<std::vector<int> >();
1028  t_v_hsimInfoConeNTotal = new std::vector<std::vector<int> >();
1029  t_v_hsimInfoConeNNeutHad = new std::vector<std::vector<int> >();
1030  t_v_hsimInfoConeNCharHad = new std::vector<std::vector<int> >();
1031  t_v_hsimInfoConeNPhoton = new std::vector<std::vector<int> >();
1032  t_v_hsimInfoConeNRest = new std::vector<std::vector<int> >();
1033 
1034  t_v_hsimCone = new std::vector<std::vector<double> >();
1035  }
1036 
1037  t_v_hCone = new std::vector<std::vector<double> >();
1038  t_v_nRecHitsCone= new std::vector<std::vector<int> >();
1039  t_v_nSimHitsCone= new std::vector<std::vector<int> >();
1040 
1041  t_v_distFromHotCell= new std::vector<std::vector<double> >();
1042  t_v_ietaFromHotCell= new std::vector<std::vector<int> >();
1043  t_v_iphiFromHotCell= new std::vector<std::vector<int> >();
1044 
1045  t_v_RH_h3x3_ieta = new std::vector<std::vector<int> >();
1046  t_v_RH_h3x3_iphi = new std::vector<std::vector<int> >();
1047  t_v_RH_h3x3_ene = new std::vector<std::vector<double> >();
1048  t_v_RH_h5x5_ieta = new std::vector<std::vector<int> >();
1049  t_v_RH_h5x5_iphi = new std::vector<std::vector<int> >();
1050  t_v_RH_h5x5_ene = new std::vector<std::vector<double> >();
1051  t_v_RH_r26_ieta = new std::vector<std::vector<int> >();
1052  t_v_RH_r26_iphi = new std::vector<std::vector<int> >();
1053  t_v_RH_r26_ene = new std::vector<std::vector<double> >();
1054  t_v_RH_r44_ieta = new std::vector<std::vector<int> >();
1055  t_v_RH_r44_iphi = new std::vector<std::vector<int> >();
1056  t_v_RH_r44_ene = new std::vector<std::vector<double> >();
1057 
1058 
1059  t_v_hlTriggers = new std::vector<std::vector<int> >();
1060 
1061  t_hltHE = new std::vector<int>();
1062  t_hltHB = new std::vector<int>();
1063  t_hltL1Jet15 = new std::vector<int>();
1064  t_hltJet30 = new std::vector<int>();
1065  t_hltJet50 = new std::vector<int>();
1066  t_hltJet80 = new std::vector<int>();
1067  t_hltJet110 = new std::vector<int>();
1068  t_hltJet140 = new std::vector<int>();
1069  t_hltJet180 = new std::vector<int>();
1070  t_hltL1SingleEG5 = new std::vector<int>();
1071  t_hltZeroBias = new std::vector<int>();
1072  t_hltMinBiasHcal = new std::vector<int>();
1073  t_hltMinBiasEcal = new std::vector<int>();
1074  t_hltMinBiasPixel = new std::vector<int>();
1075  t_hltSingleIsoTau30_Trk5 = new std::vector<int>();
1076  t_hltDoubleLooseIsoTau15_Trk5 = new std::vector<int>();
1077 
1078 
1079  t_irun = new std::vector<unsigned int>();
1080  t_ievt = new std::vector<unsigned int>();
1081  t_ilum = new std::vector<unsigned int>();
1082 
1083  BuildTree();
1084 }
1085 
1087 
1088  t_v_hnNearTRKs ->clear();
1089  t_v_hnLayers_maxNearP ->clear();
1090  t_v_htrkQual_maxNearP ->clear();
1091  t_v_hmaxNearP_goodTrk ->clear();
1092  t_v_hmaxNearP ->clear();
1093 
1094  t_v_cone_hnNearTRKs ->clear();
1095  t_v_cone_hnLayers_maxNearP ->clear();
1096  t_v_cone_htrkQual_maxNearP ->clear();
1097  t_v_cone_hmaxNearP_goodTrk ->clear();
1098  t_v_cone_hmaxNearP ->clear();
1099 
1100  // t_hScale ->clear();
1101  t_trkNOuterHits ->clear();
1102  t_trkNLayersCrossed ->clear();
1103  t_dtFromLeadJet ->clear();
1104  t_trkP ->clear();
1105  t_trkPt ->clear();
1106  t_trkEta ->clear();
1107  t_trkPhi ->clear();
1108  t_e3x3 ->clear();
1109  t_v_eDR ->clear();
1110  t_v_eMipDR ->clear();
1111  t_h3x3 ->clear();
1112  t_h5x5 ->clear();
1113  t_nRH_h3x3 ->clear();
1114  t_nRH_h5x5 ->clear();
1115 
1116  if (doMC) {
1117  t_simP ->clear();
1118  t_hsim3x3 ->clear();
1119  t_hsim5x5 ->clear();
1120  t_hsim3x3Matched ->clear();
1121  t_hsim5x5Matched ->clear();
1122  t_hsim3x3Rest ->clear();
1123  t_hsim5x5Rest ->clear();
1124  t_hsim3x3Photon ->clear();
1125  t_hsim5x5Photon ->clear();
1126  t_hsim3x3NeutHad ->clear();
1127  t_hsim5x5NeutHad ->clear();
1128  t_hsim3x3CharHad ->clear();
1129  t_hsim5x5CharHad ->clear();
1130  t_hsim3x3PdgMatched ->clear();
1131  t_hsim5x5PdgMatched ->clear();
1132  t_hsim3x3Total ->clear();
1133  t_hsim5x5Total ->clear();
1134 
1135  t_hsim3x3NMatched ->clear();
1136  t_hsim3x3NTotal ->clear();
1137  t_hsim3x3NNeutHad ->clear();
1138  t_hsim3x3NCharHad ->clear();
1139  t_hsim3x3NPhoton ->clear();
1140  t_hsim3x3NRest ->clear();
1141 
1142  t_hsim5x5NMatched ->clear();
1143  t_hsim5x5NTotal ->clear();
1144  t_hsim5x5NNeutHad ->clear();
1145  t_hsim5x5NCharHad ->clear();
1146  t_hsim5x5NPhoton ->clear();
1147  t_hsim5x5NRest ->clear();
1148 
1149  t_trkHcalEne ->clear();
1150  t_trkEcalEne ->clear();
1151  }
1152 
1153  t_distFromHotCell_h3x3 ->clear();
1154  t_ietaFromHotCell_h3x3 ->clear();
1155  t_iphiFromHotCell_h3x3 ->clear();
1156  t_distFromHotCell_h5x5 ->clear();
1157  t_ietaFromHotCell_h5x5 ->clear();
1158  t_iphiFromHotCell_h5x5 ->clear();
1159 
1160  if (doMC) {
1161  t_v_hsimInfoConeMatched ->clear();
1162  t_v_hsimInfoConeRest ->clear();
1163  t_v_hsimInfoConePhoton ->clear();
1164  t_v_hsimInfoConeNeutHad ->clear();
1165  t_v_hsimInfoConeCharHad ->clear();
1166  t_v_hsimInfoConePdgMatched->clear();
1167  t_v_hsimInfoConeTotal ->clear();
1168 
1169  t_v_hsimInfoConeNMatched ->clear();
1170  t_v_hsimInfoConeNRest ->clear();
1171  t_v_hsimInfoConeNPhoton ->clear();
1172  t_v_hsimInfoConeNNeutHad ->clear();
1173  t_v_hsimInfoConeNCharHad ->clear();
1174  t_v_hsimInfoConeNTotal ->clear();
1175 
1176  t_v_hsimCone ->clear();
1177  }
1178 
1179  t_v_hCone ->clear();
1180  t_v_nRecHitsCone->clear();
1181  t_v_nSimHitsCone->clear();
1182 
1183  t_v_distFromHotCell->clear();
1184  t_v_ietaFromHotCell->clear();
1185  t_v_iphiFromHotCell->clear();
1186 
1187  t_v_RH_h3x3_ieta ->clear();
1188  t_v_RH_h3x3_iphi ->clear();
1189  t_v_RH_h3x3_ene ->clear();
1190  t_v_RH_h5x5_ieta ->clear();
1191  t_v_RH_h5x5_iphi ->clear();
1192  t_v_RH_h5x5_ene ->clear();
1193  t_v_RH_r26_ieta ->clear();
1194  t_v_RH_r26_iphi ->clear();
1195  t_v_RH_r26_ene ->clear();
1196  t_v_RH_r44_ieta ->clear();
1197  t_v_RH_r44_iphi ->clear();
1198  t_v_RH_r44_ene ->clear();
1199 
1200  t_v_hlTriggers ->clear();
1201  t_hltHB->clear();
1202  t_hltHE->clear();
1203  t_hltL1Jet15 ->clear();
1204  t_hltJet30 ->clear();
1205  t_hltJet50 ->clear();
1206  t_hltJet80 ->clear();
1207  t_hltJet110 ->clear();
1208  t_hltJet140 ->clear();
1209  t_hltJet180 ->clear();
1210  t_hltL1SingleEG5 ->clear();
1211  t_hltZeroBias ->clear();
1212  t_hltMinBiasHcal ->clear();
1213  t_hltMinBiasEcal ->clear();
1214  t_hltMinBiasPixel ->clear();
1215  t_hltSingleIsoTau30_Trk5 ->clear();
1217 
1218  t_irun->clear();
1219  t_ievt->clear();
1220  t_ilum->clear();
1221 
1222 
1223 
1224 }
1225 
1226 // ----- method called once each job just after ending the event loop ----
1228 
1229  std::cout << "Number of Events Processed " << nEVT << " failed L1 "
1230  << nEVT_failL1 << std::endl;
1231 
1232 }
1233 
1234 
1236 
1237 
1238  hRawPt = fs->make<TH1F>("hRawPt ", "hRawPt ", 100, 0.0, 100.0);
1239  hRawP = fs->make<TH1F>("hRawP ", "hRawP ", 100, 0.0, 100.0);
1240  hRawEta = fs->make<TH1F>("hRawEta", "hRawEta", 15, 0.0, 3.0);
1241  hRawPhi = fs->make<TH1F>("hRawPhi", "hRawPhi", 100, -3.2, 3.2);
1242 
1243  ntp = fs->make<TTree>("ntp", "ntp");
1244 
1245 
1246  // Counters
1247  ntp->Branch("nEVT" , &nEVT , "nEVT/I" );
1248  ntp->Branch("leadL1JetPT" , &leadL1JetPT , "leadL1JetPT/D" );
1249  ntp->Branch("leadL1JetEta", &leadL1JetEta, "leadL1JetEta/D");
1250  ntp->Branch("leadL1JetPhi", &leadL1JetPhi, "leadL1JetPhi/D");
1251  ntp->Branch("nTRK", &nTRK, "nTRK/I");
1252  ntp->Branch("nRawTRK" , &nRawTRK ,"nRawTRK/I" );
1253  ntp->Branch("nFailHighPurityQaul", &nFailHighPurityQaul,"nFailHighPurityQaul/I");
1254  ntp->Branch("nFailPt" , &nFailPt ,"nFailPt/I" );
1255  ntp->Branch("nFailEta" , &nFailEta ,"nFailEta/I" );
1256  ntp->Branch("nMissEcal" , &nMissEcal ,"nMissEcal/I" );
1257  ntp->Branch("nMissHcal" , &nMissHcal ,"nMissHcal/I" );
1258 
1259  ntp->Branch("hnNearTRKs" ,"vector<vector<int> > ",&t_v_hnNearTRKs );
1260  ntp->Branch("hnLayers_maxNearP" ,"vector<vector<int> > ",&t_v_hnLayers_maxNearP );
1261  ntp->Branch("htrkQual_maxNearP" ,"vector<vector<int> > ",&t_v_htrkQual_maxNearP );
1262  ntp->Branch("hmaxNearP_goodTrk" ,"vector<vector<double> >",&t_v_hmaxNearP_goodTrk );
1263  ntp->Branch("hmaxNearP" ,"vector<vector<double> >",&t_v_hmaxNearP );
1264 
1265  ntp->Branch("cone_hnNearTRKs" ,"vector<vector<int> > ",&t_v_cone_hnNearTRKs );
1266  ntp->Branch("cone_hnLayers_maxNearP","vector<vector<int> > ",&t_v_cone_hnLayers_maxNearP);
1267  ntp->Branch("cone_htrkQual_maxNearP","vector<vector<int> > ",&t_v_cone_htrkQual_maxNearP);
1268  ntp->Branch("cone_hmaxNearP_goodTrk","vector<vector<double> >",&t_v_cone_hmaxNearP_goodTrk);
1269  ntp->Branch("cone_hmaxNearP" ,"vector<vector<double> >",&t_v_cone_hmaxNearP );
1270 
1271  // ntp->Branch("hScale" , "vector<double>", &t_hScale );
1272  ntp->Branch("trkNOuterHits" , "vector<double>", &t_trkNOuterHits );
1273  ntp->Branch("trkNLayersCrossed", "vector<double>", &t_trkNLayersCrossed);
1274  ntp->Branch("drFromLeadJet" , "vector<double>", &t_dtFromLeadJet );
1275  ntp->Branch("trkP" , "vector<double>", &t_trkP );
1276  ntp->Branch("trkPt" , "vector<double>", &t_trkPt );
1277  ntp->Branch("trkEta" , "vector<double>", &t_trkEta );
1278  ntp->Branch("trkPhi" , "vector<double>", &t_trkPhi );
1279  ntp->Branch("e3x3" , "vector<double>", &t_e3x3 );
1280 
1281  ntp->Branch("e3x3" , "vector<double>" , &t_e3x3 );
1282  ntp->Branch("v_eDR" , "vector<vector<double> >", &t_v_eDR);
1283  ntp->Branch("v_eMipDR" , "vector<vector<double> >", &t_v_eMipDR);
1284 
1285  ntp->Branch("h3x3" , "vector<double>", &t_h3x3 );
1286  ntp->Branch("h5x5" , "vector<double>", &t_h5x5 );
1287  ntp->Branch("nRH_h3x3" , "vector<double>", &t_nRH_h3x3 );
1288  ntp->Branch("nRH_h5x5" , "vector<double>", &t_nRH_h5x5 );
1289 
1290  if (doMC) {
1291  ntp->Branch("simP" , "vector<double>", &t_simP );
1292  ntp->Branch("hsim3x3" , "vector<double>", &t_hsim3x3 );
1293  ntp->Branch("hsim5x5" , "vector<double>", &t_hsim5x5 );
1294 
1295  ntp->Branch("hsim3x3Matched" , "vector<double>", &t_hsim3x3Matched );
1296  ntp->Branch("hsim5x5Matched" , "vector<double>", &t_hsim5x5Matched );
1297  ntp->Branch("hsim3x3Rest" , "vector<double>", &t_hsim3x3Rest );
1298  ntp->Branch("hsim5x5Rest" , "vector<double>", &t_hsim5x5Rest );
1299  ntp->Branch("hsim3x3Photon" , "vector<double>", &t_hsim3x3Photon );
1300  ntp->Branch("hsim5x5Photon" , "vector<double>", &t_hsim5x5Photon );
1301  ntp->Branch("hsim3x3NeutHad" , "vector<double>", &t_hsim3x3NeutHad );
1302  ntp->Branch("hsim5x5NeutHad" , "vector<double>", &t_hsim5x5NeutHad );
1303  ntp->Branch("hsim3x3CharHad" , "vector<double>", &t_hsim3x3CharHad );
1304  ntp->Branch("hsim5x5CharHad" , "vector<double>", &t_hsim5x5CharHad );
1305  ntp->Branch("hsim3x3PdgMatched", "vector<double>", &t_hsim3x3PdgMatched);
1306  ntp->Branch("hsim5x5PdgMatched", "vector<double>", &t_hsim5x5PdgMatched);
1307  ntp->Branch("hsim3x3Total" , "vector<double>", &t_hsim3x3Total );
1308  ntp->Branch("hsim5x5Total" , "vector<double>", &t_hsim5x5Total );
1309 
1310  ntp->Branch("hsim3x3NMatched" , "vector<int>", &t_hsim3x3NMatched );
1311  ntp->Branch("hsim3x3NRest" , "vector<int>", &t_hsim3x3NRest );
1312  ntp->Branch("hsim3x3NPhoton" , "vector<int>", &t_hsim3x3NPhoton );
1313  ntp->Branch("hsim3x3NNeutHad" , "vector<int>", &t_hsim3x3NNeutHad );
1314  ntp->Branch("hsim3x3NCharHad" , "vector<int>", &t_hsim3x3NCharHad );
1315  ntp->Branch("hsim3x3NTotal" , "vector<int>", &t_hsim3x3NTotal );
1316 
1317  ntp->Branch("hsim5x5NMatched" , "vector<int>", &t_hsim5x5NMatched );
1318  ntp->Branch("hsim5x5NRest" , "vector<int>", &t_hsim5x5NRest );
1319  ntp->Branch("hsim5x5NPhoton" , "vector<int>", &t_hsim5x5NPhoton );
1320  ntp->Branch("hsim5x5NNeutHad" , "vector<int>", &t_hsim5x5NNeutHad );
1321  ntp->Branch("hsim5x5NCharHad" , "vector<int>", &t_hsim5x5NCharHad );
1322  ntp->Branch("hsim5x5NTotal" , "vector<int>", &t_hsim5x5NTotal );
1323 
1324  ntp->Branch("trkHcalEne" , "vector<double>", &t_trkHcalEne );
1325  ntp->Branch("trkEcalEne" , "vector<double>", &t_trkEcalEne );
1326  }
1327 
1328  ntp->Branch("distFromHotCell_h3x3", "vector<double>", &t_distFromHotCell_h3x3);
1329  ntp->Branch("ietaFromHotCell_h3x3", "vector<int>", &t_ietaFromHotCell_h3x3);
1330  ntp->Branch("iphiFromHotCell_h3x3", "vector<int>", &t_iphiFromHotCell_h3x3);
1331  ntp->Branch("distFromHotCell_h5x5", "vector<double>", &t_distFromHotCell_h5x5);
1332  ntp->Branch("ietaFromHotCell_h5x5", "vector<int>", &t_ietaFromHotCell_h5x5);
1333  ntp->Branch("iphiFromHotCell_h5x5", "vector<int>", &t_iphiFromHotCell_h5x5);
1334 
1335  if (doMC) {
1336  ntp->Branch("v_hsimInfoConeMatched" ,"vector<vector<double> >",&t_v_hsimInfoConeMatched );
1337  ntp->Branch("v_hsimInfoConeRest" ,"vector<vector<double> >",&t_v_hsimInfoConeRest );
1338  ntp->Branch("v_hsimInfoConePhoton" ,"vector<vector<double> >",&t_v_hsimInfoConePhoton );
1339  ntp->Branch("v_hsimInfoConeNeutHad" ,"vector<vector<double> >",&t_v_hsimInfoConeNeutHad );
1340  ntp->Branch("v_hsimInfoConeCharHad" ,"vector<vector<double> >",&t_v_hsimInfoConeCharHad );
1341  ntp->Branch("v_hsimInfoConePdgMatched","vector<vector<double> >",&t_v_hsimInfoConePdgMatched);
1342  ntp->Branch("v_hsimInfoConeTotal" ,"vector<vector<double> >",&t_v_hsimInfoConeTotal );
1343 
1344  ntp->Branch("v_hsimInfoConeNMatched" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNMatched );
1345  ntp->Branch("v_hsimInfoConeNRest" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNRest );
1346  ntp->Branch("v_hsimInfoConeNPhoton" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNPhoton );
1347  ntp->Branch("v_hsimInfoConeNNeutHad" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNNeutHad );
1348  ntp->Branch("v_hsimInfoConeNCharHad" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNCharHad );
1349  ntp->Branch("v_hsimInfoConeNTotal" ,"vector<vector<int> >" ,&t_v_hsimInfoConeNTotal );
1350 
1351  ntp->Branch("v_hsimCone" ,"vector<vector<double> >",&t_v_hsimCone );
1352  }
1353 
1354  ntp->Branch("v_hCone" ,"vector<vector<double> >",&t_v_hCone );
1355  ntp->Branch("v_nRecHitsCone" ,"vector<vector<int> >" ,&t_v_nRecHitsCone);
1356  ntp->Branch("v_nSimHitsCone" ,"vector<vector<int> >" ,&t_v_nSimHitsCone);
1357 
1358  ntp->Branch("v_distFromHotCell" ,"vector<vector<double> >",&t_v_distFromHotCell );
1359  ntp->Branch("v_ietaFromHotCell" ,"vector<vector<int> >",&t_v_ietaFromHotCell );
1360  ntp->Branch("v_iphiFromHotCell" ,"vector<vector<int> >",&t_v_iphiFromHotCell );
1361 
1362  ntp->Branch("v_RH_h3x3_ieta" ,"vector<vector<int> >" ,&t_v_RH_h3x3_ieta);
1363  ntp->Branch("v_RH_h3x3_iphi" ,"vector<vector<int> >" ,&t_v_RH_h3x3_iphi);
1364  ntp->Branch("v_RH_h3x3_ene" ,"vector<vector<double> >",&t_v_RH_h3x3_ene );
1365  ntp->Branch("v_RH_h5x5_ieta" ,"vector<vector<int> >" ,&t_v_RH_h5x5_ieta);
1366  ntp->Branch("v_RH_h5x5_iphi" ,"vector<vector<int> >" ,&t_v_RH_h5x5_iphi);
1367  ntp->Branch("v_RH_h5x5_ene" ,"vector<vector<double> >",&t_v_RH_h5x5_ene );
1368  ntp->Branch("v_RH_r26_ieta" ,"vector<vector<int> >" ,&t_v_RH_r26_ieta );
1369  ntp->Branch("v_RH_r26_iphi" ,"vector<vector<int> >" ,&t_v_RH_r26_iphi );
1370  ntp->Branch("v_RH_r26_ene" ,"vector<vector<double> >",&t_v_RH_r26_ene );
1371  ntp->Branch("v_RH_r44_ieta" ,"vector<vector<int> >" ,&t_v_RH_r44_ieta );
1372  ntp->Branch("v_RH_r44_iphi" ,"vector<vector<int> >" ,&t_v_RH_r44_iphi );
1373  ntp->Branch("v_RH_r44_ene" ,"vector<vector<double> >",&t_v_RH_r44_ene );
1374 
1375  ntp->Branch("v_hlTriggers" ,"vector<vector<int> >",&t_v_hlTriggers);
1376  ntp->Branch("v_hltHB" ,"vector<int>",&t_hltHB);
1377  ntp->Branch("v_hltHE" ,"vector<int>",&t_hltHE);
1378  ntp->Branch("v_hltL1Jet15" ,"vector<int>",&t_hltL1Jet15 );
1379  ntp->Branch("v_hltJet30" ,"vector<int>",&t_hltJet30 );
1380  ntp->Branch("v_hltJet50" ,"vector<int>",&t_hltJet50 );
1381  ntp->Branch("v_hltJet80" ,"vector<int>",&t_hltJet80 );
1382  ntp->Branch("v_hltJet110" ,"vector<int>",&t_hltJet110 );
1383  ntp->Branch("v_hltJet140" ,"vector<int>",&t_hltJet140 );
1384  ntp->Branch("v_hltJet180" ,"vector<int>",&t_hltJet180 );
1385  ntp->Branch("v_hltL1SingleEG5" ,"vector<int>",&t_hltL1SingleEG5 );
1386  ntp->Branch("v_hltZeroBias" ,"vector<int>",&t_hltZeroBias );
1387  ntp->Branch("v_hltMinBiasHcal" ,"vector<int>",&t_hltMinBiasHcal );
1388  ntp->Branch("v_hltMinBiasEcal" ,"vector<int>",&t_hltMinBiasEcal );
1389  ntp->Branch("v_hltMinBiasPixel" ,"vector<int>",&t_hltMinBiasPixel );
1390  ntp->Branch("v_hltSingleIsoTau30_Trk5" ,"vector<int>",&t_hltSingleIsoTau30_Trk5 );
1391  ntp->Branch("v_hltDoubleLooseIsoTau15_Trk5" ,"vector<int>",&t_hltDoubleLooseIsoTau15_Trk5);
1392 
1393  ntp->Branch("irun" ,"vector<unsigned int>", &t_irun);
1394  ntp->Branch("ievt" ,"vector<unsigned int>", &t_ievt);
1395  ntp->Branch("ilum" ,"vector<unsigned int>", &t_ilum);
1396 
1397 }
1398 
1399 
1401 
1402  std::string theTrackQuality = "highPurity";
1403  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
1404 
1405  std::cout << " Reference Point " << pTrack->referencePoint() <<"\n"
1406  << " TrackMmentum " << pTrack->momentum()
1407  << " (pt,eta,phi)(" << pTrack->pt()<<","<<pTrack->eta()<<","<<pTrack->phi()<<")"
1408  << " p " << pTrack->p() << "\n"
1409  << " Normalized chi2 " << pTrack->normalizedChi2() <<" charge " << pTrack->charge()
1410  << " qoverp() " << pTrack->qoverp() <<"+-" << pTrack->qoverpError()
1411  << " d0 " << pTrack->d0() << "\n"
1412  << " NValidHits " << pTrack->numberOfValidHits() << " NLostHits " << pTrack->numberOfLostHits()
1413  << " TrackQuality " << pTrack->qualityName(trackQuality_) << " " << pTrack->quality(trackQuality_)
1414  << std::endl;
1415 
1416  if( printTrkHitPattern_ ) {
1417  const reco::HitPattern& p = pTrack->hitPattern();
1418 
1419  for (int i=0; i<p.numberOfHits(reco::HitPattern::TRACK_HITS); i++) {
1421  }
1422  }
1423 
1424 }
1425 
1426 double IsolatedTracksCone::DeltaPhi(double v1, double v2) {
1427  // Computes the correctly normalized phi difference
1428  // v1, v2 = phi of object 1 and 2
1429 
1430  double pi = 3.141592654;
1431  double twopi = 6.283185307;
1432 
1433  double diff = std::abs(v2 - v1);
1434  double corr = twopi - diff;
1435  if (diff < pi){ return diff;} else { return corr;}
1436 }
1437 
1438 
1439 double IsolatedTracksCone::DeltaR(double eta1, double phi1,
1440  double eta2, double phi2) {
1441  double deta = eta1 - eta2;
1442  double dphi = DeltaPhi(phi1, phi2);
1443  return std::sqrt(deta*deta + dphi*dphi);
1444 }
1445 
1446 
1447 //define this as a plug-in
1449 
1450 
1451 
1452 
1453 
1454 
1455 
1456 
1457 
1458 
1459 
1460 
1461 
1462 
1463 
RunNumber_t run() const
Definition: EventID.h:39
std::vector< int > * t_hsim5x5NTotal
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extFwdJet_
std::vector< std::vector< double > > * t_v_distFromHotCell
double qoverp() const
q / p
Definition: TrackBase.h:568
std::vector< double > * t_hsim5x5CharHad
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
EventNumber_t event() const
Definition: EventID.h:41
std::vector< std::vector< double > > * t_v_hmaxNearP_goodTrk
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< int > > * t_v_hlTriggers
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:676
int i
Definition: DBlmapReader.cc:9
std::vector< double > * t_trkEcalEne
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:234
std::vector< std::vector< double > > * t_v_hsimCone
TrackAssociatorParameters parameters_
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:527
std::vector< int > * t_hltJet30
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
Definition: FindDistCone.cc:9
std::vector< double > * t_trkPt
std::vector< int > * t_ietaFromHotCell_h5x5
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)
std::vector< double > * t_nRH_h3x3
std::vector< double > * t_distFromHotCell_h3x3
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< std::vector< int > > * t_v_hsimInfoConeNCharHad
std::vector< int > * t_hsim5x5NNeutHad
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< double > * t_hsim5x5Photon
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:592
std::vector< int > * t_hltMinBiasHcal
std::vector< std::vector< double > > * t_v_cone_hmaxNearP_goodTrk
std::vector< double > * t_hsim3x3CharHad
std::vector< int > * t_hsim5x5NPhoton
std::vector< std::vector< double > > * t_v_RH_r44_ene
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)
std::vector< int > * t_iphiFromHotCell_h3x3
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:556
std::vector< std::vector< int > > * t_v_cone_hnLayers_maxNearP
std::vector< double > * t_hsim5x5PdgMatched
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< double > * t_hsim3x3NeutHad
std::vector< double > * t_nRH_h5x5
TrackQuality
track quality
Definition: TrackBase.h:151
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
std::vector< std::vector< int > > * t_v_hnLayers_maxNearP
std::vector< int > * t_hltHB
edm::EDGetTokenT< edm::TriggerResults > tok_trigger_
std::vector< std::vector< double > > * t_v_hmaxNearP
std::vector< std::vector< double > > * t_v_RH_h3x3_ene
bool accept() const
Has at least one path accepted the event?
void useDefaultPropagator()
use the default propagator
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
std::vector< int > * t_hsim5x5NCharHad
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
std::vector< std::vector< int > > * t_v_hsimInfoConeNNeutHad
std::vector< std::vector< int > > * t_v_nRecHitsCone
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
std::vector< std::vector< int > > * t_v_hsimInfoConeNMatched
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:821
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< double > * t_trkP
std::vector< int > * t_hltL1SingleEG5
std::vector< int > * t_hsim5x5NRest
std::vector< double > * t_hsim5x5NeutHad
std::vector< int > * t_hltJet50
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
std::vector< std::vector< double > > * t_v_cone_hmaxNearP
std::vector< double > * t_simP
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:518
std::vector< int > * t_hsim3x3NCharHad
std::vector< std::vector< int > > * t_v_iphiFromHotCell
std::vector< std::vector< int > > * t_v_hnNearTRKs
std::vector< std::vector< int > > * t_v_cone_htrkQual_maxNearP
math::XYZPoint trkGlobPosAtHcal
std::vector< std::vector< double > > * t_v_RH_r26_ene
const Double_t pi
LuminosityBlockNumber_t luminosityBlock() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< int > * t_hltDoubleLooseIsoTau15_Trk5
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:832
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extTauJet_
std::vector< int > * t_hltJet140
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
std::vector< int > * t_hltMinBiasPixel
std::vector< double > * t_trkPhi
std::vector< double > * t_hsim3x3Total
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
std::vector< int > * t_hltHE
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int size() const
Get number of paths stored.
std::vector< std::vector< int > > * t_v_RH_h3x3_iphi
std::vector< int > * t_iphiFromHotCell_h5x5
std::vector< std::vector< double > > * t_v_hsimInfoConePdgMatched
double pt() const
track transverse momentum
Definition: TrackBase.h:616
std::vector< std::vector< int > > * t_v_htrkQual_maxNearP
std::vector< int > * t_hltMinBiasEcal
std::vector< std::vector< int > > * t_v_RH_r44_iphi
std::vector< double > * t_hsim5x5Matched
std::vector< std::vector< double > > * t_v_hsimInfoConeTotal
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< std::vector< double > > * t_v_RH_h5x5_ene
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
double DeltaPhi(double v1, double v2)
std::vector< std::vector< int > > * t_v_hsimInfoConeNRest
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:86
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)
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:815
std::vector< std::vector< double > > * t_v_hsimInfoConeCharHad
static std::string const triggerResults
Definition: EdmProvDump.cc:41
std::vector< double > * t_hsim5x5Total
bool isValid() const
Definition: HandleBase.h:75
std::vector< double > * t_hsim3x3Photon
std::vector< double > * t_hsim3x3PdgMatched
std::vector< std::vector< int > > * t_v_ietaFromHotCell
std::vector< double > * t_hsim5x5Rest
std::vector< int > * t_hltJet110
JetCorrectorParameters corr
Definition: classes.h:5
std::vector< std::vector< double > > * t_v_eMipDR
std::vector< int > * t_hltL1Jet15
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:752
virtual DetId getClosestCell(const GlobalPoint &r) const
std::vector< int > * t_hsim3x3NRest
std::vector< std::vector< double > > * t_v_hsimInfoConeRest
std::vector< std::vector< int > > * t_v_hsimInfoConeNPhoton
std::vector< std::vector< int > > * t_v_RH_r26_ieta
std::vector< double > * t_dtFromLeadJet
std::vector< std::vector< int > > * t_v_RH_h5x5_ieta
std::vector< std::vector< int > > * t_v_RH_h3x3_ieta
Definition: DetId.h:18
std::vector< unsigned int > * t_ievt
std::vector< double > * t_trkNLayersCrossed
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_L1extCenJet_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
std::vector< std::vector< double > > * t_v_hsimInfoConeNeutHad
std::vector< std::vector< int > > * t_v_nSimHitsCone
std::vector< int > * t_hltSingleIsoTau30_Trk5
std::vector< double > * t_hsim5x5
T const * product() const
Definition: Handle.h:81
GlobalVector trkMomAtEcal
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
const T & get() const
Definition: EventSetup.h:56
std::vector< std::vector< int > > * t_v_RH_h5x5_iphi
IsolatedTracksCone(const edm::ParameterSet &)
std::vector< std::vector< int > > * t_v_hsimInfoConeNTotal
std::vector< double > * t_hsim3x3Matched
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
std::vector< int > * t_hsim3x3NNeutHad
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::Service< TFileService > fs
GlobalVector trkMomAtHcal
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
std::vector< int > * t_hltZeroBias
edm::EventID id() const
Definition: EventBase.h:58
std::vector< double > * t_h5x5
std::vector< double > * t_trkNOuterHits
std::vector< std::vector< double > > * t_v_hCone
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< int > * t_hsim3x3NPhoton
TrackerHitAssociator::Config trackerHitAssociatorConfig_
std::vector< double > * t_hsim3x3Rest
std::vector< double > * t_hsim3x3
std::vector< int > * t_hsim3x3NMatched
std::vector< std::vector< int > > * t_v_RH_r44_ieta
std::vector< double > * t_trkHcalEne
std::vector< unsigned int > * t_irun
std::vector< int > * t_hltJet180
std::vector< int > * t_hsim3x3NTotal
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
void printTrack(const reco::Track *pTrack)
std::vector< int > * t_ietaFromHotCell_h3x3
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
int charge() const
track electric charge
Definition: TrackBase.h:562
std::vector< double > * t_distFromHotCell_h5x5
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_e3x3
double DeltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< double > * t_trkEta
std::vector< double > * t_h3x3
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, std::string theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
std::vector< std::vector< double > > * t_v_hsimInfoConePhoton
T const * product() const
Definition: ESHandle.h:86
std::vector< unsigned int > * t_ilum
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
TrackDetectorAssociator * trackAssociator_
std::vector< int > * t_hltJet80
std::vector< std::vector< double > > * t_v_eDR
std::vector< std::vector< double > > * t_v_hsimInfoConeMatched
std::vector< std::vector< int > > * t_v_RH_r26_iphi
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
std::vector< int > * t_hsim5x5NMatched
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool useRaw=false, bool debug=false)
std::vector< std::vector< int > > * t_v_cone_hnNearTRKs
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)