CMS 3D CMS Logo

IsoTrackCalibration.cc
Go to the documentation of this file.
1 
2 //#define DebugLog
3 
4 // system include files
5 #include <memory>
6 #include <string>
7 #include <vector>
8 
9 // Root objects
10 #include "TROOT.h"
11 #include "TSystem.h"
12 #include "TFile.h"
13 #include "TProfile.h"
14 #include "TDirectory.h"
15 #include "TTree.h"
16 #include "TH1F.h"
17 #include "TLorentzVector.h"
18 #include "TInterpreter.h"
19 
20 //Tracks
25 
26 // Vertices
30 
31 //Triggers
40 
51 
57 
73 
74 class IsoTrackCalibration : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::SharedResources> {
75 
76 public:
77  explicit IsoTrackCalibration(const edm::ParameterSet&);
78  ~IsoTrackCalibration() override;
79 
80  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
81 
82 private:
83  void analyze(edm::Event const&, edm::EventSetup const&) override;
84  void beginJob() override;
85  void beginRun(edm::Run const&, edm::EventSetup const&) override;
86  void endRun(edm::Run const&, edm::EventSetup const&) override;
87  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
88  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
89 
92  std::vector<std::string> trigNames_, HLTNames_;
99  double maxEcalEnr_;
101  int nRun_;
105 
113 
114  TTree *tree;
120  std::vector<unsigned int> *t_DetIds, *t_DetIds1, *t_DetIds3;
121  std::vector<double> *t_HitEnergies, *t_HitEnergies1, *t_HitEnergies3;
122 
123  TH1F *h_nTrk, *h_nVtx;
125  TH1I *h_iEta, *h_tketa0[5], *h_tketa1[5], *h_tketa2[5];
126  TH1I *h_tketa3[5], *h_tketa4[5], *h_tketa5[5];
128  TH1F *h_jetpt[4];
129  TH1I *h_tketav1[5][6], *h_tketav2[5][6];
130 };
131 
133  nRun_(0) {
134 
135  usesResource("TFileService");
136  //now do whatever initialization is needed
137  const double isolationRadius(28.9);
138  verbosity_ = iConfig.getUntrackedParameter<int>("Verbosity",0);
139  trigNames_ = iConfig.getUntrackedParameter<std::vector<std::string> >("Triggers");
140  theTrackQuality_ = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
141  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality_);
142  constTrackPt_ = iConfig.getUntrackedParameter<double>("ConstTrackPt", 10.0);
143  slopeTrackPt_ = iConfig.getUntrackedParameter<double>("SlopeTrackPt", 0.16);
145  selectionParameters_.minQuality = trackQuality_;
146  selectionParameters_.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.02);
147  selectionParameters_.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 0.02);
148  selectionParameters_.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
149  selectionParameters_.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
150  selectionParameters_.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
151  selectionParameters_.minLayerCrossed= iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
152  selectionParameters_.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
153  selectionParameters_.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
154  a_coneR_ = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
155  a_charIsoR_ = a_coneR_ + isolationRadius;
156  a_mipR_ = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
157  maxEcalEnr_ = iConfig.getUntrackedParameter<double>("MaxEcalEnergyInCone",2.5);
158  maxNeighborTrackEnr_ = iConfig.getUntrackedParameter<double>("MaxNeighborTrackEnergy",40.0);
159  isMC_ = iConfig.getUntrackedParameter<bool>("IsMC", false);
160  isQCD_ = iConfig.getUntrackedParameter<bool>("IsQCD", false);
161  isAOD_ = iConfig.getUntrackedParameter<bool>("IsAOD", true);
162  triggerEvent_ = edm::InputTag("hltTriggerSummaryAOD","","HLT");
163  theTriggerResultsLabel_ = edm::InputTag("TriggerResults","","HLT");
164 
165  // define tokens for access
166  tok_trigEvt_ = consumes<trigger::TriggerEvent>(triggerEvent_);
167  tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
168  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
169  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
170  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
171  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
172 
173  if (isAOD_) {
174  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
175  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
176  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
177  } else {
178  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
179  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
180  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
181  }
182 
183 #ifdef DebugLog
184  if (verbosity_>=0) {
185  std::cout <<"Parameters read from config file \n"
186  <<"\t minPt " << selectionParameters_.minPt
187  <<"\t theTrackQuality " << theTrackQuality_
188  <<"\t minQuality " << selectionParameters_.minQuality
189  <<"\t maxDxyPV " << selectionParameters_.maxDxyPV
190  <<"\t maxDzPV " << selectionParameters_.maxDzPV
191  <<"\t maxChi2 " << selectionParameters_.maxChi2
192  <<"\t maxDpOverP " << selectionParameters_.maxDpOverP
193  <<"\t minOuterHit " << selectionParameters_.minOuterHit
194  <<"\t minLayerCrossed " << selectionParameters_.minLayerCrossed
195  <<"\t maxInMiss " << selectionParameters_.maxInMiss
196  <<"\t maxOutMiss " << selectionParameters_.maxOutMiss
197  <<"\t a_coneR " << a_coneR_
198  <<"\t a_charIsoR " << a_charIsoR_
199  <<"\t a_mipR " << a_mipR_
200  <<"\t isMC " << isMC_
201  <<"\t isQCD " << isQCD_
202  <<"\t isAOD " << isAOD_
203  << std::endl;
204  std::cout << trigNames_.size() << " triggers to be studied:";
205  for (unsigned int k=0; k<trigNames_.size(); ++k)
206  std::cout << " " << trigNames_[k];
207  std::cout << std::endl;
208  }
209 #endif
210 }
211 
213  // do anything here that needs to be done at desctruction time
214  // (e.g. close files, deallocate resources etc.)
215 }
216 
218  const edm::EventSetup& iSetup) {
219 
220  t_Run = iEvent.id().run();
221  t_Event = iEvent.id().event();
222 #ifdef DebugLog
223  if (verbosity_%10 > 0)
224  std::cout << "Run " << t_Run << " Event " << t_Event << " Luminosity "
225  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing()
226  << " starts ==========" << std::endl;
227 #endif
228  //Get magnetic field and ECAL channel status
230  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
231  const MagneticField *bField = bFieldH.product();
232 
234  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
235 
236  // get handles to calogeometry and calotopology
238  iSetup.get<CaloGeometryRecord>().get(pG);
239  const CaloGeometry* geo = pG.product();
240 
241  //Get track collection
243  iEvent.getByToken(tok_genTrack_, trkCollection);
244 
245  //event weight for FLAT sample and PU information
246  t_EventWeight = 1.0;
248  iEvent.getByToken(tok_ew_, genEventInfo);
249  if (genEventInfo.isValid()) t_EventWeight = genEventInfo->weight();
250 
251  //Define the best vertex and the beamspot
253  iEvent.getByToken(tok_recVtx_, recVtxs);
254  edm::Handle<reco::BeamSpot> beamSpotH;
255  iEvent.getByToken(tok_bs_, beamSpotH);
256  math::XYZPoint leadPV(0,0,0);
257 
258  t_nVtx = recVtxs->size();
259  h_nVtx->Fill(t_nVtx);
260 
261  if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
262  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
263  } else if (beamSpotH.isValid()) {
264  leadPV = beamSpotH->position();
265  }
266 #ifdef DebugLog
267  if ((verbosity_/100)%10>0) {
268  std::cout << "Primary Vertex " << leadPV;
269  if (beamSpotH.isValid()) std::cout << " Beam Spot "
270  << beamSpotH->position();
271  std::cout << std::endl;
272  }
273 #endif
274 
275  // RecHits
276  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
277  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
278  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
279  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
281  iEvent.getByToken(tok_hbhe_, hbhe);
282 
283  //Trigger
284  bool triggerOK = false;
285  if (isMC_ && !isQCD_) {
286  triggerOK = true; // ignore HLT for single pion MC
287  } else {
288  trigger::TriggerEvent triggerEvent;
289  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
290  iEvent.getByToken(tok_trigEvt_, triggerEventHandle);
291  if (!triggerEventHandle.isValid()) {
292 #ifdef DebugLog
293  std::cout << "Error! Can't get the product "<< triggerEvent_.label()
294  << std::endl;
295 #endif
296  } else {
299  iEvent.getByToken(tok_trigRes_, triggerResults);
300  if (triggerResults.isValid()) {
301  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
302  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
303  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
304  int hlt = triggerResults->accept(iHLT);
305  if (hlt > 0) {
306  for (unsigned int i=0; i<trigNames_.size(); ++i) {
307  if (triggerNames_[iHLT].find(trigNames_[i])!=std::string::npos) {
308  triggerOK = true;
309 #ifdef DebugLog
310  if (verbosity_%10 > 0)
311  std::cout << "This is the trigger we are looking for "
312  << triggerNames_[iHLT] << " Flag " << hlt
313  << std::endl;
314 #endif
315  }
316  }
317  }
318  }
319  }
320  }
321  }
322 
323  if (triggerOK) {
324  //Propagate tracks to calorimeter surface)
325  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
326  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_,
327  trkCaloDirections, ((verbosity_/100)%10>2));
328  //Loop over tracks
329  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
330  unsigned int nTracks(0), nselTracks(0);
331  t_nTrk = trkCaloDirections.size();
332 
333  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
334  trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) {
335 
336  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
337 #ifdef DebugLog
338  if (verbosity_%10> 0)
339  std::cout << "This track : " << nTracks << " (pt/eta/phi/p) :"
340  << pTrack->pt() << "/" << pTrack->eta() << "/"
341  << pTrack->phi() << "/" << pTrack->p() << std::endl;
342 #endif
343 
344  t_ieta = 0;
345  if (trkDetItr->okHCAL) {
346  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
347  t_ieta = detId.ieta();
348  }
349  // ---------- eta-dependent restriction on Pt ----------------------------
351  // -----------------------------------------------------------------------
352 
353  //Selection of good track
354  t_selectTk = spr::goodTrack(pTrack,leadPV,selectionParameters_,((verbosity_/100)%10>2));
356  oneCutParameters.maxDxyPV = 10;
357  oneCutParameters.maxDzPV = 100;
358  oneCutParameters.maxInMiss = 2;
359  oneCutParameters.maxOutMiss= 2;
360  bool qltyFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity_/100)%10>2));
361  oneCutParameters = selectionParameters_;
362  oneCutParameters.maxDxyPV = 10;
363  oneCutParameters.maxDzPV = 100;
364  t_qltyMissFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity_/100)%10>2));
365  oneCutParameters = selectionParameters_;
366  oneCutParameters.maxInMiss = 2;
367  oneCutParameters.maxOutMiss= 2;
368  t_qltyPVFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity_/100)%10>2));
369 
370 #ifdef DebugLog
371  if (verbosity_%10 > 0)
372  std::cout << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|"
373  << trkDetItr->okECAL << "/" << trkDetItr->okHCAL
374  << std::endl;
375 #endif
376  if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
377  nselTracks++;
378  int nRH_eMipDR(0), nNearTRKs(0);
379  //------ ecal energy around track -------------------------------
380  t_eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
381  endcapRecHitsHandle,
382  trkDetItr->pointHCAL,
383  trkDetItr->pointECAL,
384  a_mipR_, trkDetItr->directionECAL,
385  nRH_eMipDR);
386  //---- isolation criteria ----------------------------------------------
387  t_hmaxNearP = spr::chargeIsolationCone(nTracks,trkCaloDirections,
388  a_charIsoR_, nNearTRKs,
389  ((verbosity_/100)%10>2));
390 
392  //------------ HCAL --------------------------------------------------
393  //------ initialize arrays of DetID and hit energies -----------------
394  t_DetIds->clear();
395  t_DetIds1->clear();
396  t_DetIds3->clear();
397  t_HitEnergies->clear();
398  t_HitEnergies1->clear();
399  t_HitEnergies3->clear();
400  int nRecHits(-999), nRecHits1(-999), nRecHits3(-999);
401  std::vector<DetId> ids, ids1, ids3;
402  //------ hcal energy in the main cone -------------------------------
403  t_eHcal = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
404  trkDetItr->pointECAL, a_coneR_,
405  trkDetItr->directionHCAL,nRecHits,
406  ids, *t_HitEnergies);
407  t_DetIds->reserve(ids.size());
408  for (unsigned int k = 0; k < ids.size(); ++k) {
409  t_DetIds->push_back(ids[k].rawId());
410  }
411  //----- hcal energy in the extended cone 1 (a_coneR+10) --------------
412  t_eHcal10 = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
413  trkDetItr->pointECAL, a_coneR_+10,
414  trkDetItr->directionHCAL,nRecHits1,
415  ids1, *t_HitEnergies1);
416  t_DetIds1->reserve(ids1.size());
417  for (unsigned int k = 0; k < ids1.size(); ++k) {
418  t_DetIds1->push_back(ids1[k].rawId());
419  }
420  //----- hcal energy in the extended cone 3 (a_coneR+30) --------------
421  t_eHcal30 = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
422  trkDetItr->pointECAL, a_coneR_+30,
423  trkDetItr->directionHCAL,nRecHits3,
424  ids3, *t_HitEnergies3);
425  t_DetIds3->reserve(ids3.size());
426  for (unsigned int k = 0; k < ids3.size(); ++k) {
427  t_DetIds3->push_back(ids3[k].rawId());
428  }
429 
430  t_p = pTrack->p();
431  t_pt = pTrack->pt();
432  t_phi = pTrack->phi();
433 #ifdef DebugLog
434  if (verbosity_%10 > 0) {
435  std::cout << "This track : " << nTracks << " (pt/eta/phi/p) :"
436  << pTrack->pt() << "/" << pTrack->eta() << "/"
437  << pTrack->phi() << "/" << t_p << std::endl;
438  std::cout << "e_MIP " << t_eMipDR << " Chg Isolation "
439  << t_hmaxNearP << " eHcal" << t_eHcal << " ieta "
440  << t_ieta << " Quality " << t_qltyMissFlag
441  << ":" << t_qltyPVFlag << ":" << t_selectTk
442  << std::endl;
443  for (unsigned int lll=0;lll<t_DetIds->size();lll++) {
444  std::cout << "det id is = " << t_DetIds->at(lll) << " "
445  << " hit enery is = " << t_HitEnergies->at(lll)
446  << std::endl;
447  }
448  }
449 #endif
450  tree->Fill();
451  } // end of conditions on t_eMipDR and t_hmaxNearP
452  } // end of loose check of track quality
453  } // end of loop over tracks
454 
455  h_nTrk->Fill(nTracks);
456  } // end of triggerOK
457 }
458 
460 
461  h_nVtx = fs_->make<TH1F>("h_nVtx","h_nVtx",100,0,100);
462  h_nTrk = fs_->make<TH1F>("h_nTrk","h_nTrk",100,0,2000);
463 
464  tree = fs_->make<TTree>("CalibTree", "CalibTree");
465 
466  tree->Branch("t_Run", &t_Run, "t_Run/I");
467  tree->Branch("t_Event", &t_Event, "t_Event/I");
468  tree->Branch("t_nVtx", &t_nVtx, "t_nVtx/I");
469  tree->Branch("t_nTrk", &t_nTrk, "t_nTrk/I");
470  tree->Branch("t_EventWeight", &t_EventWeight, "t_EventWeight/D");
471  tree->Branch("t_p", &t_p, "t_p/D");
472  tree->Branch("t_pt", &t_pt, "t_pt/D");
473  tree->Branch("t_ieta", &t_ieta, "t_ieta/I");
474  tree->Branch("t_phi", &t_phi, "t_phi/D");
475  tree->Branch("t_eMipDR", &t_eMipDR, "t_eMipDR/D");
476  tree->Branch("t_eHcal", &t_eHcal, "t_eHcal/D");
477  tree->Branch("t_eHcal10", &t_eHcal10, "t_eHcal10/D");
478  tree->Branch("t_eHcal30", &t_eHcal30, "t_eHcal30/D");
479  tree->Branch("t_hmaxNearP", &t_hmaxNearP, "t_hmaxNearP/D");
480  tree->Branch("t_selectTk", &t_selectTk, "t_selectTk/O");
481  tree->Branch("t_qltyMissFlag",&t_qltyMissFlag,"t_qltyMissFlag/O");
482  tree->Branch("t_qltyPVFlag", &t_qltyPVFlag, "t_qltyPVFlag/O)");
483 
484  t_DetIds = new std::vector<unsigned int>();
485  t_DetIds1 = new std::vector<unsigned int>();
486  t_DetIds3 = new std::vector<unsigned int>();
487  t_HitEnergies = new std::vector<double>();
488  t_HitEnergies1 = new std::vector<double>();
489  t_HitEnergies3 = new std::vector<double>();
490 
491  tree->Branch("t_DetIds", "std::vector<unsigned int>", &t_DetIds);
492 //tree->Branch("t_DetIds1", "std::vector<unsigned int>", &t_DetIds1);
493 //tree->Branch("t_DetIds3", "std::vector<unsigned int>", &t_DetIds3);
494  tree->Branch("t_HitEnergies", "std::vector<double>", &t_HitEnergies);
495 //tree->Branch("t_HitEnergies1", "std::vector<double>", &t_HitEnergies1);
496 //tree->Branch("t_HitEnergies3", "std::vector<double>", &t_HitEnergies3);
497 }
498 
499 // ------------ method called when starting to processes a run ------------
500 void IsoTrackCalibration::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
501 
502  bool changed_(true);
503  bool flag = hltConfig_.init(iRun,iSetup,"HLT",changed_);
504  edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run()
505  << " process HLT init flag "
506  << flag << " change flag " << changed_;
507 
508  // check if trigger names in (new) config
509  if (changed_) {
510  changed_ = false;
511  edm::LogInfo("HcalIsoTrack") << "New trigger menu found !!!";
512  const unsigned int n(hltConfig_.size());
513  for (unsigned itrig=0; itrig<trigNames_.size(); itrig++) {
514  unsigned int triggerindx = hltConfig_.triggerIndex(trigNames_[itrig]);
515  if (triggerindx >= n) {
516  edm::LogWarning("HcalIsoTrack") << trigNames_[itrig] << " "
517  << triggerindx << " does not exist in "
518  << "the current menu";
519  } else {
520  edm::LogInfo("HcalIsoTrack") << trigNames_[itrig] << " "
521  << triggerindx << " exists";
522  }
523  }
524  }
525 }
526 
527 // ------------ method called when ending the processing of a run ------------
529  ++nRun_;
530  edm::LogWarning("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run();
531 }
532 
533 // ------------ method called when starting to processes a luminosity block ------------
535 // ------------ method called when ending the processing of a luminosity block ------------
537 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
539  //The following says we do not know what parameters are allowed so do no validation
540  // Please change this to state exactly what you do use, even if it is no parameters
542  desc.setUnknown();
543  descriptions.addDefault(desc);
544 }
545 
546 //define this as a plug-in
548 
RunNumber_t run() const
Definition: EventID.h:39
unsigned int size() const
number of trigger paths in trigger table
std::vector< double > * t_HitEnergies3
double p() const
momentum vector magnitude
Definition: TrackBase.h:654
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, int useRaw=0, bool debug=false)
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
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)
edm::InputTag theTriggerResultsLabel_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
RunNumber_t run() const
Definition: RunBase.h:40
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
TrackQuality
track quality
Definition: TrackBase.h:151
void beginRun(edm::Run const &, edm::EventSetup const &) override
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:684
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double weight() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< unsigned int > * t_DetIds1
std::vector< unsigned int > * t_DetIds3
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:690
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)
unsigned int size() const
Get number of paths stored.
double pt() const
track transverse momentum
Definition: TrackBase.h:660
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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)
static std::string const triggerResults
Definition: EdmProvDump.cc:45
IsoTrackCalibration(const edm::ParameterSet &)
bool isValid() const
Definition: HandleBase.h:74
std::vector< double > * t_HitEnergies
std::vector< std::string > trigNames_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
int k[5][pyjets_maxn]
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:134
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::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:59
void analyze(edm::Event const &, edm::EventSetup const &) override
spr::trackSelectionParameters selectionParameters_
T get() const
Definition: EventSetup.h:71
reco::TrackBase::TrackQuality minQuality
void endRun(edm::Run const &, edm::EventSetup const &) override
const Point & position() const
position
Definition: BeamSpot.h:62
Definition: tree.py:1
edm::Service< TFileService > fs_
std::vector< double > * t_HitEnergies1
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
T const * product() const
Definition: ESHandle.h:86
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:256
Definition: Run.h:45
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_