CMS 3D CMS Logo

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