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