36 template <
class T>
T sqr(
T t) {
return t*
t;}
42 produces<L3MuonTrajectorySeedCollection>();
59 theMerger = std::make_unique<L1MuonSeedsMerger>(cleanerPSet);
66 auto result = std::make_unique<L3MuonTrajectorySeedCollection>();
75 LogDebug(
"TSGFromL1Muon")<<l1muon->size()<<
" l1 muons to seed from.";
77 L1MuonParticleCollection::const_iterator muItr = l1muon->begin();
78 L1MuonParticleCollection::const_iterator muEnd = l1muon->end();
79 for (
size_t iL1 = 0; muItr < muEnd; ++muItr, ++iL1) {
81 if (muItr->gmtMuonCand().empty())
continue;
86 theRegionProducer->setL1Constraint(muon);
87 theFitter->setL1Constraint(muon);
89 typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
90 Regions
regions = theRegionProducer->regions();
91 for (Regions::const_iterator ir=regions.begin(); ir != regions.end(); ++ir) {
97 unsigned int nSets = candidates.
size();
98 for (
unsigned int ic= 0; ic <nSets; ic++) {
101 std::vector<const TrackingRecHit *> trh;
102 for (
unsigned int i= 0, nHits = hits.
size();
i< nHits; ++
i) trh.push_back( hits[
i]->hit() );
104 theFitter->setPxConstraint(hits);
106 if (!track)
continue;
108 if (!
filter(track, trh) ) {
delete track;
continue; }
112 if(theMerger) theMerger->resolve(tracks);
113 for (L1MuonSeedsMerger::TracksAndHits::const_iterator it = tracks.begin();
114 it != tracks.end(); ++it) {
128 LogDebug(
"TSGFromL1Muon")<<
result->size()<<
" seeds to the event.";
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TSGFromL1Muon(const edm::ParameterSet &cfg)
~TSGFromL1Muon() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::pair< const reco::Track *, SeedingHitSet > TrackAndHits
void produce(edm::Event &ev, const edm::EventSetup &es) override
TrajectorySeed trajectorySeed() const
std::vector< TrackAndHits > TracksAndHits
virtual unsigned int size() const =0
Square< F >::type sqr(const F &f)
unsigned int size() const
T get(const Candidate &c)