27 : theGeometricSearchTrackerToken(iC.
esConsumes()) {
37 theCategory =
"TSGForRoadSearch|TrackerSeedGenerator";
47 if (!errorMatrixPset.
empty()) {
83 std::vector<TrajectorySeed> &
result) {
115 if (fts.position().mag() == 0 && fts.momentum().mag() == 0) {
135 if (!
IPfts(muon, cIPFTS))
159 if (fabs(z) < ptidc.front()->surface().position().z()) {
160 inLayer = blc.front();
161 }
else if (fabs(z) < ptecc.front()->surface().position().z()) {
162 inLayer = (z < 0) ? ntidc.front() : ptidc.front();
164 inLayer = (z < 0) ? ntecc.front() : ptecc.front();
168 std::vector<DetLayer::DetWithState> compatible;
169 compatible.reserve(10);
174 while (compatible.empty()) {
184 inLayer = (z < 0) ? ntidc.front() : ptidc.front();
187 inLayer = (z < 0) ? ntecc.front() : ptecc.front();
218 if (!
IPfts(muon, cIPFTS))
228 if (!outer.isValid()) {
237 double z = outer.globalPosition().z();
242 LogDebug(
theCategory) <<
"starting looking for a compatible layer from: " << outer <<
"\nz: " << z
243 <<
"TEC1 z: " << ptecc.front()->surface().position().z();
245 unsigned int layerShift = 0;
247 if (fabs(z) < ptecc.front()->surface().position().z()) {
248 inLayer = *(blc.rbegin() + layerShift);
251 unsigned int tecIt = 1;
252 for (; tecIt != ptecc.size(); tecIt++) {
254 <<
"z: " << ptecc[tecIt]->surface().position().z();
255 if (fabs(z) < ptecc[tecIt]->surface().
position().
z()) {
256 inLayer = (z < 0) ? ntecc[tecIt - 1] : ptecc[tecIt - 1];
257 layerShift = tecIt - 1;
264 inLayer = (z < 0) ? ntecc.back() : ptecc.back();
270 std::vector<DetLayer::DetWithState> compatible;
271 compatible.reserve(10);
276 while (compatible.empty()) {
284 if (layerShift >= blc.size()) {
285 LogDebug(
theCategory) <<
"all barrel layers are exhausted to find starting state. no seed,";
288 inLayer = *(blc.rbegin() + layerShift);
291 if (layerShift == 0) {
292 LogDebug(
theCategory) <<
"failed to get a compatible module on a TEC layer, using the last TOB layer.";
293 inLayer = *(blc.rbegin() + layerShift);
297 inLayer = (z < 0) ? ntecc[layerShift] : ptecc[layerShift];
319 if (!
IPfts(muon, cIPFTS))
350 if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty())) {
357 std::vector<const ForwardDetLayer *>::const_iterator layerIt;
362 if (fz < fabs(((z > 0) ? ppxlc : npxlc).front()->surface().
position().
z())) {
363 inLayer = blc.front();
364 }
else if (fz < fabs(((z > 0) ? ppxlc : npxlc).back()->surface().
position().
z())) {
365 layerIt = ((z > 0) ? ppxlc : npxlc).begin();
367 }
else if (fz < fabs(((z > 0) ? ptidc : ntidc).front()->surface().
position().
z())) {
368 layerIt = ((z > 0) ? ppxlc : npxlc).end() - 1;
370 }
else if (fz < fabs(((z > 0) ? ptecc : ntecc).front()->surface().
position().
z())) {
371 layerIt = ((z > 0) ? ptidc : ntidc).begin();
373 }
else if (fz < fabs(((z > 0) ? ptecc : ntecc).back()->surface().
position().
z())) {
374 layerIt = ((z > 0) ? ptecc : ntecc).begin();
382 std::vector<DetLayer::DetWithState> compatible;
383 compatible.reserve(10);
388 if (compatible.empty()) {
389 std::vector<const ForwardDetLayer *>::const_iterator pxlEnd = (z > 0) ? ppxlc.end() : npxlc.end();
390 std::vector<const ForwardDetLayer *>::const_iterator tidEnd = (z > 0) ? ptidc.end() : ntidc.end();
391 std::vector<const ForwardDetLayer *>::const_iterator tecEnd = (z > 0) ? ptecc.end() : ntecc.end();
392 std::vector<const ForwardDetLayer *>::const_iterator pxlBegin = (z > 0) ? ppxlc.begin() : npxlc.begin();
393 std::vector<const ForwardDetLayer *>::const_iterator tidBegin = (z > 0) ? ptidc.begin() : ntidc.begin();
394 std::vector<const ForwardDetLayer *>::const_iterator tecBegin = (z > 0) ? ptecc.begin() : ntecc.begin();
397 if (!dynamic_cast<const ForwardDetLayer *>(inLayer))
398 layerIt = pxlBegin--;
400 while (compatible.empty()) {
405 if (layerIt == pxlEnd)
412 if (layerIt == tidEnd)
418 if (layerIt == tecEnd) {
426 <<
"this should not happen... ever. Please report. GeomDetEnumerators::PixelBarrel. no seed.";
431 <<
"this should not happen... ever. Please report. GeomDetEnumerators::TIB. no seed.";
436 <<
"this should not happen... ever. Please report. GeomDetEnumerators::TOB. no seed.";
445 (*layerIt)->compatibleDetsV(
459 std::vector<DetLayer::DetWithState> &compatible,
461 std::vector<TrajectorySeed> &
result)
const {
462 if (compatible.empty()) {
469 for (std::vector<DetLayer::DetWithState>::iterator DWSit = compatible.begin(); DWSit != compatible.end(); ++DWSit) {
470 bool aBareTS =
false;
471 const GeomDet *gd = DWSit->first;
481 for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit != tmp.end(); ++Mit) {
493 if (hit->isValid()) {
505 rhContainer.
push_back(hit->hit()->clone());
527 compatible.front().second, compatible.front().first->geographicalId().rawId());
529 << compatible.front().second
530 <<
"on detector: " << compatible.front().first->geographicalId().rawId();
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::InputTag theMeasurementTrackerEventTag
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
const edm::EventSetup & eventSetup() const
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
constexpr SubDetector subDetGeom[21]
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theGeometricSearchTrackerToken
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
constexpr uint32_t rawId() const
get the raw id
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
GlobalPoint globalPosition() const
void makeSeeds_2(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
void trackerSeeds(const TrackCand &, const TrackingRegion &, const TrackerTopology *, BTSeedCollection &) override
generated seed(s) for a track. the tracking region is not used.
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken
Log< level::Error, false > LogError
std::pair< const Trajectory *, reco::TrackRef > TrackCand
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
void init(const MuonServiceProxy *service) override
initialize the service
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
Chi2MeasurementEstimator * theChi2Estimator
DetId geographicalId() const
The label of this GeomDet.
TSGForRoadSearch(const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
void setEvent(const edm::Event &event) override
set the event: update the MeasurementTracker
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
void makeSeeds_1(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
const MuonServiceProxy * theProxyService
const MeasurementTrackerEvent * theMeasurementTrackerEvent
void makeSeeds_3(const reco::Track &, std::vector< TrajectorySeed > &)
outside-in: outermost Strip layer
void makeSeeds_0(const reco::Track &, std::vector< TrajectorySeed > &)
oseed from inside-out: innermost Strip layer
MuonErrorMatrix * theErrorMatrixAdjuster
void pushTrajectorySeed(const reco::Track &muon, std::vector< DetLayer::DetWithState > &compatible, PropagationDirection direction, std::vector< TrajectorySeed > &result) const
add the seed(s) to the collection of seeds
T const * product() const
T getParameter(std::string const &) const
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::string thePropagatorCompatibleName
void makeSeeds_4(const reco::Track &, std::vector< TrajectorySeed > &)
inside-out: innermost Pixel/Strip layer
char data[epos_bytes_allocation]
static int position[264][3]
std::string thePropagatorName
~TSGForRoadSearch() override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
const PositionType & position() const
TrajectoryStateUpdator * theUpdator
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
tuple Chi2MeasurementEstimator