CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsoTrackCalibration.cc
Go to the documentation of this file.
1 //#define DebugLog
2 // system include files
3 #include <memory>
4 
5 // Root objects
6 #include "TROOT.h"
7 #include "TSystem.h"
8 #include "TFile.h"
9 #include "TProfile.h"
10 #include "TDirectory.h"
11 #include "TTree.h"
12 #include "TLorentzVector.h"
13 #include "TInterpreter.h"
14 
15 //Tracks
20 // Vertices
24 
25 //Triggers
34 
37 
46 
52 
67 //#include "DataFormats/PatCandidates/interface/Jet.h"
68 
70 
71 public:
72  explicit IsoTrackCalibration(const edm::ParameterSet&);
74 
75  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
76 
77 private:
78  virtual void beginJob() ;
79  virtual void analyze(const edm::Event&, const edm::EventSetup&);
80  virtual void endJob() ;
81  virtual void beginRun(edm::Run const&, edm::EventSetup const&);
82  virtual void endRun(edm::Run const&, edm::EventSetup const&);
83  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
84  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
85 
89 
90  bool changed;
93  std::vector<std::string> trigNames, HLTNames;
94  int verbosity;
98  bool qcdMC;
99  int nRun;
100 
104 
112 
113  TTree* tree;
119  std::vector<unsigned int> *t_DetIds;
120  std::vector<double> *t_HitEnergies;
121 };
122 
124  changed(false), nRun(0) {
125  //now do whatever initialization is needed
126  verbosity = iConfig.getUntrackedParameter<int>("Verbosity",0);
127  trigNames = iConfig.getUntrackedParameter<std::vector<std::string> >("Triggers");
128  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
129  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
130  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
131  selectionParameters.minQuality = trackQuality_;
132  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
133  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
134  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
135  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
136  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
137  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
138  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
139  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
140  a_coneR = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
141  a_charIsoR = a_coneR + 28.9;
142  a_mipR = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
143  qcdMC = iConfig.getUntrackedParameter<bool>("IsItQCDMC", false);
144  bool isItAOD = iConfig.getUntrackedParameter<bool>("IsItAOD", true);
145  triggerEvent_ = edm::InputTag("hltTriggerSummaryAOD","","HLT");
146  theTriggerResultsLabel = edm::InputTag("TriggerResults","","HLT");
147 
148  // define tokens for access
149  tok_trigEvt = consumes<trigger::TriggerEvent>(triggerEvent_);
150  tok_trigRes = consumes<edm::TriggerResults>(theTriggerResultsLabel);
151  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
152  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
153  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
154  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
155 
156  if (isItAOD) {
157  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
158  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
159  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
160  } else {
161  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
162  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
163  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
164  }
165 
166  if (verbosity>=0) {
167  edm::LogInfo("IsoTrack") <<"Parameters read from config file \n"
168  <<"\t minPt " << selectionParameters.minPt
169  <<"\t theTrackQuality " << theTrackQuality
170  <<"\t minQuality " << selectionParameters.minQuality
171  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
172  <<"\t maxDzPV " << selectionParameters.maxDzPV
173  <<"\t maxChi2 " << selectionParameters.maxChi2
174  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
175  <<"\t minOuterHit " << selectionParameters.minOuterHit
176  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
177  <<"\t maxInMiss " << selectionParameters.maxInMiss
178  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
179  <<"\t a_coneR " << a_coneR
180  <<"\t a_charIsoR " << a_charIsoR
181  <<"\t a_mipR " << a_mipR
182  <<"\t qcdMC " << qcdMC;
183  edm::LogInfo("IsoTrack") << trigNames.size() << " triggers to be studied:";
184  for (unsigned int k=0; k<trigNames.size(); ++k)
185  edm::LogInfo("IsoTrack") << "Trigger[" << k << "] : " << trigNames[k];
186  }
187 }
188 
190  // do anything here that needs to be done at desctruction time
191  // (e.g. close files, deallocate resources etc.)
192 
193 }
194 
196  const edm::EventSetup& iSetup) {
197 
198  t_Run = iEvent.id().run();
199  t_Event = iEvent.id().event();
200  if (verbosity%10 > 0)
201  edm::LogInfo("IsoTrack") << "Run " << t_Run << " Event " << t_Event
202  << " Luminosity " << iEvent.luminosityBlock()
203  << " Bunch " << iEvent.bunchCrossing()
204  << " starts";
205 
206  //Get magnetic field and ECAL channel status
208  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
209  const MagneticField *bField = bFieldH.product();
210 
212  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
213 
214  // get handles to calogeometry and calotopology
216  iSetup.get<CaloGeometryRecord>().get(pG);
217  const CaloGeometry* geo = pG.product();
218 
219  //Get track collection
221  iEvent.getByToken(tok_genTrack_, trkCollection);
222  reco::TrackCollection::const_iterator trkItr;
223 
224  //event weight for FLAT sample
225  t_EventWeight = 1.0;
227  iEvent.getByToken(tok_ew_, genEventInfo);
228  if (genEventInfo.isValid()) t_EventWeight = genEventInfo->weight();
229 
230  //Define the best vertex and the beamspot
232  iEvent.getByToken(tok_recVtx_, recVtxs);
233  edm::Handle<reco::BeamSpot> beamSpotH;
234  iEvent.getByToken(tok_bs_, beamSpotH);
235  math::XYZPoint leadPV(0,0,0);
236  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
237  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
238  } else if (beamSpotH.isValid()) {
239  leadPV = beamSpotH->position();
240  }
241  if ((verbosity/100)%10>0) {
242  edm::LogInfo("IsoTrack") << "Primary Vertex " << leadPV;
243  if (beamSpotH.isValid()) edm::LogInfo("IsoTrack") << " Beam Spot "
244  << beamSpotH->position();
245  }
246 
247  // RecHits
248  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
249  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
250  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
251  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
253  iEvent.getByToken(tok_hbhe_, hbhe);
254 
255  trigger::TriggerEvent triggerEvent;
256  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
257  iEvent.getByToken(tok_trigEvt, triggerEventHandle);
258  if (!triggerEventHandle.isValid()) {
259  edm::LogWarning("IsoTrack") << "Error! Can't get the product "
260  << triggerEvent_.label();
261  } else {
262  triggerEvent = *(triggerEventHandle.product());
263 
264  const trigger::TriggerObjectCollection& TOC(triggerEvent.getObjects());
267  iEvent.getByToken(tok_trigRes, triggerResults);
268  if (triggerResults.isValid()) {
269  std::vector<std::string> modules;
270  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
271  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
272  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
273  bool ok(false);
274  int hlt = triggerResults->accept(iHLT);
275  for (unsigned int i=0; i<trigNames.size(); ++i) {
276  if (triggerNames_[iHLT].find(trigNames[i].c_str())!=std::string::npos) {
277  if (hlt > 0) ok = true;
278  if (verbosity%10 > 0)
279  edm::LogInfo("IsoTrack") << "This is the trigger we are looking for "
280  << triggerNames_[iHLT] << " Flag "
281  << hlt << ":" << ok;
282  }
283  }
284  if (ok) {
285  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[iHLT]);
286  const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
287 
288  std::vector<math::XYZTLorentzVector> vec[3];
289  //loop over all trigger filters in event (i.e. filters passed)
290  for (unsigned int ifilter=0; ifilter<triggerEvent.sizeFilters();
291  ++ifilter) {
292  std::vector<int> Keys;
293  std::string label = triggerEvent.filterTag(ifilter).label();
294  //loop over keys to objects passing this filter
295  for (unsigned int imodule=0; imodule<moduleLabels.size();
296  imodule++) {
297  if (label.find(moduleLabels[imodule]) != std::string::npos) {
298  if (verbosity%10 > 0)
299  edm::LogInfo("IsoTrack") << "FilterName " << label;
300  for (unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) {
301  Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]);
302  const trigger::TriggerObject& TO(TOC[Keys[ifiltrKey]]);
303  math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy());
304  if (qcdMC) {
305  if (label.find("hltL1s") != std::string::npos) {
306  vec[0].push_back(v4);
307  } else if (label.find("PFJet") != std::string::npos) {
308  vec[2].push_back(v4);
309  } else {
310  vec[1].push_back(v4);
311  }
312  } else {
313  if (label.find("L2Filter") != std::string::npos) {
314  vec[1].push_back(v4);
315  } else if (label.find("Filter") != std::string::npos) {
316  vec[2].push_back(v4);
317  } else {
318  vec[0].push_back(v4);
319  }
320  }
321  if (verbosity%10 > 2)
322  edm::LogInfo("IsoTrack") << "key " << ifiltrKey << " : pt "
323  << TO.pt() << " eta " << TO.eta()
324  << " phi " << TO.phi() << " mass "
325  << TO.mass() << " Id " << TO.id();
326 
327  }
328  if (verbosity%10 > 0)
329  edm::LogInfo("IsoTrack") << "sizes " << vec[0].size()
330  << ":" << vec[1].size() << ":"
331  << vec[2].size();
332 
333  }
334  }
335  }
336 
337  double deta, dphi, dr;
339  math::XYZTLorentzVector mindRvec1;
340  double mindR1(999);
341  for (int lvl=1; lvl<3; lvl++) {
342  for (unsigned int i=0; i<vec[lvl].size(); i++) {
343  deta = dEta(vec[0][0],vec[lvl][i]);
344  dphi = dPhi(vec[0][0],vec[lvl][i]);
345  dr = dR(vec[0][0],vec[lvl][i]);
346  if (verbosity%10 > 2)
347  edm::LogInfo("IsoTrack") << "lvl " <<lvl << " i " << i
348  << " deta " << deta << " dphi "
349  << dphi << " dR " << dr;
350  if (dr<mindR1) {
351  mindR1 = dr;
352  mindRvec1 = vec[lvl][i];
353  }
354  }
355  }
356 
357  t_l1pt = vec[0][0].pt();
358  t_l1eta = vec[0][0].eta();
359  t_l1phi = vec[0][0].phi();
360  t_l3pt = vec[2][0].pt();
361  t_l3eta = vec[2][0].eta();
362  t_l3phi = vec[2][0].phi();
363 
364  //Propagate tracks to calorimeter surface)
365  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
366  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality,
367  trkCaloDirections, ((verbosity/100)%10>2));
368  //Loop over tracks
369  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
370  unsigned int nTracks(0), nselTracks(0);
371  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
372  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
373  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
374  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
375  pTrack->pz(), pTrack->p());
376  if (verbosity%10 > 0)
377  edm::LogInfo("IsoTrack") << "This track : " << nTracks
378  << " (pt/eta/phi/p) :" << pTrack->pt()
379  << "/" << pTrack->eta() << "/"
380  << pTrack->phi() << "/" << pTrack->p();
381  math::XYZTLorentzVector mindRvec2;
382  t_mindR2 = 999;
383 
384  for (unsigned int k=0; k<vec[2].size(); ++k) {
385  dr = dR(vec[2][k],v4); //changed 1 to 2
386  if (dr<t_mindR2) {
387  t_mindR2 = dr;
388  mindRvec2 = vec[2][k];
389  }
390  }
391  t_mindR1 = dR(mindRvec1,v4);
392  if (verbosity%10 > 2)
393  edm::LogInfo("IsoTrack") << "Closest L3 object at mindr :"
394  << t_mindR2 << " is " << mindRvec2
395  << " and from L1 " << t_mindR1;
396 
397  //Selection of good track
398  t_selectTk = spr::goodTrack(pTrack,leadPV,selectionParameters,((verbosity/100)%10>2));
400  oneCutParameters.maxDxyPV = 10;
401  oneCutParameters.maxDzPV = 100;
402  oneCutParameters.maxInMiss = 2;
403  oneCutParameters.maxOutMiss= 2;
404  bool qltyFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
405  oneCutParameters = selectionParameters;
406  oneCutParameters.maxDxyPV = 10;
407  oneCutParameters.maxDzPV = 100;
408  t_qltyMissFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
409  oneCutParameters = selectionParameters;
410  oneCutParameters.maxInMiss = 2;
411  oneCutParameters.maxOutMiss= 2;
412  t_qltyPVFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
413  t_ieta = 0;
414  if (trkDetItr->okHCAL) {
415  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
416  t_ieta = detId.ieta();
417  }
418  if (verbosity%10 > 0)
419  edm::LogInfo("IsoTrack") << "qltyFlag|okECAL|okHCAL : "
420  << qltyFlag << "|" << trkDetItr->okECAL
421  << "/" << trkDetItr->okHCAL;
422  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
423  nselTracks++;
424  int nRH_eMipDR(0), nNearTRKs(0), nRecHits(-999);
425  t_eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
426  endcapRecHitsHandle,
427  trkDetItr->pointHCAL,
428  trkDetItr->pointECAL,
429  a_mipR, trkDetItr->directionECAL,
430  nRH_eMipDR);
431  t_DetIds->clear(); t_HitEnergies->clear();
432  std::vector<DetId> ids;
433  t_eHcal = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
434  trkDetItr->pointECAL, a_coneR,
435  trkDetItr->directionHCAL,nRecHits,
436  ids, *t_HitEnergies);
437  for (unsigned int k=0; k<ids.size(); ++k) {
438  t_DetIds->push_back(ids[k].rawId());
439  }
440  t_hmaxNearP = spr::chargeIsolationCone(nTracks,trkCaloDirections,
441  a_charIsoR, nNearTRKs,
442  ((verbosity/100)%10>2));
443  t_p = pTrack->p();
444  if (verbosity%10 > 0) {
445  edm::LogInfo("IsoTrack") << "This track : " << nTracks
446  << " (pt/eta/phi/p) :" << pTrack->pt()
447  << "/" << pTrack->eta() << "/"
448  << pTrack->phi() << "/" << t_p << "\n"
449  << "e_MIP " << t_eMipDR
450  << " Chg Isolation " << t_hmaxNearP
451  << " eHcal" << t_eHcal << " ieta "
452  << t_ieta << " Quality "
453  << t_qltyMissFlag << ":"
454  << t_qltyPVFlag << ":" << t_selectTk;
455  }
456 
457  tree->Fill();
458  }
459  }
460 // break;
461  }
462  }
463  // check if trigger names in (new) config
464  if (changed) {
465  changed = false;
466  if ((verbosity/10)%10 > 1) {
467  edm::LogInfo("IsoTrack") << "New trigger menu found !!!";
468  const unsigned int n(hltConfig_.size());
469  for (unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
470  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[itrig]);
471  if (triggerindx >= n)
472  edm::LogInfo("IsoTrack") << triggerNames_[itrig] << " "
473  << triggerindx << " does not exist";
474  else
475  edm::LogInfo("IsoTrack") << triggerNames_[itrig] << " "
476  << triggerindx << " exists";
477  }
478  }
479  }
480  }
481  }
482 }
483 
485 
486  tree = fs->make<TTree>("CalibTree", "CalibTree");
487 
488  tree->Branch("t_Run", &t_Run, "t_Run/I");
489  tree->Branch("t_Event", &t_Event, "t_Event/I");
490  tree->Branch("t_ieta", &t_ieta, "t_ieta/I");
491  tree->Branch("t_EventWeight", &t_EventWeight, "t_EventWeight/D");
492  tree->Branch("t_l1pt", &t_l1pt, "t_l1pt/D");
493  tree->Branch("t_l1eta", &t_l1eta, "t_l1eta/D");
494  tree->Branch("t_l1phi", &t_l1phi, "t_l1phi/D");
495  tree->Branch("t_l3pt", &t_l3pt, "t_l3pt/D");
496  tree->Branch("t_l3eta", &t_l3eta, "t_l3eta/D");
497  tree->Branch("t_l3phi", &t_l3phi, "t_l3phi/D");
498  tree->Branch("t_p", &t_p, "t_p/D");
499  tree->Branch("t_mindR1", &t_mindR1, "t_mindR1/D");
500  tree->Branch("t_mindR2", &t_mindR2, "t_mindR2/D");
501  tree->Branch("t_eMipDR", &t_eMipDR, "t_eMipDR/D");
502  tree->Branch("t_eHcal", &t_eHcal, "t_eHcal/D");
503  tree->Branch("t_hmaxNearP", &t_hmaxNearP, "t_hmaxNearP/D");
504  tree->Branch("t_selectTk", &t_selectTk, "t_selectTk/O");
505  tree->Branch("t_qltyMissFlag",&t_qltyMissFlag,"t_qltyMissFlag/O");
506  tree->Branch("t_qltyPVFlag", &t_qltyPVFlag, "t_qltyPVFlag/O)");
507 
508  t_DetIds = new std::vector<unsigned int>();
509  t_HitEnergies = new std::vector<double>();
510 
511  tree->Branch("t_DetIds", "std::vector<unsigned int>", &t_DetIds);
512  tree->Branch("t_HitEnergies", "std::vector<double>", &t_HitEnergies);
513 }
514 
515 // ------------ method called once each job just after ending the event loop ------------
517 }
518 
519 // ------------ method called when starting to processes a run ------------
520 void IsoTrackCalibration::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
521  edm::LogInfo("IsoTrack") << "Run[" << nRun <<"] " << iRun.run()
522  << " hltconfig.init "
523  << hltConfig_.init(iRun,iSetup,"HLT",changed);
524 }
525 
526 // ------------ method called when ending the processing of a run ------------
528  nRun++;
529  edm::LogInfo("IsoTrack") << "endRun[" << nRun << "] " << iRun.run();
530 }
531 
532 // ------------ method called when starting to processes a luminosity block ------------
534 // ------------ method called when ending the processing of a luminosity block ------------
536 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
538  //The following says we do not know what parameters are allowed so do no validation
539  // Please change this to state exactly what you do use, even if it is no parameters
541  desc.setUnknown();
542  descriptions.addDefault(desc);
543 }
544 
546  return (vec1.eta()-vec2.eta());
547 }
548 
550  return reco::deltaPhi(vec1.phi(),vec2.phi());
551 }
552 
554  return reco::deltaR(vec1.eta(),vec1.phi(),vec2.eta(),vec2.phi());
555 }
556 
557 //define this as a plug-in
559 
RunNumber_t run() const
Definition: EventID.h:39
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:199
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
int id() const
getters
Definition: TriggerObject.h:55
RunNumber_t run() const
Definition: RunBase.h:42
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
float phi() const
Definition: TriggerObject.h:58
TrackQuality
track quality
Definition: TrackBase.h:133
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::vector< std::string > trigNames
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
float energy() const
Definition: TriggerObject.h:65
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
float eta() const
Definition: TriggerObject.h:57
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
virtual void endRun(edm::Run const &, edm::EventSetup const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::InputTag theTriggerResultsLabel
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
float float float z
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< std::string > HLTNames
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
std::vector< double > vec1
Definition: HCALResponse.h:15
double pt() const
track transverse momentum
Definition: TrackBase.h:669
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
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)
edm::Service< TFileService > fs
static std::string const triggerResults
Definition: EdmProvDump.cc:41
IsoTrackCalibration(const edm::ParameterSet &)
bool isValid() const
Definition: HandleBase.h:76
std::vector< double > * t_HitEnergies
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:103
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:108
T const * product() const
Definition: Handle.h:81
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 debug=false)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< size_type > Keys
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::string const & label() const
Definition: InputTag.h:42
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
edm::EventID id() const
Definition: EventBase.h:56
spr::trackSelectionParameters selectionParameters
reco::TrackBase::TrackQuality minQuality
volatile std::atomic< bool > shutdown_flag false
Definition: DDAxes.h:10
float mass() const
Definition: TriggerObject.h:59
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
Definition: Run.h:41
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_