23 produces<L3MuonTrajectorySeedCollection>();
93 std::vector<edm::Handle<edm::View<TrajectorySeed> > > theSeeds;
94 theSeeds.resize(seedCollections);
95 unsigned seed_size = 0;
98 seed_size += theSeeds[
iseed]->size();
103 unsigned int imuMax=l2muonH->size();
105 for (;imu!=imuMax;++imu){
112 || muRef->innerMomentum().Rho() <
thePtCut
113 || muRef->innerMomentum().R() < 2.5 )
continue;
119 std::vector<TrajectorySeed> tkSeeds;
120 std::set<unsigned> tkIds;
121 tkSeeds.reserve(seed_size);
124 unsigned nSeeds = aSeedCollection->size();
125 for (
unsigned seednr = 0; seednr < nSeeds; ++seednr) {
136 int simTrackId = theFirstSeedingRecHit->
simtrackId();
139 std::set<unsigned>::iterator tkId = tkIds.find(simTrackId);
140 if( tkId != tkIds.end() )
continue;
142 const SimTrack& theSimTrack = (*theSimTracks)[simTrackId];
144 if (
clean(muRef,region,aSeed,theSimTrack) ) tkSeeds.push_back(*aSeed);
145 tkIds.insert(simTrackId);
163 unsigned int isMax=tkSeeds.size();
164 for (;is!=isMax;++is){
188 double etaSeed = theSimTrack.
momentum().Eta();
189 double etaLimit = (fabs(fabs(etaRange.
max())-fabs(etaRange.
mean())) <0.05) ?
190 0.05 : fabs(fabs(etaRange.
max()) - fabs(etaRange.
mean())) ;
192 etaSeed >= (etaRange.
mean() - etaLimit) &&
193 etaSeed <= (etaRange.
mean() + etaLimit) ;
194 if ( !inEtaRange )
return false;
198 double phiSeed = theSimTrack.
momentum().Phi();
199 double phiLimit = (phiMargin.
right() < 0.05 ) ? 0.05 : phiMargin.
right();
202 if ( !inPhiRange )
return false;
207 bool inPtRange = ptSeed >= ptMin && ptSeed<= 2*(muRef->pt());
void update(const edm::EventSetup &setup)
update the services each event
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
T getParameter(std::string const &) const
virtual ~FastTSGFromL2Muon()
MuonServiceProxy * theService
std::vector< edm::InputTag > theSeedCollectionLabels
virtual void produce(edm::Event &ev, const edm::EventSetup &es) override
const Margin & phiMargin() const
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
std::vector< L3MuonTrajectorySeed > L3MuonTrajectorySeedCollection
Geom::Phi< T > phi() const
tuple MuonTrackingRegionBuilder
edm::InputTag theSimTrackCollectionLabel
MuonTrackingRegionBuilder * theRegionBuilder
edm::ParameterSet theConfig
GlobalVector const & direction() const
the direction around which region is constructed
const int & simtrackId() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool clean(reco::TrackRef muRef, RectangularEtaPhiTrackingRegion *region, const BasicTrajectorySeed *aSeed, const SimTrack &theSimTrack)
std::pair< const_iterator, const_iterator > range
FastTSGFromL2Muon(const edm::ParameterSet &cfg)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
float ptMin() const
minimal pt of interest
edm::InputTag theL2CollectionLabel
const math::XYZTLorentzVectorD & momentum() const
virtual void beginRun(edm::Run const &run, edm::EventSetup const &es) override
const Range & etaRange() const
allowed eta range [eta_min, eta_max] interval