CMS 3D CMS Logo

AlCaIsoTracksProducer.cc
Go to the documentation of this file.
1 
2 // -*- C++ -*-
3 //#define DebugLog
4 
5 // system include files
6 #include <atomic>
7 #include <memory>
8 #include <string>
9 #include <cmath>
10 #include <iostream>
11 #include <sstream>
12 #include <fstream>
13 #include <vector>
14 #include <boost/regex.hpp>
15 
16 // user include files
27 
54 
56 
61 
75 
76 
77 //
78 // class declaration
79 //
80 
81 namespace AlCaIsoTracks {
82  struct Counters {
83  Counters() : nAll_(0), nGood_(0), nRange_(0) {}
84  mutable std::atomic<unsigned int> nAll_, nGood_, nRange_;
85  };
86 }
87 
88 class AlCaIsoTracksProducer : public edm::stream::EDProducer<edm::GlobalCache<AlCaIsoTracks::Counters> > {
89 public:
91  ~AlCaIsoTracksProducer() override;
92 
93  static std::unique_ptr<AlCaIsoTracks::Counters> initializeGlobalCache(edm::ParameterSet const& ) {
94  return std::make_unique<AlCaIsoTracks::Counters>();
95  }
96 
97  void produce(edm::Event &, edm::EventSetup const&) override;
98  void endStream() override;
99  static void globalEndJob(const AlCaIsoTracks::Counters* counters);
100 
101 private:
102 
103  void beginRun(edm::Run const&, edm::EventSetup const&) override;
104  void endRun(edm::Run const&, edm::EventSetup const&) override;
105  reco::HcalIsolatedTrackCandidateCollection* select(edm::Handle<edm::TriggerResults>& triggerResults, const std::vector<std::string> & triggerNames_, edm::Handle<reco::TrackCollection>& trkCollection, math::XYZPoint& leadPV,edm::Handle<EcalRecHitCollection>& barrelRecHitsHandle, edm::Handle<EcalRecHitCollection>& endcapRecHitsHandle, edm::Handle<HBHERecHitCollection>& hbhe, double ptL1, double etaL1, double phiL1);
106  void setPtEtaPhi(std::vector< edm::Ref<l1extra::L1JetParticleCollection> >& objref, double &ptL1, double &etaL1, double &phiL1);
107 
108  // ----------member data ---------------------------
110  std::vector<std::string> trigNames_, HLTNames_;
111  unsigned int nRun_, nAll_, nGood_, nRange_;
114  double maxRestrictionP_, slopeRestrictionP_;
115  double a_mipR_, a_coneR_, a_charIsoR_;
116  double pTrackMin_, eEcalMax_, eIsolate_;
117  double pTrackLow_, pTrackHigh_;
119  edm::InputTag labelTriggerEvent_, labelTriggerResults_;
120  edm::InputTag labelGenTrack_, labelRecVtx_, labelHltGT_;
121  edm::InputTag labelEB_, labelEE_, labelHBHE_, labelBS_;
125 
135 };
136 
137 
139  nRun_(0), nAll_(0), nGood_(0), nRange_(0) {
140  //Get the run parameters
141  const double isolationRadius(28.9);
142  trigNames_ = iConfig.getParameter<std::vector<std::string> >("Triggers");
143  theTrackQuality_ = iConfig.getParameter<std::string>("TrackQuality");
144  processName_ = iConfig.getParameter<std::string>("ProcessName");
145  selectionParameter_.minPt = iConfig.getParameter<double>("MinTrackPt");;
147  selectionParameter_.maxDxyPV = iConfig.getParameter<double>("MaxDxyPV");
148  selectionParameter_.maxDzPV = iConfig.getParameter<double>("MaxDzPV");
149  selectionParameter_.maxChi2 = iConfig.getParameter<double>("MaxChi2");
150  selectionParameter_.maxDpOverP = iConfig.getParameter<double>("MaxDpOverP");
151  selectionParameter_.minOuterHit = iConfig.getParameter<int>("MinOuterHit");
152  selectionParameter_.minLayerCrossed = iConfig.getParameter<int>("MinLayerCrossed");
153  selectionParameter_.maxInMiss = iConfig.getParameter<int>("MaxInMiss");
154  selectionParameter_.maxOutMiss = iConfig.getParameter<int>("MaxOutMiss");
155  a_coneR_ = iConfig.getParameter<double>("ConeRadius");
156  a_charIsoR_ = a_coneR_ + isolationRadius;
157  a_mipR_ = iConfig.getParameter<double>("ConeRadiusMIP");
158  pTrackMin_ = iConfig.getParameter<double>("MinimumTrackP");
159  eEcalMax_ = iConfig.getParameter<double>("MaximumEcalEnergy");
160  // Different isolation cuts are described in DN-2016/029
161  // Tight cut uses 2 GeV; Loose cut uses 10 GeV
162  // Eta dependent cut uses (maxRestrictionP_ * exp(|ieta|*log(2.5)/18))
163  // with the factor for exponential slopeRestrictionP_ = log(2.5)/18
164  // maxRestrictionP_ = 8 GeV as came from a study
165  maxRestrictionP_ = iConfig.getParameter<double>("MaxTrackP");
166  slopeRestrictionP_ = iConfig.getParameter<double>("SlopeTrackP");
167  eIsolate_ = iConfig.getParameter<double>("IsolationEnergy");
168  pTrackLow_ = iConfig.getParameter<double>("MomentumRangeLow");
169  pTrackHigh_ = iConfig.getParameter<double>("MomentumRangeHigh");
170  preScale_ = iConfig.getParameter<int>("PreScaleFactor");
171  labelGenTrack_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
172  labelRecVtx_ = iConfig.getParameter<edm::InputTag>("VertexLabel");
173  labelBS_ = iConfig.getParameter<edm::InputTag>("BeamSpotLabel");
174  labelEB_ = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
175  labelEE_ = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
176  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
177  labelHltGT_ = iConfig.getParameter<edm::InputTag>("L1GTSeedLabel");
178  labelTriggerEvent_ = iConfig.getParameter<edm::InputTag>("TriggerEventLabel");
179  labelTriggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
180  labelIsoTk_ = iConfig.getParameter<std::string>("IsoTrackLabel");
181 
182  // define tokens for access
183  tok_hltGT_ = consumes<trigger::TriggerFilterObjectWithRefs>(labelHltGT_);
184  tok_trigEvt_ = consumes<trigger::TriggerEvent>(labelTriggerEvent_);
185  tok_trigRes_ = consumes<edm::TriggerResults>(labelTriggerResults_);
186  tok_genTrack_ = consumes<reco::TrackCollection>(labelGenTrack_);
187  tok_recVtx_ = consumes<reco::VertexCollection>(labelRecVtx_);
188  tok_bs_ = consumes<reco::BeamSpot>(labelBS_);
189  tok_EB_ = consumes<EcalRecHitCollection>(labelEB_);
190  tok_EE_ = consumes<EcalRecHitCollection>(labelEE_);
191  tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_);
192 
193  edm::LogInfo("HcalIsoTrack") <<"Parameters read from config file \n"
194  <<"\t minPt " << selectionParameter_.minPt
195  <<"\t theTrackQuality " << theTrackQuality_
196  <<"\t minQuality " << selectionParameter_.minQuality
197  <<"\t maxDxyPV " << selectionParameter_.maxDxyPV
198  <<"\t maxDzPV " << selectionParameter_.maxDzPV
199  <<"\t maxChi2 " << selectionParameter_.maxChi2
200  <<"\t maxDpOverP " << selectionParameter_.maxDpOverP
201  <<"\t minOuterHit " << selectionParameter_.minOuterHit
202  <<"\t minLayerCrossed " << selectionParameter_.minLayerCrossed
203  <<"\t maxInMiss " << selectionParameter_.maxInMiss
204  <<"\t maxOutMiss " << selectionParameter_.maxOutMiss << "\n"
205  <<"\t a_coneR " << a_coneR_
206  <<"\t a_charIsoR " << a_charIsoR_
207  <<"\t a_mipR " << a_mipR_
208  <<"\t pTrackMin " << pTrackMin_
209  <<"\t eEcalMax " << eEcalMax_
210  <<"\t maxRestrictionP_ "<< maxRestrictionP_
211  <<"\t slopeRestrictionP_ " << slopeRestrictionP_
212  <<"\t eIsolate_ " << eIsolate_
213  <<"\t Process " << processName_ << "\n"
214  <<"\t Precale factor " << preScale_
215  <<"\t in momentum range " << pTrackLow_
216  <<":" << pTrackHigh_;
217  for (unsigned int k=0; k<trigNames_.size(); ++k)
218  edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k];
219 
220  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
221  produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_);
222  produces<reco::VertexCollection>(labelRecVtx_.label());
223  produces<EcalRecHitCollection>(labelEB_.instance());
224  produces<EcalRecHitCollection>(labelEE_.instance());
225  produces<HBHERecHitCollection>(labelHBHE_.label());
226 
227  edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n"
228  << "reco::HcalIsolatedTrackCandidateCollection "
229  << " with label HcalIsolatedTrackCollection\n"
230  << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n"
231  << "EcalRecHitCollection with label EcalRecHitsEB\n"
232  << "EcalRecHitCollection with label EcalRecHitsEE\n"
233  << "HBHERecHitCollection with label " << labelHBHE_.label();
234 }
235 
236 
238 
239 
241 
242  nAll_++;
243 #ifdef DebugLog
244  edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event "
245  << iEvent.id().event() << " Luminosity "
246  << iEvent.luminosityBlock() << " Bunch "
247  << iEvent.bunchCrossing();
248 #endif
249  bool valid(true);
250  //Step1: Get all the relevant containers
251  trigger::TriggerEvent triggerEvent;
252  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
253  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
254  if (!triggerEventHandle.isValid()) {
255  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerEvent_;
256  valid = false;
257  }
259  iEvent.getByToken(tok_trigRes_, triggerResults);
260  if (!triggerResults.isValid()) {
261  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelTriggerResults_;
262  valid = false;
263  }
264 
266  iEvent.getByToken(tok_genTrack_, trkCollection);
267  if (!trkCollection.isValid()) {
268  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
269  valid = false;
270  }
271  reco::TrackCollection::const_iterator trkItr;
272 
274  iEvent.getByToken(tok_recVtx_, recVtxs);
275  if (!recVtxs.isValid()) {
276  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_;
277  valid = false;
278  }
279 
280  edm::Handle<reco::BeamSpot> beamSpotH;
281  iEvent.getByToken(tok_bs_, beamSpotH);
282  math::XYZPoint leadPV(0,0,0);
283  if (valid) {
284  if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
285  leadPV = math::XYZPoint((*recVtxs)[0].x(),(*recVtxs)[0].y(),
286  (*recVtxs)[0].z());
287  } else if (beamSpotH.isValid()) {
288  leadPV = beamSpotH->position();
289  }
290  }
291 #ifdef DebugLog
292  edm::LogInfo("HcalIsoTrack") << "Primary Vertex " << leadPV;
293 #endif
294 
295  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
296  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
297  if (!barrelRecHitsHandle.isValid()) {
298  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_;
299  valid = false;
300  }
301  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
302  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
303  if (!endcapRecHitsHandle.isValid()) {
304  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_;
305  valid = false;
306  }
308  iEvent.getByToken(tok_hbhe_, hbhe);
309  if (!hbhe.isValid()) {
310  edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_;
311  valid = false;
312  }
313 
314  //Get L1 trigger object
315  double ptL1(0), etaL1(0), phiL1(0);
317  iEvent.getByToken(tok_hltGT_, l1trigobj);
318 
319  if (l1trigobj.isValid()) {
320  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
321  l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
322  setPtEtaPhi(l1tauobjref,ptL1,etaL1,phiL1);
323 
324  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
325  l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
326  setPtEtaPhi(l1jetobjref,ptL1,etaL1,phiL1);
327 
328  std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
329  l1trigobj->getObjects(trigger::TriggerL1ForJet, l1forjetobjref);
330  setPtEtaPhi(l1forjetobjref,ptL1,etaL1,phiL1);
331  } else {
332  valid = false;
333  }
334 
335  auto outputHcalIsoTrackColl = std::make_unique<reco::HcalIsolatedTrackCandidateCollection>();
336  auto outputVColl = std::make_unique<reco::VertexCollection>();
337  auto outputEBColl = std::make_unique<EBRecHitCollection>();
338  auto outputEEColl = std::make_unique<EERecHitCollection>();
339  auto outputHBHEColl = std::make_unique<HBHERecHitCollection>();
340 
341  //For valid HLT record
342  if (!valid) {
343  edm::LogWarning("HcalIsoTrack") << "Error! Can't get some of the products";
344  } else {
345  trigger::TriggerEvent triggerEvent = *(triggerEventHandle.product());
346  if (triggerResults.isValid()) {
347  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
348  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
349  reco::HcalIsolatedTrackCandidateCollection* isotk = select(triggerResults, triggerNames_, trkCollection, leadPV, barrelRecHitsHandle, endcapRecHitsHandle, hbhe, ptL1, etaL1, phiL1);
350 #ifdef DebugLog
351  edm::LogInfo("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns "
352  << isotk->size() << " isolated tracks";
353 #endif
354 
355  if (!isotk->empty()) {
356  int ntrin(0), ntrout(0);
357  for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr=isotk->begin(); itr!=isotk->end(); ++itr) {
358  if (itr->p() > pTrackLow_ && itr->p() < pTrackHigh_) ntrin++;
359  else ntrout++;
360  }
361  bool selectEvent = ntrout > 0;
362  if (!selectEvent && ntrin > 0) {
363  ++nRange_;
364  if (preScale_ <= 1) selectEvent = true;
365  else if (nRange_%preScale_ == 1) selectEvent = true;
366  }
367  if (selectEvent) {
368  for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr=isotk->begin(); itr!=isotk->end(); ++itr)
369  outputHcalIsoTrackColl->push_back(*itr);
370 
371  for (reco::VertexCollection::const_iterator vtx=recVtxs->begin(); vtx!=recVtxs->end(); ++vtx)
372  outputVColl->push_back(*vtx);
373 
374  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=barrelRecHitsHandle->begin(); ehit!=barrelRecHitsHandle->end(); ++ehit)
375  outputEBColl->push_back(*ehit);
376 
377  for (edm::SortedCollection<EcalRecHit>::const_iterator ehit=endcapRecHitsHandle->begin(); ehit!=endcapRecHitsHandle->end(); ++ehit)
378  outputEEColl->push_back(*ehit);
379 
380  for (std::vector<HBHERecHit>::const_iterator hhit=hbhe->begin(); hhit!=hbhe->end(); ++hhit)
381  outputHBHEColl->push_back(*hhit);
382  ++nGood_;
383  }
384  }
385  }
386  }
387  iEvent.put(std::move(outputHcalIsoTrackColl), labelIsoTk_);
388  iEvent.put(std::move(outputVColl), labelRecVtx_.label());
389  iEvent.put(std::move(outputEBColl), labelEB_.instance());
390  iEvent.put(std::move(outputEEColl), labelEE_.instance());
391  iEvent.put(std::move(outputHBHEColl), labelHBHE_.label());
392 }
393 
395  globalCache()->nAll_ += nAll_;
396  globalCache()->nGood_ += nGood_;
397  globalCache()->nRange_ += nRange_;
398 }
399 
401  edm::LogInfo("HcalIsoTrack") << "Finds " << count->nGood_ <<" good tracks in "
402  << count->nAll_ << " events and " << count->nRange_
403  << " events in the momentum raange";
404 }
405 
406 void AlCaIsoTracksProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
407  bool changed(false);
408  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run()
409  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName_,changed);
410 
412  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
413  bField = bFieldH.product();
415  iSetup.get<CaloGeometryRecord>().get(pG);
416  geo = pG.product();
417 }
418 
420  edm::LogInfo("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run();
421  ++nRun_;
422 }
423 
426  const std::vector<std::string> & triggerNames_,
427  edm::Handle<reco::TrackCollection>& trkCollection,
428  math::XYZPoint& leadPV,edm::Handle<EcalRecHitCollection>& barrelRecHitsHandle,
429  edm::Handle<EcalRecHitCollection>& endcapRecHitsHandle,
431  double ptL1, double etaL1, double phiL1) {
432 
434  bool ok(false);
435 
436  // Find a good HLT trigger
437  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
438  int hlt = triggerResults->accept(iHLT);
439  for (unsigned int i=0; i<trigNames_.size(); ++i) {
440  if (triggerNames_[iHLT].find(trigNames_[i])!=std::string::npos) {
441  if (hlt > 0) {
442  ok = true;
443  }
444  edm::LogInfo("HcalIsoTrack") << "The trigger we are looking for "
445  << triggerNames_[iHLT] << " Flag "
446  << hlt << ":" << ok;
447  }
448  }
449  }
450 
451  //Propagate tracks to calorimeter surface)
452  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
454  trkCaloDirections, false);
455 
456  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
457  unsigned int nTracks(0), nselTracks(0);
458  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
459  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
460  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
461  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
462  pTrack->pz(), pTrack->p());
463 #ifdef DebugLog
464  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
465  << " (pt|eta|phi|p) :" << pTrack->pt()
466  << "|" << pTrack->eta() << "|"
467  << pTrack->phi() << "|" << pTrack->p();
468 #endif
469  //Selection of good track
470  bool qltyFlag = spr::goodTrack(pTrack,leadPV,selectionParameter_,false);
471 #ifdef DebugLog
472  edm::LogInfo("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag
473  << "|" << trkDetItr->okECAL << "|"
474  << trkDetItr->okHCAL;
475 #endif
476  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
477  double t_p = pTrack->p();
478  nselTracks++;
479  int nRH_eMipDR(0), nNearTRKs(0);
480  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
481  endcapRecHitsHandle,
482  trkDetItr->pointHCAL,
483  trkDetItr->pointECAL, a_mipR_,
484  trkDetItr->directionECAL,
485  nRH_eMipDR);
486  double hmaxNearP = spr::chargeIsolationCone(nTracks,
487  trkCaloDirections,
488  a_charIsoR_,
489  nNearTRKs, false);
490  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
491  int ieta = detId.ietaAbs();
492  double eIsolation = (maxRestrictionP_*exp(slopeRestrictionP_*((double)(ieta))));
493  if (eIsolation < eIsolate_) eIsolation = eIsolate_;
494 #ifdef DebugLog
495  edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks
496  << " (pt|eta|phi|p) :" << pTrack->pt()
497  << "|" << pTrack->eta() << "|"
498  << pTrack->phi() << "|" << t_p
499  << " e_MIP " << eMipDR
500  << " Chg Isolation " << hmaxNearP
501  << ":" << eIsolation;
502 #endif
503  if (t_p>pTrackMin_ && eMipDR<eEcalMax_ && hmaxNearP<eIsolation) {
504  reco::HcalIsolatedTrackCandidate newCandidate(v4);
505  newCandidate.SetMaxP(hmaxNearP);
506  newCandidate.SetEnergyEcal(eMipDR);
507  newCandidate.setL1(ptL1,etaL1,phiL1);
508  newCandidate.SetEtaPhiEcal((trkDetItr->pointECAL).eta(),
509  (trkDetItr->pointECAL).phi());
510  HcalDetId detId = HcalDetId(trkDetItr->detIdHCAL);
511  newCandidate.SetEtaPhiHcal((trkDetItr->pointHCAL).eta(),
512  (trkDetItr->pointHCAL).phi(),
513  detId.ieta(), detId.iphi());
514  int indx(0);
515  reco::TrackCollection::const_iterator trkItr1;
516  for (trkItr1=trkCollection->begin(); trkItr1 != trkCollection->end(); ++trkItr1,++indx) {
517  const reco::Track* pTrack1 = &(*trkItr1);
518  if (pTrack1 == pTrack) {
519  reco::TrackRef tRef = reco::TrackRef(trkCollection,indx);
520  newCandidate.setTrack(tRef);
521  break;
522  }
523  }
524  trackCollection->push_back(newCandidate);
525  }
526  }
527  }
528  return trackCollection;
529 }
530 
531 void AlCaIsoTracksProducer::setPtEtaPhi(std::vector< edm::Ref<l1extra::L1JetParticleCollection> >& objref, double &ptL1, double &etaL1, double &phiL1) {
532 
533  for (unsigned int p=0; p<objref.size(); p++) {
534  if (objref[p]->pt()>ptL1) {
535  ptL1 = objref[p]->pt();
536  phiL1 = objref[p]->phi();
537  etaL1 = objref[p]->eta();
538  }
539  }
540 }
541 
543 
RunNumber_t run() const
Definition: EventID.h:39
double p() const
momentum vector magnitude
Definition: TrackBase.h:648
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
const unsigned int nTracks(const reco::Vertex &sv)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
RunNumber_t run() const
Definition: RunBase.h:40
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
AlCaIsoTracksProducer(edm::ParameterSet const &, const AlCaIsoTracks::Counters *count)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
void beginRun(edm::Run const &, edm::EventSetup const &) override
bool accept() const
Has at least one path accepted the event?
const CaloGeometry * geo
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:66
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
void produce(edm::Event &, edm::EventSetup const &) override
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:678
static void globalEndJob(const AlCaIsoTracks::Counters *counters)
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:660
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hltGT_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:684
std::vector< HcalIsolatedTrackCandidate > HcalIsolatedTrackCandidateCollection
collectin of HcalIsolatedTrackCandidate objects
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
void SetEtaPhiEcal(double eta, double phi)
eta, phi at ECAL surface
unsigned int size() const
Get number of paths stored.
double pt() const
track transverse momentum
Definition: TrackBase.h:654
void setPtEtaPhi(std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &objref, double &ptL1, double &etaL1, double &phiL1)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
void SetEtaPhiHcal(double eta, double phi, int ieta, int iphi)
eta, phi at HCAL surface
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)
const MagneticField * bField
static std::string const triggerResults
Definition: EdmProvDump.cc:42
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:672
int k[5][pyjets_maxn]
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
std::atomic< unsigned int > nGood_
const_iterator end() const
void endRun(edm::Run const &, edm::EventSetup const &) override
void setPtEtaPhi(const reco::Candidate &p, float &pt, float &eta, float &phi)
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
static std::unique_ptr< AlCaIsoTracks::Counters > initializeGlobalCache(edm::ParameterSet const &)
T const * product() const
Definition: Handle.h:81
void setL1(double pt, double eta, double phi)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
std::atomic< unsigned int > nAll_
std::string const & label() const
Definition: InputTag.h:36
spr::trackSelectionParameters selectionParameter_
std::vector< std::string > trigNames_
edm::EventID id() const
Definition: EventBase.h:60
T get() const
Definition: EventSetup.h:68
reco::TrackBase::TrackQuality minQuality
void setTrack(const reco::TrackRef &tr)
const Point & position() const
position
Definition: BeamSpot.h:62
reco::HcalIsolatedTrackCandidateCollection * select(edm::Handle< edm::TriggerResults > &triggerResults, const std::vector< std::string > &triggerNames_, edm::Handle< reco::TrackCollection > &trkCollection, math::XYZPoint &leadPV, edm::Handle< EcalRecHitCollection > &barrelRecHitsHandle, edm::Handle< EcalRecHitCollection > &endcapRecHitsHandle, edm::Handle< HBHERecHitCollection > &hbhe, double ptL1, double etaL1, double phiL1)
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
T const * product() const
Definition: ESHandle.h:84
std::string const & instance() const
Definition: InputTag.h:37
std::atomic< unsigned int > nRange_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:666
Definition: Run.h:44