CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiTrackValidator.cc
Go to the documentation of this file.
3 
6 
25 
29 #include<type_traits>
30 
31 
32 #include "TMath.h"
33 #include <TF1.h>
36 //#include <iostream>
37 
38 using namespace std;
39 using namespace edm;
40 
42 
44  //theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet, consumesCollector());
45 
46  ParameterSet psetForHistoProducerAlgo = pset.getParameter<ParameterSet>("histoProducerAlgoBlock");
47  string histoProducerAlgoName = psetForHistoProducerAlgo.getParameter<string>("ComponentName");
48  histoProducerAlgo_ = MTVHistoProducerAlgoFactory::get()->create(histoProducerAlgoName ,psetForHistoProducerAlgo, consumesCollector());
49 
50  dirName_ = pset.getParameter<std::string>("dirName");
51  assMapInput = pset.getParameter< edm::InputTag >("associatormap");
52  associatormapStR = mayConsume<reco::SimToRecoCollection>(assMapInput);
53  associatormapRtS = mayConsume<reco::RecoToSimCollection>(assMapInput);
54  UseAssociators = pset.getParameter< bool >("UseAssociators");
55 
56  m_dEdx1Tag = mayConsume<edm::ValueMap<reco::DeDxData> >(pset.getParameter< edm::InputTag >("dEdx1Tag"));
57  m_dEdx2Tag = mayConsume<edm::ValueMap<reco::DeDxData> >(pset.getParameter< edm::InputTag >("dEdx2Tag"));
58 
59  tpSelector = TrackingParticleSelector(pset.getParameter<double>("ptMinTP"),
60  pset.getParameter<double>("minRapidityTP"),
61  pset.getParameter<double>("maxRapidityTP"),
62  pset.getParameter<double>("tipTP"),
63  pset.getParameter<double>("lipTP"),
64  pset.getParameter<int>("minHitTP"),
65  pset.getParameter<bool>("signalOnlyTP"),
66  pset.getParameter<bool>("chargedOnlyTP"),
67  pset.getParameter<bool>("stableOnlyTP"),
68  pset.getParameter<std::vector<int> >("pdgIdTP"));
69 
71  pset.getParameter<double>("minRapidityTP"),
72  pset.getParameter<double>("maxRapidityTP"),
73  pset.getParameter<double>("tipTP"),
74  pset.getParameter<double>("lipTP"),
75  pset.getParameter<int>("minHitTP"),
76  pset.getParameter<bool>("chargedOnlyTP"),
77  pset.getParameter<std::vector<int> >("pdgIdTP"));
78 
79 
80  ParameterSet psetVsEta = psetForHistoProducerAlgo.getParameter<ParameterSet>("TpSelectorForEfficiencyVsEta");
81  dRtpSelector = TrackingParticleSelector(psetVsEta.getParameter<double>("ptMin"),
82  psetVsEta.getParameter<double>("minRapidity"),
83  psetVsEta.getParameter<double>("maxRapidity"),
84  psetVsEta.getParameter<double>("tip"),
85  psetVsEta.getParameter<double>("lip"),
86  psetVsEta.getParameter<int>("minHit"),
87  psetVsEta.getParameter<bool>("signalOnly"),
88  psetVsEta.getParameter<bool>("chargedOnly"),
89  psetVsEta.getParameter<bool>("stableOnly"),
90  psetVsEta.getParameter<std::vector<int> >("pdgId"));
91 
92  useGsf = pset.getParameter<bool>("useGsf");
93  runStandalone = pset.getParameter<bool>("runStandalone");
94 
95  _simHitTpMapTag = mayConsume<SimHitTPAssociationProducer::SimHitTPAssociationList>(pset.getParameter<edm::InputTag>("simHitTpMapTag"));
96 
97  labelTokenForDrCalculation = consumes<edm::View<reco::Track> >(pset.getParameter<edm::InputTag>("trackCollectionForDrCalculation"));
98 
99  if (!UseAssociators) {
100  associators.clear();
101  associators.push_back(assMapInput.label());
102  } else {
103  for (auto const& associatorName : associators) {
104  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag(associatorName));
105  }
106  }
107 
108 }
109 
110 
112 
113 
115 
116  for (unsigned int ww=0;ww<associators.size();ww++){
117  for (unsigned int www=0;www<label.size();www++){
118  ibook.cd();
119  InputTag algo = label[www];
120  string dirName=dirName_;
121  if (algo.process()!="")
122  dirName+=algo.process()+"_";
123  if(algo.label()!="")
124  dirName+=algo.label()+"_";
125  if(algo.instance()!="")
126  dirName+=algo.instance()+"_";
127  if (dirName.find("Tracks")<dirName.length()){
128  dirName.replace(dirName.find("Tracks"),6,"");
129  }
130  string assoc= associators[ww];
131  if (assoc.find("Track")<assoc.length()){
132  assoc.replace(assoc.find("Track"),5,"");
133  }
134  dirName+=assoc;
135  std::replace(dirName.begin(), dirName.end(), ':', '_');
136 
137  ibook.setCurrentFolder(dirName.c_str());
138 
139  // vector of vector initialization
140  histoProducerAlgo_->initialize(); //TO BE FIXED. I'D LIKE TO AVOID THIS CALL
141 
142  string subDirName = dirName + "/simulation";
143  ibook.setCurrentFolder(subDirName.c_str());
144 
145  //Booking histograms concerning with simulated tracks
147 
148  ibook.cd();
149  ibook.setCurrentFolder(dirName.c_str());
150 
151  //Booking histograms concerning with reconstructed tracks
154 
155  }//end loop www
156  }// end loop ww
157 }
158 
159 
161  using namespace reco;
162 
163  edm::LogInfo("TrackValidator") << "\n====================================================" << "\n"
164  << "Analyzing new event" << "\n"
165  << "====================================================\n" << "\n";
166 
167  std::vector<const reco::TrackToTrackingParticleAssociator*> associator;
168  if (UseAssociators) {
170  for (auto const& associatorName : associators) {
171  event.getByLabel(associatorName,theAssociator);
172  associator.push_back( theAssociator.product() );
173  }
174  }
175 
176 
177  edm::ESHandle<ParametersDefinerForTP> parametersDefinerTPHandle;
178  setup.get<TrackAssociatorRecord>().get(parametersDefiner,parametersDefinerTPHandle);
179  //Since we modify the object, we must clone it
180  auto parametersDefinerTP = parametersDefinerTPHandle->clone();
181 
182  edm::Handle<TrackingParticleCollection> TPCollectionHeff ;
183  event.getByToken(label_tp_effic,TPCollectionHeff);
184  TrackingParticleCollection const & tPCeff = *(TPCollectionHeff.product());
185 
186  edm::Handle<TrackingParticleCollection> TPCollectionHfake ;
187  event.getByToken(label_tp_fake,TPCollectionHfake);
188 
189 
190  if(parametersDefiner=="CosmicParametersDefinerForTP") {
192  //warning: make sure the TP collection used in the map is the same used in the MTV!
193  event.getByToken(_simHitTpMapTag,simHitsTPAssoc);
194  parametersDefinerTP->initEvent(simHitsTPAssoc);
195  cosmictpSelector.initEvent(simHitsTPAssoc);
196  }
197 
198 
199  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
200  event.getByToken(bsSrc,recoBeamSpotHandle);
201  reco::BeamSpot const & bs = *recoBeamSpotHandle;
202 
204  event.getByToken(label_pileupinfo,puinfoH);
205  PileupSummaryInfo puinfo;
206 
207  for (unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
208  if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
209  puinfo=(*puinfoH)[puinfo_ite];
210  break;
211  }
212  }
213 
214  /*
215  edm::Handle<TrackingVertexCollection> tvH;
216  event.getByToken(label_tv,tvH);
217  TrackingVertexCollection const & tv = *tvH;
218  */
219 
220  //calculate dR for TPs
221  float dR_tPCeff[(*TPCollectionHeff).size()];
222  {
223  int j=0;
224  float etaL[(*TPCollectionHeff).size()], phiL[(*TPCollectionHeff).size()];
225  bool okL[(*TPCollectionHeff).size()];
226  for ( auto const & tp2 : *TPCollectionHeff) {
227  okL[j]=false;
228  if(tpSelector(tp2)) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
229  okL[j]=true;
230  auto && p = tp2.momentum();
231  etaL[j] = etaFromXYZ(p.x(),p.y(),p.z());
232  phiL[j] = atan2f(p.y(),p.x());
233 
234  }
235  ++j;
236  }
237  auto i=0U;
238  for ( auto const & tp : *TPCollectionHeff) {
240  if(dRtpSelector(tp)) {//only for those needed for efficiency!
241  auto && p = tp.momentum();
242  float eta = etaFromXYZ(p.x(),p.y(),p.z());
243  float phi = atan2f(p.y(),p.x());
244  for (auto j=0U; j< (*TPCollectionHeff).size(); ++j ) {
245  if (i==j) {continue;}
246  if(okL[j]) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
247  auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]);
248  if (dR_tmp<dR) dR=dR_tmp;
249  }
250  } // ttp2 (j)
251  }
252  dR_tPCeff[i++] = std::sqrt(dR);
253  } // tp
254  }
255 
256  edm::Handle<View<Track> > trackCollectionForDrCalculation;
257  event.getByToken(labelTokenForDrCalculation, trackCollectionForDrCalculation);
258 
259  int w=0; //counter counting the number of sets of histograms
260  for (unsigned int ww=0;ww<associators.size();ww++){
261  for (unsigned int www=0;www<label.size();www++){
262  //
263  //get collections from the event
264  //
266  if(!event.getByToken(labelToken[www], trackCollection)&&ignoremissingtkcollection_)continue;
267 
268  reco::RecoToSimCollection const * recSimCollP=nullptr;
269  reco::SimToRecoCollection const * simRecCollP=nullptr;
270  reco::RecoToSimCollection recSimCollL;
271  reco::SimToRecoCollection simRecCollL;
272 
273  //associate tracks
274  if(UseAssociators){
275  edm::LogVerbatim("TrackValidator") << "Analyzing "
276  << label[www].process()<<":"
277  << label[www].label()<<":"
278  << label[www].instance()<<" with "
279  << associators[ww].c_str() <<"\n";
280 
281  LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n";
282  recSimCollL = std::move(associator[ww]->associateRecoToSim(trackCollection,
283  TPCollectionHfake));
284  recSimCollP = &recSimCollL;
285  LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n";
286  simRecCollL = std::move(associator[ww]->associateSimToReco(trackCollection,
287  TPCollectionHeff));
288  simRecCollP = &simRecCollL;
289  }
290  else{
291  edm::LogVerbatim("TrackValidator") << "Analyzing "
292  << label[www].process()<<":"
293  << label[www].label()<<":"
294  << label[www].instance()<<" with "
295  << assMapInput.process()<<":"
296  << assMapInput.label()<<":"
297  << assMapInput.instance()<<"\n";
298 
299  Handle<reco::SimToRecoCollection > simtorecoCollectionH;
300  event.getByToken(associatormapStR,simtorecoCollectionH);
301  simRecCollP = simtorecoCollectionH.product();
302 
303  Handle<reco::RecoToSimCollection > recotosimCollectionH;
304  event.getByToken(associatormapRtS,recotosimCollectionH);
305  recSimCollP = recotosimCollectionH.product();
306  }
307 
308  reco::RecoToSimCollection const & recSimColl = *recSimCollP;
309  reco::SimToRecoCollection const & simRecColl = *simRecCollP;
310 
311 
312 
313  // ########################################################
314  // fill simulation histograms (LOOP OVER TRACKINGPARTICLES)
315  // ########################################################
316 
317  //compute number of tracks per eta interval
318  //
319  edm::LogVerbatim("TrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
320  int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks
321  int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
322  unsigned sts(0); //This counter counts the number of simTracks surviving the bunchcrossing cut
323  unsigned asts(0); //This counter counts the number of simTracks that are "associated" to recoTracks surviving the bunchcrossing cut
324  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){ //loop over TPs collection for tracking efficiency
325  TrackingParticleRef tpr(TPCollectionHeff, i);
326  TrackingParticle* tp=const_cast<TrackingParticle*>(tpr.get()); // why????
327  TrackingParticle::Vector momentumTP;
328  TrackingParticle::Point vertexTP;
329  double dxySim(0);
330  double dzSim(0);
331  double dR=dR_tPCeff[i];
332 
333  //---------- THIS PART HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
334  //If the TrackingParticle is collison like, get the momentum and vertex at production state
335  if(parametersDefiner=="LhcParametersDefinerForTP" || parametersDefiner=="hltLhcParametersDefinerForTP")
336  {
337  if(! tpSelector(*tp)) continue;
338  momentumTP = tp->momentum();
339  vertexTP = tp->vertex();
340  //Calcualte the impact parameters w.r.t. PCA
341  TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event,setup,tpr);
342  TrackingParticle::Point vertex = parametersDefinerTP->vertex(event,setup,tpr);
343  dxySim = (-vertex.x()*sin(momentum.phi())+vertex.y()*cos(momentum.phi()));
344  dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/sqrt(momentum.perp2())
345  * momentum.z()/sqrt(momentum.perp2());
346  }
347  //If the TrackingParticle is comics, get the momentum and vertex at PCA
348  if(parametersDefiner=="CosmicParametersDefinerForTP")
349  {
350  if(! cosmictpSelector(tpr,&bs,event,setup)) continue;
351  momentumTP = parametersDefinerTP->momentum(event,setup,tpr);
352  vertexTP = parametersDefinerTP->vertex(event,setup,tpr);
353  dxySim = (-vertexTP.x()*sin(momentumTP.phi())+vertexTP.y()*cos(momentumTP.phi()));
354  dzSim = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/sqrt(momentumTP.perp2())
355  * momentumTP.z()/sqrt(momentumTP.perp2());
356  }
357  //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
358 
359  st++; //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
360 
361  // in the coming lines, histos are filled using as input
362  // - momentumTP
363  // - vertexTP
364  // - dxySim
365  // - dzSim
366 
368 
369 
370  // ##############################################
371  // fill RecoAssociated SimTracks' histograms
372  // ##############################################
373  const reco::Track* matchedTrackPointer=0;
374  if(simRecColl.find(tpr) != simRecColl.end()){
375  auto const & rt = simRecColl[tpr];
376  if (rt.size()!=0) {
377  ats++; //This counter counts the number of simTracks that have a recoTrack associated
378  // isRecoMatched = true; // UNUSED
379  matchedTrackPointer = rt.begin()->first.get();
380  edm::LogVerbatim("TrackValidator") << "TrackingParticle #" << st
381  << " with pt=" << sqrt(momentumTP.perp2())
382  << " associated with quality:" << rt.begin()->second <<"\n";
383  }
384  }else{
385  edm::LogVerbatim("TrackValidator")
386  << "TrackingParticle #" << st
387  << " with pt,eta,phi: "
388  << sqrt(momentumTP.perp2()) << " , "
389  << momentumTP.eta() << " , "
390  << momentumTP.phi() << " , "
391  << " NOT associated to any reco::Track" << "\n";
392  }
393 
394 
395 
396 
397  int nSimHits = tp->numberOfTrackerHits();
398  histoProducerAlgo_->fill_recoAssociated_simTrack_histos(w,*tp,momentumTP,vertexTP,dxySim,dzSim,nSimHits,matchedTrackPointer,puinfo.getPU_NumInteractions(), dR);
399  sts++;
400  if (matchedTrackPointer) asts++;
401 
402 
403 
404 
405  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
406 
407  //if (st!=0) h_tracksSIM[w]->Fill(st); // TO BE FIXED
408 
409 
410  // ##############################################
411  // fill recoTracks histograms (LOOP OVER TRACKS)
412  // ##############################################
413  edm::LogVerbatim("TrackValidator") << "\n# of reco::Tracks with "
414  << label[www].process()<<":"
415  << label[www].label()<<":"
416  << label[www].instance()
417  << ": " << trackCollection->size() << "\n";
418 
419  int sat(0); //This counter counts the number of recoTracks that are associated to SimTracks from Signal only
420  int at(0); //This counter counts the number of recoTracks that are associated to SimTracks
421  int rT(0); //This counter counts the number of recoTracks in general
422 
423 
424  // dE/dx
425  // at some point this could be generalized, with a vector of tags and a corresponding vector of Handles
426  // I'm writing the interface such to take vectors of ValueMaps
429  std::vector<edm::ValueMap<reco::DeDxData> > v_dEdx;
430  v_dEdx.clear();
431  if (label[www].label()=="generalTracks") {
432  try {
433  event.getByToken(m_dEdx1Tag, dEdx1Handle);
434  const edm::ValueMap<reco::DeDxData> dEdx1 = *dEdx1Handle.product();
435  event.getByToken(m_dEdx2Tag, dEdx2Handle);
436  const edm::ValueMap<reco::DeDxData> dEdx2 = *dEdx2Handle.product();
437  v_dEdx.push_back(dEdx1);
438  v_dEdx.push_back(dEdx2);
439  } catch (cms::Exception e){
440  LogTrace("TrackValidator") << "exception found: " << e.what() << "\n";
441  }
442  }
443  //end dE/dx
444 
445 
446  //calculate dR for tracks
447  float dR_trk[trackCollection->size()];
448  int i=0;
449  float etaL[trackCollectionForDrCalculation->size()];
450  float phiL[trackCollectionForDrCalculation->size()];
451  for (auto const & track2 : *trackCollectionForDrCalculation) {
452  auto && p = track2.momentum();
453  etaL[i] = etaFromXYZ(p.x(),p.y(),p.z());
454  phiL[i] = atan2f(p.y(),p.x());
455  ++i;
456  }
457  for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
458  auto const & track = (*trackCollection)[i];
460  auto && p = track.momentum();
461  float eta = etaFromXYZ(p.x(),p.y(),p.z());
462  float phi = atan2f(p.y(),p.x());
463  for(View<Track>::size_type j=0; j<trackCollectionForDrCalculation->size(); ++j){
464  auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]);
465  if ( (dR_tmp<dR) & (dR_tmp>std::numeric_limits<float>::min())) dR=dR_tmp;
466  }
467  dR_trk[i] = std::sqrt(dR);
468  }
469 
470  for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
471 
472  RefToBase<Track> track(trackCollection, i);
473  rT++;
474 
476 
477  bool isSigSimMatched(false);
478  bool isSimMatched(false);
479  bool isChargeMatched(true);
480  int numAssocRecoTracks = 0;
481  int nSimHits = 0;
482  double sharedFraction = 0.;
483  auto const & tp = (recSimColl.find(track) != recSimColl.end()) ? recSimColl[track] : dummyTP;
484 
485  if (!tp.empty()) {
486  nSimHits = tp[0].first->numberOfTrackerHits();
487  sharedFraction = tp[0].second;
488  isSimMatched = true;
489  if (tp[0].first->charge() != track->charge()) isChargeMatched = false;
490  if(simRecColl.find(tp[0].first) != simRecColl.end()) numAssocRecoTracks = simRecColl[tp[0].first].size();
491  at++;
492  for (unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
493  TrackingParticle trackpart = *(tp[tp_ite].first);
494  if ((trackpart.eventId().event() == 0) && (trackpart.eventId().bunchCrossing() == 0)){
495  isSigSimMatched = true;
496  sat++;
497  break;
498  }
499  }
500  edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
501  << " associated with quality:" << tp.begin()->second <<"\n";
502  } else {
503  edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
504  << " NOT associated to any TrackingParticle" << "\n";
505  }
506 
507  double dR=dR_trk[i];
508  histoProducerAlgo_->fill_generic_recoTrack_histos(w,*track,bs.position(),isSimMatched,isSigSimMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), nSimHits, sharedFraction,dR);
509 
510  // dE/dx
511  // reco::TrackRef track2 = reco::TrackRef( trackCollection, i );
512  if (v_dEdx.size() > 0) histoProducerAlgo_->fill_dedx_recoTrack_histos(w,track, v_dEdx);
513  //if (v_dEdx.size() > 0) histoProducerAlgo_->fill_dedx_recoTrack_histos(track2, v_dEdx);
514 
515 
516  //Fill other histos
517  //try{ //Is this really necessary ????
518 
519  if (tp.size()==0) continue;
520 
522 
523  TrackingParticleRef tpr = tp.begin()->first;
524 
525  /* TO BE FIXED LATER
526  if (associators[ww]=="trackAssociatorByChi2"){
527  //association chi2
528  double assocChi2 = -tp.begin()->second;//in association map is stored -chi2
529  h_assochi2[www]->Fill(assocChi2);
530  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
531  }
532  else if (associators[ww]=="quickTrackAssociatorByHits"){
533  double fraction = tp.begin()->second;
534  h_assocFraction[www]->Fill(fraction);
535  h_assocSharedHit[www]->Fill(fraction*track->numberOfValidHits());
536  }
537  */
538 
539 
540  //Get tracking particle parameters at point of closest approach to the beamline
541  TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event,setup,tpr);
542  TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event,setup,tpr);
543  int chargeTP = tpr->charge();
544 
545  histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(w,momentumTP,vertexTP,chargeTP,
546  *track,bs.position());
547 
548 
549  //TO BE FIXED
550  //std::vector<PSimHit> simhits=tpr.get()->trackPSimHit(DetId::Tracker);
551  //nrecHit_vs_nsimHit_rec2sim[w]->Fill(track->numberOfValidHits(), (int)(simhits.end()-simhits.begin() ));
552 
553  /*
554  } // End of try{
555  catch (cms::Exception e){
556  LogTrace("TrackValidator") << "exception found: " << e.what() << "\n";
557  }
558  */
559 
560  } // End of for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
561 
563 
564  edm::LogVerbatim("TrackValidator") << "Total Simulated: " << st << "\n"
565  << "Total Associated (simToReco): " << ats << "\n"
566  << "Total Reconstructed: " << rT << "\n"
567  << "Total Associated (recoToSim): " << at << "\n"
568  << "Total Fakes: " << rT-at << "\n";
569 
570  w++;
571  } // End of for (unsigned int www=0;www<label.size();www++){
572  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
573 
574 }
575 
577  int w=0;
578  for (unsigned int ww=0;ww<associators.size();ww++){
579  for (unsigned int www=0;www<label.size();www++){
582  w++;
583  }
584  }
585  //if ( out.size() != 0 && dbe_ ) dbe_->save(out);
586 }
587 
588 
589 
virtual char const * what() const
Definition: Exception.cc:141
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
unsigned int size_type
Definition: View.h:85
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx1Tag
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
void endRun(edm::Run const &, edm::EventSetup const &)
Method called at the end of the event loop.
int event() const
get the contents of the subdetector field (should be protected?)
const double w
Definition: UKUtility.cc:23
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
CosmicTrackingParticleSelector cosmictpSelector
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
last iterator over the map (read only)
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
void cd(void)
Definition: DQMStore.cc:266
virtual void fill_dedx_recoTrack_histos(int count, edm::RefToBase< reco::Track > &trackref, const std::vector< edm::ValueMap< reco::DeDxData > > &v_dEdx)=0
edm::Ref< GenParticleCollection > GenParticleRef
persistent reference to a GenParticle
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator find(const key_type &k) const
find element with specified reference key
void analyze(const edm::Event &, const edm::EventSetup &)
Method called once per event.
edm::EDGetTokenT< reco::RecoToSimCollection > associatormapRtS
virtual void fill_ResoAndPull_recoTrack_histos(int count, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, int chargeTP, const reco::Track &track, const math::XYZPoint &bsPosition)=0
virtual void bookRecoHistosForStandaloneRunning(DQMStore::IBooker &ibook)=0
TrackingParticleSelector dRtpSelector
T eta() const
uint16_t size_type
virtual void fill_recoAssociated_simTrack_histos(int count, const TrackingParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track, int numVertices, double dR)=0
edm::EDGetTokenT< reco::SimToRecoCollection > associatormapStR
edm::EDGetTokenT< reco::BeamSpot > bsSrc
math::XYZPointD Point
point in the space
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
std::vector< edm::InputTag > label
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:48
int bunchCrossing() const
get the detector field from this detid
double pt() const
track transverse momentum
Definition: TrackBase.h:669
TrackingParticleSelector tpSelector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::View< reco::Track > > labelTokenForDrCalculation
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
void initEvent(edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
virtual void bookRecoHistos(DQMStore::IBooker &ibook)=0
virtual void fillProfileHistosFromVectors(int counter)=0
virtual void initialize()=0
virtual void bookSimHistos(DQMStore::IBooker &ibook)=0
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
T min(T a, T b)
Definition: MathUtil.h:58
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
MultiTrackValidator(const edm::ParameterSet &pset)
Constructor.
#define LogTrace(id)
ObjectSelector< CosmicTrackingParticleSelector > CosmicTrackingParticleSelector
virtual void finalHistoFits(int counter)=0
MTVHistoProducerAlgo * histoProducerAlgo_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
virtual void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)=0
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
virtual void fill_trackBased_histos(int count, int assTracks, int numRecoTracks, int numSimTracks)=0
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Method called to book the DQM histograms.
std::string const & label() const
Definition: InputTag.h:42
EncodedEventId eventId() const
Signal source, crossing number.
Point vertex() const
Parent vertex position.
std::string const & process() const
Definition: InputTag.h:46
virtual void fill_generic_recoTrack_histos(int count, const reco::Track &track, const math::XYZPoint &bsPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int nSimHits, double sharedFraction, double dR)=0
Vector momentum() const
spatial momentum vector
Monte Carlo truth information used for tracking validation.
int charge() const
track electric charge
Definition: TrackBase.h:615
std::vector< std::string > associators
int numberOfTrackerHits() const
The number of hits in the tracker. Hits on overlaps in the same layer count separately.
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > labelToken
math::XYZVectorD Vector
point in the space
virtual void fill_generic_simTrack_histos(int counter, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx)=0
edm::EDGetTokenT< TrackingParticleCollection > label_tp_fake
std::string const & instance() const
Definition: InputTag.h:43
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
T get(const Candidate &c)
Definition: component.h:55
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx2Tag
Definition: Run.h:41
virtual ~MultiTrackValidator()
Destructor.
list at
Definition: asciidump.py:428
Definition: DDAxes.h:10