38 theCategory =
"TSGForRoadSearch|TrackerSeedGenerator";
48 if (!errorMatrixPset.
empty()) {
90 std::vector<TrajectorySeed> &
result) {
122 if (fts.position().mag() == 0 && fts.momentum().mag() == 0) {
142 if (!
IPfts(muon, cIPFTS))
166 if (fabs(z) < ptidc.front()->surface().position().z()) {
167 inLayer = blc.front();
168 }
else if (fabs(z) < ptecc.front()->surface().position().z()) {
169 inLayer = (z < 0) ? ntidc.front() : ptidc.front();
171 inLayer = (z < 0) ? ntecc.front() : ptecc.front();
175 std::vector<DetLayer::DetWithState> compatible;
176 compatible.reserve(10);
181 while (compatible.empty()) {
191 inLayer = (z < 0) ? ntidc.front() : ptidc.front();
194 inLayer = (z < 0) ? ntecc.front() : ptecc.front();
225 if (!
IPfts(muon, cIPFTS))
235 if (!outer.isValid()) {
244 double z = outer.globalPosition().z();
249 LogDebug(
theCategory) <<
"starting looking for a compatible layer from: " << outer <<
"\nz: " << z
250 <<
"TEC1 z: " << ptecc.front()->surface().position().z();
252 unsigned int layerShift = 0;
254 if (fabs(z) < ptecc.front()->surface().position().z()) {
255 inLayer = *(blc.rbegin() + layerShift);
258 unsigned int tecIt = 1;
259 for (; tecIt != ptecc.size(); tecIt++) {
261 <<
"z: " << ptecc[tecIt]->surface().position().z();
262 if (fabs(z) < ptecc[tecIt]->surface().
position().
z()) {
263 inLayer = (z < 0) ? ntecc[tecIt - 1] : ptecc[tecIt - 1];
264 layerShift = tecIt - 1;
271 inLayer = (z < 0) ? ntecc.back() : ptecc.back();
277 std::vector<DetLayer::DetWithState> compatible;
278 compatible.reserve(10);
283 while (compatible.empty()) {
291 if (layerShift >= blc.size()) {
292 LogDebug(
theCategory) <<
"all barrel layers are exhausted to find starting state. no seed,";
295 inLayer = *(blc.rbegin() + layerShift);
298 if (layerShift == 0) {
299 LogDebug(
theCategory) <<
"failed to get a compatible module on a TEC layer, using the last TOB layer.";
300 inLayer = *(blc.rbegin() + layerShift);
304 inLayer = (z < 0) ? ntecc[layerShift] : ptecc[layerShift];
326 if (!
IPfts(muon, cIPFTS))
357 if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty())) {
364 std::vector<const ForwardDetLayer *>::const_iterator layerIt;
369 if (fz < fabs(((z > 0) ? ppxlc : npxlc).front()->surface().
position().
z())) {
370 inLayer = blc.front();
371 }
else if (fz < fabs(((z > 0) ? ppxlc : npxlc).back()->surface().
position().
z())) {
372 layerIt = ((z > 0) ? ppxlc : npxlc).begin();
374 }
else if (fz < fabs(((z > 0) ? ptidc : ntidc).front()->surface().
position().
z())) {
375 layerIt = ((z > 0) ? ppxlc : npxlc).end() - 1;
377 }
else if (fz < fabs(((z > 0) ? ptecc : ntecc).front()->surface().
position().
z())) {
378 layerIt = ((z > 0) ? ptidc : ntidc).begin();
380 }
else if (fz < fabs(((z > 0) ? ptecc : ntecc).back()->surface().
position().
z())) {
381 layerIt = ((z > 0) ? ptecc : ntecc).begin();
389 std::vector<DetLayer::DetWithState> compatible;
390 compatible.reserve(10);
395 if (compatible.empty()) {
396 std::vector<const ForwardDetLayer *>::const_iterator pxlEnd = (z > 0) ? ppxlc.end() : npxlc.end();
397 std::vector<const ForwardDetLayer *>::const_iterator tidEnd = (z > 0) ? ptidc.end() : ntidc.end();
398 std::vector<const ForwardDetLayer *>::const_iterator tecEnd = (z > 0) ? ptecc.end() : ntecc.end();
399 std::vector<const ForwardDetLayer *>::const_iterator pxlBegin = (z > 0) ? ppxlc.begin() : npxlc.begin();
400 std::vector<const ForwardDetLayer *>::const_iterator tidBegin = (z > 0) ? ptidc.begin() : ntidc.begin();
401 std::vector<const ForwardDetLayer *>::const_iterator tecBegin = (z > 0) ? ptecc.begin() : ntecc.begin();
404 if (!dynamic_cast<const ForwardDetLayer *>(inLayer))
405 layerIt = pxlBegin--;
407 while (compatible.empty()) {
412 if (layerIt == pxlEnd)
419 if (layerIt == tidEnd)
425 if (layerIt == tecEnd) {
433 <<
"this should not happen... ever. Please report. GeomDetEnumerators::PixelBarrel. no seed.";
438 <<
"this should not happen... ever. Please report. GeomDetEnumerators::TIB. no seed.";
443 <<
"this should not happen... ever. Please report. GeomDetEnumerators::TOB. no seed.";
452 (*layerIt)->compatibleDetsV(
466 std::vector<DetLayer::DetWithState> &compatible,
468 std::vector<TrajectorySeed> &
result)
const {
469 if (compatible.empty()) {
476 for (std::vector<DetLayer::DetWithState>::iterator DWSit = compatible.begin(); DWSit != compatible.end(); ++DWSit) {
477 bool aBareTS =
false;
478 const GeomDet *gd = DWSit->first;
488 for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit != tmp.end(); ++Mit) {
500 if (hit->isValid()) {
512 rhContainer.
push_back(hit->hit()->clone());
534 compatible.front().second, compatible.front().first->geographicalId().rawId());
536 << compatible.front().second
537 <<
"on detector: " << compatible.front().first->geographicalId().rawId();
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
edm::InputTag theMeasurementTrackerEventTag
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
const edm::EventSetup & eventSetup() const
get the whole EventSetup
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
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
edm::ESHandle< MeasurementTracker > theMeasurementTracker
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.
std::vector< BarrelDetLayer const * > const & tobLayers() const
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken
std::pair< const Trajectory *, reco::TrackRef > TrackCand
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
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
Chi2MeasurementEstimator * theChi2Estimator
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
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
SubDetector subDetGeom[21]
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
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
std::vector< BarrelDetLayer const * > const & tibLayers() const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::string thePropagatorCompatibleName
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
std::vector< ForwardDetLayer const * > const & negTidLayers() const
void makeSeeds_4(const reco::Track &, std::vector< TrajectorySeed > &)
inside-out: innermost Pixel/Strip layer
std::vector< ForwardDetLayer const * > const & posTidLayers() const
char data[epos_bytes_allocation]
static int position[264][3]
std::string thePropagatorName
~TSGForRoadSearch() override
std::vector< ForwardDetLayer const * > const & negTecLayers() const
const PositionType & position() const
TrajectoryStateUpdator * theUpdator
T const * product() const
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.