CMS 3D CMS Logo

HSCPValidator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HSCP
4 // Class: HSCPValidator
5 //
13 //
14 // Original Author: Seth Cooper,27 1-024,+41227672342,
15 // Created: Wed Apr 14 14:27:52 CEST 2010
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <vector>
22 #include <string>
23 #include <map>
24 
25 // user include files
74 
77 
78 #include "TH1.h"
79 #include "TGraph.h"
80 #include "TCanvas.h"
81 
83 
84 //
85 // constants, enums and typedefs
86 //
87 
88 //
89 // static data member definitions
90 //
92 
93 //
94 // constructors and destructor
95 //
97  : doGenPlots_(iConfig.getParameter<bool>("MakeGenPlots")),
98  doHLTPlots_(iConfig.getParameter<bool>("MakeHLTPlots")),
99  doSimTrackPlots_(iConfig.getParameter<bool>("MakeSimTrackPlots")),
100  doSimDigiPlots_(iConfig.getParameter<bool>("MakeSimDigiPlots")),
101  doRecoPlots_(iConfig.getParameter<bool>("MakeRecoPlots")),
102  token_(consumes<edm::HepMCProduct>(iConfig.getParameter<edm::InputTag>("generatorLabel"))),
103  simTracksToken_(consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"))),
104  trEvToken_(consumes<trigger::TriggerEvent>(edm::InputTag("hltTriggerSummaryAOD"))),
105  tkTracksToken_(consumes<reco::TrackCollection>(edm::InputTag("generalTracks"))),
106  dEdxTrackToken_(consumes<edm::ValueMap<reco::DeDxData> >(edm::InputTag("dedxHarmonic2"))),
107  rpcRecHitsToken_(consumes<RPCRecHitCollection>(edm::InputTag("rpcRecHits"))),
108  triggerResultsToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults", "", "HLT"))),
109  particleIds_(iConfig.getParameter<std::vector<int> >("particleIds")),
110  particleStatus_(iConfig.getUntrackedParameter<int>("particleStatus", 1)),
111  ebSimHitToken_(consumes<edm::PCaloHitContainer>(iConfig.getParameter<edm::InputTag>("EBSimHitCollection"))),
112  eeSimHitToken_(consumes<edm::PCaloHitContainer>(iConfig.getParameter<edm::InputTag>("EESimHitCollection"))),
113  simTrackToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("SimTrackCollection"))),
114  EBDigiCollectionToken_(consumes<EBDigiCollection>(iConfig.getParameter<edm::InputTag>("EBDigiCollection"))),
115  EEDigiCollectionToken_(consumes<EEDigiCollection>(iConfig.getParameter<edm::InputTag>("EEDigiCollection"))) {
116  //now do what ever initialization is needed
117  // GEN
118  particleEtaHist_ = fileService->make<TH1F>("particleEta", "Eta of gen particle", 100, -5, 5);
119  particlePhiHist_ = fileService->make<TH1F>("particlePhi", "Phi of gen particle", 180, -3.15, 3.15);
120  particlePHist_ = fileService->make<TH1F>("particleP", "Momentum of gen particle", 500, 0, 2000);
121  particlePtHist_ = fileService->make<TH1F>("particlePt", "P_{T} of gen particle", 500, 0, 2000);
122  particleMassHist_ = fileService->make<TH1F>("particleMass", "Mass of gen particle", 1000, 0, 2000);
123  particleStatusHist_ = fileService->make<TH1F>("particleStatus", "Status of gen particle", 10, 0, 10);
124  particleBetaHist_ = fileService->make<TH1F>("particleBeta", "Beta of gen particle", 100, 0, 1);
125  particleBetaInverseHist_ = fileService->make<TH1F>("particleBetaInverse", "1/#beta of gen particle", 100, 0, 5);
126 
127  h_genhscp_met = fileService->make<TH1F>("hscp_met", "missing E_{T} hscp", 100, 0., 1500.);
128  h_genhscp_met_nohscp = fileService->make<TH1F>("hscp_met_nohscp", "missing E_{T} w/o hscp", 100, 0., 1500.);
129  h_genhscp_scaloret = fileService->make<TH1F>("hscp_scaloret", "scalor E_{T} sum", 100, 0., 1500.);
131  fileService->make<TH1F>("hscp_scaloret_nohscp", "scalor E_{T} sum w/o hscp", 100, 0., 1500.);
132 
133  //SIM track Info
134  simTrackParticleEtaHist_ = fileService->make<TH1F>("simTrackParticleEta", "Eta of simTrackParticle", 100, -5, 5);
136  fileService->make<TH1F>("simTrackParticlePhi", "Phi of simTrackParticle", 180, -3.15, 3.15);
137  simTrackParticlePHist_ = fileService->make<TH1F>("simTrackParticleP", "Momentum of simTrackParticle", 500, 0, 2000);
138  simTrackParticlePtHist_ = fileService->make<TH1F>("simTrackParticlePt", "P_{T} of simTrackParticle", 500, 0, 2000);
139  simTrackParticleBetaHist_ = fileService->make<TH1F>("simTrackParticleBeta", "Beta of simTrackParticle", 100, 0, 1);
140  //reco track Info
141 
142  RecoHSCPPtVsGenPt = fileService->make<TH2F>("Recovsgenpt", "RecovsGen", 100, 0, 1000, 100, 0, 1000);
143  dedxVsp = fileService->make<TH2F>("dedxvsp", "dedxvsp", 100, 0, 1000, 100, 0, 10);
144  //HLT Info
145  hltmet = fileService->make<TH1F>("HLT_MET", "MET", 3, -1, 2);
146  hltjet = fileService->make<TH1F>("HLT_JET", "JET", 3, -1, 2);
147  hltmu = fileService->make<TH1F>("HLT_Mu", "Mu", 3, -1, 2);
148 
149  // SIM-DIGI: ECAL
151  fileService->make<TH1F>("ecalEnergyOfSimHitsEB", "HSCP SimTrack-matching SimHit energy EB [GeV]", 125, -1, 4);
153  fileService->make<TH1F>("ecalEnergyOfSimHitsEE", "HSCP SimTrack-matching SimHit energy EE [GeV]", 125, -1, 4);
155  fileService->make<TH1F>("ecalTimingOfSimHitsEB", "HSCP SimTrack-matching SimHit time EB [ns]", 115, -15, 100);
157  fileService->make<TH1F>("ecalTimingOfSimHitsEE", "HSCP SimTrack-matching SimHit time EE [ns]", 115, -15, 100);
159  "ecalNumberOfSimHitsEB", "Number of HSCP SimTrack-matching EB sim hits in event", 100, 0, 200);
161  "ecalNumberOfSimHitsEE", "Number of HSCP SimTrack-matching EE sim hits in event", 100, 0, 200);
163  fileService->make<TH2F>("ecalEnergyVsTimeOfSimHitsEB",
164  "Energy vs. time of HSCP SimTrack-matching EB sim hits in event",
165  115,
166  -15,
167  100,
168  125,
169  -1,
170  4);
172  fileService->make<TH2F>("ecalEnergyVsTimeOfSimHitsEE",
173  "Energy vs. time of HSCP SimTrack-matching EE sim hits in event",
174  115,
175  -15,
176  100,
177  125,
178  -1,
179  4);
181  fileService->make<TH1F>("ecalEnergyOfDigiMatSimHitsEB", "HSCP digi-matching SimHit energy EB [GeV]", 125, -1, 4);
183  fileService->make<TH1F>("ecalEnergyOfDigiMatSimHitsEE", "HSCP digi-matching SimHit energy EE [GeV]", 125, -1, 4);
185  fileService->make<TH1F>("ecalTimingOfDigiMatSimHitsEB", "HSCP digi-matching SimHit time EB [ns]", 115, -15, 100);
187  fileService->make<TH1F>("ecalTimingOfDigiMatSimHitsEE", "HSCP digi-matching SimHit time EE [ns]", 115, -15, 100);
189  "ecalEnergyVsTimeOfDigiMatSimHitsEB", "HSCP digi-matching EB SimHit energy vs. time", 115, -15, 100, 125, -1, 4);
191  "ecalEnergyVsTimeOfDigiMatSimHitsEE", "HSCP digi-matching EE SimHit energy vs. time", 115, -15, 100, 125, -1, 4);
193  fileService->make<TH1F>("ecalIEtaOfDigiMatchSimHits", "iEta of digi-matching Ecal simHits (EB)", 171, -85, 86);
195  fileService->make<TH1F>("ecalIPhiOfDigiMatchSimHits", "iPhi of digi-matching Ecal simHits (EB)", 360, 1, 361);
197  fileService->make<TH1F>("ecalDigisNumberEB", "Number of EB digis matching simhits in event", 200, 0, 1000);
199  fileService->make<TH1F>("ecalDigisNumberEE", "Number of EE digis matching simhits in event", 200, 0, 1000);
201  "ecalDigiOccupancyMapEB", "Occupancy of simhit-matching digis EB;i#phi;i#eta", 360, 1, 361, 171, -85, 86);
203  "ecalDigiOccupancyMapEEM", "Occupancy of simhit-matching digis EEM;ix;iy", 100, 1, 100, 100, 1, 100);
205  "ecalDigiOccupancyMapEEP", "Occupancy of simhit-matching digis EEP;ix;iy", 100, 1, 100, 100, 1, 100);
206 
207  // SIM-DIGI: RPC
209  fileService->make<TH1F>("residualsRPCRecHitSimDigis", "HSCP SimHit - Clossest RPC RecHit", 100, -5, 5);
211  fileService->make<TH1F>("efficiencyRPCRecHitSimDigis", "HSCP SimHits RecHits Efficiency", 2, -0.5, 1.5);
212  cluSizeDistribution_ = fileService->make<TH1F>("RPCCluSizeDistro", "RPC HSCP CluSize Distribution", 11, -0.5, 10.5);
213  rpcTimeOfFlightBarrel_[0] = fileService->make<TH1F>("RPCToFLayer1", "RPC HSCP Time Of Flight Layer 1", 50, 5, 100);
214  rpcTimeOfFlightBarrel_[1] = fileService->make<TH1F>("RPCToFLayer2", "RPC HSCP Time Of Flight Layer 2", 50, 5, 100);
215  rpcTimeOfFlightBarrel_[2] = fileService->make<TH1F>("RPCToFLayer3", "RPC HSCP Time Of Flight Layer 3", 50, 5, 100);
216  rpcTimeOfFlightBarrel_[3] = fileService->make<TH1F>("RPCToFLayer4", "RPC HSCP Time Of Flight Layer 4", 50, 5, 100);
217  rpcTimeOfFlightBarrel_[4] = fileService->make<TH1F>("RPCToFLayer5", "RPC HSCP Time Of Flight Layer 5", 50, 5, 100);
218  rpcTimeOfFlightBarrel_[5] = fileService->make<TH1F>("RPCToFLayer6", "RPC HSCP Time Of Flight Layer 6", 50, 5, 100);
219  rpcBXBarrel_[0] = fileService->make<TH1F>("RPCBXLayer1", "RPC HSCP BX Layer 1", 5, -0.5, 4.5);
220  rpcBXBarrel_[1] = fileService->make<TH1F>("RPCBXLayer2", "RPC HSCP BX Layer 2", 5, -0.5, 4.5);
221  rpcBXBarrel_[2] = fileService->make<TH1F>("RPCBXLayer3", "RPC HSCP BX Layer 3", 5, -0.5, 4.5);
222  rpcBXBarrel_[3] = fileService->make<TH1F>("RPCBXLayer4", "RPC HSCP BX Layer 4", 5, -0.5, 4.5);
223  rpcBXBarrel_[4] = fileService->make<TH1F>("RPCBXLayer5", "RPC HSCP BX Layer 5", 5, -0.5, 4.5);
224  rpcBXBarrel_[5] = fileService->make<TH1F>("RPCBXLayer6", "RPC HSCP BX Layer 6", 5, -0.5, 4.5);
225  rpcTimeOfFlightEndCap_[0] = fileService->make<TH1F>("RPCToFDisk1", "RPC HSCP Time Of Flight Disk 1", 50, 5, 100);
226  rpcTimeOfFlightEndCap_[1] = fileService->make<TH1F>("RPCToFDisk2", "RPC HSCP Time Of Flight Disk 2", 50, 5, 100);
227  rpcTimeOfFlightEndCap_[2] = fileService->make<TH1F>("RPCToFDisk3", "RPC HSCP Time Of Flight Disk 3", 50, 5, 100);
228  rpcBXEndCap_[0] = fileService->make<TH1F>("RPCBXDisk1", "RPC HSCP BX Disk 1", 5, -0.5, 4.5);
229  rpcBXEndCap_[1] = fileService->make<TH1F>("RPCBXDisk2", "RPC HSCP BX Disk 2", 5, -0.5, 4.5);
230  rpcBXEndCap_[2] = fileService->make<TH1F>("RPCBXDisk3", "RPC HSCP BX Disk 3", 5, -0.5, 4.5);
231 }
232 
234  // do anything here that needs to be done at desctruction time
235  // (e.g. close files, deallocate resources etc.)
236  // particleEtaHist_ = fileService->make<TH1F>("particleEta","Eta of gen particle",100,-5,5);
237  // particlePhiHist_ = fileService->make<TH1F>("particlePhi","Phi of gen particle",180,-3.15,3.15);
238  // particlePHist_ = fileService->make<TH1F>("particleP","Momentum of gen particle",500,0,2000);
239  // particlePtHist_ = fileService->make<TH1F>("particlePt","P_{T} of gen particle",500,0,2000);
240  // particleMassHist_ = fileService->make<TH1F>("particleMass","Mass of gen particle",1000,0,2000);
241  // particleStatusHist_ = fileService->make<TH1F>("particleStatus","Status of gen particle",10,0,10);
242  // particleBetaHist_ = fileService->make<TH1F>("particleBeta","Beta of gen particle",100,0,1);
243  // particleBetaInverseHist_ = fileService->make<TH1F>("particleBetaInverse","1/#beta of gen particle",100,0,5);
244 }
245 
246 //
247 // member functions
248 //
249 
250 // ------------ method called to for each event ------------
252  using namespace edm;
253  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
254 
255  if (doGenPlots_)
257  if (doSimTrackPlots_)
259  if (doSimDigiPlots_) {
262  }
263  if (doHLTPlots_) {
265  }
266  if (doRecoPlots_) {
268  }
269 }
270 
271 // ------------ method called once each job just before starting event loop ------------
273 
274 // ------------ method called once each job just after ending the event loop ------------
276  std::string frequencies = "";
277  for (std::map<int, int>::const_iterator itr = particleIdsFoundMap_.begin(); itr != particleIdsFoundMap_.end();
278  ++itr) {
279  frequencies += "PDG ID: ";
280  frequencies += intToString(itr->first);
281  frequencies += " Frequency: ";
282  frequencies += intToString(itr->second);
283  frequencies += "\n";
284  }
285  std::cout << "Found PDGIds: "
286  << "\n\n"
287  << frequencies << std::endl;
288 }
289 
290 // ------------- Make gen plots ---------------------------------------------------------
292  using namespace edm;
293 
294  double missingpx = 0;
295  double missingpy = 0;
296  double missingpx_nohscp = 0;
297  double missingpy_nohscp = 0;
298  double scalorEt = 0;
299  double scalorEt_nohscp = 0;
300 
302  iEvent.getByToken(token_, evt);
303 
304  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
305  for (HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p) {
306  if ((*p)->status() != particleStatus_)
307  continue;
308  //calculate MET(neutrino as MET)
309  if (abs((*p)->pdg_id()) != 12 && abs((*p)->pdg_id()) != 14 &&
310  abs((*p)->pdg_id()) != 16) { //for non-neutrino particles.
311  missingpx -= (*p)->momentum().px();
312  missingpy -= (*p)->momentum().py();
313  scalorEt += (*p)->momentum().perp();
314  }
315 
316  // Check if the particleId is in our R-hadron list
317  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), (*p)->pdg_id());
318  if (partIdItr == particleIds_.end()) {
319  //calculate MET(neutrino+ HSCP as MET)
320  if (abs((*p)->pdg_id()) != 12 && abs((*p)->pdg_id()) != 14 &&
321  abs((*p)->pdg_id()) != 16) { //for non-neutrino particles.
322  missingpx_nohscp -= (*p)->momentum().px();
323  missingpy_nohscp -= (*p)->momentum().py();
324  scalorEt_nohscp += (*p)->momentum().perp();
325  }
326  } else {
327  particleStatusHist_->Fill((*p)->status());
328 
329  std::pair<std::map<int, int>::iterator, bool> pair =
330  particleIdsFoundMap_.insert(std::make_pair<int, int>((*p)->pdg_id(), 1));
331  if (!pair.second) {
332  ++(pair.first->second);
333  }
334 
335  double mag = sqrt(pow((*p)->momentum().px(), 2) + pow((*p)->momentum().py(), 2) + pow((*p)->momentum().pz(), 2));
336  particleEtaHist_->Fill((*p)->momentum().eta());
337  particlePhiHist_->Fill((*p)->momentum().phi());
338  particlePHist_->Fill(mag);
339  particlePtHist_->Fill((*p)->momentum().perp());
340  particleMassHist_->Fill((*p)->generated_mass());
341  float particleP = mag;
342  float particleM = (*p)->generated_mass();
343  particleBetaHist_->Fill(particleP / sqrt(particleP * particleP + particleM * particleM));
344  particleBetaInverseHist_->Fill(sqrt(particleP * particleP + particleM * particleM) / particleP);
345  }
346  }
347 
348  h_genhscp_met->Fill(sqrt(missingpx * missingpx + missingpy * missingpy));
349  h_genhscp_met_nohscp->Fill(sqrt(missingpx_nohscp * missingpx_nohscp + missingpy_nohscp * missingpy_nohscp));
350  h_genhscp_scaloret->Fill(scalorEt);
351  h_genhscp_scaloret_nohscp->Fill(scalorEt_nohscp);
352 
353  delete myGenEvent;
354 }
355 
356 // ------------- Make SimTrack plots ---------------------------------------------------------
358  using namespace edm;
359  //get sim track infos
360  Handle<edm::SimTrackContainer> simTracksHandle;
361  iEvent.getByToken(simTracksToken_, simTracksHandle);
362  const SimTrackContainer simTracks = *(simTracksHandle.product());
363 
364  SimTrackContainer::const_iterator simTrack;
365 
366  for (simTrack = simTracks.begin(); simTrack != simTracks.end(); ++simTrack) {
367  // Check if the particleId is in our list
368  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), simTrack->type());
369  if (partIdItr == particleIds_.end())
370  continue;
371 
372  simTrackParticleEtaHist_->Fill((*simTrack).momentum().eta());
373  simTrackParticlePhiHist_->Fill((*simTrack).momentum().phi());
374  simTrackParticlePHist_->Fill((*simTrack).momentum().P());
375 
376  simTrackParticlePtHist_->Fill((*simTrack).momentum().pt());
377 
378  simTrackParticleBetaHist_->Fill((*simTrack).momentum().P() / (*simTrack).momentum().e());
379 
380  // std::cout<<"Particle:"<<simTrack->type()<<" Charge:"<<simTrack->charge()<<std::endl;
381  }
382 }
383 // ------------- Make HLT plots ---------------------------------------------------------
385  using namespace edm;
386  //get HLT infos
387 
390 
391  edm::TriggerResultsByName tr(nullptr, nullptr);
392  if (triggerResults.isValid()) {
393  tr = iEvent.triggerResultsByName(*triggerResults);
394  }
395 
396  if (!tr.isValid()) {
397  std::cout << "Trigger Results not available" << std::endl;
398  }
399 
401  iEvent.getByToken(trEvToken_, trEvHandle);
402  trigger::TriggerEvent trEv = *trEvHandle;
403 
404  unsigned int TrIndex_Unknown = tr.size();
405 
406  // HLT TRIGGER BASED ON 1 MUON!
407  if (TrIndex_Unknown != tr.triggerIndex("HLT_Mu40_v1")) {
408  if (tr.accept(tr.triggerIndex("HLT_Mu40_v1")))
409  hltmu->Fill(1);
410  else {
411  hltmu->Fill(0);
412  }
413  } else {
414  if (TrIndex_Unknown != tr.triggerIndex("HLT_Mu30_v1")) {
415  if (IncreasedTreshold(trEv, InputTag("hltSingleMu30L3Filtered30", "", "HLT"), 40, 2.1, 1, false))
416  hltmu->Fill(1);
417  else
418  hltmu->Fill(0);
419  } else {
420  printf("BUG with HLT_Mu\n");
421  std::cout << "trigger names are : ";
422  for (unsigned int i = 0; i < tr.size(); i++) {
423  std::cout << " " << tr.triggerName(i);
424  }
425  std::cout << std::endl;
426  }
427  }
428 
429  // HLT TRIGGER BASED ON MET!
430  if (TrIndex_Unknown != tr.triggerIndex("HLT_PFMHT150_v3")) {
431  if (tr.accept(tr.triggerIndex("HLT_PFMHT150_v3")))
432  hltmet->Fill(1);
433  else
434  hltmet->Fill(0);
435  } else {
436  if (TrIndex_Unknown != tr.triggerIndex("HLT_PFMHT150_v2")) {
437  if (tr.accept(tr.triggerIndex("HLT_PFMHT150_v2")))
438  hltmet->Fill(1);
439  else
440  hltmet->Fill(0);
441  } else {
442  printf("BUG with HLT_MET\n");
443  }
444  }
445 
446  // HLT TRIGGER BASED ON 1 JET!
447  if (TrIndex_Unknown != tr.triggerIndex("HLT_Jet370_v1")) {
448  if (tr.accept(tr.triggerIndex("HLT_Jet370_v1")))
449  hltjet->Fill(1);
450  else
451  hltjet->Fill(0);
452  } else {
453  if (TrIndex_Unknown != tr.triggerIndex("HLT_Jet100U")) {
454  if (IncreasedTreshold(trEv, InputTag("hlt1jet100U", "", "HLT"), 140, 5., 1, false))
455  hltjet->Fill(1);
456  else
457  hltjet->Fill(0);
458  } else {
459  if (TrIndex_Unknown != tr.triggerIndex("HLT_Jet70U")) {
460  if (IncreasedTreshold(trEv, InputTag("hlt1jet70U", "", "HLT"), 140, 5., 1, false))
461  hltjet->Fill(1);
462  else
463  hltjet->Fill(0);
464  } else {
465  if (TrIndex_Unknown != tr.triggerIndex("HLT_Jet50U")) {
466  if (IncreasedTreshold(trEv, InputTag("hlt1jet50U", "", "HLT"), 140, 2.5, 1, false))
467  hltjet->Fill(1);
468  else
469  hltjet->Fill(0);
470  } else {
471  printf("BUG with HLT_Jet\n");
472  }
473  }
474  }
475  }
476 }
477 
478 // ------------- Make simDigi plots ECAL ------------------------------------------------
480  using namespace edm;
481  // EB SimHits
482  Handle<PCaloHitContainer> ebSimHits;
483  iEvent.getByToken(ebSimHitToken_, ebSimHits);
484  if (!ebSimHits.isValid()) {
485  std::cout << "Cannot get EBSimHits from event!" << std::endl;
486  return;
487  }
488  // EE SimHits
490  iEvent.getByToken(eeSimHitToken_, eeSimHits);
491  if (!eeSimHits.isValid()) {
492  std::cout << "Cannot get EESimHits from event!" << std::endl;
493  return;
494  }
495  // SimTracks
497  iEvent.getByToken(simTrackToken_, simTracks);
498  if (!simTracks.isValid()) {
499  std::cout << "Cannot get SimTracks from event!" << std::endl;
500  return;
501  }
502  // EB Digis
503  Handle<EBDigiCollection> ebDigis;
504  iEvent.getByToken(EBDigiCollectionToken_, ebDigis);
505  if (!ebDigis.isValid()) {
506  std::cout << "Cannot get EBDigis from event!" << std::endl;
507  return;
508  }
509  // EE Digis
512  if (!eeDigis.isValid()) {
513  std::cout << "Cannot get EEDigis from event!" << std::endl;
514  return;
515  }
516 
517  // EB first
518  // 1) Look at SimTracks, getting only the HSCP tracks
519  // 2) Match to PCaloHits
520  // 3) Match to digis
521  int numMatchedSimHitsEventEB = 0;
522  int numMatchedDigisEventEB = 0;
523  const PCaloHitContainer* phitsEB = nullptr;
524  phitsEB = ebSimHits.product();
525  for (SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack) {
526  // Check if the particleId is in our list
527  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), simTrack->type());
528  if (partIdItr == particleIds_.end())
529  continue;
530 
531  PCaloHitContainer mySimHitsEB;
532  std::vector<EBDataFrame> myDigisEB;
533 
534  //int particleId = simTrack->type();
535  int trackId = simTrack->trackId();
536  PCaloHitContainer::const_iterator simHitItr = phitsEB->begin();
537  while (simHitItr != phitsEB->end()) {
538  if (simHitItr->geantTrackId() == trackId)
539  mySimHitsEB.push_back(*simHitItr);
540  ++simHitItr;
541  }
542  if (mySimHitsEB.empty()) {
543  std::cout << "Could not find matching EB PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack"
544  << std::endl;
545  continue;
546  }
547 
548  // Loop over matching PCaloHits
549  for (simHitItr = mySimHitsEB.begin(); simHitItr != mySimHitsEB.end(); ++simHitItr) {
550  simHitsEcalEnergyHistEB_->Fill(simHitItr->energy());
551  simHitsEcalTimeHistEB_->Fill(simHitItr->time());
552  simHitsEcalEnergyVsTimeHistEB_->Fill(simHitItr->time(), simHitItr->energy());
553  EBDetId simHitId = EBDetId(simHitItr->id());
554  std::cout << "SimHit DetId found: " << simHitId << " for PDGid: " << simTrack->type() << std::endl;
555  //std::cout << "SimHit hashedIndex: " << simHitId.hashedIndex() << std::endl;
556  std::cout << "SimHit energy: " << simHitItr->energy() << " time: " << simHitItr->time() << std::endl;
557  ++numMatchedSimHitsEventEB;
558 
559  EBDigiCollection::const_iterator digiItr = ebDigis->begin();
560  while (digiItr != ebDigis->end() && (digiItr->id() != simHitId))
561  ++digiItr;
562  if (digiItr == ebDigis->end()) {
563  // Commented out for debugging ease, Aug 3 2009
564  std::cout << "Could not find simHit detId: " << simHitId << "in EBDigiCollection!" << std::endl;
565  continue;
566  }
567  std::vector<EBDataFrame>::const_iterator myDigiItr = myDigisEB.begin();
568  while (myDigiItr != myDigisEB.end() && (digiItr->id() != myDigiItr->id()))
569  ++myDigiItr;
570  if (myDigiItr != myDigisEB.end())
571  continue; // if this digi is already in the list, skip it
572 
573  ++numMatchedDigisEventEB;
574  EBDataFrame df = *digiItr;
575  myDigisEB.push_back(df);
576  std::cout << "SAMPLE ADCs: "
577  << "\t";
578  for (int i = 0; i < 10; ++i)
579  std::cout << i << "\t";
580  std::cout << std::endl << "\t\t";
581  for (int i = 0; i < df.size(); ++i) {
582  std::cout << df.sample(i).adc() << "\t";
583  }
584  std::cout << std::endl << std::endl;
585 
586  simHitsEcalDigiMatchEnergyHistEB_->Fill(simHitItr->energy());
587  simHitsEcalDigiMatchTimeHistEB_->Fill(simHitItr->time());
588  simHitsEcalDigiMatchEnergyVsTimeHistEB_->Fill(simHitItr->time(), simHitItr->energy());
589  simHitsEcalDigiMatchIEtaHist_->Fill(((EBDetId)digiItr->id()).ieta());
590  simHitsEcalDigiMatchIPhiHist_->Fill(((EBDetId)digiItr->id()).iphi());
591  digiOccupancyMapEB_->Fill(((EBDetId)digiItr->id()).iphi(), ((EBDetId)digiItr->id()).ieta());
592  }
593  }
594  simHitsEcalNumHistEB_->Fill(numMatchedSimHitsEventEB);
595  digisEcalNumHistEB_->Fill(numMatchedDigisEventEB);
596 
597  // EE next
598  int numMatchedSimHitsEventEE = 0;
599  int numMatchedDigisEventEE = 0;
600  const PCaloHitContainer* phitsEE = nullptr;
601  phitsEE = eeSimHits.product();
602  for (SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack) {
603  // Check if the particleId is in our list
604  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), simTrack->type());
605  if (partIdItr == particleIds_.end())
606  continue;
607 
608  PCaloHitContainer mySimHitsEE;
609  std::vector<EEDataFrame> myDigisEE;
610 
611  //int particleId = simTrack->type();
612  int trackId = simTrack->trackId();
613  PCaloHitContainer::const_iterator simHitItr = phitsEE->begin();
614  while (simHitItr != phitsEE->end()) {
615  if (simHitItr->geantTrackId() == trackId)
616  mySimHitsEE.push_back(*simHitItr);
617  ++simHitItr;
618  }
619  if (mySimHitsEE.empty()) {
620  std::cout << "Could not find matching EE PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack"
621  << std::endl;
622  continue;
623  }
624 
625  // Loop over matching PCaloHits
626  for (simHitItr = mySimHitsEE.begin(); simHitItr != mySimHitsEE.end(); ++simHitItr) {
627  simHitsEcalEnergyHistEE_->Fill(simHitItr->energy());
628  simHitsEcalTimeHistEE_->Fill(simHitItr->time());
629  simHitsEcalEnergyVsTimeHistEE_->Fill(simHitItr->time(), simHitItr->energy());
630  EEDetId simHitId = EEDetId(simHitItr->id());
631  std::cout << "SimHit DetId found: " << simHitId << " for PDGid: " << simTrack->type() << std::endl;
632  //std::cout << "SimHit hashedIndex: " << simHitId.hashedIndex() << std::endl;
633  std::cout << "SimHit energy: " << simHitItr->energy() << " time: " << simHitItr->time() << std::endl;
634  ++numMatchedSimHitsEventEE;
635 
636  EEDigiCollection::const_iterator digiItr = eeDigis->begin();
637  while (digiItr != eeDigis->end() && (digiItr->id() != simHitId))
638  ++digiItr;
639  if (digiItr == eeDigis->end()) {
640  // Commented out for debugging ease, Aug 3 2009
641  std::cout << "Could not find simHit detId: " << simHitId << "in EEDigiCollection!" << std::endl;
642  continue;
643  }
644  std::vector<EEDataFrame>::const_iterator myDigiItr = myDigisEE.begin();
645  while (myDigiItr != myDigisEE.end() && (digiItr->id() != myDigiItr->id()))
646  ++myDigiItr;
647  if (myDigiItr != myDigisEE.end())
648  continue; // if this digi is already in the list, skip it
649 
650  ++numMatchedDigisEventEE;
651  EEDataFrame df = *digiItr;
652  myDigisEE.push_back(df);
653  std::cout << "SAMPLE ADCs: "
654  << "\t";
655  for (int i = 0; i < 10; ++i)
656  std::cout << i << "\t";
657  std::cout << std::endl << "\t\t";
658  for (int i = 0; i < df.size(); ++i) {
659  std::cout << df.sample(i).adc() << "\t";
660  }
661  std::cout << std::endl << std::endl;
662 
663  simHitsEcalDigiMatchEnergyHistEE_->Fill(simHitItr->energy());
664  simHitsEcalDigiMatchTimeHistEE_->Fill(simHitItr->time());
665  simHitsEcalDigiMatchEnergyVsTimeHistEE_->Fill(simHitItr->time(), simHitItr->energy());
666  if (((EEDetId)digiItr->id()).zside() > 0)
667  digiOccupancyMapEEP_->Fill(((EEDetId)digiItr->id()).ix(), ((EEDetId)digiItr->id()).iy());
668  else if (((EEDetId)digiItr->id()).zside() < 0)
669  digiOccupancyMapEEM_->Fill(((EEDetId)digiItr->id()).ix(), ((EEDetId)digiItr->id()).iy());
670  }
671  }
672  simHitsEcalNumHistEE_->Fill(numMatchedSimHitsEventEE);
673  digisEcalNumHistEE_->Fill(numMatchedDigisEventEE);
674 }
675 // ------------- Make Reco plots ---------------------------------------------------------
677  using namespace edm;
678  using namespace reco;
679 
681  iEvent.getByToken(token_, evt);
682 
683  Handle<TrackCollection> tkTracks;
684  iEvent.getByToken(tkTracksToken_, tkTracks);
685  const reco::TrackCollection tkTC = *(tkTracks.product());
686 
687  Handle<ValueMap<DeDxData> > dEdxTrackHandle;
688  iEvent.getByToken(dEdxTrackToken_, dEdxTrackHandle);
689  const ValueMap<DeDxData> dEdxTrack = *dEdxTrackHandle.product();
690 
691  for (size_t i = 0; i < tkTracks->size(); i++) {
692  reco::TrackRef trkRef = reco::TrackRef(tkTracks, i);
693 
694  if (trkRef->pt() < 5 || trkRef->normalizedChi2() > 10)
695  continue;
696 
697  double minR = 999;
698  double hscpgenPt = -1;
699 
700  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
701  for (HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p) {
702  if ((*p)->status() != particleStatus_)
703  continue;
704  // Check if the particleId is in our R-hadron list
705  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), (*p)->pdg_id());
706  if (partIdItr != particleIds_.end()) {
707  //calculate DeltaR
708  double distance =
709  pow((*p)->momentum().eta() - trkRef->eta(), 2) + pow((*p)->momentum().phi() - trkRef->phi(), 2);
711  if (distance < minR) {
712  minR = distance;
713  hscpgenPt = (*p)->momentum().perp();
714  }
715  }
716  }
717  RecoHSCPPtVsGenPt->Fill(trkRef->pt(), hscpgenPt);
718 
719  delete myGenEvent;
720  double dedx = dEdxTrack[trkRef].dEdx();
721  dedxVsp->Fill(trkRef->p(), dedx);
722  }
723 }
724 
725 // ------------- Make simDigi plots RPC -------------------------------------------------
727  using namespace edm;
728 
729  //std::cout << " Getting the SimHits " <<std::endl;
730  std::vector<Handle<edm::PSimHitContainer> > theSimHitContainers;
731  iEvent.getManyByType(theSimHitContainers);
732  //std::cout << " The Number of sim Hits is " << theSimHitContainers.size() <<std::endl;
733 
735  iEvent.getByToken(rpcRecHitsToken_, rpcRecHits);
736 
737  //SimTrack Stuff
738  std::vector<PSimHit> theSimHits;
739 
740  for (int i = 0; i < int(theSimHitContainers.size()); i++) {
741  theSimHits.insert(theSimHits.end(), theSimHitContainers.at(i)->begin(), theSimHitContainers.at(i)->end());
742  }
743 
744  for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++) {
745  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(), particleIds_.end(), (*iHit).particleType());
746  if (partIdItr == particleIds_.end())
747  continue;
748 
749  DetId theDetUnitId((*iHit).detUnitId());
750 
751  DetId simdetid = DetId((*iHit).detUnitId());
752 
753  if (simdetid.det() == DetId::Muon && simdetid.subdetId() == MuonSubdetId::RPC) { //Only RPCs
754 
755  RPCDetId rollId(theDetUnitId);
756  RPCGeomServ rpcsrv(rollId);
757 
758  //std::cout << " Reading the Roll"<<std::endl;
759  const RPCRoll* rollasociated = rpcGeo->roll(rollId);
760 
761  //std::cout << " Getting the Surface"<<std::endl;
762  const BoundPlane& RPCSurface = rollasociated->surface();
763 
764  GlobalPoint SimHitInGlobal = RPCSurface.toGlobal((*iHit).localPosition());
765 
766  std::cout << "\t\t We have an RPC Sim Hit! in t=" << (*iHit).timeOfFlight() << "ns " << rpcsrv.name()
767  << " Global postition=" << SimHitInGlobal << std::endl;
768 
769  int layer = 0;
770 
771  if (rollId.station() == 1 && rollId.layer() == 1)
772  layer = 1;
773  else if (rollId.station() == 1 && rollId.layer() == 2)
774  layer = 2;
775  else if (rollId.station() == 2 && rollId.layer() == 1)
776  layer = 3;
777  else if (rollId.station() == 2 && rollId.layer() == 2)
778  layer = 4;
779  else if (rollId.station() == 3)
780  layer = 5;
781  else if (rollId.station() == 4)
782  layer = 6;
783 
784  if (rollId.region() == 0) {
785  rpcTimeOfFlightBarrel_[layer - 1]->Fill((*iHit).timeOfFlight());
786  } else {
787  rpcTimeOfFlightEndCap_[rollId.station() - 1]->Fill((*iHit).timeOfFlight());
788  }
789 
790  std::cout << "\t\t r=" << SimHitInGlobal.mag() << " phi=" << SimHitInGlobal.phi()
791  << " eta=" << SimHitInGlobal.eta() << std::endl;
792 
793  int cluSize = 0;
794  int bx = 100;
795  float minres = 3000.;
796 
797  std::cout << "\t \t \t \t Getting RecHits in Roll Asociated" << std::endl;
798 
799  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
800  rangeRecHits recHitCollection = rpcRecHits->get(rollId);
802 
804 
805  for (recHit = recHitCollection.first; recHit != recHitCollection.second; recHit++) {
806  LocalPoint recHitPos = recHit->localPosition();
807  float res = (*iHit).localPosition().x() - recHitPos.x();
808  if (fabs(res) < fabs(minres)) {
809  minres = res;
810  cluSize = recHit->clusterSize();
811  bx = recHit->BunchX();
812  std::cout << "\t New Min Res " << res << "cm." << std::endl;
813  }
814  }
815 
816  if (minres < 3000.) {
817  residualsRPCRecHitSimDigis_->Fill(minres);
819  cluSizeDistribution_->Fill(cluSize);
820  if (rollId.region() == 0)
821  rpcBXBarrel_[layer - 1]->Fill(bx);
822  else
823  rpcBXEndCap_[rollId.station() - 1]->Fill(bx);
824  }
825  }
826  }
827 }
828 
829 // ------------- Convert int to string for printing -------------------------------------
831  using namespace std;
832  ostringstream myStream;
833  myStream << num << flush;
834  return (myStream.str()); //returns the string form of the stringstream object
835 }
836 
837 //------Increase trigger thresold----
838 
840  const edm::InputTag& InputPath,
841  double NewThreshold,
842  double etaCut,
843  int NObjectAboveThreshold,
844  bool averageThreshold) {
845  unsigned int filterIndex = trEv.filterIndex(InputPath);
846  //if(filterIndex<trEv.sizeFilters())printf("SELECTED INDEX =%i --> %s XXX %s\n",filterIndex,trEv.filterTag(filterIndex).label().c_str(), trEv.filterTag(filterIndex).process().c_str());
847 
848  if (filterIndex < trEv.sizeFilters()) {
849  const trigger::Vids& VIDS(trEv.filterIds(filterIndex));
850  const trigger::Keys& KEYS(trEv.filterKeys(filterIndex));
851  const int nI(VIDS.size());
852  const int nK(KEYS.size());
853  assert(nI == nK);
854  const int n(std::max(nI, nK));
855  const trigger::TriggerObjectCollection& TOC(trEv.getObjects());
856 
857  if (!averageThreshold) {
858  int NObjectAboveThresholdObserved = 0;
859  for (int i = 0; i != n; ++i) {
860  if (TOC[KEYS[i]].pt() > NewThreshold && fabs(TOC[KEYS[i]].eta()) < etaCut)
861  NObjectAboveThresholdObserved++;
862  //cout << " " << i << " " << VIDS[i] << "/" << KEYS[i] << ": "<< TOC[KEYS[i]].id() << " " << TOC[KEYS[i]].pt() << " " << TOC[KEYS[i]].eta() << " " << TOC[KEYS[i]].phi() << " " << TOC[KEYS[i]].mass()<< endl;
863  }
864  if (NObjectAboveThresholdObserved >= NObjectAboveThreshold)
865  return true;
866 
867  } else {
868  std::vector<double> ObjPt;
869 
870  for (int i = 0; i != n; ++i) {
871  ObjPt.push_back(TOC[KEYS[i]].pt());
872  //cout << " " << i << " " << VIDS[i] << "/" << KEYS[i] << ": "<< TOC[KEYS[i]].id() << " " << TOC[KEYS[i]].pt() << " " << TOC[KEYS[i]].eta() << " " << TOC[KEYS[i]].phi() << " " << TOC[KEYS[i]].mass()<< endl;
873  }
874  if ((int)(ObjPt.size()) < NObjectAboveThreshold)
875  return false;
876  std::sort(ObjPt.begin(), ObjPt.end());
877 
878  double Average = 0;
879  for (int i = 0; i < NObjectAboveThreshold; i++) {
880  Average += ObjPt[ObjPt.size() - 1 - i];
881  }
882  Average /= NObjectAboveThreshold;
883  //cout << "AVERAGE = " << Average << endl;
884 
885  if (Average > NewThreshold)
886  return true;
887  }
888  }
889  return false;
890 }
891 
892 //define this as a plug-in
Propagator.h
RPCRoll
Definition: RPCRoll.h:12
EcalDataFrame::sample
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
HSCPValidator::simHitsEcalEnergyVsTimeHistEB_
TH2F * simHitsEcalEnergyVsTimeHistEB_
Definition: HSCPValidator.h:117
Handle.h
trigger::TriggerEvent::sizeFilters
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
RPCGeomServ
Definition: RPCGeomServ.h:8
HSCPValidator::cluSizeDistribution_
TH1F * cluSizeDistribution_
Definition: HSCPValidator.h:138
trigger::TriggerEvent::filterKeys
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
HSCPValidator::digisEcalNumHistEE_
TH1F * digisEcalNumHistEE_
Definition: HSCPValidator.h:131
MuonPatternRecoDumper.h
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SteppingHelixPropagator.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::TriggerResultsByName::isValid
bool isValid() const
Definition: TriggerResultsByName.cc:34
DeDxData.h
trigger::Vids
std::vector< int > Vids
Definition: TriggerTypeDefs.h:21
HLT_2018_cff.minR
minR
Definition: HLT_2018_cff.py:83154
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
HSCPValidator::trEvToken_
edm::EDGetTokenT< trigger::TriggerEvent > trEvToken_
Definition: HSCPValidator.h:78
edm::TriggerResultsByName::triggerName
std::string const & triggerName(unsigned i) const
Definition: TriggerResultsByName.cc:163
HSCPValidator::RecoHSCPPtVsGenPt
TH2F * RecoHSCPPtVsGenPt
Definition: HSCPValidator.h:148
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
fileService
edm::Service< TFileService > fileService
Definition: HSCPValidator.cc:91
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HSCPValidator::particleEtaHist_
TH1F * particleEtaHist_
Definition: HSCPValidator.h:86
HSCPValidator::hltmu
TH1F * hltmu
Definition: HSCPValidator.h:146
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
EBDataFrame
Definition: EBDataFrame.h:11
HSCPValidator::efficiencyRPCRecHitSimDigis_
TH1F * efficiencyRPCRecHitSimDigis_
Definition: HSCPValidator.h:137
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
RPCDetId
Definition: RPCDetId.h:16
edm::TriggerResultsByName::triggerIndex
unsigned triggerIndex(std::string const &pathName) const
Definition: TriggerResultsByName.cc:171
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PSimHitContainer.h
EBDetId.h
EEDetId.h
HSCPValidator::HSCPValidator
HSCPValidator(const edm::ParameterSet &)
Definition: HSCPValidator.cc:96
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
HSCPValidator::digiOccupancyMapEEP_
TH2F * digiOccupancyMapEEP_
Definition: HSCPValidator.h:133
HSCPValidator::EEDigiCollectionToken_
edm::EDGetTokenT< EEDigiCollection > EEDigiCollectionToken_
Definition: HSCPValidator.h:111
HSCPValidator::particlePhiHist_
TH1F * particlePhiHist_
Definition: HSCPValidator.h:87
HSCPValidator::particleStatus_
int particleStatus_
Definition: HSCPValidator.h:84
cms::cuda::assert
assert(be >=bs)
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
HSCPValidator::particleIdsFoundMap_
std::map< int, int > particleIdsFoundMap_
Definition: HSCPValidator.h:85
HSCPValidator::doSimDigiPlots_
bool doSimDigiPlots_
Definition: HSCPValidator.h:72
HSCPValidator::hltjet
TH1F * hltjet
Definition: HSCPValidator.h:145
RPCGeometry::roll
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:50
RPCRoll.h
HSCPValidator::simHitsEcalTimeHistEB_
TH1F * simHitsEcalTimeHistEB_
Definition: HSCPValidator.h:115
HSCPValidator::eeSimHitToken_
edm::EDGetTokenT< edm::PCaloHitContainer > eeSimHitToken_
Definition: HSCPValidator.h:108
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TransientTrack.h
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HSCPValidator::rpcRecHitsToken_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsToken_
Definition: HSCPValidator.h:81
HSCPValidator::doHLTPlots_
bool doHLTPlots_
Definition: HSCPValidator.h:70
edm::Handle
Definition: AssociativeIterator.h:50
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
HSCPValidator::particlePtHist_
TH1F * particlePtHist_
Definition: HSCPValidator.h:89
HSCPValidator::simHitsEcalTimeHistEE_
TH1F * simHitsEcalTimeHistEE_
Definition: HSCPValidator.h:119
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
CandMatchMap.h
edm::Ref< TrackCollection >
HSCPValidator::h_genhscp_met_nohscp
TH1F * h_genhscp_met_nohscp
Definition: HSCPValidator.h:95
HSCPValidator::residualsRPCRecHitSimDigis_
TH1F * residualsRPCRecHitSimDigis_
Definition: HSCPValidator.h:136
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
CandidateFwd.h
DetId
Definition: DetId.h:17
HSCPValidator::digiOccupancyMapEB_
TH2F * digiOccupancyMapEB_
Definition: HSCPValidator.h:132
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
RPCGeomServ.h
EcalMGPASample::adc
int adc() const
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:31
HSCPValidator::simTrackToken_
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
Definition: HSCPValidator.h:109
HSCPValidator::digiOccupancyMapEEM_
TH2F * digiOccupancyMapEEM_
Definition: HSCPValidator.h:134
PSimHit.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HSCPValidator::makeRecoPlots
void makeRecoPlots(const edm::Event &iEvent)
Definition: HSCPValidator.cc:676
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Surface.h
HSCPValidator::simTrackParticlePtHist_
TH1F * simTrackParticlePtHist_
Definition: HSCPValidator.h:103
LocalError.h
HSCPValidator::doSimTrackPlots_
bool doSimTrackPlots_
Definition: HSCPValidator.h:71
Service.h
HSCPValidator::ebSimHitToken_
edm::EDGetTokenT< edm::PCaloHitContainer > ebSimHitToken_
Definition: HSCPValidator.h:107
PVValHelper::eta
Definition: PVValidationHelpers.h:69
RPCRecHitCollection
HSCPValidator::simHitsEcalEnergyHistEE_
TH1F * simHitsEcalEnergyHistEE_
Definition: HSCPValidator.h:118
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimVertex.h
HSCPValidator::doRecoPlots_
bool doRecoPlots_
Definition: HSCPValidator.h:73
EcalDigiCollections.h
IdealMagneticFieldRecord.h
HSCPValidator::simTrackParticlePHist_
TH1F * simTrackParticlePHist_
Definition: HSCPValidator.h:102
HSCPValidator::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: HSCPValidator.cc:251
HSCPValidator::endJob
void endJob() override
Definition: HSCPValidator.cc:275
HSCPValidator::simHitsEcalDigiMatchEnergyVsTimeHistEB_
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEB_
Definition: HSCPValidator.h:124
RPCGeomServ::name
virtual std::string name()
Definition: RPCGeomServ.cc:11
RPCDigi.h
Point3DBase< float, GlobalTag >
HSCPValidator::token_
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: HSCPValidator.h:76
HSCPValidator::h_genhscp_scaloret
TH1F * h_genhscp_scaloret
Definition: HSCPValidator.h:96
GlobalTrackingGeometryRecord.h
EEDetId
Definition: EEDetId.h:14
HSCPValidator::intToString
std::string intToString(int num)
Definition: HSCPValidator.cc:830
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HSCPValidator::simTracksToken_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: HSCPValidator.h:77
RPCDetId.h
TFileService.h
HSCPValidator
Definition: HSCPValidator.h:46
HSCPValidator::particlePHist_
TH1F * particlePHist_
Definition: HSCPValidator.h:88
RPCRecHitCollection.h
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HSCPValidator::beginJob
void beginJob() override
Definition: HSCPValidator.cc:272
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
HSCPValidator::simHitsEcalEnergyHistEB_
TH1F * simHitsEcalEnergyHistEB_
Definition: HSCPValidator.h:114
ParticleDataTable.h
fftjetproducer_cfi.etaCut
etaCut
Definition: fftjetproducer_cfi.py:168
HSCPValidator::simHitsEcalDigiMatchTimeHistEE_
TH1F * simHitsEcalDigiMatchTimeHistEE_
Definition: HSCPValidator.h:126
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HSCPValidator::simTrackParticleBetaHist_
TH1F * simTrackParticleBetaHist_
Definition: HSCPValidator.h:104
HSCPValidator::rpcGeo
edm::ESHandle< RPCGeometry > rpcGeo
Definition: HSCPValidator.h:112
EBDigiCollection
Definition: EcalDigiCollections.h:32
EEDigiCollection
Definition: EcalDigiCollections.h:45
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
HSCPValidator::EBDigiCollectionToken_
edm::EDGetTokenT< EBDigiCollection > EBDigiCollectionToken_
Definition: HSCPValidator.h:110
HSCPValidator::dedxVsp
TH2F * dedxVsp
Definition: HSCPValidator.h:149
muonSimHitMatcherPSet.simTrack
simTrack
Definition: muonSimHitMatcherPSet.py:4
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
HSCPValidator::particleBetaHist_
TH1F * particleBetaHist_
Definition: HSCPValidator.h:92
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::TriggerResultsByName::accept
bool accept() const
Definition: TriggerResultsByName.cc:52
trigger::TriggerEvent::filterIndex
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
edm::TriggerResultsByName
Definition: TriggerResultsByName.h:48
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
HSCPValidator::hltmet
TH1F * hltmet
Definition: HSCPValidator.h:144
AnalyticalPropagator.h
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
edm::TriggerResultsByName::size
std::vector< std::string >::size_type size() const
Definition: TriggerResultsByName.cc:179
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
hgcalTriggerNtuples_cfi.eeSimHits
eeSimHits
Definition: hgcalTriggerNtuples_cfi.py:50
get
#define get
res
Definition: Electron.h:6
trigger::TriggerEvent::getObjects
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
MuonSubdetId.h
HSCPValidator::simHitsEcalNumHistEB_
TH1F * simHitsEcalNumHistEB_
Definition: HSCPValidator.h:116
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
trigger::TriggerEvent::filterIds
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:117
HSCPValidator::doGenPlots_
bool doGenPlots_
Definition: HSCPValidator.h:69
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
HSCPValidator::simHitsEcalDigiMatchTimeHistEB_
TH1F * simHitsEcalDigiMatchTimeHistEB_
Definition: HSCPValidator.h:123
HSCPValidator::tkTracksToken_
edm::EDGetTokenT< reco::TrackCollection > tkTracksToken_
Definition: HSCPValidator.h:79
HSCPValidator::simHitsEcalDigiMatchEnergyHistEE_
TH1F * simHitsEcalDigiMatchEnergyHistEE_
Definition: HSCPValidator.h:125
HSCPValidator::rpcTimeOfFlightEndCap_
TH1F * rpcTimeOfFlightEndCap_[3]
Definition: HSCPValidator.h:141
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
HSCPValidator::simHitsEcalDigiMatchEnergyHistEB_
TH1F * simHitsEcalDigiMatchEnergyHistEB_
Definition: HSCPValidator.h:122
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
GeomDet.h
HSCPValidator::makeGenPlots
void makeGenPlots(const edm::Event &iEvent)
Definition: HSCPValidator.cc:291
std
Definition: JetResolutionObject.h:76
HSCPValidator::particleBetaInverseHist_
TH1F * particleBetaInverseHist_
Definition: HSCPValidator.h:93
HSCPValidator::rpcBXBarrel_
TH1F * rpcBXBarrel_[6]
Definition: HSCPValidator.h:140
HSCPValidator.h
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
DetId.h
dtTriggerPhase2PrimitiveDigis_cfi.rpcRecHits
rpcRecHits
Definition: dtTriggerPhase2PrimitiveDigis_cfi.py:39
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
HSCPValidator::particleMassHist_
TH1F * particleMassHist_
Definition: HSCPValidator.h:90
HSCPValidator::makeSimDigiPlotsECAL
void makeSimDigiPlotsECAL(const edm::Event &iEvent)
Definition: HSCPValidator.cc:479
LocalPoint.h
TrackingComponentsRecord.h
HSCPValidator::triggerResultsToken_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
Definition: HSCPValidator.h:82
BoundPlane
HSCPValidator::makeSimDigiPlotsRPC
void makeSimDigiPlotsRPC(const edm::Event &iEvent)
Definition: HSCPValidator.cc:726
HSCPValidator::particleIds_
std::vector< int > particleIds_
Definition: HSCPValidator.h:83
RPCRecHit.h
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
RPCDigiCollection.h
HSCPValidator::simTrackParticleEtaHist_
TH1F * simTrackParticleEtaHist_
Definition: HSCPValidator.h:100
HSCPValidator::makeHLTPlots
void makeHLTPlots(const edm::Event &iEvent)
Definition: HSCPValidator.cc:384
HSCPValidator::simHitsEcalDigiMatchIPhiHist_
TH1F * simHitsEcalDigiMatchIPhiHist_
Definition: HSCPValidator.h:129
PCaloHitContainer.h
EcalDataFrame::size
int size() const
Definition: EcalDataFrame.h:26
trigger
Definition: HLTPrescaleTableCond.h:8
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
HepMCProduct
Candidate.h
DetId::Muon
Definition: DetId.h:26
Average
Definition: trackSplitPlot.h:34
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HSCPValidator::h_genhscp_met
TH1F * h_genhscp_met
Definition: HSCPValidator.h:94
HSCPValidator::simHitsEcalDigiMatchEnergyVsTimeHistEE_
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEE_
Definition: HSCPValidator.h:127
SimTrack.h
HSCPValidator::makeSimTrackPlots
void makeSimTrackPlots(const edm::Event &iEvent)
Definition: HSCPValidator.cc:357
MuonGeometryRecord.h
HSCPValidator::digisEcalNumHistEB_
TH1F * digisEcalNumHistEB_
Definition: HSCPValidator.h:130
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HSCPValidator::rpcTimeOfFlightBarrel_
TH1F * rpcTimeOfFlightBarrel_[6]
Definition: HSCPValidator.h:139
HSCPValidator::simHitsEcalEnergyVsTimeHistEE_
TH2F * simHitsEcalEnergyVsTimeHistEE_
Definition: HSCPValidator.h:121
HSCPValidator::~HSCPValidator
~HSCPValidator() override
Definition: HSCPValidator.cc:233
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
EEDataFrame
Definition: EEDataFrame.h:12
edm::Event
Definition: Event.h:73
RPCDetId::layer
int layer() const
Definition: RPCDetId.h:85
HSCPValidator::IncreasedTreshold
bool IncreasedTreshold(const trigger::TriggerEvent &trEv, const edm::InputTag &InputPath, double NewThreshold, double etaCut, int NObjectAboveThreshold, bool averageThreshold)
Definition: HSCPValidator.cc:839
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
HSCPValidator::simTrackParticlePhiHist_
TH1F * simTrackParticlePhiHist_
Definition: HSCPValidator.h:101
SimL1EmulatorDM_cff.eeDigis
eeDigis
Definition: SimL1EmulatorDM_cff.py:18
RPCGeometry.h
SimTrackContainer.h
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
HSCPValidator::simHitsEcalDigiMatchIEtaHist_
TH1F * simHitsEcalDigiMatchIEtaHist_
Definition: HSCPValidator.h:128
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
SimVertexContainer.h
HSCPValidator::dEdxTrackToken_
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > dEdxTrackToken_
Definition: HSCPValidator.h:80
HSCPValidator::particleStatusHist_
TH1F * particleStatusHist_
Definition: HSCPValidator.h:91
TrackToTrackMap.h
HSCPValidator::rpcBXEndCap_
TH1F * rpcBXEndCap_[3]
Definition: HSCPValidator.h:142
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
HSCPValidator::simHitsEcalNumHistEE_
TH1F * simHitsEcalNumHistEE_
Definition: HSCPValidator.h:120
ZCounting_cff.TriggerEvent
TriggerEvent
Definition: ZCounting_cff.py:5
HSCPValidator::h_genhscp_scaloret_nohscp
TH1F * h_genhscp_scaloret_nohscp
Definition: HSCPValidator.h:97