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")),
101 trackerPropagatorName_(iConfig.getParameter<
std::
string>(
"trackerPropagator")),
102 muonPropagatorName_(iConfig.getParameter<
std::
string>(
"muonPropagator")),
104 estimatorName_(iConfig.getParameter<
std::
string>(
"hitCollector")),
105 updatorName_(
"KFUpdator"),
106 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
107 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
108 debug_(iConfig.getUntrackedParameter<
bool>(
"debug",
false)) {
109 produces<std::vector<TrajectorySeed>>();
132 auto out = std::make_unique<std::vector<TrajectorySeed>>();
134 for (
auto const &
mu : *
src) {
137 if (
debug_ &&
mu.innerTrack().isNonnull())
143 std::unique_ptr<Propagator> pmuon_cloned =
147 int sizeBefore =
out->size();
149 LogDebug(
"OutsideInMuonSeeder") <<
"\n\n\nSeeding for muon of pt " <<
mu.pt() <<
", eta " <<
mu.eta() <<
", phi "
150 <<
mu.phi() << std::endl;
158 std::vector<BarrelDetLayer const *>
const &tob =
measurementTracker->geometricSearchTracker()->tobLayers();
160 int iLayer = tob.size();
162 LogError(
"OutsideInMuonSeeder") <<
"TOB has no layers.";
164 for (
auto it = tob.rbegin(), ed = tob.rend(); it != ed; ++it, --iLayer) {
166 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying TOB " << iLayer <<
" ====" << std::endl;
178 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID+). ";
180 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC+ tot layers " << forwLayers.size() <<
" ====" << std::endl;
182 int iLayer = forwLayers.size();
184 LogError(
"OutsideInMuonSeeder") <<
"TEC+ has no layers.";
187 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
188 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
190 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer +" << +iLayer <<
" ====" << std::endl;
202 LogDebug(
"OutsideInMuonSeeder") <<
"\n We are using the Phase2 Outer Tracker (defined as a TID-). ";
204 LogTrace(
"OutsideInMuonSeeder") <<
"\n ==== TEC- tot layers " << forwLayers.size() <<
" ====" << std::endl;
206 int iLayer = forwLayers.size();
208 LogError(
"OutsideInMuonSeeder") <<
"TEC- has no layers.";
211 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Tot layers " << forwLayers.size() <<
" ====" << std::endl;
212 for (
auto it = forwLayers.rbegin(), ed = forwLayers.rend(); it != ed; ++it, --iLayer) {
214 LogDebug(
"OutsideInMuonSeeder") <<
"\n ==== Trying Forward Layer -" << -iLayer <<
" ====" << std::endl;
222 LogDebug(
"OutsideInMuonSeeder") <<
"Outcome of seeding for muon of pt " <<
mu.pt() <<
", eta " <<
mu.eta()
223 <<
", phi " <<
mu.phi() <<
": found " << (
out->size() - sizeBefore) <<
" seeds."
232 std::vector<TrajectorySeed> &
out,
238 std::vector<GeometricSearchDet::DetWithState> dets;
245 <<
" returned " << dets.size() <<
" compatible detectors" << std::endl;
248 std::vector<TrajectoryMeasurement> meas;
249 for (std::vector<GeometricSearchDet::DetWithState>::const_iterator it = dets.begin(), ed = dets.end(); it != ed;
253 std::cerr <<
"BOGUS detid " << it->first->geographicalId().rawId() << std::endl;
256 if (!it->second.isValid())
258 std::vector<TrajectoryMeasurement> mymeas =
261 LogDebug(
"OutsideInMuonSeeder") <<
"Query on detector " << it->first->geographicalId().rawId() <<
" returned "
262 << mymeas.size() <<
" measurements." << std::endl;
263 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
265 if (it2->recHit()->isValid())
266 meas.push_back(*it2);
271 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = meas.begin(), ed2 = meas.end(); it2 != ed2; ++it2) {
273 LogDebug(
"OutsideInMuonSeeder") <<
" inspecting Hit with chi2 = " << it2->estimate() << std::endl;
274 LogDebug(
"OutsideInMuonSeeder") <<
" track state " << it2->forwardPredictedState().globalPosition()
276 LogDebug(
"OutsideInMuonSeeder") <<
" rechit position " << it2->recHit()->globalPosition() << std::endl;
284 seedHits.
push_back(*it2->recHit()->hit());
306 tsos = pmuon_cloned->propagate(tsos, det->
surface());
311 if (
hit->isValid()) {
312 LogDebug(
"OutsideInMuonSeeder") <<
" valid rechit on detid " <<
hit->geographicalId().rawId()
315 LogDebug(
"OutsideInMuonSeeder") <<
" invalid rechit on detid " <<
hit->geographicalId().rawId()