26 includeZeroHitMuons(conf.getParameter<bool>(
"includeZeroHitMuons")),
27 acceptOneStubMatchings(conf.getParameter<bool>(
"acceptOneStubMatchings")),
28 UseTracker(conf.getParameter<bool>(
"UseTracker")),
29 UseMuon(conf.getParameter<bool>(
"UseMuon")),
30 AbsoluteNumberOfHits_track(conf.getParameter<bool>(
"AbsoluteNumberOfHits_track")),
31 NHitCut_track(conf.getParameter<unsigned int>(
"NHitCut_track")),
32 EfficiencyCut_track(conf.getParameter<double>(
"EfficiencyCut_track")),
33 PurityCut_track(conf.getParameter<double>(
"PurityCut_track")),
34 AbsoluteNumberOfHits_muon(conf.getParameter<bool>(
"AbsoluteNumberOfHits_muon")),
35 NHitCut_muon(conf.getParameter<unsigned int>(
"NHitCut_muon")),
36 EfficiencyCut_muon(conf.getParameter<double>(
"EfficiencyCut_muon")),
37 PurityCut_muon(conf.getParameter<double>(
"PurityCut_muon")),
38 UsePixels(conf.getParameter<bool>(
"UsePixels")),
39 UseGrouped(conf.getParameter<bool>(
"UseGrouped")),
40 UseSplitting(conf.getParameter<bool>(
"UseSplitting")),
41 ThreeHitTracksAreSpecial(conf.getParameter<bool>(
"ThreeHitTracksAreSpecial")),
42 dumpDT(conf.getParameter<bool>(
"dumpDT")),
43 dumpInputCollections(conf.getParameter<bool>(
"dumpInputCollections")),
44 crossingframe(conf.getParameter<bool>(
"crossingframe")),
45 simtracksTag(conf.getParameter<edm::InputTag>(
"simtracksTag")),
46 simtracksXFTag(conf.getParameter<edm::InputTag>(
"simtracksXFTag")),
52 if (
UseTracker)
edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n UseTracker = TRUE : Tracker SimHits and RecHits WILL be counted";
53 else edm::LogVerbatim(
"MuonAssociatorByHits") <<
"\n UseTracker = FALSE : Tracker SimHits and RecHits WILL NOT be counted";
56 if (
UseMuon)
edm::LogVerbatim(
"MuonAssociatorByHits")<<
" UseMuon = TRUE : Muon SimHits and RecHits WILL be counted";
57 else edm::LogVerbatim(
"MuonAssociatorByHits") <<
" UseMuon = FALSE : Muon SimHits and RecHits WILL NOT be counted"<<endl;
62 <<
"\n includeZeroHitMuons = TRUE"
63 <<
"\n ==> (re)set NHitCut_muon = 0, PurityCut_muon = 0, EfficiencyCut_muon = 0"<<endl;
83 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
87 for (IndexAssociation::const_iterator it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
88 for (std::vector<IndexMatch>::const_iterator itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
94 return outputCollection;
102 int tracker_nshared = 0;
103 int muon_nshared = 0;
104 int global_nshared = 0;
106 double tracker_quality = 0;
107 double tracker_quality_cut;
111 double muon_quality = 0;
112 double muon_quality_cut;
116 double global_quality = 0;
135 if (TPCollectionH.
size()!=0) tPC = *(TPCollectionH.
product());
139 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"reco::Track collection --- size = "<<tC.size();
143 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"TrackingParticle collection --- size = "<<tPC.size();
145 for(TrackingParticleCollection::const_iterator ITER=tPC.begin(); ITER!=tPC.end(); ITER++, j++) {
147 <<
"TrackingParticle "<<j<<
", q = "<<ITER->charge()<<
", p = "<<ITER->p()
148 <<
", pT = "<<ITER->pt()<<
", eta = "<<ITER->eta()<<
", phi = "<<ITER->phi();
151 <<
"\t pdg code = "<<ITER->pdgId()<<
", made of "<<ITER->trackPSimHit().size()<<
" PSimHit"
152 <<
" (in "<<ITER->matchedHit()<<
" layers)"
153 <<
" from "<<ITER->g4Tracks().size()<<
" SimTrack:";
156 <<
"\t\t Id:"<<g4T->trackId()<<
"/Evt:("<<g4T->eventId().event()<<
","<<g4T->eventId().bunchCrossing()<<
")";
172 <<
" has size = "<<SimTk->size();
177 <<
" - Id:"<<ITER->trackId()<<
"/Evt:("<<ITER->eventId().event()<<
","<<ITER->eventId().bunchCrossing()<<
")"
178 <<
" pdgId = "<<ITER->type()<<
", q = "<<ITER->charge()<<
", p = "<<ITER->momentum().P()
179 <<
", pT = "<<ITER->momentum().Pt()<<
", eta = "<<ITER->momentum().Eta()<<
", phi = "<<ITER->momentum().Phi()
180 <<
"\n * "<<*ITER <<endl;
185 <<
" has size = "<<SimVtx->size();
190 <<
" : "<< *VITER <<endl;
197 <<
" has size = "<<simTC.size()<<endl;
199 for(edm::SimTrackContainer::const_iterator ITER=simTC.begin(); ITER!=simTC.end(); ITER++, k++){
202 <<
" - Id:"<<ITER->trackId()<<
"/Evt:("<<ITER->eventId().event()<<
","<<ITER->eventId().bunchCrossing()<<
")"
203 <<
" pdgId = "<<ITER->type()<<
", q = "<<ITER->charge()<<
", p = "<<ITER->momentum().P()
204 <<
", pT = "<<ITER->momentum().Pt()<<
", eta = "<<ITER->momentum().Eta()<<
", phi = "<<ITER->momentum().Phi()
205 <<
"\n * "<<*ITER <<endl;
207 e->
getByLabel(
"g4SimHits",simVertexCollection);
209 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"SimVertex collection with InputTag = "<<
"g4SimHits"
210 <<
" has size = "<<simVC.size()<<endl;
212 for (edm::SimVertexContainer::const_iterator VITER=simVC.begin(); VITER!=simVC.end(); VITER++, kv++){
215 <<
" : "<< *VITER <<endl;
221 for (TrackHitsCollection::const_iterator
track=tC.begin();
track!=tC.end();
track++, tindex++) {
223 <<
"\n"<<
"reco::Track "<<tindex
224 <<
", number of RecHits = "<< (
track->second -
track->first) <<
"\n";
225 tracker_matchedIds_valid.clear();
226 muon_matchedIds_valid.clear();
228 tracker_matchedIds_INVALID.clear();
229 muon_matchedIds_INVALID.clear();
231 bool this_track_matched =
false;
232 int n_matching_simhits = 0;
236 int n_tracker_all = 0;
243 int n_tracker_valid = 0;
244 int n_muon_valid = 0;
249 int n_matched_valid = 0;
250 int n_tracker_matched_valid = 0;
251 int n_muon_matched_valid = 0;
252 int n_dt_matched_valid = 0;
253 int n_csc_matched_valid = 0;
254 int n_rpc_matched_valid = 0;
257 int n_tracker_INVALID = 0;
258 int n_muon_INVALID = 0;
259 int n_dt_INVALID = 0;
260 int n_csc_INVALID = 0;
261 int n_rpc_INVALID = 0;
263 int n_matched_INVALID = 0;
264 int n_tracker_matched_INVALID = 0;
265 int n_muon_matched_INVALID = 0;
266 int n_dt_matched_INVALID = 0;
267 int n_csc_matched_INVALID = 0;
268 int n_rpc_matched_INVALID = 0;
271 getMatchedIds(tracker_matchedIds_valid, muon_matchedIds_valid,
272 tracker_matchedIds_INVALID, muon_matchedIds_INVALID,
273 n_tracker_valid, n_dt_valid, n_csc_valid, n_rpc_valid,
274 n_tracker_matched_valid, n_dt_matched_valid, n_csc_matched_valid, n_rpc_matched_valid,
275 n_tracker_INVALID, n_dt_INVALID, n_csc_INVALID, n_rpc_INVALID,
276 n_tracker_matched_INVALID, n_dt_matched_INVALID, n_csc_matched_INVALID, n_rpc_matched_INVALID,
278 trackertruth, dttruth, csctruth, rpctruth,
281 n_matching_simhits = tracker_matchedIds_valid.size() + muon_matchedIds_valid.size() +
282 tracker_matchedIds_INVALID.size() +muon_matchedIds_INVALID.size();
284 n_muon_valid = n_dt_valid + n_csc_valid + n_rpc_valid;
285 n_valid = n_tracker_valid + n_muon_valid;
286 n_muon_INVALID = n_dt_INVALID + n_csc_INVALID + n_rpc_INVALID;
287 n_INVALID = n_tracker_INVALID + n_muon_INVALID;
290 n_tracker_all = n_tracker_valid + n_tracker_INVALID;
291 n_dt_all = n_dt_valid + n_dt_INVALID;
292 n_csc_all = n_csc_valid + n_csc_INVALID;
293 n_rpc_all = n_rpc_valid + n_rpc_INVALID;
294 n_muon_all = n_muon_valid + n_muon_INVALID;
295 n_all = n_valid + n_INVALID;
297 n_muon_matched_valid = n_dt_matched_valid + n_csc_matched_valid + n_rpc_matched_valid;
298 n_matched_valid = n_tracker_matched_valid + n_muon_matched_valid;
299 n_muon_matched_INVALID = n_dt_matched_INVALID + n_csc_matched_INVALID + n_rpc_matched_INVALID;
300 n_matched_INVALID = n_tracker_matched_INVALID + n_muon_matched_INVALID;
303 int n_tracker_selected_hits = n_tracker_valid;
304 int n_muon_selected_hits = n_muon_valid;
305 int n_dt_selected_hits = n_dt_valid;
306 int n_csc_selected_hits = n_csc_valid;
307 int n_rpc_selected_hits = n_rpc_valid;
310 int n_tracker_matched = n_tracker_matched_valid;
311 int n_muon_matched = n_muon_matched_valid;
312 int n_dt_matched = n_dt_matched_valid;
313 int n_csc_matched = n_csc_matched_valid;
314 int n_rpc_matched = n_rpc_matched_valid;
316 std::string InvMuonHits, ZeroHitMuon;
321 InvMuonHits =
" ***INVALID MUON HITS***";
322 ZeroHitMuon =
" ***ZERO-HIT MUON***";
324 n_muon_selected_hits = n_muon_INVALID;
325 n_dt_selected_hits = n_dt_INVALID;
326 n_csc_selected_hits = n_csc_INVALID;
327 n_rpc_selected_hits = n_rpc_INVALID;
329 n_muon_matched = n_muon_matched_INVALID;
330 n_dt_matched = n_dt_matched_INVALID;
331 n_csc_matched = n_csc_matched_INVALID;
332 n_rpc_matched = n_rpc_matched_INVALID;
335 int n_selected_hits = n_tracker_selected_hits + n_muon_selected_hits;
336 int n_matched = n_tracker_matched + n_muon_matched;
339 <<
"\n"<<
"# TrackingRecHits: "<<(
track->second -
track->first)
340 <<
"\n"<<
"# used RecHits = " << n_all <<
" ("<<n_tracker_all<<
"/"
341 <<n_dt_all<<
"/"<<n_csc_all<<
"/"<<n_rpc_all<<
" in Tracker/DT/CSC/RPC)"<<
", obtained from " << n_matching_simhits <<
" SimHits"
342 <<
"\n"<<
"# selected RecHits = " <<n_selected_hits <<
" (" <<n_tracker_selected_hits<<
"/"
343 <<n_dt_selected_hits<<
"/"<<n_csc_selected_hits<<
"/"<<n_rpc_selected_hits<<
" in Tracker/DT/CSC/RPC)"<<InvMuonHits
344 <<
"\n"<<
"# matched RecHits = " <<n_matched<<
" ("<<n_tracker_matched<<
"/"
345 <<n_dt_matched<<
"/"<<n_csc_matched<<
"/"<<n_rpc_matched<<
" in Tracker/DT/CSC/RPC)";
347 if (n_all>0 && n_matching_simhits == 0)
349 <<
"*** WARNING in MuonAssociatorByHits::associateRecoToSim: no matching PSimHit found for this reco::Track !";
351 if (n_matching_simhits != 0) {
353 <<
"\n"<<
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
354 <<
"\n"<<
"reco::Track "<<tindex<<ZeroHitMuon
355 <<
"\n\t"<<
"made of "<<n_selected_hits<<
" selected RecHits (tracker:"<<n_tracker_selected_hits<<
"/muons:"<<n_muon_selected_hits<<
")";
358 for (TrackingParticleCollection::const_iterator trpart = tPC.begin(); trpart != tPC.end(); ++trpart, ++tpindex) {
359 tracker_nshared =
getShared(tracker_matchedIds_valid, trpart);
360 muon_nshared =
getShared(muon_matchedIds_valid, trpart);
363 muon_nshared =
getShared(muon_matchedIds_INVALID, trpart);
365 global_nshared = tracker_nshared + muon_nshared;
368 else if(n_tracker_selected_hits != 0) tracker_quality = (
static_cast<double>(tracker_nshared)/static_cast<double>(n_tracker_selected_hits));
369 else tracker_quality = 0;
372 else if(n_muon_selected_hits != 0) muon_quality = (
static_cast<double>(muon_nshared)/static_cast<double>(n_muon_selected_hits));
373 else muon_quality = 0;
376 if (n_selected_hits != 0) {
378 global_quality = global_nshared;
380 global_quality = (
static_cast<double>(global_nshared)/static_cast<double>(n_selected_hits));
381 }
else global_quality = 0;
383 bool trackerOk =
false;
384 if (n_tracker_selected_hits != 0) {
385 if (tracker_quality > tracker_quality_cut) trackerOk =
true;
391 if (n_muon_selected_hits != 0) {
392 if (muon_quality > muon_quality_cut) muonOk =
true;
396 bool matchOk = trackerOk || muonOk;
400 matchOk = trackerOk && muonOk;
404 outputCollection[tindex].push_back(
IndexMatch(tpindex, global_quality));
405 this_track_matched =
true;
408 <<
"\n\t"<<
" **MATCHED** with quality = "<<global_quality<<
" (tracker: "<<tracker_quality<<
" / muon: "<<muon_quality<<
")"
409 <<
"\n\t"<<
" N shared hits = "<<global_nshared<<
" (tracker: "<<tracker_nshared<<
" / muon: "<<muon_nshared<<
")"
410 <<
"\n"<<
" to: TrackingParticle " <<tpindex<<
", q = "<<(*trpart).charge()<<
", p = "<<(*trpart).p()
411 <<
", pT = "<<(*trpart).pt()<<
", eta = "<<(*trpart).eta()<<
", phi = "<<(*trpart).phi()
412 <<
"\n\t"<<
" pdg code = "<<(*trpart).pdgId()<<
", made of "<<(*trpart).trackPSimHit().size()<<
" PSimHits"
413 <<
" from "<<(*trpart).g4Tracks().size()<<
" SimTrack:";
415 g4T!=(*trpart).g4Track_end();
418 <<
"\t"<<
" Id:"<<(*g4T).trackId()<<
"/Evt:("<<(*g4T).eventId().event()<<
","<<(*g4T).eventId().bunchCrossing()<<
")";
423 if (global_nshared != 0)
425 <<
"\n\t"<<
" NOT matched to TrackingParticle "<<tpindex
426 <<
" with quality = "<<global_quality<<
" (tracker: "<<tracker_quality<<
" / muon: "<<muon_quality<<
")"
427 <<
"\n"<<
" N shared hits = "<<global_nshared<<
" (tracker: "<<tracker_nshared<<
" / muon: "<<muon_nshared<<
")";
432 if (!this_track_matched) {
434 <<
"\n"<<
" NOT matched to any TrackingParticle";
438 <<
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<
"\n";
445 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"0 reconstructed tracks (-->> 0 associated !)";
448 for (IndexAssociation::iterator it = outputCollection.begin(), ed = outputCollection.end(); it != ed; ++it) {
449 std::sort(it->second.begin(), it->second.end());
451 return outputCollection;
463 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
467 for (IndexAssociation::const_iterator it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
468 for (std::vector<IndexMatch>::const_iterator itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
470 std::make_pair(tC[itma->idx], itma->quality));
475 return outputCollection;
484 int tracker_nshared = 0;
485 int muon_nshared = 0;
486 int global_nshared = 0;
488 double tracker_quality = 0;
489 double tracker_quality_cut;
493 double muon_quality = 0;
494 double muon_quality_cut;
498 double global_quality = 0;
500 double tracker_purity = 0;
501 double muon_purity = 0;
502 double global_purity = 0;
522 if (TPCollectionH.
size()!=0) tPC = *(TPCollectionH.
product());
524 bool any_trackingParticle_matched =
false;
527 for (TrackHitsCollection::const_iterator
track=tC.begin();
track!=tC.end();
track++, tindex++) {
529 <<
"\n"<<
"reco::Track "<<tindex
530 <<
", number of RecHits = "<< (
track->second -
track->first) <<
"\n";
532 tracker_matchedIds_valid.clear();
533 muon_matchedIds_valid.clear();
535 tracker_matchedIds_INVALID.clear();
536 muon_matchedIds_INVALID.clear();
538 int n_matching_simhits = 0;
542 int n_tracker_all = 0;
549 int n_tracker_valid = 0;
550 int n_muon_valid = 0;
555 int n_matched_valid = 0;
556 int n_tracker_matched_valid = 0;
557 int n_muon_matched_valid = 0;
558 int n_dt_matched_valid = 0;
559 int n_csc_matched_valid = 0;
560 int n_rpc_matched_valid = 0;
563 int n_tracker_INVALID = 0;
564 int n_muon_INVALID = 0;
565 int n_dt_INVALID = 0;
566 int n_csc_INVALID = 0;
567 int n_rpc_INVALID = 0;
569 int n_matched_INVALID = 0;
570 int n_tracker_matched_INVALID = 0;
571 int n_muon_matched_INVALID = 0;
572 int n_dt_matched_INVALID = 0;
573 int n_csc_matched_INVALID = 0;
574 int n_rpc_matched_INVALID = 0;
577 getMatchedIds(tracker_matchedIds_valid, muon_matchedIds_valid,
578 tracker_matchedIds_INVALID, muon_matchedIds_INVALID,
579 n_tracker_valid, n_dt_valid, n_csc_valid, n_rpc_valid,
580 n_tracker_matched_valid, n_dt_matched_valid, n_csc_matched_valid, n_rpc_matched_valid,
581 n_tracker_INVALID, n_dt_INVALID, n_csc_INVALID, n_rpc_INVALID,
582 n_tracker_matched_INVALID, n_dt_matched_INVALID, n_csc_matched_INVALID, n_rpc_matched_INVALID,
584 trackertruth, dttruth, csctruth, rpctruth,
587 n_matching_simhits = tracker_matchedIds_valid.size() + muon_matchedIds_valid.size() +
588 tracker_matchedIds_INVALID.size() +muon_matchedIds_INVALID.size();
590 n_muon_valid = n_dt_valid + n_csc_valid + n_rpc_valid;
591 n_valid = n_tracker_valid + n_muon_valid;
592 n_muon_INVALID = n_dt_INVALID + n_csc_INVALID + n_rpc_INVALID;
593 n_INVALID = n_tracker_INVALID + n_muon_INVALID;
596 n_tracker_all = n_tracker_valid + n_tracker_INVALID;
597 n_dt_all = n_dt_valid + n_dt_INVALID;
598 n_csc_all = n_csc_valid + n_csc_INVALID;
599 n_rpc_all = n_rpc_valid + n_rpc_INVALID;
600 n_muon_all = n_muon_valid + n_muon_INVALID;
601 n_all = n_valid + n_INVALID;
603 n_muon_matched_valid = n_dt_matched_valid + n_csc_matched_valid + n_rpc_matched_valid;
604 n_matched_valid = n_tracker_matched_valid + n_muon_matched_valid;
605 n_muon_matched_INVALID = n_dt_matched_INVALID + n_csc_matched_INVALID + n_rpc_matched_INVALID;
606 n_matched_INVALID = n_tracker_matched_INVALID + n_muon_matched_INVALID;
609 int n_tracker_selected_hits = n_tracker_valid;
610 int n_muon_selected_hits = n_muon_valid;
611 int n_dt_selected_hits = n_dt_valid;
612 int n_csc_selected_hits = n_csc_valid;
613 int n_rpc_selected_hits = n_rpc_valid;
616 int n_tracker_matched = n_tracker_matched_valid;
617 int n_muon_matched = n_muon_matched_valid;
618 int n_dt_matched = n_dt_matched_valid;
619 int n_csc_matched = n_csc_matched_valid;
620 int n_rpc_matched = n_rpc_matched_valid;
622 std::string InvMuonHits, ZeroHitMuon;
627 InvMuonHits =
" ***INVALID MUON HITS***";
628 ZeroHitMuon =
" ***ZERO-HIT MUON***";
630 n_muon_selected_hits = n_muon_INVALID;
631 n_dt_selected_hits = n_dt_INVALID;
632 n_csc_selected_hits = n_csc_INVALID;
633 n_rpc_selected_hits = n_rpc_INVALID;
635 n_muon_matched = n_muon_matched_INVALID;
636 n_dt_matched = n_dt_matched_INVALID;
637 n_csc_matched = n_csc_matched_INVALID;
638 n_rpc_matched = n_rpc_matched_INVALID;
641 int n_selected_hits = n_tracker_selected_hits + n_muon_selected_hits;
642 int n_matched = n_tracker_matched + n_muon_matched;
645 <<
"\n"<<
"# TrackingRecHits: "<<(
track->second -
track->first)
646 <<
"\n"<<
"# used RecHits = " <<n_all <<
" ("<<n_tracker_all<<
"/"
647 <<n_dt_all<<
"/"<<n_csc_all<<
"/"<<n_rpc_all<<
" in Tracker/DT/CSC/RPC)"<<
", obtained from " << n_matching_simhits <<
" SimHits"
648 <<
"\n"<<
"# selected RecHits = " <<n_selected_hits <<
" (" <<n_tracker_selected_hits<<
"/"
649 <<n_dt_selected_hits<<
"/"<<n_csc_selected_hits<<
"/"<<n_rpc_selected_hits<<
" in Tracker/DT/CSC/RPC)"<<InvMuonHits
650 <<
"\n"<<
"# matched RecHits = " <<n_matched<<
" ("<<n_tracker_matched<<
"/"
651 <<n_dt_matched<<
"/"<<n_csc_matched<<
"/"<<n_rpc_matched<<
" in Tracker/DT/CSC/RPC)";
653 if (printRtS && n_all>0 && n_matching_simhits==0)
655 <<
"*** WARNING in MuonAssociatorByHits::associateSimToReco: no matching PSimHit found for this reco::Track !";
657 if (n_matching_simhits != 0) {
659 for (TrackingParticleCollection::const_iterator trpart = tPC.begin(); trpart != tPC.end(); ++trpart, ++tpindex) {
661 int n_tracker_simhits = 0;
662 int n_tracker_recounted_simhits = 0;
663 int n_muon_simhits = 0;
664 int n_global_simhits = 0;
665 std::vector<PSimHit> tphits;
667 int n_tracker_selected_simhits = 0;
668 int n_muon_selected_simhits = 0;
669 int n_global_selected_simhits = 0;
672 tracker_nshared =
getShared(tracker_matchedIds_valid, trpart);
673 muon_nshared =
getShared(muon_matchedIds_valid, trpart);
676 muon_nshared =
getShared(muon_matchedIds_INVALID, trpart);
678 global_nshared = tracker_nshared + muon_nshared;
679 if (global_nshared == 0)
continue;
681 for(std::vector<PSimHit>::const_iterator TPhit = trpart->pSimHit_begin(); TPhit != trpart->pSimHit_end(); TPhit++) {
688 unsigned int subdetId =
static_cast<unsigned int>(dId.
subdetId());
698 for(std::vector<PSimHit>::const_iterator TPhitOK = tphits.begin(); TPhitOK != tphits.end(); TPhitOK++) {
721 tphits.push_back(*TPhit);
739 n_tracker_recounted_simhits = tphits.size();
741 if (trpart->trackPSimHit().empty()) {
743 n_tracker_recounted_simhits = tracker_nshared;
744 n_muon_simhits = muon_nshared;
746 n_global_simhits = n_tracker_recounted_simhits + n_muon_simhits;
749 n_muon_selected_simhits = n_muon_simhits;
750 n_global_selected_simhits = n_muon_selected_simhits;
753 n_tracker_selected_simhits = n_tracker_recounted_simhits;
754 n_global_selected_simhits += n_tracker_selected_simhits;
758 else if (n_tracker_selected_simhits!=0)
759 tracker_quality =
static_cast<double>(tracker_nshared)/static_cast<double>(n_tracker_selected_simhits);
760 else tracker_quality = 0;
763 else if (n_muon_selected_simhits!=0)
764 muon_quality =
static_cast<double>(muon_nshared)/static_cast<double>(n_muon_selected_simhits);
765 else muon_quality = 0;
768 if (n_global_selected_simhits != 0) {
770 global_quality = global_nshared;
772 global_quality =
static_cast<double>(global_nshared)/static_cast<double>(n_global_selected_simhits);
774 else global_quality = 0;
777 if (n_selected_hits != 0) {
779 global_purity = global_nshared;
781 global_purity =
static_cast<double>(global_nshared)/static_cast<double>(n_selected_hits);
783 else global_purity = 0;
785 bool trackerOk =
false;
786 if (n_tracker_selected_hits != 0) {
787 if (tracker_quality > tracker_quality_cut) trackerOk =
true;
789 tracker_purity =
static_cast<double>(tracker_nshared)/static_cast<double>(n_tracker_selected_hits);
799 if (n_muon_selected_hits != 0) {
800 if (muon_quality > muon_quality_cut) muonOk =
true;
802 muon_purity =
static_cast<double>(muon_nshared)/static_cast<double>(n_muon_selected_hits);
809 bool matchOk = trackerOk || muonOk;
813 matchOk = trackerOk && muonOk;
817 outputCollection[tpindex].push_back(
IndexMatch(tindex,global_quality));
818 any_trackingParticle_matched =
true;
821 <<
"************************************************************************************************************************"
822 <<
"\n"<<
"TrackingParticle " << tpindex <<
", q = "<<(*trpart).charge()<<
", p = "<<(*trpart).p()
823 <<
", pT = "<<(*trpart).pt()<<
", eta = "<<(*trpart).eta()<<
", phi = "<<(*trpart).phi()
824 <<
"\n"<<
" pdg code = "<<(*trpart).pdgId()
825 <<
", made of "<<(*trpart).trackPSimHit().size()<<
" PSimHits, recounted "<<n_global_simhits<<
" PSimHits"
826 <<
" (tracker:"<<n_tracker_recounted_simhits<<
"/muons:"<<n_muon_simhits<<
")"
827 <<
", from "<<(*trpart).g4Tracks().size()<<
" SimTrack:";
829 g4T!=(*trpart).g4Track_end();
832 <<
" Id:"<<(*g4T).trackId()<<
"/Evt:("<<(*g4T).eventId().event()<<
","<<(*g4T).eventId().bunchCrossing()<<
")";
835 <<
"\t selected "<<n_global_selected_simhits<<
" PSimHits"
836 <<
" (tracker:"<<n_tracker_selected_simhits<<
"/muons:"<<n_muon_selected_simhits<<
")"
837 <<
"\n\t **MATCHED** with quality = "<<global_quality<<
" (tracker: "<<tracker_quality<<
" / muon: "<<muon_quality<<
")"
838 <<
"\n\t and purity = "<<global_purity<<
" (tracker: "<<tracker_purity<<
" / muon: "<<muon_purity<<
")"
839 <<
"\n\t N shared hits = "<<global_nshared<<
" (tracker: "<<tracker_nshared<<
" / muon: "<<muon_nshared<<
")"
840 <<
"\n" <<
" to: reco::Track "<<tindex<<ZeroHitMuon
841 <<
"\n\t"<<
" made of "<<n_selected_hits<<
" RecHits (tracker:"<<n_tracker_valid<<
"/muons:"<<n_muon_selected_hits<<
")";
845 if (global_nshared != 0) {
847 <<
"************************************************************************************************************************"
848 <<
"\n"<<
"TrackingParticle " << tpindex <<
", q = "<<(*trpart).charge()<<
", p = "<<(*trpart).p()
849 <<
", pT = "<<(*trpart).pt()<<
", eta = "<<(*trpart).eta()<<
", phi = "<<(*trpart).phi()
850 <<
"\n"<<
" pdg code = "<<(*trpart).pdgId()
851 <<
", made of "<<(*trpart).trackPSimHit().size()<<
" PSimHits, recounted "<<n_global_simhits<<
" PSimHits"
852 <<
" (tracker:"<<n_tracker_recounted_simhits<<
"/muons:"<<n_muon_simhits<<
")"
853 <<
", from "<<(*trpart).g4Tracks().size()<<
" SimTrack:";
855 g4T!=(*trpart).g4Track_end();
858 <<
" Id:"<<(*g4T).trackId()<<
"/Evt:("<<(*g4T).eventId().event()<<
","<<(*g4T).eventId().bunchCrossing()<<
")";
861 <<
"\t selected "<<n_global_selected_simhits<<
" PSimHits"
862 <<
" (tracker:"<<n_tracker_selected_simhits<<
"/muons:"<<n_muon_selected_simhits<<
")"
863 <<
"\n\t NOT matched to reco::Track "<<tindex<<ZeroHitMuon
864 <<
" with quality = "<<global_quality<<
" (tracker: "<<tracker_quality<<
" / muon: "<<muon_quality<<
")"
865 <<
"\n\t and purity = "<<global_purity<<
" (tracker: "<<tracker_purity<<
" / muon: "<<muon_purity<<
")"
866 <<
"\n\t N shared hits = "<<global_nshared<<
" (tracker: "<<tracker_nshared<<
" / muon: "<<muon_nshared<<
")";
873 if (!any_trackingParticle_matched) {
876 <<
"************************************************************************************************************************"
877 <<
"\n NO TrackingParticle associated to ANY input reco::Track ! \n"
878 <<
"************************************************************************************************************************"<<
"\n";
881 <<
"************************************************************************************************************************"<<
"\n";
885 for (IndexAssociation::iterator it = outputCollection.begin(), ed = outputCollection.end(); it != ed; ++it) {
886 std::sort(it->second.begin(), it->second.end());
888 return outputCollection;
896 unsigned int subdetId =
static_cast<unsigned int>(detId.
subdetId());
900 layerNumber = tibid.
layer();
905 layerNumber = tobid.
layer();
910 layerNumber = tidid.
wheel();
915 layerNumber = tecid.
wheel();
920 layerNumber = pxbid.
layer();
925 layerNumber = pxfid.
disk();
928 <<
"*** WARNING in MuonAssociatorByHits::LayerFromDetid: Unknown Tracker subdetector: subdetId = " << subdetId;
936 int& n_tracker_valid,
int& n_dt_valid,
int& n_csc_valid,
int& n_rpc_valid,
937 int& n_tracker_matched_valid,
int& n_dt_matched_valid,
int& n_csc_matched_valid,
int& n_rpc_matched_valid,
938 int& n_tracker_INVALID,
int& n_dt_INVALID,
int& n_csc_INVALID,
int& n_rpc_INVALID,
939 int& n_tracker_matched_INVALID,
int& n_dt_matched_INVALID,
int& n_csc_matched_INVALID,
int& n_rpc_matched_INVALID,
945 tracker_matchedIds_valid.clear();
946 muon_matchedIds_valid.clear();
948 tracker_matchedIds_INVALID.clear();
949 muon_matchedIds_INVALID.clear();
956 n_tracker_matched_valid = 0;
957 n_dt_matched_valid = 0;
958 n_csc_matched_valid = 0;
959 n_rpc_matched_valid = 0;
961 n_tracker_INVALID = 0;
966 n_tracker_matched_INVALID = 0;
967 n_dt_matched_INVALID = 0;
968 n_csc_matched_INVALID = 0;
969 n_rpc_matched_INVALID = 0;
971 std::vector<SimHitIdpr> SimTrackIds;
977 stringstream hit_index;
984 stringstream detector_id;
987 string hitlog =
"TrackingRecHit "+hit_index.str();
989 std::vector<string> DTSimHits;
994 bool valid_Hit = hitp->
isValid();
998 stringstream detector_id;
1002 detector_id << pxbdetid;
1006 detector_id << pxfdetid;
1010 detector_id << tibdetid;
1014 detector_id << tobdetid;
1018 detector_id << tiddetid;
1022 detector_id << tecdetid;
1025 if (valid_Hit) hitlog = hitlog+
" -Tracker - detID = "+detector_id.str();
1026 else hitlog = hitlog+
" *** INVALID ***"+
" -Tracker - detID = "+detector_id.str();
1034 if(!SimTrackIds.empty()) {
1035 n_tracker_matched_valid++;
1036 tracker_matchedIds_valid[iH] = SimTrackIds;
1039 n_tracker_INVALID++;
1041 if(!SimTrackIds.empty()) {
1042 n_tracker_matched_INVALID++;
1043 tracker_matchedIds_INVALID[iH] = SimTrackIds;
1053 stringstream dt_detector_id;
1054 dt_detector_id << dtdetid;
1055 if (valid_Hit) hitlog = hitlog+
" -Muon DT - detID = "+dt_detector_id.str();
1056 else hitlog = hitlog+
" *** INVALID ***"+
" -Muon DT - detID = "+dt_detector_id.str();
1068 if (!SimTrackIds.empty()) {
1069 n_dt_matched_valid++;
1070 muon_matchedIds_valid[iH] = SimTrackIds;
1075 if (!SimTrackIds.empty()) {
1076 n_dt_matched_INVALID++;
1077 muon_matchedIds_INVALID[iH] = SimTrackIds;
1085 std::vector<PSimHit> dtSimHits = dttruth.
associateHit(*hitp);
1087 stringstream ndthits;
1088 ndthits<<dtSimHits.size();
1089 wireidlog =
"\t DTWireId :"+wid.str()+
", "+ndthits.str()+
" associated PSimHit :";
1091 for (
unsigned int j=0;
j<dtSimHits.size();
j++) {
1094 stringstream simhit;
1095 simhit<<dtSimHits[
j];
1096 string simhitlog =
"\t\t PSimHit "+index.str()+
": "+simhit.str();
1097 DTSimHits.push_back(simhitlog);
1108 std::vector<const TrackingRecHit *> componentHits, phiHits, zHits;
1109 if (dtsegment->
hasPhi()) {
1111 componentHits.insert(componentHits.end(),phiHits.begin(),phiHits.end());
1113 if (dtsegment->
hasZed()) {
1115 componentHits.insert(componentHits.end(),zHits.begin(),zHits.end());
1118 <<
"\n\t this TrackingRecHit is a DTRecSegment4D with "
1119 <<componentHits.size()<<
" hits (phi:"<<phiHits.size()<<
", z:"<<zHits.size()<<
")";
1121 std::vector<SimHitIdpr> i_SimTrackIds;
1123 for (std::vector<const TrackingRecHit *>::const_iterator ithit =componentHits.begin();
1124 ithit != componentHits.end(); ++ithit) {
1129 i_SimTrackIds.clear();
1138 if (!i_SimTrackIds.empty()) {
1139 n_dt_matched_valid++;
1140 muon_matchedIds_valid[iH] = i_SimTrackIds;
1145 if (!i_SimTrackIds.empty()) {
1146 n_dt_matched_INVALID++;
1147 muon_matchedIds_INVALID[iH] = i_SimTrackIds;
1151 <<
"*** WARNING in MuonAssociatorByHits::getMatchedIds, null dynamic_cast of a DT TrackingRecHit !";
1153 unsigned int i_detid = (*ithit)->geographicalId().rawId();
1156 stringstream i_dt_detector_id;
1157 i_dt_detector_id << i_dtdetid;
1160 i_ss<<
"\t\t hit "<<i_compHit<<
" -Muon DT - detID = "<<i_dt_detector_id.str();
1162 string i_hitlog = i_ss.str();
1163 i_hitlog = i_hitlog + write_matched_simtracks(i_SimTrackIds);
1166 SimTrackIds.insert(SimTrackIds.end(),i_SimTrackIds.begin(),i_SimTrackIds.end());
1171 <<
"*** WARNING in MuonAssociatorByHits::getMatchedIds, DT TrackingRecHit is neither DTRecHit1D nor DTRecSegment4D ! ";
1178 stringstream csc_detector_id;
1179 csc_detector_id << cscdetid;
1180 if (valid_Hit) hitlog = hitlog+
" -Muon CSC- detID = "+csc_detector_id.str();
1181 else hitlog = hitlog+
" *** INVALID ***"+
" -Muon CSC- detID = "+csc_detector_id.str();
1193 if (!SimTrackIds.empty()) {
1194 n_csc_matched_valid++;
1195 muon_matchedIds_valid[iH] = SimTrackIds;
1200 if (!SimTrackIds.empty()) {
1201 n_csc_matched_INVALID++;
1202 muon_matchedIds_INVALID[iH] = SimTrackIds;
1213 std::vector<const TrackingRecHit *> componentHits = cscsegment->
recHits();
1215 <<
"\n\t this TrackingRecHit is a CSCSegment with "<<componentHits.size()<<
" hits";
1217 std::vector<SimHitIdpr> i_SimTrackIds;
1219 for (std::vector<const TrackingRecHit *>::const_iterator ithit =componentHits.begin();
1220 ithit != componentHits.end(); ++ithit) {
1225 i_SimTrackIds.clear();
1234 if (!i_SimTrackIds.empty()) {
1235 n_csc_matched_valid++;
1236 muon_matchedIds_valid[iH] = i_SimTrackIds;
1241 if (!i_SimTrackIds.empty()) {
1242 n_csc_matched_INVALID++;
1243 muon_matchedIds_INVALID[iH] = i_SimTrackIds;
1247 <<
"*** WARNING in MuonAssociatorByHits::getMatchedIds, null dynamic_cast of a CSC TrackingRecHit !";
1249 unsigned int i_detid = (*ithit)->geographicalId().rawId();
1252 stringstream i_csc_detector_id;
1253 i_csc_detector_id << i_cscdetid;
1256 i_ss<<
"\t\t hit "<<i_compHit<<
" -Muon CSC- detID = "<<i_csc_detector_id.str();
1258 string i_hitlog = i_ss.str();
1259 i_hitlog = i_hitlog + write_matched_simtracks(i_SimTrackIds);
1262 SimTrackIds.insert(SimTrackIds.end(),i_SimTrackIds.begin(),i_SimTrackIds.end());
1267 <<
"*** WARNING in MuonAssociatorByHits::getMatchedIds, CSC TrackingRecHit is neither CSCRecHit2D nor CSCSegment ! ";
1274 stringstream rpc_detector_id;
1275 rpc_detector_id << rpcdetid;
1276 if (valid_Hit) hitlog = hitlog+
" -Muon RPC- detID = "+rpc_detector_id.str();
1277 else hitlog = hitlog+
" *** INVALID ***"+
" -Muon RPC- detID = "+rpc_detector_id.str();
1285 if (!SimTrackIds.empty()) {
1286 n_rpc_matched_valid++;
1287 muon_matchedIds_valid[iH] = SimTrackIds;
1292 if (!SimTrackIds.empty()) {
1293 n_rpc_matched_INVALID++;
1294 muon_matchedIds_INVALID[iH] = SimTrackIds;
1299 <<
"TrackingRecHit "<<iloop<<
" *** WARNING *** Unexpected Hit from Detector = "<<det;
1303 hitlog = hitlog + write_matched_simtracks(SimTrackIds);
1308 for (
unsigned int j=0;
j<DTSimHits.size();
j++) {
1320 for (MapOfMatchedIds::const_iterator iRecH=matchedIds.begin(); iRecH!=matchedIds.end(); ++iRecH) {
1323 std::vector<SimHitIdpr> SimTrackIds = (*iRecH).second;
1327 for (std::vector<SimHitIdpr>::const_iterator iSimH=SimTrackIds.begin(); iSimH!=SimTrackIds.end(); ++iSimH) {
1328 uint32_t simtrackId = iSimH->first;
1333 if (simtrack->trackId() == simtrackId && simtrack->eventId() == evtId) {
1353 if (!SimTrackIds.empty()) {
1354 hitlog =
" matched to SimTrack";
1356 for(
size_t j=0;
j<SimTrackIds.size();
j++){
1357 stringstream trackid;
1358 trackid<<SimTrackIds[
j].first;
1361 evtid<<SimTrackIds[
j].second.event();
1363 stringstream bunchxid;
1364 bunchxid<<SimTrackIds[
j].second.bunchCrossing();
1366 hitlog = hitlog+
" Id:"+trackid.str()+
"/Evt:("+evtid.str()+
","+bunchxid.str()+
") ";
1368 }
else hitlog =
" *** UNMATCHED ***";
1379 for (
unsigned int j=0;
j<tPCH->size();
j++)
1394 switch (trackType) {
1399 muonHitRefs.push_back(std::make_pair(mur->
track()->recHitsBegin(), mur->
track()->recHitsEnd()));
1401 muonHitRefs.push_back(std::make_pair(hitRefVector.
begin(), hitRefVector.
end()));
1409 muonHitRefs.push_back(std::make_pair(mur->
outerTrack()->recHitsBegin(), mur->
outerTrack()->recHitsEnd()));
1411 muonHitRefs.push_back(std::make_pair(hitRefVector.
begin(), hitRefVector.
end()));
1419 muonHitRefs.push_back(std::make_pair(mur->
globalTrack()->recHitsBegin(), mur->
globalTrack()->recHitsEnd()));
1421 muonHitRefs.push_back(std::make_pair(hitRefVector.
begin(), hitRefVector.
end()));
1427 hitExtractor.
init(*event, *setup);
1429 std::vector<std::pair<size_t, size_t> > muonHitIndices;
1432 std::pair<size_t, size_t> indices(allTMRecHits.
size(), allTMRecHits.
size());
1434 std::vector<const TrackingRecHit *> hits = hitExtractor.
getMuonHits(*mur);
1435 for (std::vector<const TrackingRecHit *>::const_iterator ith = hits.begin(), edh = hits.end(); ith != edh; ++ith) {
1438 indices.second += hits.size();
1440 muonHitIndices.push_back(indices);
1443 for (
size_t i = 0,
n = allTMRecHits.
size();
i <
n; ++
i) {
1447 typedef std::pair<size_t, size_t> index_pair;
1449 for (std::vector<std::pair<size_t, size_t> >::const_iterator idxs = muonHitIndices.begin(), idxend = muonHitIndices.end(); idxs != idxend; ++idxs) {
1450 muonHitRefs.push_back(std::make_pair(hitRefBegin+idxs->first,
1451 hitRefBegin+idxs->second));
1460 for (MuonAssociatorByHits::IndexAssociation::const_iterator it = recSimColl.begin(), ed = recSimColl.end(); it != ed; ++it) {
1462 const std::vector<MuonAssociatorByHits::IndexMatch> & idxAss = it->second;
1463 std::vector<std::pair<TrackingParticleRef, double> > & tpAss = recToSim[rec];
1464 for (std::vector<MuonAssociatorByHits::IndexMatch>::const_iterator ita = idxAss.begin(), eda = idxAss.end(); ita != eda; ++ita) {
1465 tpAss.
push_back(std::make_pair(tPC[ita->idx], ita->quality));
1469 for (MuonAssociatorByHits::IndexAssociation::const_iterator it = simRecColl.begin(), ed = simRecColl.end(); it != ed; ++it) {
1471 const std::vector<MuonAssociatorByHits::IndexMatch> & idxAss = it->second;
1472 std::vector<std::pair<edm::RefToBase<reco::Muon>,
double> > & recAss = simToRec[
sim];
1473 for (std::vector<MuonAssociatorByHits::IndexMatch>::const_iterator ita = idxAss.begin(), eda = idxAss.end(); ita != eda; ++ita) {
1474 recAss.
push_back(std::make_pair(muons[ita->idx], ita->quality));
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
reco::RecoToSimCollection associateRecoToSim(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Reco To Sim with Collections.
unsigned int layer() const
layer id
C const * product() const
Accessor for product collection.
edm::InputTag simtracksXFTag
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &, MuonTrackType, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
bool isTrackerMuon() const
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
std::vector< PSimHit > associateHit(const TrackingRecHit &hit)
unsigned int layerNumber(align::ID)
Layer number increases with rho from 1 to 8.
const_iterator end() const
virtual TrackRef track() const
reference to a Track
const edm::ParameterSet & conf_
edm::InputTag simtracksTag
const_iterator end() const
Termination of iteration.
int LayerFromDetid(const DetId &) const
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit)
const bool AbsoluteNumberOfHits_muon
std::map< unsigned int, std::vector< SimHitIdpr > > MapOfMatchedIds
const_iterator begin() const
Initialize an iterator over the RefVector.
unsigned int layer() const
layer id
const bool includeZeroHitMuons
uint32_t rawId() const
get the raw id
bool isNonnull() const
Checks for non-null.
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
int getShared(MapOfMatchedIds &matchedIds, TrackingParticleCollection::const_iterator trpart) const
const CSCBadChambers * cscBadChambers
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
void post_insert()
post insert action
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
virtual uint32_t partnerDetId() const
std::vector< SimHitIdpr > associateCSCHitId(const CSCRecHit2D *)
unsigned int NHitCut_muon
bool hasPhi() const
Does it have the Phi projection?
const bool acceptOneStubMatchings
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::string write_matched_simtracks(const std::vector< SimHitIdpr > &) const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int disk() const
disk id
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
const bool AbsoluteNumberOfHits_track
const bool ThreeHitTracksAreSpecial
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
std::vector< SimTrack >::const_iterator g4t_iterator
Detector identifier class for the strip tracker.
void getMatchedIds(MapOfMatchedIds &tracker_matchedIds_valid, MapOfMatchedIds &muon_matchedIds_valid, MapOfMatchedIds &tracker_matchedIds_INVALID, MapOfMatchedIds &muon_matchedIds_INVALID, int &n_tracker_valid, int &n_dt_valid, int &n_csc_valid, int &n_rpc_valid, int &n_tracker_matched_valid, int &n_dt_matched_valid, int &n_csc_matched_valid, int &n_rpc_matched_valid, int &n_tracker_INVALID, int &n_dt_INVALID, int &n_csc_INVALID, int &n_rpc_INVALID, int &n_tracker_matched_INVALID, int &n_dt_matched_INVALID, int &n_csc_matched_INVALID, int &n_rpc_matched_INVALID, trackingRecHit_iterator begin, trackingRecHit_iterator end, TrackerHitAssociator *trackertruth, DTHitAssociator &dttruth, MuonTruth &csctruth, RPCHitAssociator &rpctruth, bool printRts) const
bool hasZed() const
Does it have the Z projection?
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< SimVertex > SimVertexContainer
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
T const * product() const
unsigned int wheel() const
wheel id
const_iterator begin() const
unsigned int layer() const
layer id
std::vector< SimHitIdpr > associateDTHitId(const DTRecHit1D *dtrechit)
reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Association Sim To Reco with Collections.
MuonAssociatorByHits(const edm::ParameterSet &)
unsigned int NHitCut_track
void push_back(const RefToBase< T > &)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
std::vector< TrackingParticle > TrackingParticleCollection
DetId geographicalId() const
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const
Detector det() const
get the detector field from this detid
double EfficiencyCut_track
std::vector< SimTrack > SimTrackContainer
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
double EfficiencyCut_muon
std::vector< SimHitIdpr > associateRecHit(const TrackingRecHit &hit)
unsigned int wheel() const
wheel id
std::map< size_t, std::vector< IndexMatch > > IndexAssociation
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
DTWireId wireId() const
Return the wireId.
const bool dumpInputCollections