54 : theCategory(
"FastSimulation|Muons|FastTSGFromPropagation"),
61 theSimTrackCollectionToken_(
63 recHitCombinationsToken_(
66 theMeasurementTrackerEventToken_(
77 std::vector<TrajectorySeed>&
result) {
101 bool usePredictedState =
false;
104 std::vector<TrajectoryMeasurement> alltm;
106 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin(); inl != nls.end(); inl++, ndesLayer++) {
107 if ((*inl ==
nullptr))
111 if ((!alltm.empty())) {
120 usePredictedState =
true;
124 if (alltm.size() > 5)
125 alltm.erase(alltm.begin() + 5, alltm.end());
129 std::vector<TrajectorySeedHitCandidate> outerHits;
132 bool isMatch =
false;
133 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
140 const auto& recHitCombination = (*recHitCombinations)[icomb];
141 if (recHitCombination.empty())
143 int32_t simTrackId = recHitCombination.back()->simTrackId(0);
144 const SimTrack& simtrack = (*simTracks)[simTrackId];
157 unsigned int outerId = 0;
158 for (
const auto& recHitRef : recHitCombination) {
169 for (
const auto& recHitRef : recHitCombination) {
172 auto aTrackingRecHit = std::unique_ptr<TrackingRecHit>(theSeedHits.
hit()->
clone());
179 container.
push_back(recHit->hit()->clone());
191 result.push_back(ts);
200 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
209 const auto& recHitCombination = (*recHitCombinations)[icomb];
210 if (recHitCombination.empty())
212 int32_t simTrackId = recHitCombination.back()->simTrackId(0);
213 const SimTrack& simtrack = (*simTracks)[simTrackId];
226 unsigned int outerId = 0;
227 for (
const auto& recHitRef : recHitCombination) {
238 for (
const auto& recHitRef : recHitCombination) {
241 aTrackingRecHit = theSeedHits.
hit()->
clone();
248 container.
push_back(recHit->hit()->clone());
260 result.push_back(ts);
290 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin(); inl != nls.end(); inl++) {
291 if (!result.empty() || *inl ==
nullptr) {
294 std::vector<DetLayer::DetWithState> compatDets = (*inl)->compatibleDets(staState, *
propagator(), *
estimator());
296 if (compatDets.empty())
299 result.push_back(ts);
318 <<
"Possible choices are: discrete, fixed, matrix.\n"
319 <<
"Use discrete method" << std::endl;
372 theNavigation = std::make_unique<DirectTrackerNavigation>(theTracker);
379 if (staMuon.first && staMuon.first->isValid()) {
381 innerTS = staMuon.first->firstMeasurement().updatedState();
383 innerTS = staMuon.first->lastMeasurement().updatedState();
405 result = fromInside(iniState);
420 const DetId&
id)
const {
426 std::vector<TrajectoryMeasurement>::iterator tmsend = std::remove_if(tms.begin(), tms.end(),
isInvalid());
427 tms.erase(tmsend, tms.end());
433 std::vector<TrajectoryMeasurement>
result;
436 if (compatDets.empty())
439 for (std::vector<DetLayer::DetWithState>::const_iterator idws = compatDets.begin(); idws != compatDets.end();
441 if (idws->second.isValid() && (idws->first)) {
442 std::vector<TrajectoryMeasurement> tmptm =
450 result.insert(result.end(), tmptm.begin(), tmptm.end());
485 float pt = (staMuon.second)->
pt();
540 float localErrors[15];
542 for (
int i = 0;
i < dim; ++
i) {
543 for (
int j = 0;
j <=
i; ++
j) {
544 localErrors[k++] =
m(
i,
j);
547 int surfaceSide =
static_cast<int>(ts.
surfaceSide());
std::vector< TrajectoryMeasurement > findMeasurements(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer
edm::Handle< MeasurementTrackerEvent > theMeasTrackerEvent
std::unique_ptr< const TrajectoryStateUpdator > theUpdator
void rescaleError(double factor)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > theGeometryToken
void setRecHitCombinationIndex(edm::OwnVector< T > &recHits, int32_t icomb)
const math::XYZVectorD & trackerSurfacePosition() const
FastTSGFromPropagation(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
constructor
edm::Handle< reco::BeamSpot > theBeamSpot
bool theUseVertexStateFlag
void adjust(FreeTrajectoryState &) const
adjust the error matrix of the FTS
uint16_t *__restrict__ id
const LocalTrajectoryParameters & localParameters() const
const GlobalTrajectoryParameters & parameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SimTrackContainer > theSimTrackCollectionToken_
edm::Handle< edm::SimTrackContainer > theSimTracks
const CurvilinearTrajectoryError & curvilinearError() const
std::string thePropagatorName
constexpr uint32_t rawId() const
get the raw id
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTTRHBuilderToken
GlobalPoint globalPosition() const
void validMeasurements(std::vector< TrajectoryMeasurement > &) const
select valid measurements
const MuonServiceProxy * theService
std::string theResetMethod
Log< level::Error, false > LogError
std::pair< const Trajectory *, reco::TrackRef > TrackCand
float charge() const
charge
const Plane & surface() const
The nominal surface of the GeomDet.
const CurvilinearTrajectoryError & curvilinearError() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
theSigmaZ(iConfig.getParameter< double >("SigmaZ"))
const Chi2MeasurementEstimator * estimator() const
theTrackerToken(iC.esConsumes())
double theFlexErrorRescaling
void getRescalingFactor(const TrackCand &staMuon)
static const double pts[33]
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken_
~FastTSGFromPropagation() override
destructor
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const edm::ParameterSet theConfig
const SurfaceType & surface() const
bool passSelection(const TrajectoryStateOnSurface &) const
check some quantity and beam-spot compatibility and decide to continue
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
FreeTrajectoryState const * freeState(bool withErrors=true) const
unsigned int detId() const
TrajectoryStateOnSurface outerTkState(const TrackCand &) const
const AlgebraicSymMatrix55 & matrix() const
static void multiply(CurvilinearTrajectoryError &initial_error, const CurvilinearTrajectoryError &scale_error)
multiply term by term the two matrix
TrajectoryStateOnSurface innerState(const TrackCand &) const
const LocalTrajectoryError & localError() const
const TrackerGeomDet * idToDet(DetId) const override
GlobalVector momentum() const
void trackerSeeds(const TrackCand &, const TrackingRegion &, const TrackerTopology *tTopo, std::vector< TrajectorySeed > &) override
generate seed(s) for a track
void init(const MuonServiceProxy *) override
initialize
void rescaleError(double factor)
const TrackerGeometry * theGeometry
double zDis(const TrajectoryStateOnSurface &tsos) const
const TrajectoryStateUpdator * updator() const
const GlobalTrajectoryParameters & globalParameters() const
std::unique_ptr< const DirectTrackerNavigation > theNavigation
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
edm::ESHandle< Propagator > propagator() const
TrajectorySeed createSeed(const TrajectoryStateOnSurface &, const DetId &) const
create a hitless seed from a trajectory state
void stateOnDet(const TrajectoryStateOnSurface &ts, unsigned int detid, PTrajectoryStateOnDet &pts) const
A mere copy (without memory leak) of an existing tracking method.
T getParameter(std::string const &) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
edm::Handle< FastTrackerRecHitCombinationCollection > recHitCombinations
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theTrackerToken
void setEvent(const edm::Event &) override
set an event
GlobalVector globalMomentum() const
edm::EDGetTokenT< reco::BeamSpot > beamSpot_
static int position[264][3]
std::vector< FastTrackerRecHitCombination > FastTrackerRecHitCombinationCollection
double theFixedErrorRescaling
std::unique_ptr< const Chi2MeasurementEstimator > theEstimator
tuple MeasurementTrackerEvent
double dxyDis(const TrajectoryStateOnSurface &tsos) const
edm::EDGetTokenT< FastTrackerRecHitCombinationCollection > recHitCombinationsToken_
const FastTrackerRecHit * hit() const
The Hit itself.
DetId geographicalId() const
FastTrackerRecHit * clone() const override
const BasicVectorType & basicVector() const
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
std::vector< SimTrack > SimTrackContainer
unsigned long long theCacheId_TG
std::unique_ptr< MuonErrorMatrix > theErrorMatrixAdjuster