CMS 3D CMS Logo

GlobalTrajectoryBuilderBase.h
Go to the documentation of this file.
1 #ifndef RecoMuon_GlobalTrackingTools_GlobalTrajectoryBuilderBase_H
2 #define RecoMuon_GlobalTrackingTools_GlobalTrajectoryBuilderBase_H
3 
25 
33 
34 //Forward declare classes from same package (RecoMuon)
37 class MuonServiceProxy;
39 class GlobalMuonRefitter;
41 
43 public:
52  typedef std::vector<Trajectory> TC;
53  typedef TC::const_iterator TI;
54 
57 
60 
64  }
65 
67  void setEvent(const edm::Event&) override;
68 
69 protected:
71 
74 
76  virtual std::vector<TrackCand> makeTkCandCollection(const TrackCand&) = 0;
77 
79  std::vector<TrackCand> chooseRegionalTrackerTracks(const TrackCand&, const std::vector<TrackCand>&);
80 
83 
85  void checkMuonHits(const reco::Track&, ConstRecHitContainer&, ConstRecHitContainer&, std::vector<int>&) const;
86 
88  ConstRecHitContainer selectMuonHits(const Trajectory&, const std::vector<int>&) const;
89 
92 
94  void fixTEC(ConstRecHitContainer& all, double scl_x, double scl_y) const;
95 
97  const Trajectory* chooseTrajectory(const std::vector<Trajectory*>&, int) const;
98 
100  double trackProbability(const Trajectory&) const;
101 
103  void printHits(const ConstRecHitContainer&) const;
104 
106  void addTraj(TrackCand&) {}
107 
110 
113 
116 
118  const MuonServiceProxy* service() const { return theService; }
119 
123  bool barrel_a = (a->det()->subDetector() == GeomDetEnumerators::DT ||
124  a->det()->subDetector() == GeomDetEnumerators::RPCBarrel);
125 
126  bool barrel_b = (b->det()->subDetector() == GeomDetEnumerators::DT ||
127  b->det()->subDetector() == GeomDetEnumerators::RPCBarrel);
128 
129  if (barrel_a && barrel_b)
130  return a->det()->surface().position().perp() < b->det()->surface().position().perp();
131 
132  else if (!barrel_a && !barrel_b)
133  return fabs(a->globalPosition().z()) < fabs(b->globalPosition().z());
134  else if (barrel_a && !barrel_b)
135  return true;
136  else if (!barrel_a && barrel_b)
137  return false;
138  //shouldn't really get here in any case (there's some sense to throw here )
139  return false;
140  }
141  };
142 
144  float thePtCut;
145  float thePCut;
146 
147 private:
167 };
168 #endif
GlobalTrajectoryBuilderBase
Definition: GlobalTrajectoryBuilderBase.h:42
GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
Definition: GlobalTrajectoryBuilderBase.cc:302
MuonTrackingRegionBuilder
Definition: MuonTrackingRegionBuilder.h:43
TrajectoryStateOnSurface.h
GlobalTrajectoryBuilderBase::ConstRecHitPointer
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: GlobalTrajectoryBuilderBase.h:47
GlobalTrajectoryBuilderBase::theTopoToken
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopoToken
Definition: GlobalTrajectoryBuilderBase.h:165
GlobalTrajectoryBuilderBase::thePtCut
float thePtCut
Definition: GlobalTrajectoryBuilderBase.h:144
GlobalTrajectoryBuilderBase::MuonRecHitPointer
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
Definition: GlobalTrajectoryBuilderBase.h:48
GlobalTrajectoryBuilderBase::theService
const MuonServiceProxy * theService
Definition: GlobalTrajectoryBuilderBase.h:152
MuonTransientTrackingRecHit::ConstMuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:22
RectangularEtaPhiTrackingRegion
Definition: RectangularEtaPhiTrackingRegion.h:25
GlobalTrajectoryBuilderBase::TI
TC::const_iterator TI
Definition: GlobalTrajectoryBuilderBase.h:53
GlobalTrajectoryBuilderBase::theEvent
const edm::Event * theEvent
Definition: GlobalTrajectoryBuilderBase.h:160
GlobalTrajectoryBuilderBase::theTrackerPropagatorName
std::string theTrackerPropagatorName
Definition: GlobalTrajectoryBuilderBase.h:159
GlobalTrajectoryBuilderBase::theMuonRecHitBuilderToken
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theMuonRecHitBuilderToken
Definition: GlobalTrajectoryBuilderBase.h:163
MuonDetLayerMeasurements
Definition: MuonDetLayerMeasurements.h:41
TrackerTopology
Definition: TrackerTopology.h:16
GlobalTrajectoryBuilderBase::ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: GlobalTrajectoryBuilderBase.h:45
GlobalTrajectoryBuilderBase::RecHitPointer
TransientTrackingRecHit::RecHitPointer RecHitPointer
Definition: GlobalTrajectoryBuilderBase.h:46
GlobalTrajectoryBuilderBase::MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: GlobalTrajectoryBuilderBase.h:50
GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
Definition: GlobalTrajectoryBuilderBase.cc:76
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
GlobalTrajectoryBuilderBase::ComparatorInOut
Definition: GlobalTrajectoryBuilderBase.h:120
GlobalTrajectoryBuilderBase::trackMatcher
GlobalMuonTrackMatcher * trackMatcher() const
Definition: GlobalTrajectoryBuilderBase.h:115
MuonTransientTrackingRecHit::ConstMuonRecHitContainer
std::vector< ConstMuonRecHitPointer > ConstMuonRecHitContainer
Definition: MuonTransientTrackingRecHit.h:27
MuonTransientTrackingRecHit::MuonRecHitContainer
std::vector< MuonRecHitPointer > MuonRecHitContainer
Definition: MuonTransientTrackingRecHit.h:26
GlobalTrajectoryBuilderBase::service
const MuonServiceProxy * service() const
Definition: GlobalTrajectoryBuilderBase.h:118
MuonTransientTrackingRecHit.h
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
GlobalTrajectoryBuilderBase::TC
std::vector< Trajectory > TC
Definition: GlobalTrajectoryBuilderBase.h:52
GlobalTrajectoryBuilderBase::build
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits
Definition: GlobalTrajectoryBuilderBase.cc:155
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
edm::Ref< TrackCollection >
GlobalTrajectoryBuilderBase::theTECxScale
float theTECxScale
Definition: GlobalTrajectoryBuilderBase.h:157
TrackerTopology.h
MuonTransientTrackingRecHit::MuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:21
GlobalTrajectoryBuilderBase::theRefitFlag
bool theRefitFlag
Definition: GlobalTrajectoryBuilderBase.h:155
TrackFwd.h
GlobalTrajectoryBuilderBase::inToOut
Definition: GlobalTrajectoryBuilderBase.h:70
TrackingRecHit::RecHitContainer
std::vector< ConstRecHitPointer > RecHitContainer
Definition: TrackingRecHit.h:31
GlobalTrajectoryBuilderBase::theMuonRecHitBuilder
const TransientTrackingRecHitBuilder * theMuonRecHitBuilder
Definition: GlobalTrajectoryBuilderBase.h:164
GlobalTrajectoryBuilderBase::ComparatorInOut::operator()
bool operator()(const TransientTrackingRecHit::ConstRecHitPointer &a, const TransientTrackingRecHit::ConstRecHitPointer &b) const
Definition: GlobalTrajectoryBuilderBase.h:121
reco::Track
Definition: Track.h:27
TrajectoryFitter.h
GlobalTrajectoryBuilderBase::theTrackerRecHitBuilder
const TransientTrackingRecHitBuilder * theTrackerRecHitBuilder
Definition: GlobalTrajectoryBuilderBase.h:162
GlobalTrajectoryBuilderBase::defineRegionOfInterest
RectangularEtaPhiTrackingRegion defineRegionOfInterest(const reco::TrackRef &) const
define region of interest with tracker
Definition: GlobalTrajectoryBuilderBase.cc:335
b
double b
Definition: hdecay.h:118
GlobalTrajectoryBuilderBase::theTrackMatcher
GlobalMuonTrackMatcher * theTrackMatcher
Definition: GlobalTrajectoryBuilderBase.h:148
GlobalTrajectoryBuilderBase::theLayerMeasurements
MuonDetLayerMeasurements * theLayerMeasurements
Definition: GlobalTrajectoryBuilderBase.h:149
MuonTrajectoryBuilder
Definition: MuonTrajectoryBuilder.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GlobalTrajectoryBuilderBase::fixTEC
void fixTEC(ConstRecHitContainer &all, double scl_x, double scl_y) const
rescale errors of outermost TEC RecHit
Definition: GlobalTrajectoryBuilderBase.cc:442
GlobalTrajectoryBuilderBase::theTECyScale
float theTECyScale
Definition: GlobalTrajectoryBuilderBase.h:158
GeomDetEnumerators::DT
Definition: GeomDetEnumerators.h:18
GlobalTrajectoryBuilderBase::setEvent
void setEvent(const edm::Event &) override
pass the Event to the algo at each event
Definition: GlobalTrajectoryBuilderBase.cc:136
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
GlobalTrajectoryBuilderBase::theGlbRefitter
GlobalMuonRefitter * theGlbRefitter
Definition: GlobalTrajectoryBuilderBase.h:153
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
GlobalTrajectoryBuilderBase::~GlobalTrajectoryBuilderBase
~GlobalTrajectoryBuilderBase() override
destructor
Definition: GlobalTrajectoryBuilderBase.cc:122
GlobalTrajectoryBuilderBase::trackProbability
double trackProbability(const Trajectory &) const
calculate chi2 probability (-ln(P))
Definition: GlobalTrajectoryBuilderBase.cc:356
GlobalTrajectoryBuilderBase::outToIn
Definition: GlobalTrajectoryBuilderBase.h:70
GlobalTrajectoryBuilderBase::theCategory
std::string theCategory
Definition: GlobalTrajectoryBuilderBase.h:143
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
RefitDirection
Definition: RefitDirection.h:13
RectangularEtaPhiTrackingRegion.h
TrackTransformer.h
GlobalTrajectoryBuilderBase::ConstMuonRecHitPointer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
Definition: GlobalTrajectoryBuilderBase.h:49
GlobalTrajectoryBuilderBase::RecHitContainer
TransientTrackingRecHit::RecHitContainer RecHitContainer
Definition: GlobalTrajectoryBuilderBase.h:44
GlobalMuonTrackMatcher
Definition: GlobalMuonTrackMatcher.h:39
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord >
GlobalTrajectoryBuilderBase::theMuonHitsOption
int theMuonHitsOption
Definition: GlobalTrajectoryBuilderBase.h:156
Trajectory.h
GlobalTrajectoryBuilderBase::checkRecHitsOrdering
RefitDirection checkRecHitsOrdering(const ConstRecHitContainer &) const
This does nothing now.
Definition: GlobalTrajectoryBuilderBase.cc:386
MuonTrajectoryBuilder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrajectoryBuilder.h:23
ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: MillePedeAlignmentAlgorithm.cc:74
GlobalTrajectoryBuilderBase::getTransientRecHits
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits(const reco::Track &) const
get transient RecHits of a Track
Definition: GlobalTrajectoryBuilderBase.cc:499
Trajectory
Definition: Trajectory.h:38
GlobalTrajectoryBuilderBase::trajectories
MuonTrajectoryBuilder::TrajectoryContainer trajectories(const TrajectorySeed &) override
dummy implementation, unused in this class
Definition: GlobalTrajectoryBuilderBase.h:62
GlobalMuonRefitter
Definition: GlobalMuonRefitter.h:51
GlobalTrajectoryBuilderBase::selectMuonHits
ConstRecHitContainer selectMuonHits(const Trajectory &, const std::vector< int > &) const
select muon hits compatible with trajectory; check hits in chambers with showers
GlobalTrajectoryBuilderBase::thePCut
float thePCut
Definition: GlobalTrajectoryBuilderBase.h:145
TrajectorySeed
Definition: TrajectorySeed.h:18
GlobalTrajectoryBuilderBase::theTrackTransformer
TrackTransformer * theTrackTransformer
Definition: GlobalTrajectoryBuilderBase.h:150
MuonTrajectoryBuilder::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition: MuonTrajectoryBuilder.h:25
GlobalTrajectoryBuilderBase::undetermined
Definition: GlobalTrajectoryBuilderBase.h:70
GlobalTrajectoryBuilderBase::chooseTrajectory
const Trajectory * chooseTrajectory(const std::vector< Trajectory * > &, int) const
choose final trajectory
MuonTrajectoryBuilder.h
TransientTrackingRecHitBuilder.h
GeomDetEnumerators::RPCBarrel
Definition: GeomDetEnumerators.h:19
GlobalTrajectoryBuilderBase::theRegionBuilder
MuonTrackingRegionBuilder * theRegionBuilder
Definition: GlobalTrajectoryBuilderBase.h:151
ConsumesCollector.h
MuonServiceProxy
Definition: MuonServiceProxy.h:38
GlobalTrajectoryBuilderBase::printHits
void printHits(const ConstRecHitContainer &) const
print all RecHits of a trajectory
Definition: GlobalTrajectoryBuilderBase.cc:367
GlobalTrajectoryBuilderBase::makeTkCandCollection
virtual std::vector< TrackCand > makeTkCandCollection(const TrackCand &)=0
make a TrackCand collection using tracker Track, Trajectory information
edm::Event
Definition: Event.h:73
GlobalTrajectoryBuilderBase::addTraj
void addTraj(TrackCand &)
if TrackCand has only a TrackRef, attempt to add Trajectory*
Definition: GlobalTrajectoryBuilderBase.h:106
TransientTrackingRecHitBuilder
Definition: TransientTrackingRecHitBuilder.h:6
GlobalTrajectoryBuilderBase::theTrackerRecHitBuilderToken
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTrackerRecHitBuilderToken
Definition: GlobalTrajectoryBuilderBase.h:161
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
GlobalTrajectoryBuilderBase::selectTrackerHits
ConstRecHitContainer selectTrackerHits(const ConstRecHitContainer &) const
select tracker hits; exclude some tracker hits in the global trajectory
Definition: GlobalTrajectoryBuilderBase.cc:418
GlobalTrajectoryBuilderBase::checkMuonHits
void checkMuonHits(const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &, std::vector< int > &) const
check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit
GlobalTrajectoryBuilderBase::theRPCInTheFit
bool theRPCInTheFit
Definition: GlobalTrajectoryBuilderBase.h:154
GlobalTrajectoryBuilderBase::ConstMuonRecHitContainer
MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer
Definition: GlobalTrajectoryBuilderBase.h:51
GlobalTrajectoryBuilderBase::theTopo
const TrackerTopology * theTopo
Definition: GlobalTrajectoryBuilderBase.h:166
TrackTransformer
Definition: TrackTransformer.h:46