27 : theGeometricSearchTrackerToken(iC.
esConsumes()) {
37 theCategory =
"TSGForRoadSearch|TrackerSeedGenerator";
83 std::vector<TrajectorySeed> &
result) {
115 if (fts.position().mag() == 0 && fts.momentum().mag() == 0) {
142 if (!
inner.isValid()) {
151 double z =
inner.globalPosition().z();
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();
228 if (!
outer.isValid()) {
237 double z =
outer.globalPosition().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];
332 if (!
inner.isValid()) {
341 double z =
inner.globalPosition().z();
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()) {
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)
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
std::vector< ForwardDetLayer const * > const & posTecLayers() const
T getParameter(std::string const &) const
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
constexpr SubDetector subDetGeom[21]
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theGeometricSearchTrackerToken
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
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
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
T const * product() const
void init(const MuonServiceProxy *service) override
initialize the service
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
Chi2MeasurementEstimator * theChi2Estimator
TSGForRoadSearch(const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
void setEvent(const edm::Event &event) override
set the event: update the MeasurementTracker
void makeSeeds_1(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
DetId geographicalId() const
The label of this GeomDet.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::vector< ForwardDetLayer const * > const & negTidLayers() const
const MuonServiceProxy * theProxyService
const MeasurementTrackerEvent * theMeasurementTrackerEvent
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
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
const PositionType & position() const
std::vector< ForwardDetLayer const * > const & posTidLayers() const
constexpr uint32_t rawId() const
get the raw id
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::string thePropagatorCompatibleName
std::vector< BarrelDetLayer const * > const & tibLayers() const
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
void makeSeeds_4(const reco::Track &, std::vector< TrajectorySeed > &)
inside-out: innermost Pixel/Strip layer
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
char data[epos_bytes_allocation]
static int position[264][3]
std::vector< BarrelDetLayer const * > const & tobLayers() const
std::string thePropagatorName
~TSGForRoadSearch() override
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
const edm::EventSetup & eventSetup() const
Log< level::Warning, false > LogWarning
std::vector< ForwardDetLayer const * > const & negTecLayers() const
TrajectoryStateUpdator * theUpdator