94 std::vector<TrajectorySeed> &
out,
105 layersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
106 hitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
107 fromVertex_(iConfig.getParameter<bool>(
"fromVertex")),
115 debug_(iConfig.getUntrackedParameter<bool>(
"debug",
false)),
118 produces<std::vector<TrajectorySeed> >();
144 auto out = std::make_unique<std::vector<TrajectorySeed>>();
158 int sizeBefore =
out->size();
159 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n\n\nSeeding for muon of pt " << mu.
pt() <<
", eta " << mu.
eta() <<
", phi " << mu.
phi() << std::endl;
171 std::vector< BarrelDetLayer const* >
const & tob = measurementTracker->geometricSearchTracker()->tobLayers();
173 int iLayer = tob.size();
174 if(iLayer==0)
LogError(
"OutsideInMuonSeeder") <<
"TOB has no layers." ;
176 for (
auto it = tob.rbegin(), ed = tob.rend(); it != ed; ++it, --iLayer) {
177 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying TOB " << iLayer <<
" ====" << std::endl;
179 *(pmuon_cloned.get()),
180 *(ptracker_cloned.get()),
181 *measurementTracker)) {
188 measurementTracker->geometricSearchTracker()->posTidLayers() : measurementTracker->geometricSearchTracker()->posTecLayers();
190 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID+). ";
192 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC+ tot layers " << forwLayers.size() <<
" ====" << std::endl;
194 int iLayer = forwLayers.size();
195 if(iLayer==0)
LogError(
"OutsideInMuonSeeder") <<
"TEC+ has no layers." ;
197 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
198 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
199 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer +" << +iLayer <<
" ====" << std::endl;
201 *(pmuon_cloned.get()),
202 *(ptracker_cloned.get()),
203 *measurementTracker)) {
210 measurementTracker->geometricSearchTracker()->negTidLayers() : measurementTracker->geometricSearchTracker()->negTecLayers();
212 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID-). ";
214 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC- tot layers " << forwLayers.size() <<
" ====" << std::endl;
216 int iLayer = forwLayers.size();
217 if(iLayer==0)
LogError(
"OutsideInMuonSeeder") <<
"TEC- has no layers." ;
219 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
220 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
221 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer -" << -iLayer <<
" ====" << std::endl;
223 *(pmuon_cloned.get()),
224 *(ptracker_cloned.get()),
225 *measurementTracker)) {
230 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"Outcome of seeding for muon of pt " << mu.
pt() <<
", eta " << mu.
eta() <<
", phi " << mu.
phi() <<
": found " << (
out->size() - sizeBefore) <<
" seeds."<< std::endl;
240 std::vector<TrajectorySeed> &
out,
246 std::vector< GeometricSearchDet::DetWithState > dets;
252 " returned " << dets.size() <<
" compatible detectors" << std::endl;
255 std::vector<TrajectoryMeasurement> meas;
256 for (std::vector<GeometricSearchDet::DetWithState>::const_iterator it = dets.begin(), ed = dets.end(); it != ed; ++it) {
258 if (det.
isNull()) {
std::cerr <<
"BOGUS detid " << it->first->geographicalId().rawId() << std::endl;
continue; }
259 if (!it->second.isValid())
continue;
261 if (
debug_)
LogDebug(
"OutsideInMuonSeeder") <<
"Query on detector " << it->first->geographicalId().rawId() <<
" returned " << mymeas.size() <<
" measurements." << std::endl;
262 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
263 if (it2->recHit()->isValid()) meas.push_back(*it2);
268 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = meas.begin(), ed2 = meas.end(); it2 != ed2; ++it2) {
270 LogDebug(
"OutsideInMuonSeeder") <<
" inspecting Hit with chi2 = " << it2->estimate() << std::endl;
271 LogDebug(
"OutsideInMuonSeeder") <<
" track state " << it2->forwardPredictedState().globalPosition() << std::endl;
272 LogDebug(
"OutsideInMuonSeeder") <<
" rechit position " << it2->recHit()->globalPosition() << std::endl;
278 seedHits.
push_back(*it2->recHit()->hit());
295 if (det == 0)
continue;
296 if (
i != 0) tsos = pmuon_cloned->propagate(tsos, det->
surface());
int hitsToTry_
How many hits to try on same layer.
TkRotation< Scalar > RotationType
void rescaleError(double factor)
virtual double pt() const final
transverse momentum
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
virtual ~OutsideInMuonSeeder()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
virtual double eta() const final
momentum pseudorapidity
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
edm::ESHandle< Chi2MeasurementEstimatorBase > estimator_
edm::ESHandle< MagneticField > magfield_
edm::ESHandle< GlobalTrackingGeometry > geometry_
GlobalPoint globalPosition() const
edm::ESHandle< Propagator > trackerPropagator_
edm::ESHandle< TrajectoryStateUpdator > updator_
const Plane & surface() const
The nominal surface of the GeomDet.
LocalError positionError() const
int doLayer(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const Propagator &muon_propagator, const Propagator &tracker_propagator, const MeasurementTrackerEvent &mte) const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool isThere(GeomDetEnumerators::SubDetector subdet) const
uint32_t rawId() const
get the raw id
Point3DBase< Scalar, GlobalTag > PositionType
virtual double phi() const final
momentum azimuthal angle
virtual const GeomDet * idToDet(DetId) const
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
std::string trackerPropagatorName_
double eta() const
pseudorapidity of momentum vector
bool debug_
Dump deug information.
std::string muonPropagatorName_
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
std::string estimatorName_
Abs< T >::type abs(const T &t)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const LocalTrajectoryError & localError() const
bool isNull() const
Checks for null.
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
edm::ESHandle< Propagator > muonPropagator_
GlobalPoint position() const
int layersToTry_
How many layers to try.
StringCutObjectSelector< reco::Muon > selector_
Muon selection.
double errorRescaling_
How much to rescale errors from STA.
edm::EDGetTokenT< edm::View< reco::Muon > > src_
Labels for input collections.
void doDebug(const reco::Track &tk) const
GlobalVector globalMomentum() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
DetId geographicalId() const
Plane::PlanePointer dummyPlane_
Surface used to make a TSOS at the PCA to the beamline.
std::string measurementTrackerName_
T const * product() const
bool fromVertex_
Do inside-out.
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
OutsideInMuonSeeder(const edm::ParameterSet &iConfig)