98 src_(iConfig.getParameter<edm::InputTag>(
"src")),
99 selector_(iConfig.existsAs<std::
string>(
"cut") ? iConfig.getParameter<std::
string>(
"cut") :
"",
true),
100 layersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
101 hitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
102 fromVertex_(iConfig.getParameter<bool>(
"fromVertex")),
103 errorRescaling_(iConfig.getParameter<double>(
"errorRescaleFactor")),
104 trackerPropagatorName_(iConfig.getParameter<std::
string>(
"trackerPropagator")),
105 muonPropagatorName_(iConfig.getParameter<std::
string>(
"muonPropagator")),
107 estimatorName_(iConfig.getParameter<std::
string>(
"hitCollector")),
108 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
109 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
110 debug_(iConfig.getUntrackedParameter<bool>(
"debug",
false)),
113 produces<std::vector<TrajectorySeed> >();
136 auto_ptr<vector<TrajectorySeed> >
out(
new vector<TrajectorySeed>());
146 int sizeBefore = out->size();
147 if (
debug_)
std::cout <<
"\n\n\nSeeding for muon of pt " << mu.
pt() <<
", eta " << mu.
eta() <<
", phi " << mu.
phi() << std::endl;
159 std::vector< BarrelDetLayer * >
const & tob = measurementTracker->geometricSearchTracker()->tobLayers();
160 int iLayer = 6,
found = 0;
161 for (std::vector<BarrelDetLayer *>::const_reverse_iterator it = tob.rbegin(), ed = tob.rend(); it != ed; ++it, --iLayer) {
162 if (
debug_)
std::cout <<
"\n ==== Trying TOB " << iLayer <<
" ====" << std::endl;
163 if (
doLayer(**it, state, *out, *measurementTracker)) {
169 int iLayer = 9,
found = 0;
170 std::vector< ForwardDetLayer * >
const & tec = measurementTracker->geometricSearchTracker()->posTecLayers();
171 for (std::vector<ForwardDetLayer *>::const_reverse_iterator it = tec.rbegin(), ed = tec.rend(); it != ed; ++it, --iLayer) {
172 if (
debug_)
std::cout <<
"\n ==== Trying TEC " << +iLayer <<
" ====" << std::endl;
173 if (
doLayer(**it, state, *out, *measurementTracker)) {
179 int iLayer = 9,
found = 0;
180 std::vector< ForwardDetLayer * >
const & tec = measurementTracker->geometricSearchTracker()->negTecLayers();
181 for (std::vector<ForwardDetLayer *>::const_reverse_iterator it = tec.rbegin(), ed = tec.rend(); it != ed; ++it, --iLayer) {
182 if (
debug_)
std::cout <<
"\n ==== Trying TEC " << -iLayer <<
" ====" << std::endl;
183 if (
doLayer(**it, state, *out, *measurementTracker)) {
188 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;
199 std::vector< GeometricSearchDet::DetWithState > dets;
205 " returned " << dets.size() <<
" compatible detectors" << std::endl;
208 std::vector<TrajectoryMeasurement> meas;
209 for (std::vector<GeometricSearchDet::DetWithState>::const_iterator it = dets.begin(), ed = dets.end(); it != ed; ++it) {
211 if (det.
isNull()) {
std::cerr <<
"BOGUS detid " << it->first->geographicalId().rawId() << std::endl;
continue; }
212 if (!it->second.isValid())
continue;
214 if (
debug_)
std::cout <<
"Query on detector " << it->first->geographicalId().rawId() <<
" returned " << mymeas.size() <<
" measurements." << std::endl;
215 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
216 if (it2->recHit()->isValid()) meas.push_back(*it2);
221 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = meas.begin(), ed2 = meas.end(); it2 != ed2; ++it2) {
223 std::cout <<
" inspecting Hit with chi2 = " << it2->estimate() << std::endl;
224 std::cout <<
" track state " << it2->forwardPredictedState().globalPosition() << std::endl;
225 std::cout <<
" rechit position " << it2->recHit()->globalPosition() << std::endl;
231 seedHits.
push_back(*it2->recHit()->hit());
248 if (det == 0)
continue;
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()
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::InputTag src_
Labels for input collections.
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
uint32_t rawId() const
get the raw id
Point3DBase< Scalar, GlobalTag > PositionType
bool isNonnull() const
Checks for non-null.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
std::string trackerPropagatorName_
bool isNull() const
Checks for null.
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 getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
edm::ESHandle< Propagator > muonPropagator_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
GlobalPoint position() const
int doLayer(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const MeasurementTrackerEvent &mte) 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.
void doDebug(const reco::Track &tk) const
GlobalVector globalMomentum() const
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.
virtual float pt() const GCC11_FINAL
transverse momentum
std::string measurementTrackerName_
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)