|
|
Go to the documentation of this file.
27 LogTrace(
"Muon|RecoMuon|L3TkMuonProducer") <<
" constructor called";
31 trackToken_ = consumes<reco::TrackCollection>(theL3CollectionLabel);
32 produces<TrackCollection>();
33 produces<TrackExtraCollection>();
34 produces<TrackingRecHitCollection>();
39 this->mayConsume<L3MuonTrajectorySeedCollection>(
47 LogTrace(
"Muon|RecoMuon|L3TkMuonProducer") <<
" L3TkMuonProducer destructor called";
52 if (s1.
nHits() == 0 ||
s2.nHits() == 0)
63 if (i1_b->geographicalId() != i2_b->geographicalId())
66 for (
i1 = i1_b,
i2 = i2_b;
i1 != i1_e &&
i2 != i2_e; ++
i1, ++
i2) {
75 for (
unsigned int i = 0;
i !=
v.size(); ++
i) {
78 ss <<
"track with ref: " <<
v[
i].id().id() <<
":" <<
v[
i].key() <<
" and pT: " <<
v[
i]->pt()
79 <<
" with seedRef: " <<
v[
i]->seedRef().id().id() <<
":" <<
v[
i]->seedRef().key();
86 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() <<
":"
92 <<
v[
i]->l1Particle().key();
94 ss <<
" and pT: " <<
v[
i]->l2Track()->pt() <<
" of L2: " <<
v[
i]->l2Track().id().id() <<
":"
95 <<
v[
i]->l2Track().key();
101 std::stringstream
ss;
102 ss <<
" seed ref: " <<
s.id().id() <<
":" <<
s.key() <<
" has " <<
s->nHits() <<
"rechits";
105 for (; it !=
r.second; ++it)
106 ss <<
"\n detId: " << std::hex << it->geographicalId().rawId() <<
std::dec <<
" position: " << it->localPosition()
107 <<
" and error: " << it->localPositionError();
113 const string metname =
"Muon|RecoMuon|L3TkMuonProducer";
116 LogDebug(
metname) <<
" Taking the L3/GLB muons: " << theL3CollectionLabel.label();
118 event.getByToken(trackToken_,
tracks);
124 bool gotL3seeds =
false;
128 vector<TrackRef> orderedTrackTracks(
maxI);
129 for (
unsigned int i = 0;
i !=
maxI;
i++)
133 sort(orderedTrackTracks.begin(), orderedTrackTracks.end(), trackRefBypT);
136 for (
unsigned int i = 0;
i !=
maxI;
i++) {
140 vector<SeedRef> allPossibleOrderedLx;
142 allPossibleOrderedLx.push_back(l3seedRef);
144 <<
" for this tracker track: " << tk.
id().
id() <<
":" << tk.
key();
152 event.getByLabel(l3seedsTag, l3seeds);
157 for (
unsigned int iS = 0; iS != l3seeds->size(); ++iS) {
160 if (l3seedRef.
key() == iS)
163 if (sharedSeed(
seed, thisSeed)) {
164 SeedRef thisSharedSeedRef(l3seeds, iS);
168 <<
"\nadding ANOTHER seed ref: " << thisSharedSeedRef.
id().
id() <<
":"
169 << thisSharedSeedRef.
key() <<
" for this tracker track: " << tk.
id().
id() <<
":" << tk.
key();
171 allPossibleOrderedLx.push_back(thisSharedSeedRef);
178 <<
" before ordering\n"
180 sort(allPossibleOrderedLx.begin(), allPossibleOrderedLx.end(), seedRefBypT);
182 <<
" after ordering\n"
185 for (
unsigned int iL = 0; iL != allPossibleOrderedLx.size(); ++iL) {
186 SeedRef thisRef = allPossibleOrderedLx[iL];
189 <<
" transcribe to pseudoref: " << ref.first <<
":" << ref.second;
190 LXtoL3sMap::iterator
f = LXtoL3s.find(ref);
191 if (
f != LXtoL3s.end()) {
195 <<
"\n cannot compete in pT with track: " <<
f->second.first.id().id() <<
":"
196 <<
f->second.first.key() <<
" (" <<
f->second.first->pt() <<
")"
197 <<
"\n already assigned to pseudo ref: " << ref.first <<
":" << ref.second
198 <<
" which corresponds to seedRef: " <<
f->second.second.id().id() <<
":"
199 <<
f->second.second.key();
204 <<
" is assigned to pseudo ref: " << ref.first <<
":" << ref.second
205 <<
" which corresponds to seedRef: " << thisRef.
id().
id() <<
":" << thisRef.
key();
206 LXtoL3s[ref] = std::make_pair(tk, thisRef);
214 auto outTracks = std::make_unique<TrackCollection>(LXtoL3s.size());
215 auto outTrackExtras = std::make_unique<TrackExtraCollection>(LXtoL3s.size());
217 auto outRecHits = std::make_unique<TrackingRecHitCollection>();
220 LogDebug(
metname) <<
"reading the map to make " << LXtoL3s.size() <<
"products.";
222 LXtoL3sMap::iterator
f = LXtoL3s.begin();
224 for (;
f != LXtoL3s.end(); ++
f, ++
i) {
226 const Track& trk = *(
f->second.first);
227 (*outTracks)[
i] =
Track(trk);
230 LogDebug(
metname) <<
"copy the trackExtra too, and change the seedref";
247 unsigned int iRH = 0;
249 outRecHits->push_back((*hit)->clone());
251 (*outTrackExtras)[
i].setHits(rHits, 0, iRH);
254 LogDebug(
metname) <<
"made: " << outTracks->size() <<
" tracks, " << outTrackExtras->size() <<
" extras and "
255 << outRecHits->size() <<
" rechits.";
263 <<
"================================";
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
std::string const & moduleLabel() const
bool sharedSeed(const L3MuonTrajectorySeed &s1, const L3MuonTrajectorySeed &s2)
std::pair< unsigned int, unsigned int > pseudoRef
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
std::string const & productInstanceName() const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
L3TkMuonProducer(const edm::ParameterSet &)
constructor with config
std::pair< const_iterator, const_iterator > range
unsigned int nHits() const
recHitContainer::const_iterator const_iterator
bool outerOk() const
return true if the outermost hit is valid
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
bool innerOk() const
return true if the innermost hit is valid
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
string printvector(const vector< TrackRef > &v)
std::string const & processName() const
std::string const & processName() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
TypeID unwrappedTypeID() const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
std::string const & productInstanceName() const
PropagationDirection direction() const
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const math::XYZPoint & innerPosition() const
position of the innermost hit
void produce(edm::Event &, const edm::EventSetup &) override
produce candidates
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
T getParameter(std::string const &) const
~L3TkMuonProducer() override
destructor
ProductID id() const
Accessor for product ID.
std::map< pseudoRef, std::pair< reco::TrackRef, SeedRef > > LXtoL3sMap
std::string const & moduleLabel() const
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
key_type key() const
Accessor for product key.
string printseed(const L3TkMuonProducer::SeedRef &s)
const std::string metname