CMS 3D CMS Logo

ExhaustiveMuonTrajectoryBuilder.cc
Go to the documentation of this file.
5 
7  const MuonServiceProxy* proxy,
9  : theTrajBuilder(pset, proxy, iC), theSeeder(), theService(proxy) {}
10 
12 
14  LocalTrajectoryParameters localTrajectoryParameters(seed.startingState().parameters());
15  LocalVector p(localTrajectoryParameters.momentum());
16  int rawId = seed.startingState().detId();
17  DetId detId(rawId);
18  bool isBarrel = (detId.subdetId() == 1);
19  // homemade local-to-global
20  double pt = (isBarrel) ? -p.z() : p.perp();
21  pt *= localTrajectoryParameters.charge();
22  float err00 = seed.startingState().error(0);
23  // float p_err = sqr(sptmean/(ptmean*ptmean));
24  // mat[0][0]= p_err;
25  float sigmapt = sqrt(err00) * pt * pt;
27  // Make a new seed based on each segment, using the original pt and sigmapt
28  for (auto const& recHit : seed.recHits()) {
29  const GeomDet* geomDet = theService->trackingGeometry()->idToDet(recHit.geographicalId());
30  auto muonRecHit = MuonTransientTrackingRecHit::specificBuild(geomDet, &recHit);
31  TrajectorySeed tmpSeed(theSeeder.createSeed(pt, sigmapt, muonRecHit));
33  result.insert(
34  result.end(), std::make_move_iterator(trajectories.begin()), std::make_move_iterator(trajectories.end()));
35  }
36  return result;
37 }
38 
40  return CandidateContainer();
41 }
42 
44 
46  // choose the one with the most hits, and the smallest chi-squared
47  if (trajectories.empty()) {
48  return;
49  }
50  int best_nhits = 0;
51  unsigned best = 0;
52  unsigned ntraj = trajectories.size();
53  for (unsigned i = 0; i < ntraj; ++i) {
54  int nhits = trajectories[i]->foundHits();
55  if (nhits > best_nhits) {
56  best_nhits = nhits;
57  best = i;
58  } else if (nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared()) {
59  best = i;
60  }
61  }
63  result.reserve(1);
64  result.emplace_back(std::move(trajectories[best]));
65  trajectories.swap(result);
66 }
Vector3DBase< float, LocalTag >
mps_fire.i
i
Definition: mps_fire.py:428
MuonTransientTrackingRecHit::specificBuild
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
Definition: MuonTransientTrackingRecHit.h:75
GeomDet
Definition: GeomDet.h:27
ExhaustiveMuonTrajectoryBuilder::theSeeder
MuonSeedFromRecHits theSeeder
Definition: ExhaustiveMuonTrajectoryBuilder.h:35
ExhaustiveMuonTrajectoryBuilder::~ExhaustiveMuonTrajectoryBuilder
~ExhaustiveMuonTrajectoryBuilder() override
Definition: ExhaustiveMuonTrajectoryBuilder.cc:11
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ExhaustiveMuonTrajectoryBuilder::theService
const MuonServiceProxy * theService
Definition: ExhaustiveMuonTrajectoryBuilder.h:36
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
ExhaustiveMuonTrajectoryBuilder::clean
void clean(TrajectoryContainer &trajectories) const
Definition: ExhaustiveMuonTrajectoryBuilder.cc:45
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
fileCollector.seed
seed
Definition: fileCollector.py:127
DetId
Definition: DetId.h:17
StandAloneMuonTrajectoryBuilder::trajectories
TrajectoryContainer trajectories(const TrajectorySeed &) override
return a container of the reconstructed trajectories compatible with a given seed
Definition: StandAloneTrajectoryBuilder.cc:138
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ExhaustiveMuonTrajectoryBuilder::theTrajBuilder
StandAloneMuonTrajectoryBuilder theTrajBuilder
Definition: ExhaustiveMuonTrajectoryBuilder.h:34
nhits
Definition: HIMultiTrackSelector.h:42
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::ParameterSet
Definition: ParameterSet.h:47
StandAloneMuonTrajectoryBuilder::setEvent
void setEvent(const edm::Event &event) override
Pass the Event to the algo at each event.
Definition: StandAloneTrajectoryBuilder.cc:107
ExhaustiveMuonTrajectoryBuilder.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonTrajectoryBuilder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrajectoryBuilder.h:23
ExhaustiveMuonTrajectoryBuilder::trajectories
TrajectoryContainer trajectories(const TrajectorySeed &) override
return a container of the reconstructed trajectories compatible with a given seed
Definition: ExhaustiveMuonTrajectoryBuilder.cc:13
MuonTransientTrackingRecHitBuilder.h
MuonServiceProxy::trackingGeometry
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
Definition: MuonServiceProxy.h:59
ExhaustiveMuonTrajectoryBuilder::ExhaustiveMuonTrajectoryBuilder
ExhaustiveMuonTrajectoryBuilder(const edm::ParameterSet &pset, const MuonServiceProxy *, edm::ConsumesCollector &)
Definition: ExhaustiveMuonTrajectoryBuilder.cc:6
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
MuonServiceProxy.h
TrajectorySeed
Definition: TrajectorySeed.h:18
MuonTrajectoryBuilder::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition: MuonTrajectoryBuilder.h:25
mps_fire.result
result
Definition: mps_fire.py:311
ParameterSet.h
MuonServiceProxy
Definition: MuonServiceProxy.h:38
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
ExhaustiveMuonTrajectoryBuilder::setEvent
void setEvent(const edm::Event &event) override
pass the Event to the algo at each event
Definition: ExhaustiveMuonTrajectoryBuilder.cc:43
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MuonSeedFromRecHits::createSeed
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
Definition: MuonSeedFromRecHits.cc:38