87 std::vector<TrajectorySeed> &
out,
97 layersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
98 hitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
99 fromVertex_(iConfig.getParameter<
bool>(
"fromVertex")),
100 errorRescaling_(iConfig.getParameter<double>(
"errorRescaleFactor")),
109 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
110 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
111 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
false)) {
112 produces<std::vector<TrajectorySeed>>();
134 auto out = std::make_unique<std::vector<TrajectorySeed>>();
136 for (
auto const &
mu : *
src) {
139 if (
debug_ &&
mu.innerTrack().isNonnull())
145 std::unique_ptr<Propagator> pmuon_cloned =
149 int sizeBefore =
out->size();
151 LogDebug(
"OutsideInMuonSeeder") <<
"\n\n\nSeeding for muon of pt " <<
mu.pt() <<
", eta " <<
mu.eta() <<
", phi " 152 <<
mu.phi() << std::endl;
160 std::vector<BarrelDetLayer const *>
const &tob =
measurementTracker->geometricSearchTracker()->tobLayers();
162 int iLayer = tob.size();
164 LogError(
"OutsideInMuonSeeder") <<
"TOB has no layers.";
166 for (
auto it = tob.rbegin(), ed = tob.rend(); it != ed; ++it, --iLayer) {
168 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying TOB " << iLayer <<
" ====" << std::endl;
180 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID+). ";
182 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC+ tot layers " << forwLayers.size() <<
" ====" << std::endl;
184 int iLayer = forwLayers.size();
186 LogError(
"OutsideInMuonSeeder") <<
"TEC+ has no layers.";
189 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
190 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
192 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer +" << +iLayer <<
" ====" << std::endl;
204 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID-). ";
206 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC- tot layers " << forwLayers.size() <<
" ====" << std::endl;
208 int iLayer = forwLayers.size();
210 LogError(
"OutsideInMuonSeeder") <<
"TEC- has no layers.";
213 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
214 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
216 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer -" << -iLayer <<
" ====" << std::endl;
224 LogDebug(
"OutsideInMuonSeeder") <<
"Outcome of seeding for muon of pt " <<
mu.pt() <<
", eta " <<
mu.eta()
225 <<
", phi " <<
mu.phi() <<
": found " << (
out->size() - sizeBefore) <<
" seeds." 234 std::vector<TrajectorySeed> &
out,
240 std::vector<GeometricSearchDet::DetWithState> dets;
247 <<
" returned " << dets.size() <<
" compatible detectors" << std::endl;
250 std::vector<TrajectoryMeasurement> meas;
251 for (std::vector<GeometricSearchDet::DetWithState>::const_iterator it = dets.begin(), ed = dets.end(); it != ed;
255 std::cerr <<
"BOGUS detid " << it->first->geographicalId().rawId() << std::endl;
258 if (!it->second.isValid())
260 std::vector<TrajectoryMeasurement> mymeas =
263 LogDebug(
"OutsideInMuonSeeder") <<
"Query on detector " << it->first->geographicalId().rawId() <<
" returned " 264 << mymeas.size() <<
" measurements." << std::endl;
265 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
267 if (it2->recHit()->isValid())
268 meas.push_back(*it2);
273 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = meas.begin(), ed2 = meas.end(); it2 != ed2; ++it2) {
275 LogDebug(
"OutsideInMuonSeeder") <<
" inspecting Hit with chi2 = " << it2->estimate() << std::endl;
276 LogDebug(
"OutsideInMuonSeeder") <<
" track state " << it2->forwardPredictedState().globalPosition()
278 LogDebug(
"OutsideInMuonSeeder") <<
" rechit position " << it2->recHit()->globalPosition() << std::endl;
286 seedHits.
push_back(*it2->recHit()->hit());
308 tsos = pmuon_cloned->propagate(tsos, det->
surface());
313 if (
hit->isValid()) {
314 LogDebug(
"OutsideInMuonSeeder") <<
" valid rechit on detid " <<
hit->geographicalId().rawId()
317 LogDebug(
"OutsideInMuonSeeder") <<
" invalid rechit on detid " <<
hit->geographicalId().rawId()
void rescaleError(double factor)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const LocalTrajectoryError & localError() const
const TrajectoryStateUpdator * updator_
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
const Chi2MeasurementEstimatorBase * estimator_
float const maxEtaForTOB_
const bool fromVertex_
Do inside-out.
trackerPropagator
Propagator used searching for hits.
Log< level::Error, false > LogError
LocalError positionError() const
const GeomDet * idToDet(DetId) const override
const edm::ESGetToken< Propagator, TrackingComponentsRecord > muonPropagatorToken_
const MagneticField * magfield_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const bool debug_
Dump deug information.
GlobalPoint globalPosition() const
const double errorRescaling_
How much to rescale errors from STA.
void doDebug(const reco::Track &tk) const
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const Propagator * muonPropagator_
const edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > updatorToken_
double eta() const
pseudorapidity of momentum vector
const Plane & surface() const
The nominal surface of the GeomDet.
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
const GlobalTrackingGeometry * geometry_
GlobalVector globalMomentum() const
StringCutObjectSelector< reco::Muon > selector_
Muon selection.
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
edm::EDGetTokenT< edm::View< reco::Muon > > src_
Labels for input collections.
const int layersToTry_
How many layers to try.
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
const int hitsToTry_
How many hits to try on same layer.
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeometryToken_
float const minEtaForTEC_
OutsideInMuonSeeder(const edm::ParameterSet &iConfig)
int doLayer(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const Propagator &muon_propagator, const Propagator &tracker_propagator, const MeasurementTrackerEvent &mte) const
const edm::ESGetToken< Propagator, TrackingComponentsRecord > trackerPropagatorToken_
~OutsideInMuonSeeder() override