79 : theLayerMeasurements(
nullptr),
175 if ((muonRecHits.size() > 1) &&
176 (muonRecHits.front()->globalPosition().mag() > muonRecHits.back()->globalPosition().mag())) {
180 for (
auto&& it : tkTrajs) {
182 LogTrace(
theCategory) <<
" Track p and pT " << it->trackerTrack()->p() <<
" " << it->trackerTrack()->pt();
183 if (it->trackerTrack()->p() <
thePCut || it->trackerTrack()->pt() <
thePtCut)
189 if (it->trackerTrack().isNonnull()) {
197 if (
std::abs(it->trackerTrack()->eta()) > 0.95 &&
std::abs(it->trackerTrack()->eta()) < 1.15 &&
198 it->trackerTrack()->pt() < 60) {
207 reverse(trackerRecHits.begin(), trackerRecHits.end());
213 if (it->trackerTrack()->seedRef().isAvailable())
214 tmpSeed = it->trackerTrack()->seedRef();
216 if (!innerTsos.isValid()) {
221 innerTsos.rescaleError(100.);
223 TC refitted0, refitted1;
228 if (!(it->trackerTrajectory() && it->trackerTrajectory()->isValid())) {
230 if (!refitted0.empty())
231 tkTrajectory =
new Trajectory(*(refitted0.begin()));
235 tkTrajectory = it->trackerTrajectory();
241 allRecHits.insert(allRecHits.end(), muonRecHits.begin(), muonRecHits.end());
243 LogTrace(
theCategory) <<
" This track-sta refitted to " << refitted1.size() <<
" trajectories";
246 if (!refitted1.empty())
247 glbTrajectory1 =
new Trajectory(*(refitted1.begin()));
253 finalTrajectory =
nullptr;
254 if (glbTrajectory1 && tkTrajectory)
258 tkTrajectory ?
new Trajectory(*tkTrajectory) :
nullptr);
261 refittedResult.push_back(finalTrajectory);
267 if (it->trackerTrack()->seedRef().isAvailable())
268 tmpSeed = it->trackerTrack()->seedRef();
272 if (!(it->trackerTrajectory() && it->trackerTrajectory()->isValid())) {
274 if (!refitted0.empty()) {
275 tkTrajectory =
new Trajectory(*(refitted0.begin()));
279 tkTrajectory = it->trackerTrajectory();
284 new Trajectory(*tkTrajectory), it->muonTrack(), it->trackerTrack(),
new Trajectory(*tkTrajectory));
286 refittedResult.push_back(finalTrajectory);
295 if (!refittedResult.empty())
296 tmpCand = *(refittedResult.begin());
299 for (
auto&& iter : refittedResult) {
301 LogTrace(
theCategory) <<
" refitted-track-sta with pT " << iter->trackerTrack()->pt() <<
" has probability " 304 if (prob < minProb) {
311 selectedResult.push_back(
317 for (
auto&& it : refittedResult) {
318 if (it->trajectory())
320 if (it->trackerTrajectory())
321 delete it->trackerTrajectory();
325 refittedResult.clear();
327 return selectedResult;
334 const TrackCand& staCand,
const std::vector<TrackCand>& tkTs) {
342 std::vector<TrackCand>
result;
344 double deltaR_max = 1.0;
346 for (
auto&& is : tkTs) {
348 static_cast<double>(regionOfInterest.
direction().
phi()),
354 if (deltaR_tmp < deltaR_max) {
356 result.push_back(tmpCand);
371 std::abs(region1->etaRange().max() - region1->etaRange().mean()));
376 region1->originRBound(),
377 region1->originZBound(),
379 region1->phiMargin());
400 for (
auto&& ir : hits) {
401 if (!ir->isValid()) {
409 <<
" dimension = " << ir->dimension() <<
" " << ir->det()->geographicalId().det() <<
" " 410 << ir->det()->subDetector();
419 if (!recHits.empty()) {
420 ConstRecHitContainer::const_iterator frontHit = recHits.begin();
421 ConstRecHitContainer::const_iterator backHit = recHits.end() - 1;
422 while (!(*frontHit)->isValid() && frontHit != backHit) {
425 while (!(*backHit)->isValid() && backHit != frontHit) {
429 double rFirst = (*frontHit)->globalPosition().mag();
430 double rLast = (*backHit)->globalPosition().mag();
434 else if (rFirst > rLast)
454 for (
auto&&
i : all) {
475 ConstRecHitContainer::iterator lone_tec;
477 for (ConstRecHitContainer::iterator
i = all.begin();
i != all.end();
i++) {
478 if (!(*i)->isValid())
486 if ((
i + 1) != all.end() && (*(
i + 1))->isValid() &&
498 int hitDet = (*lone_tec)->hit()->geographicalId().det();
499 int hitSubDet = (*lone_tec)->hit()->geographicalId().subdetId();
503 if (strip && strip->
det()) {
505 if ((*lone_tec)->detUnit()) {
512 LocalError scaledError(rotError.
xx() * scl_x * scl_x, 0, rotError.
yy() * scl_y * scl_y);
513 error = scaledError.
rotate(-angle);
538 auto hitCloner = tkbuilder->cloner();
540 if ((*hit)->isValid()) {
541 DetId recoid = (*hit)->geographicalId();
543 if (!(*hit)->hasPositionAndError()) {
550 <<
"Could not get a tsos on the hit surface. We will miss a tracking hit.";
554 auto h = (**hit).cloneForFit(*tkbuilder->geometry()->idToDet((**hit).geographicalId()));
555 result.emplace_back(hitCloner.makeShared(
h, predTsos));
557 result.push_back((*hit)->cloneSH());
560 if ((*hit)->geographicalId().subdetId() == 3 && !
theRPCInTheFit) {
const reco::TrackRef muonTrack() const
return muon track
const TrackerTopology * theTopo
std::vector< Trajectory > TC
T getParameter(std::string const &) const
static constexpr auto TEC
MuonCandidate::CandidateContainer CandidateContainer
void printHits(const ConstRecHitContainer &) const
print all RecHits of a trajectory
T getUntrackedParameter(std::string const &, T const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const edm::EventSetup & eventSetup() const
get the whole EventSetup
ConstRecHitContainer selectTrackerHits(const ConstRecHitContainer &) const
select tracker hits; exclude some tracker hits in the global trajectory
LocalError localPositionError() const final
GlobalMuonRefitter * theGlbRefitter
std::pair< const Trajectory *, reco::TrackRef > TrackCand
CaloTopology const * topology(0)
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
float LnChiSquaredProbability(double chiSquared, double nrDOF)
virtual void setEvent(const edm::Event &)
Pass the Event to the algo at each event.
Geom::Phi< T > phi() const
MuonTrackingRegionBuilder
virtual float strip(const LocalPoint &) const =0
void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
const Plane & surface() const
The nominal surface of the GeomDet.
~GlobalTrajectoryBuilderBase() override
destructor
std::unique_ptr< RectangularEtaPhiTrackingRegion > region(const reco::TrackRef &) const
Define tracking region.
const reco::TrackRef trackerTrack() const
return tracker track
std::string theTrackerPropagatorName
void fixTEC(ConstRecHitContainer &all, double scl_x, double scl_y) const
rescale errors of outermost TEC RecHit
GlobalVector const & direction() const
the direction around which region is constructed
double trackProbability(const Trajectory &) const
calculate chi2 probability (-ln(P))
TrackTransformer * theTrackTransformer
virtual float stripAngle(float strip) const =0
const GeomDet * det() const
Trajectory * trackerTrajectory() const
return tracker trajectory
std::string theMuonRecHitBuilderName
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits(const reco::Track &) const
get transient RecHits of a Track
const MuonServiceProxy * theService
Abs< T >::type abs(const T &t)
ClusterRef cluster() const
void setEvent(const edm::Event &) override
pass the Event to the algo at each event
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::vector< MuonCandidate * > CandidateContainer
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::string theTrackerRecHitBuilderName
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
int ndof(bool bon=true) const
GlobalMuonTrackMatcher * theTrackMatcher
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
void setSeedRef(const edm::RefToBase< TrajectorySeed > &seedRef)
RectangularEtaPhiTrackingRegion defineRegionOfInterest(const reco::TrackRef &) const
define region of interest with tracker
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
const GeomDet * idToDet(DetId) const override
RefitDirection checkRecHitsOrdering(const ConstRecHitContainer &) const
This does nothing now.
const edm::Event * theEvent
unsigned long long theCacheId_TRH
LocalPoint localPosition() const final
MuonTrackingRegionBuilder * theRegionBuilder
Trajectory * trajectory() const
return trajectory
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
T const * product() const
static RecHitPointer build(const GeomDet *geom, const TrackingRecHit *rh)
FIXME virtual ConstMuonRecHitContainer specificTransientHits() const;.
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
build combined trajectory from sta Track and tracker RecHits
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
constexpr Detector det() const
get the detector field from this detid
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.