28 LogTrace(
"Muon|RecoMuon|L3TkMuonProducer")<<
" constructor called";
32 trackToken_ = consumes<reco::TrackCollection>(theL3CollectionLabel);
33 produces<TrackCollection>();
34 produces<TrackExtraCollection>();
35 produces<TrackingRecHitCollection>();
52 LogTrace(
"Muon|RecoMuon|L3TkMuonProducer")<<
" L3TkMuonProducer destructor called";
57 if (s1.
nHits()==0 || s2.
nHits()==0)
return false;
66 if(i1_b->geographicalId() != i2_b->geographicalId())
return false;
68 for (i1=i1_b,i2=i2_b;i1!=i1_e,i2!=i2_e;++i1,++i2){
76 for (
unsigned int i=0;
i!=v.size();++
i) {
78 ss<<
"track with ref: "<<v[
i].id().id()<<
":"<<v[
i].key()
79 <<
" and pT: "<<v[
i]->pt()
80 <<
" with seedRef: "<<v[
i]->seedRef().id().id()<<
":"<<v[
i]->seedRef().key();
87 for (
unsigned int i=0;
i!=v.size();++
i){
89 ss<<
"seed ref: "<<v[
i].id().id()<<
":"<<v[
i].key();
90 if (v[
i]->l2Track().isNull())
91 ss<<
" and pT: "<<v[
i]->l1Particle()->pt()<<
" of L1: "<<v[
i]->l1Particle().id().id()<<
":"<<v[
i]->l1Particle().key();
93 ss<<
" and pT: "<<v[
i]->l2Track()->pt()<<
" of L2: "<<v[
i]->l2Track().id().id()<<
":"<<v[
i]->l2Track().key();
100 ss<<
" seed ref: "<<s.
id().
id()<<
":"<<s.
key()<<
" has "<< s->nHits()<<
"rechits";
103 for (;it!=r.second;++it)
104 ss<<
"\n detId: "<<it->geographicalId()<<
" position: "<<it->localPosition()<<
" and error: "<<it->localPositionError();
110 const string metname =
"Muon|RecoMuon|L3TkMuonProducer";
113 LogDebug(metname)<<
" Taking the L3/GLB muons: "<<theL3CollectionLabel.label();
115 event.getByToken(trackToken_,tracks);
120 unsigned int maxI = tracks->size();
121 bool gotL3seeds=
false;
125 vector<TrackRef> orderedTrackTracks(maxI);
127 LogDebug(metname)<<
"vector of L3 tracks before ordering:\n"<<
printvector(orderedTrackTracks);
129 sort(orderedTrackTracks.begin(),orderedTrackTracks.end(),trackRefBypT);
130 LogDebug(metname)<<
"vector of L3 tracks after ordering:\n"<<
printvector(orderedTrackTracks);
132 for (
unsigned int i=0;
i!=
maxI;
i++) {
136 vector<SeedRef> allPossibleOrderedLx;
138 allPossibleOrderedLx.push_back(l3seedRef);
139 LogDebug(metname)<<
"adding the seed ref: "<<l3seedRef.
id().
id()<<
":"<<l3seedRef.
key()<<
" for this tracker track: "<<tk.
id().
id()<<
":"<<tk.
key();
147 event.getByLabel(l3seedsTag, l3seeds);
149 LogDebug(metname)<<
"got seeds handle from: "<<l3seedsTag;
152 for (
unsigned int iS=0;iS!=l3seeds->size();++iS){
155 if (l3seedRef.
key()==iS)
continue;
157 if (sharedSeed(seed,thisSeed)){
158 SeedRef thisSharedSeedRef(l3seeds,iS);
160 <<
"\nadding ANOTHER seed ref: "<<thisSharedSeedRef.
id().
id()<<
":"<<thisSharedSeedRef.
key()<<
" for this tracker track: "<<tk.
id().
id()<<
":"<<tk.
key();
162 allPossibleOrderedLx.push_back(thisSharedSeedRef);
168 LogDebug(metname)<<
"list of possible Lx objects for tracker track: "<<tk.
id().
id()<<
":"<<tk.
key()<<
" before ordering\n"<<
printvector(allPossibleOrderedLx);
169 sort(allPossibleOrderedLx.begin(),allPossibleOrderedLx.end(),seedRefBypT);
170 LogDebug(metname)<<
"list of possible Lx objects for tracker track: "<<tk.
id().
id()<<
":"<<tk.
key()<<
" after ordering\n"<<
printvector(allPossibleOrderedLx);
172 for (
unsigned int iL=0;iL!=allPossibleOrderedLx.size();++iL){
173 SeedRef thisRef=allPossibleOrderedLx[iL];
175 LogDebug(metname)<<
"seed ref: "<<thisRef.
id().
id()<<
":"<<thisRef.
key()<<
" transcribe to pseudoref: "<<ref.first<<
":"<<ref.second;
176 LXtoL3sMap::iterator
f=LXtoL3s.find(ref);
177 if (f!=LXtoL3s.end()){
180 LogDebug(metname)<<
"this tracker track: "<<tk.
id().
id()<<
":"<<tk.
key()<<
" ("<< tk->pt()<<
")"
181 <<
"\n cannot compete in pT with track: "<<f->second.first.
id().
id()<<
":"<<f->second.first.key()<<
" ("<<f->second.first->pt()<<
")"
182 <<
"\n already assigned to pseudo ref: "<<ref.first<<
":"<<ref.second<<
" which corresponds to seedRef: "<<f->second.second.id().id()<<
":"<<f->second.second.key();
187 <<
" is assigned to pseudo ref: "<<ref.first<<
":"<<ref.second<<
" which corresponds to seedRef: "<<thisRef.
id().
id()<<
":"<<thisRef.
key();
188 LXtoL3s[ref] = std::make_pair(tk,thisRef);
197 std::auto_ptr<TrackCollection> outTracks(
new TrackCollection(LXtoL3s.size()));
203 LogDebug(metname)<<
"reading the map to make "<< LXtoL3s.size()<<
"products.";
205 LXtoL3sMap::iterator
f=LXtoL3s.begin();
207 for (;f!=LXtoL3s.end();++
f,++
i){
209 LogDebug(metname)<<
"copy the track over, and make ref to extra";
210 const Track & trk = *(f->second.first);
211 (*outTracks)[
i] =
Track(trk);
214 LogDebug(metname)<<
"copy the trackExtra too, and change the seedref";
225 LogDebug(metname)<<
"copy the hits too";
228 outRecHits->push_back((*hit)->clone());
233 LogDebug(metname)<<
"made: "<<outTracks->size()<<
" tracks, "<<outTrackExtras->size()<<
" extras and "<<outRecHits->size()<<
" rechits.";
237 event.put(outTracks);
238 event.put(outTrackExtras);
239 event.put(outRecHits);
241 <<
"================================";
PropagationDirection direction() const
T getParameter(std::string const &) const
std::pair< unsigned int, unsigned int > pseudoRef
string printseed(const L3TkMuonProducer::SeedRef &s)
const std::string metname
std::vector< Track > TrackCollection
collection of Tracks
bool innerOk() const
return true if the innermost hit is valid
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
std::string const & processName() const
std::string const & processName() const
const math::XYZPoint & outerPosition() const
position of the outermost hit
bool sharedSeed(const L3MuonTrajectorySeed &s1, const L3MuonTrajectorySeed &s2)
const math::XYZPoint & innerPosition() const
position of the innermost hit
std::string const & moduleLabel() const
std::string const & productInstanceName() const
recHitContainer::const_iterator const_iterator
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
TypeID unwrappedTypeID() const
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
L3TkMuonProducer(const edm::ParameterSet &)
constructor with config
virtual void produce(edm::Event &, const edm::EventSetup &)
produce candidates
std::pair< const_iterator, const_iterator > range
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
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
std::map< pseudoRef, std::pair< reco::TrackRef, SeedRef > > LXtoL3sMap
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
bool outerOk() const
return true if the outermost hit is valid
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
key_type key() const
Accessor for product key.
std::string const & moduleLabel() const
virtual ~L3TkMuonProducer()
destructor
unsigned int nHits() const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
ProductID id() const
Accessor for product ID.
std::string const & productInstanceName() const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
string printvector(const vector< TrackRef > &v)
ParameterSet const & parameterSet(Provenance const &provenance)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.