35 : theCategory(
"Muon|RecoMuon|TSGFromPropagation"),
37 theMaxChi2(iConfig.getParameter<double>(
"MaxChi2")),
38 theFixedErrorRescaling(iConfig.getParameter<double>(
"ErrorRescaling")),
39 theUseVertexStateFlag(iConfig.getParameter<
bool>(
"UseVertexState")),
40 theUpdateStateFlag(iConfig.getParameter<
bool>(
"UpdateState")),
43 if (resetMethod !=
"discrete" && resetMethod !=
"fixed" && resetMethod !=
"matrix") {
44 edm::LogError(
"TSGFromPropagation") <<
"Wrong error rescaling method: " << resetMethod <<
"\n" 45 <<
"Possible choices are: discrete, fixed, matrix.\n" 46 <<
"Use discrete method" << std::endl;
47 resetMethod =
"discrete";
49 if (
"fixed" == resetMethod) {
52 if (
"matrix" == resetMethod) {
57 theSelectStateFlag(iConfig.getParameter<
bool>(
"SelectState")),
59 theSigmaZ(iConfig.getParameter<
double>(
"SigmaZ")),
62 theMeasurementTrackerEventToken(
64 theTrackerToken(iC.esConsumes()) {}
71 std::vector<TrajectorySeed>&
result) {
95 bool usePredictedState =
false;
98 std::vector<TrajectoryMeasurement> alltm;
100 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin(); inl != nls.end(); inl++, ndesLayer++) {
101 if ((*inl ==
nullptr))
105 if ((!alltm.empty())) {
114 usePredictedState =
true;
118 if (alltm.size() > 5)
119 alltm.erase(alltm.begin() + 5, alltm.end());
122 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++,
i++) {
126 container.
push_back(itm->recHit()->hit()->clone());
138 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin(); inl != nls.end(); inl++) {
139 if (!
result.empty() || *inl ==
nullptr) {
142 std::vector<DetLayer::DetWithState> compatDets = (*inl)->compatibleDets(staState, *
propagator(), *
estimator());
144 if (compatDets.empty())
184 theNavigation = std::make_unique<DirectTrackerNavigation>(theTracker);
191 if (staMuon.first && staMuon.first->isValid()) {
193 innerTS = staMuon.first->firstMeasurement().updatedState();
195 innerTS = staMuon.first->lastMeasurement().updatedState();
219 result = fromInside(iniState);
234 const DetId&
id)
const {
240 std::vector<TrajectoryMeasurement>::iterator tmsend = std::remove_if(tms.begin(), tms.end(),
isInvalid());
241 tms.erase(tmsend, tms.end());
247 std::vector<TrajectoryMeasurement>
result;
250 if (compatDets.empty())
253 for (std::vector<DetLayer::DetWithState>::const_iterator idws = compatDets.begin(); idws != compatDets.end();
255 if (idws->second.isValid() && (idws->first)) {
256 std::vector<TrajectoryMeasurement> tmptm =
264 result.insert(
result.end(), tmptm.begin(), tmptm.end());
299 float pt = (staMuon.second)->
pt();
edm::Handle< MeasurementTrackerEvent > theMeasTrackerEvent
TrajectorySeed createSeed(const TrajectoryStateOnSurface &, const DetId &) const
create a hitless seed from a trajectory state
void trackerSeeds(const TrackCand &, const TrackingRegion &, const TrackerTopology *, std::vector< TrajectorySeed > &) override
generate seed(s) for a track
std::unique_ptr< const Chi2MeasurementEstimator > theEstimator
T getParameter(std::string const &) const
const MuonServiceProxy * theService
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken
edm::ESHandle< Propagator > propagator() const
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
const TrajectoryStateUpdator * updator() const
void init(const MuonServiceProxy *) override
initialize
unsigned long long theCacheId_TG
double theFlexErrorRescaling
std::unique_ptr< MuonErrorMatrix > theErrorMatrixAdjuster
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
TrajectoryStateOnSurface innerState(const TrackCand &) const
std::vector< TrajectoryMeasurement > findMeasurements(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer
TSGFromPropagation(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
constructor
bool passSelection(const TrajectoryStateOnSurface &) const
check some quantity and beam-spot compatibility and decide to continue
std::unique_ptr< const TrajectoryStateUpdator > theUpdator
Log< level::Error, false > LogError
std::pair< const Trajectory *, reco::TrackRef > TrackCand
const ResetMethod theResetMethod
void validMeasurements(std::vector< TrajectoryMeasurement > &) const
select valid measurements
const Chi2MeasurementEstimator * estimator() const
void setEvent(const edm::Event &) override
set an event
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
std::unique_ptr< const DirectTrackerNavigation > theNavigation
GlobalPoint globalPosition() const
void getRescalingFactor(const TrackCand &staMuon)
const double theFixedErrorRescaling
const edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
const std::string theCategory
static void multiply(CurvilinearTrajectoryError &initial_error, const CurvilinearTrajectoryError &scale_error)
multiply term by term the two matrix
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > theTrackerToken
void adjust(FreeTrajectoryState &) const
adjust the error matrix of the FTS
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const bool theUseVertexStateFlag
const bool theUpdateStateFlag
GlobalVector globalMomentum() const
TrajectoryStateOnSurface outerTkState(const TrackCand &) const
double z0() const
z coordinate
FreeTrajectoryState const * freeState(bool withErrors=true) const
const bool theSelectStateFlag
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
const edm::EventSetup & eventSetup() const
const edm::ParameterSet theErrorMatrixPset
double dxyDis(const TrajectoryStateOnSurface &tsos) const
double zDis(const TrajectoryStateOnSurface &tsos) const
edm::Handle< reco::BeamSpot > beamSpot
~TSGFromPropagation() override
destructor