94 std::vector<TrajectorySeed> &
out,
104 selector_(iConfig.existsAs<std::
string>(
"cut") ? iConfig.getParameter<std::
string>(
"cut") :
"",
true),
105 layersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
106 hitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
107 fromVertex_(iConfig.getParameter<bool>(
"fromVertex")),
108 errorRescaling_(iConfig.getParameter<double>(
"errorRescaleFactor")),
109 trackerPropagatorName_(iConfig.getParameter<std::
string>(
"trackerPropagator")),
110 muonPropagatorName_(iConfig.getParameter<std::
string>(
"muonPropagator")),
112 estimatorName_(iConfig.getParameter<std::
string>(
"hitCollector")),
113 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
114 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
115 debug_(iConfig.getUntrackedParameter<bool>(
"debug",
false)),
118 produces<std::vector<TrajectorySeed> >();
141 auto_ptr<vector<TrajectorySeed> >
out(
new vector<TrajectorySeed>());
155 int sizeBefore = out->size();
156 if (
debug_)
std::cout <<
"\n\n\nSeeding for muon of pt " << mu.
pt() <<
", eta " << mu.
eta() <<
", phi " << mu.
phi() << std::endl;
168 std::vector< BarrelDetLayer const* >
const & tob =
measurementTracker->geometricSearchTracker()->tobLayers();
169 int iLayer = 6,
found = 0;
170 for (
auto it = tob.rbegin(), ed = tob.rend(); it != ed; ++it, --iLayer) {
171 if (
debug_)
std::cout <<
"\n ==== Trying TOB " << iLayer <<
" ====" << std::endl;
173 *(pmuon_cloned.get()),
174 *(ptracker_cloned.get()),
181 int iLayer = 9,
found = 0;
182 std::vector< ForwardDetLayer const* >
const & tec =
measurementTracker->geometricSearchTracker()->posTecLayers();
183 for (
auto it = tec.rbegin(), ed = tec.rend(); it != ed; ++it, --iLayer) {
184 if (
debug_)
std::cout <<
"\n ==== Trying TEC " << +iLayer <<
" ====" << std::endl;
186 *(pmuon_cloned.get()),
187 *(ptracker_cloned.get()),
194 int iLayer = 9,
found = 0;
195 std::vector< ForwardDetLayer const* >
const & tec =
measurementTracker->geometricSearchTracker()->negTecLayers();
196 for (
auto it = tec.rbegin(), ed = tec.rend(); it != ed; ++it, --iLayer) {
197 if (
debug_)
std::cout <<
"\n ==== Trying TEC " << -iLayer <<
" ====" << std::endl;
199 *(pmuon_cloned.get()),
200 *(ptracker_cloned.get()),
206 if (
debug_)
std::cout <<
"Outcome of seeding for muon of pt " << mu.
pt() <<
", eta " << mu.
eta() <<
", phi " << mu.
phi() <<
": found " << (out->size() - sizeBefore) <<
" seeds."<< std::endl;
216 std::vector<TrajectorySeed> &
out,
222 std::vector< GeometricSearchDet::DetWithState > dets;
228 " returned " << dets.size() <<
" compatible detectors" << std::endl;
231 std::vector<TrajectoryMeasurement> meas;
232 for (std::vector<GeometricSearchDet::DetWithState>::const_iterator it = dets.begin(), ed = dets.end(); it != ed; ++it) {
234 if (det.
isNull()) {
std::cerr <<
"BOGUS detid " << it->first->geographicalId().rawId() << std::endl;
continue; }
235 if (!it->second.isValid())
continue;
237 if (
debug_)
std::cout <<
"Query on detector " << it->first->geographicalId().rawId() <<
" returned " << mymeas.size() <<
" measurements." << std::endl;
238 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
239 if (it2->recHit()->isValid()) meas.push_back(*it2);
244 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = meas.begin(), ed2 = meas.end(); it2 != ed2; ++it2) {
246 std::cout <<
" inspecting Hit with chi2 = " << it2->estimate() << std::endl;
247 std::cout <<
" track state " << it2->forwardPredictedState().globalPosition() << std::endl;
248 std::cout <<
" rechit position " << it2->recHit()->globalPosition() << std::endl;
254 seedHits.
push_back(*it2->recHit()->hit());
271 if (det == 0)
continue;
272 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)
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
virtual ~OutsideInMuonSeeder()
bool isNonnull() const
Checks for non-null.
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 double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
uint32_t rawId() const
get the raw id
Point3DBase< Scalar, GlobalTag > PositionType
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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
T const * product() 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
volatile std::atomic< bool > shutdown_flag false
Plane::PlanePointer dummyPlane_
Surface used to make a TSOS at the PCA to the beamline.
std::string measurementTrackerName_
virtual double phi() const
momentum azimuthal angle
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)