18 using namespace muonAssociatorByHitsDiagnostics;
20 namespace muonAssociatorByHitsDiagnostics {
26 simtracksTag(conf.getParameter<edm::
InputTag>(
"simtracksTag")),
27 simtracksXFTag(conf.getParameter<edm::
InputTag>(
"simtracksXFTag")),
28 crossingframe(conf.getParameter<bool>(
"crossingframe")) {}
54 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"reco::Track collection --- size = "<<tC.size();
58 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"TrackingParticle collection --- size = "<<tPC.size();
60 for(TrackingParticleCollection::const_iterator ITER=tPC.begin(); ITER!=tPC.end(); ITER++, j++) {
62 <<
"TrackingParticle "<<j<<
", q = "<<ITER->charge()<<
", p = "<<ITER->p()
63 <<
", pT = "<<ITER->pt()<<
", eta = "<<ITER->eta()<<
", phi = "<<ITER->phi();
66 <<
"\t pdg code = "<<ITER->pdgId()<<
", made of "<<ITER->numberOfHits()<<
" PSimHit"
67 <<
" (in "<<ITER->numberOfTrackerLayers()<<
" layers)"
68 <<
" from "<<ITER->g4Tracks().size()<<
" SimTrack:";
71 <<
"\t\t Id:"<<g4T->trackId()<<
"/Evt:("<<g4T->eventId().event()<<
","<<g4T->eventId().bunchCrossing()<<
")";
84 event.getByLabel(simtracksXFTag,cf_simtracks);
86 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"CrossingFrame<SimTrack> collection with InputTag = "<<simtracksXFTag
87 <<
" has size = "<<SimTk->size();
92 <<
" - Id:"<<ITER->trackId()<<
"/Evt:("<<ITER->eventId().event()<<
","<<ITER->eventId().bunchCrossing()<<
")"
93 <<
" pdgId = "<<ITER->type()<<
", q = "<<ITER->charge()<<
", p = "<<ITER->momentum().P()
94 <<
", pT = "<<ITER->momentum().Pt()<<
", eta = "<<ITER->momentum().Eta()<<
", phi = "<<ITER->momentum().Phi()
95 <<
"\n * "<<*ITER <<endl;
97 event.getByLabel(simtracksXFTag,cf_simvertices);
99 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"CrossingFrame<SimVertex> collection with InputTag = "<<simtracksXFTag
100 <<
" has size = "<<SimVtx->size();
105 <<
" : "<< *VITER <<endl;
109 event.getByLabel(simtracksTag,simTrackCollection);
111 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"SimTrack collection with InputTag = "<<simtracksTag
112 <<
" has size = "<<simTC.size()<<endl;
114 for(edm::SimTrackContainer::const_iterator ITER=simTC.begin(); ITER!=simTC.end(); ITER++, k++){
117 <<
" - Id:"<<ITER->trackId()<<
"/Evt:("<<ITER->eventId().event()<<
","<<ITER->eventId().bunchCrossing()<<
")"
118 <<
" pdgId = "<<ITER->type()<<
", q = "<<ITER->charge()<<
", p = "<<ITER->momentum().P()
119 <<
", pT = "<<ITER->momentum().Pt()<<
", eta = "<<ITER->momentum().Eta()<<
", phi = "<<ITER->momentum().Phi()
120 <<
"\n * "<<*ITER <<endl;
122 event.getByLabel(simtracksTag,simVertexCollection);
124 edm::LogVerbatim(
"MuonAssociatorByHits")<<
"\n"<<
"SimVertex collection with InputTag = "<<
"g4SimHits"
125 <<
" has size = "<<simVC.size()<<endl;
127 for (edm::SimVertexContainer::const_iterator VITER=simVC.begin(); VITER!=simVC.end(); VITER++, kv++){
130 <<
" : "<< *VITER <<endl;
175 for (
auto it = tC.
begin(), ed = tC.
end(); it != ed; ++it) {
176 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
204 for (
auto it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
205 for (
auto itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
206 outputCollection.
insert(tC[it->first], std::make_pair(TPCollectionH[itma->idx], itma->quality));
211 return outputCollection;
221 for (
auto it = tC.
begin(), ed = tC.
end(); it != ed; ++it) {
222 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
235 bool printRtS =
false;
243 for (
auto it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
244 for (
auto itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
245 outputCollection.
insert(TPCollectionH[ it->first],
246 std::make_pair(tC[itma->idx], itma->quality));
251 return outputCollection;
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet const conf_
MuonAssociatorByHits(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
reco::RecoToSimCollection associateRecoToSim(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const override
Association Reco To Sim with Collections.
std::vector< TrackingParticle > TrackingParticleCollection
const_iterator end() const
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
std::unique_ptr< muonAssociatorByHitsDiagnostics::InputDumper > diagnostics_
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
void post_insert()
post insert action
std::function< void(const TrackHitsCollection &, const TrackingParticleCollection &)> diagnostics_
MuonAssociatorByHitsHelper::TrackHitsCollection TrackHitsCollection
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
reco::SimToRecoCollection associateSimToReco(const edm::RefToBaseVector< reco::Track > &, const edm::RefVector< TrackingParticleCollection > &, const edm::Event *event=0, const edm::EventSetup *setup=0) const override
Association Sim To Reco with Collections.
std::vector< SimTrack >::const_iterator g4t_iterator
T const * product() const
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< SimVertex > SimVertexContainer
T const * product() const
const_iterator begin() const
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
MuonAssociatorByHitsHelper helper_
std::vector< SimTrack > SimTrackContainer
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")