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 
27 
31 #include<type_traits>
32 
33 
34 #include "TMath.h"
35 #include <TF1.h>
38 //#include <iostream>
39 
40 using namespace std;
41 using namespace edm;
42 
44 
46  //theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet, consumesCollector());
47 
48  ParameterSet psetForHistoProducerAlgo = pset.getParameter<ParameterSet>("histoProducerAlgoBlock");
49  string histoProducerAlgoName = psetForHistoProducerAlgo.getParameter<string>("ComponentName");
50  histoProducerAlgo_ = MTVHistoProducerAlgoFactory::get()->create(histoProducerAlgoName ,psetForHistoProducerAlgo, consumesCollector());
51 
52  dirName_ = pset.getParameter<std::string>("dirName");
53  assMapInput = pset.getParameter< edm::InputTag >("associatormap");
54  associatormapStR = mayConsume<reco::SimToRecoCollection>(assMapInput);
55  associatormapRtS = mayConsume<reco::RecoToSimCollection>(assMapInput);
56  UseAssociators = pset.getParameter< bool >("UseAssociators");
57 
58  m_dEdx1Tag = mayConsume<edm::ValueMap<reco::DeDxData> >(pset.getParameter< edm::InputTag >("dEdx1Tag"));
59  m_dEdx2Tag = mayConsume<edm::ValueMap<reco::DeDxData> >(pset.getParameter< edm::InputTag >("dEdx2Tag"));
60 
61  tpSelector = TrackingParticleSelector(pset.getParameter<double>("ptMinTP"),
62  pset.getParameter<double>("minRapidityTP"),
63  pset.getParameter<double>("maxRapidityTP"),
64  pset.getParameter<double>("tipTP"),
65  pset.getParameter<double>("lipTP"),
66  pset.getParameter<int>("minHitTP"),
67  pset.getParameter<bool>("signalOnlyTP"),
68  pset.getParameter<bool>("chargedOnlyTP"),
69  pset.getParameter<bool>("stableOnlyTP"),
70  pset.getParameter<std::vector<int> >("pdgIdTP"));
71 
73  pset.getParameter<double>("minRapidityTP"),
74  pset.getParameter<double>("maxRapidityTP"),
75  pset.getParameter<double>("tipTP"),
76  pset.getParameter<double>("lipTP"),
77  pset.getParameter<int>("minHitTP"),
78  pset.getParameter<bool>("chargedOnlyTP"),
79  pset.getParameter<std::vector<int> >("pdgIdTP"));
80 
81 
82  ParameterSet psetVsEta = psetForHistoProducerAlgo.getParameter<ParameterSet>("TpSelectorForEfficiencyVsEta");
83  dRtpSelector = TrackingParticleSelector(psetVsEta.getParameter<double>("ptMin"),
84  psetVsEta.getParameter<double>("minRapidity"),
85  psetVsEta.getParameter<double>("maxRapidity"),
86  psetVsEta.getParameter<double>("tip"),
87  psetVsEta.getParameter<double>("lip"),
88  psetVsEta.getParameter<int>("minHit"),
89  psetVsEta.getParameter<bool>("signalOnly"),
90  psetVsEta.getParameter<bool>("chargedOnly"),
91  psetVsEta.getParameter<bool>("stableOnly"),
92  psetVsEta.getParameter<std::vector<int> >("pdgId"));
93 
94  useGsf = pset.getParameter<bool>("useGsf");
95  runStandalone = pset.getParameter<bool>("runStandalone");
96 
97  _simHitTpMapTag = mayConsume<SimHitTPAssociationProducer::SimHitTPAssociationList>(pset.getParameter<edm::InputTag>("simHitTpMapTag"));
98 
99  labelTokenForDrCalculation = consumes<edm::View<reco::Track> >(pset.getParameter<edm::InputTag>("trackCollectionForDrCalculation"));
100 
101  if (!UseAssociators) {
102  associators.clear();
103  associators.push_back(assMapInput.label());
104  }
105 
106 }
107 
108 
110 
111 
113 
114  for (unsigned int ww=0;ww<associators.size();ww++){
115  for (unsigned int www=0;www<label.size();www++){
116  ibook.cd();
117  InputTag algo = label[www];
118  string dirName=dirName_;
119  if (algo.process()!="")
120  dirName+=algo.process()+"_";
121  if(algo.label()!="")
122  dirName+=algo.label()+"_";
123  if(algo.instance()!="")
124  dirName+=algo.instance()+"_";
125  if (dirName.find("Tracks")<dirName.length()){
126  dirName.replace(dirName.find("Tracks"),6,"");
127  }
128  string assoc= associators[ww];
129  if (assoc.find("Track")<assoc.length()){
130  assoc.replace(assoc.find("Track"),5,"");
131  }
132  dirName+=assoc;
133  std::replace(dirName.begin(), dirName.end(), ':', '_');
134 
135  ibook.setCurrentFolder(dirName.c_str());
136 
137  // vector of vector initialization
138  histoProducerAlgo_->initialize(); //TO BE FIXED. I'D LIKE TO AVOID THIS CALL
139 
140  string subDirName = dirName + "/simulation";
141  ibook.setCurrentFolder(subDirName.c_str());
142 
143  //Booking histograms concerning with simulated tracks
145 
146  ibook.cd();
147  ibook.setCurrentFolder(dirName.c_str());
148 
149  //Booking histograms concerning with reconstructed tracks
152 
153  if (UseAssociators) {
155  for (unsigned int w=0;w<associators.size();w++) {
156  setup.get<TrackAssociatorRecord>().get(associators[w],theAssociator);
157  associator.push_back( theAssociator.product() );
158  }//end loop w
159  }
160  }//end loop www
161  }// end loop ww
162 }
163 
164 
166  using namespace reco;
167 
168  edm::LogInfo("TrackValidator") << "\n====================================================" << "\n"
169  << "Analyzing new event" << "\n"
170  << "====================================================\n" << "\n";
171  edm::ESHandle<ParametersDefinerForTP> parametersDefinerTPHandle;
172  setup.get<TrackAssociatorRecord>().get(parametersDefiner,parametersDefinerTPHandle);
173  //Since we modify the object, we must clone it
174  auto parametersDefinerTP = parametersDefinerTPHandle->clone();
175 
176  edm::Handle<TrackingParticleCollection> TPCollectionHeff ;
177  event.getByToken(label_tp_effic,TPCollectionHeff);
178  TrackingParticleCollection const & tPCeff = *(TPCollectionHeff.product());
179 
180  edm::Handle<TrackingParticleCollection> TPCollectionHfake ;
181  event.getByToken(label_tp_fake,TPCollectionHfake);
182 
183 
184  if(parametersDefiner=="CosmicParametersDefinerForTP") {
186  //warning: make sure the TP collection used in the map is the same used in the MTV!
187  event.getByToken(_simHitTpMapTag,simHitsTPAssoc);
188  parametersDefinerTP->initEvent(simHitsTPAssoc);
189  cosmictpSelector.initEvent(simHitsTPAssoc);
190  }
191 
192 
193  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
194  event.getByToken(bsSrc,recoBeamSpotHandle);
195  reco::BeamSpot const & bs = *recoBeamSpotHandle;
196 
198  event.getByToken(label_pileupinfo,puinfoH);
199  PileupSummaryInfo puinfo;
200 
201  for (unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){
202  if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){
203  puinfo=(*puinfoH)[puinfo_ite];
204  break;
205  }
206  }
207 
208  /*
209  edm::Handle<TrackingVertexCollection> tvH;
210  event.getByToken(label_tv,tvH);
211  TrackingVertexCollection const & tv = *tvH;
212  */
213 
214  //calculate dR for TPs
215  float dR_tPCeff[(*TPCollectionHeff).size()];
216  {
217  int j=0;
218  float etaL[(*TPCollectionHeff).size()], phiL[(*TPCollectionHeff).size()];
219  bool okL[(*TPCollectionHeff).size()];
220  for ( auto const & tp2 : *TPCollectionHeff) {
221  okL[j]=false;
222  if(tpSelector(tp2)) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
223  okL[j]=true;
224  auto && p = tp2.momentum();
225  etaL[j] = etaFromXYZ(p.x(),p.y(),p.z());
226  phiL[j] = atan2f(p.y(),p.x());
227 
228  }
229  ++j;
230  }
231  auto i=0U;
232  for ( auto const & tp : *TPCollectionHeff) {
234  if(dRtpSelector(tp)) {//only for those needed for efficiency!
235  auto && p = tp.momentum();
236  float eta = etaFromXYZ(p.x(),p.y(),p.z());
237  float phi = atan2f(p.y(),p.x());
238  for (auto j=0U; j< (*TPCollectionHeff).size(); ++j ) {
239  if (i==j) {continue;}
240  if(okL[j]) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
241  auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]);
242  if (dR_tmp<dR) dR=dR_tmp;
243  }
244  } // ttp2 (j)
245  }
246  dR_tPCeff[i++] = std::sqrt(dR);
247  } // tp
248  }
249 
250  edm::Handle<View<Track> > trackCollectionForDrCalculation;
251  event.getByToken(labelTokenForDrCalculation, trackCollectionForDrCalculation);
252 
253  int w=0; //counter counting the number of sets of histograms
254  for (unsigned int ww=0;ww<associators.size();ww++){
255  for (unsigned int www=0;www<label.size();www++){
256  //
257  //get collections from the event
258  //
259  edm::Handle<View<Track> > trackCollection;
260  if(!event.getByToken(labelToken[www], trackCollection)&&ignoremissingtkcollection_)continue;
261 
262  reco::RecoToSimCollection const * recSimCollP=nullptr;
263  reco::SimToRecoCollection const * simRecCollP=nullptr;
264  reco::RecoToSimCollection recSimCollL;
265  reco::SimToRecoCollection simRecCollL;
266 
267  //associate tracks
268  if(UseAssociators){
269  edm::LogVerbatim("TrackValidator") << "Analyzing "
270  << label[www].process()<<":"
271  << label[www].label()<<":"
272  << label[www].instance()<<" with "
273  << associators[ww].c_str() <<"\n";
274 
275  LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n";
276  recSimCollL = std::move(associator[ww]->associateRecoToSim(trackCollection,
277  TPCollectionHfake,
278  &event,&setup));
279  recSimCollP = &recSimCollL;
280  LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n";
281  simRecCollL = std::move(associator[ww]->associateSimToReco(trackCollection,
282  TPCollectionHeff,
283  &event,&setup));
284  simRecCollP = &simRecCollL;
285  }
286  else{
287  edm::LogVerbatim("TrackValidator") << "Analyzing "
288  << label[www].process()<<":"
289  << label[www].label()<<":"
290  << label[www].instance()<<" with "
291  << assMapInput.process()<<":"
292  << assMapInput.label()<<":"
293  << assMapInput.instance()<<"\n";
294 
295  Handle<reco::SimToRecoCollection > simtorecoCollectionH;
296  event.getByToken(associatormapStR,simtorecoCollectionH);
297  simRecCollP = simtorecoCollectionH.product();
298 
299  Handle<reco::RecoToSimCollection > recotosimCollectionH;
300  event.getByToken(associatormapRtS,recotosimCollectionH);
301  recSimCollP = recotosimCollectionH.product();
302  }
303 
304  reco::RecoToSimCollection const & recSimColl = *recSimCollP;
305  reco::SimToRecoCollection const & simRecColl = *simRecCollP;
306 
307 
308 
309  // ########################################################
310  // fill simulation histograms (LOOP OVER TRACKINGPARTICLES)
311  // ########################################################
312 
313  //compute number of tracks per eta interval
314  //
315  edm::LogVerbatim("TrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
316  int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks
317  int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
318  unsigned sts(0); //This counter counts the number of simTracks surviving the bunchcrossing cut
319  unsigned asts(0); //This counter counts the number of simTracks that are "associated" to recoTracks surviving the bunchcrossing cut
320  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){ //loop over TPs collection for tracking efficiency
321  TrackingParticleRef tpr(TPCollectionHeff, i);
322  TrackingParticle* tp=const_cast<TrackingParticle*>(tpr.get()); // why????
323  TrackingParticle::Vector momentumTP;
324  TrackingParticle::Point vertexTP;
325  double dxySim(0);
326  double dzSim(0);
327  double dR=dR_tPCeff[i];
328 
329  //---------- THIS PART HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
330  //If the TrackingParticle is collison like, get the momentum and vertex at production state
331  if(parametersDefiner=="LhcParametersDefinerForTP" || parametersDefiner=="hltLhcParametersDefinerForTP")
332  {
333  if(! tpSelector(*tp)) continue;
334  momentumTP = tp->momentum();
335  vertexTP = tp->vertex();
336  //Calcualte the impact parameters w.r.t. PCA
337  TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event,setup,tpr);
338  TrackingParticle::Point vertex = parametersDefinerTP->vertex(event,setup,tpr);
339  dxySim = (-vertex.x()*sin(momentum.phi())+vertex.y()*cos(momentum.phi()));
340  dzSim = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/sqrt(momentum.perp2())
341  * momentum.z()/sqrt(momentum.perp2());
342  }
343  //If the TrackingParticle is comics, get the momentum and vertex at PCA
344  if(parametersDefiner=="CosmicParametersDefinerForTP")
345  {
346  if(! cosmictpSelector(tpr,&bs,event,setup)) continue;
347  momentumTP = parametersDefinerTP->momentum(event,setup,tpr);
348  vertexTP = parametersDefinerTP->vertex(event,setup,tpr);
349  dxySim = (-vertexTP.x()*sin(momentumTP.phi())+vertexTP.y()*cos(momentumTP.phi()));
350  dzSim = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/sqrt(momentumTP.perp2())
351  * momentumTP.z()/sqrt(momentumTP.perp2());
352  }
353  //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
354 
355  st++; //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
356 
357  // in the coming lines, histos are filled using as input
358  // - momentumTP
359  // - vertexTP
360  // - dxySim
361  // - dzSim
362 
364 
365 
366  // ##############################################
367  // fill RecoAssociated SimTracks' histograms
368  // ##############################################
369  const reco::Track* matchedTrackPointer=0;
370  if(simRecColl.find(tpr) != simRecColl.end()){
371  auto const & rt = simRecColl[tpr];
372  if (rt.size()!=0) {
373  ats++; //This counter counts the number of simTracks that have a recoTrack associated
374  // isRecoMatched = true; // UNUSED
375  matchedTrackPointer = rt.begin()->first.get();
376  edm::LogVerbatim("TrackValidator") << "TrackingParticle #" << st
377  << " with pt=" << sqrt(momentumTP.perp2())
378  << " associated with quality:" << rt.begin()->second <<"\n";
379  }
380  }else{
381  edm::LogVerbatim("TrackValidator")
382  << "TrackingParticle #" << st
383  << " with pt,eta,phi: "
384  << sqrt(momentumTP.perp2()) << " , "
385  << momentumTP.eta() << " , "
386  << momentumTP.phi() << " , "
387  << " NOT associated to any reco::Track" << "\n";
388  }
389 
390 
391 
392 
393  int nSimHits = tp->numberOfTrackerHits();
394  histoProducerAlgo_->fill_recoAssociated_simTrack_histos(w,*tp,momentumTP,vertexTP,dxySim,dzSim,nSimHits,matchedTrackPointer,puinfo.getPU_NumInteractions(), dR);
395  sts++;
396  if (matchedTrackPointer) asts++;
397 
398 
399 
400 
401  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
402 
403  //if (st!=0) h_tracksSIM[w]->Fill(st); // TO BE FIXED
404 
405 
406  // ##############################################
407  // fill recoTracks histograms (LOOP OVER TRACKS)
408  // ##############################################
409  edm::LogVerbatim("TrackValidator") << "\n# of reco::Tracks with "
410  << label[www].process()<<":"
411  << label[www].label()<<":"
412  << label[www].instance()
413  << ": " << trackCollection->size() << "\n";
414 
415  int sat(0); //This counter counts the number of recoTracks that are associated to SimTracks from Signal only
416  int at(0); //This counter counts the number of recoTracks that are associated to SimTracks
417  int rT(0); //This counter counts the number of recoTracks in general
418 
419 
420  // dE/dx
421  // at some point this could be generalized, with a vector of tags and a corresponding vector of Handles
422  // I'm writing the interface such to take vectors of ValueMaps
425  std::vector<edm::ValueMap<reco::DeDxData> > v_dEdx;
426  v_dEdx.clear();
427  if (label[www].label()=="generalTracks") {
428  try {
429  event.getByToken(m_dEdx1Tag, dEdx1Handle);
430  const edm::ValueMap<reco::DeDxData> dEdx1 = *dEdx1Handle.product();
431  event.getByToken(m_dEdx2Tag, dEdx2Handle);
432  const edm::ValueMap<reco::DeDxData> dEdx2 = *dEdx2Handle.product();
433  v_dEdx.push_back(dEdx1);
434  v_dEdx.push_back(dEdx2);
435  } catch (cms::Exception e){
436  LogTrace("TrackValidator") << "exception found: " << e.what() << "\n";
437  }
438  }
439  //end dE/dx
440 
441 
442  //calculate dR for tracks
443  float dR_trk[trackCollection->size()];
444  int i=0;
445  float etaL[trackCollectionForDrCalculation->size()];
446  float phiL[trackCollectionForDrCalculation->size()];
447  for (auto const & track2 : *trackCollectionForDrCalculation) {
448  auto && p = track2.momentum();
449  etaL[i] = etaFromXYZ(p.x(),p.y(),p.z());
450  phiL[i] = atan2f(p.y(),p.x());
451  ++i;
452  }
453  for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
454  auto const & track = (*trackCollection)[i];
456  auto && p = track.momentum();
457  float eta = etaFromXYZ(p.x(),p.y(),p.z());
458  float phi = atan2f(p.y(),p.x());
459  for(View<Track>::size_type j=0; j<trackCollectionForDrCalculation->size(); ++j){
460  auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]);
461  if ( (dR_tmp<dR) & (dR_tmp>std::numeric_limits<float>::min())) dR=dR_tmp;
462  }
463  dR_trk[i] = std::sqrt(dR);
464  }
465 
466  for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
467 
468  RefToBase<Track> track(trackCollection, i);
469  rT++;
470 
472 
473  bool isSigSimMatched(false);
474  bool isSimMatched(false);
475  bool isChargeMatched(true);
476  int numAssocRecoTracks = 0;
477  int nSimHits = 0;
478  double sharedFraction = 0.;
479  auto const & tp = (recSimColl.find(track) != recSimColl.end()) ? recSimColl[track] : dummyTP;
480 
481  if (!tp.empty()) {
482  nSimHits = tp[0].first->numberOfTrackerHits();
483  sharedFraction = tp[0].second;
484  isSimMatched = true;
485  if (tp[0].first->charge() != track->charge()) isChargeMatched = false;
486  if(simRecColl.find(tp[0].first) != simRecColl.end()) numAssocRecoTracks = simRecColl[tp[0].first].size();
487  at++;
488  for (unsigned int tp_ite=0;tp_ite<tp.size();++tp_ite){
489  TrackingParticle trackpart = *(tp[tp_ite].first);
490  if ((trackpart.eventId().event() == 0) && (trackpart.eventId().bunchCrossing() == 0)){
491  isSigSimMatched = true;
492  sat++;
493  break;
494  }
495  }
496  edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
497  << " associated with quality:" << tp.begin()->second <<"\n";
498  } else {
499  edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
500  << " NOT associated to any TrackingParticle" << "\n";
501  }
502 
503  double dR=dR_trk[i];
504  histoProducerAlgo_->fill_generic_recoTrack_histos(w,*track,bs.position(),isSimMatched,isSigSimMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), nSimHits, sharedFraction,dR);
505 
506  // dE/dx
507  // reco::TrackRef track2 = reco::TrackRef( trackCollection, i );
508  if (v_dEdx.size() > 0) histoProducerAlgo_->fill_dedx_recoTrack_histos(w,track, v_dEdx);
509  //if (v_dEdx.size() > 0) histoProducerAlgo_->fill_dedx_recoTrack_histos(track2, v_dEdx);
510 
511 
512  //Fill other histos
513  //try{ //Is this really necessary ????
514 
515  if (tp.size()==0) continue;
516 
518 
519  TrackingParticleRef tpr = tp.begin()->first;
520 
521  /* TO BE FIXED LATER
522  if (associators[ww]=="TrackAssociatorByChi2"){
523  //association chi2
524  double assocChi2 = -tp.begin()->second;//in association map is stored -chi2
525  h_assochi2[www]->Fill(assocChi2);
526  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
527  }
528  else if (associators[ww]=="quickTrackAssociatorByHits"){
529  double fraction = tp.begin()->second;
530  h_assocFraction[www]->Fill(fraction);
531  h_assocSharedHit[www]->Fill(fraction*track->numberOfValidHits());
532  }
533  */
534 
535 
536  //Get tracking particle parameters at point of closest approach to the beamline
537  TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event,setup,tpr);
538  TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event,setup,tpr);
539  int chargeTP = tpr->charge();
540 
541  histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(w,momentumTP,vertexTP,chargeTP,
542  *track,bs.position());
543 
544 
545  //TO BE FIXED
546  //std::vector<PSimHit> simhits=tpr.get()->trackPSimHit(DetId::Tracker);
547  //nrecHit_vs_nsimHit_rec2sim[w]->Fill(track->numberOfValidHits(), (int)(simhits.end()-simhits.begin() ));
548 
549  /*
550  } // End of try{
551  catch (cms::Exception e){
552  LogTrace("TrackValidator") << "exception found: " << e.what() << "\n";
553  }
554  */
555 
556  } // End of for(View<Track>::size_type i=0; i<trackCollection->size(); ++i){
557 
559 
560  edm::LogVerbatim("TrackValidator") << "Total Simulated: " << st << "\n"
561  << "Total Associated (simToReco): " << ats << "\n"
562  << "Total Reconstructed: " << rT << "\n"
563  << "Total Associated (recoToSim): " << at << "\n"
564  << "Total Fakes: " << rT-at << "\n";
565 
566  w++;
567  } // End of for (unsigned int www=0;www<label.size();www++){
568  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
569 
570 }
571 
573  int w=0;
574  for (unsigned int ww=0;ww<associators.size();ww++){
575  for (unsigned int www=0;www<label.size();www++){
578  w++;
579  }
580  }
581  //if ( out.size() != 0 && dbe_ ) dbe_->save(out);
582 }
583 
584 
585 
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?)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
const double w
Definition: UKUtility.cc:23
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:446
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
std::vector< const TrackAssociatorBase * > associator
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
bool first
Definition: L1TdeRCT.cc:75
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
T const * product() const
Definition: ESHandle.h:86
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
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