CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ExhaustiveMuonTrajectoryBuilder Class Reference

#include <ExhaustiveMuonTrajectoryBuilder.h>

Inheritance diagram for ExhaustiveMuonTrajectoryBuilder:
MuonTrajectoryBuilder

Public Member Functions

 ExhaustiveMuonTrajectoryBuilder (const edm::ParameterSet &pset, const MuonServiceProxy *, edm::ConsumesCollector &)
 
void setEvent (const edm::Event &event) override
 pass the Event to the algo at each event More...
 
CandidateContainer trajectories (const TrackCand &) override
 return a container reconstructed muons starting from a given track More...
 
TrajectoryContainer trajectories (const TrajectorySeed &) override
 return a container of the reconstructed trajectories compatible with a given seed More...
 
 ~ExhaustiveMuonTrajectoryBuilder () override
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Member Functions

void clean (TrajectoryContainer &trajectories) const
 

Private Attributes

MuonSeedFromRecHits theSeeder
 
const MuonServiceProxytheService
 
StandAloneMuonTrajectoryBuilder theTrajBuilder
 

Additional Inherited Members

- Public Types inherited from MuonTrajectoryBuilder
typedef MuonCandidate::CandidateContainer CandidateContainer
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
typedef MuonCandidate::TrajectoryContainer TrajectoryContainer
 

Detailed Description

Instead of letting the SeedGenerator code choose a segment to start from, this TrajectoryBuilder makes a seed wfor each segment, and chooses the Trajectory with the most hits and the lowest chi-squared

Definition at line 17 of file ExhaustiveMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ ExhaustiveMuonTrajectoryBuilder()

ExhaustiveMuonTrajectoryBuilder::ExhaustiveMuonTrajectoryBuilder ( const edm::ParameterSet pset,
const MuonServiceProxy proxy,
edm::ConsumesCollector iC 
)

Definition at line 6 of file ExhaustiveMuonTrajectoryBuilder.cc.

9  : theTrajBuilder(pset, proxy, iC), theSeeder(), theService(proxy) {}

◆ ~ExhaustiveMuonTrajectoryBuilder()

ExhaustiveMuonTrajectoryBuilder::~ExhaustiveMuonTrajectoryBuilder ( )
override

Definition at line 11 of file ExhaustiveMuonTrajectoryBuilder.cc.

11 {}

Member Function Documentation

◆ clean()

void ExhaustiveMuonTrajectoryBuilder::clean ( TrajectoryContainer trajectories) const
private

Definition at line 47 of file ExhaustiveMuonTrajectoryBuilder.cc.

47  {
48  // choose the one with the most hits, and the smallest chi-squared
49  if (trajectories.empty()) {
50  return;
51  }
52  int best_nhits = 0;
53  unsigned best = 0;
54  unsigned ntraj = trajectories.size();
55  for (unsigned i = 0; i < ntraj; ++i) {
56  int nhits = trajectories[i]->foundHits();
57  if (nhits > best_nhits) {
58  best_nhits = nhits;
59  best = i;
60  } else if (nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared()) {
61  best = i;
62  }
63  }
65  result.reserve(1);
66  result.emplace_back(std::move(trajectories[best]));
67  trajectories.swap(result);
68 }

References mps_fire::i, eostools::move(), nhits, mps_fire::result, and trajectories().

◆ setEvent()

void ExhaustiveMuonTrajectoryBuilder::setEvent ( const edm::Event event)
overridevirtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 45 of file ExhaustiveMuonTrajectoryBuilder.cc.

References StandAloneMuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

◆ trajectories() [1/2]

MuonTrajectoryBuilder::CandidateContainer ExhaustiveMuonTrajectoryBuilder::trajectories ( const TrackCand )
overridevirtual

return a container reconstructed muons starting from a given track

Implements MuonTrajectoryBuilder.

Definition at line 41 of file ExhaustiveMuonTrajectoryBuilder.cc.

41  {
42  return CandidateContainer();
43 }

◆ trajectories() [2/2]

MuonTrajectoryBuilder::TrajectoryContainer ExhaustiveMuonTrajectoryBuilder::trajectories ( const TrajectorySeed seed)
overridevirtual

return a container of the reconstructed trajectories compatible with a given seed

Implements MuonTrajectoryBuilder.

Definition at line 13 of file ExhaustiveMuonTrajectoryBuilder.cc.

13  {
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;
26  TrajectorySeed::range range = seed.recHits();
28  // Make a new seed based on each segment, using the original pt and sigmapt
29  for (TrajectorySeed::const_iterator recHitItr = range.first; recHitItr != range.second; ++recHitItr) {
30  const GeomDet* geomDet = theService->trackingGeometry()->idToDet((*recHitItr).geographicalId());
32  MuonTransientTrackingRecHit::specificBuild(geomDet, &*recHitItr);
33  TrajectorySeed tmpSeed(theSeeder.createSeed(pt, sigmapt, muonRecHit));
35  result.insert(
36  result.end(), std::make_move_iterator(trajectories.begin()), std::make_move_iterator(trajectories.end()));
37  }
38  return result;
39 }

References MuonSeedFromRecHits::createSeed(), GlobalTrackingGeometry::idToDet(), PixelPluginsPhase0_cfi::isBarrel, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, FastTimerService_cff::range, mps_fire::result, SurveyInfoScenario_cff::seed, MuonTransientTrackingRecHit::specificBuild(), mathSSE::sqrt(), DetId::subdetId(), theSeeder, theService, theTrajBuilder, MuonServiceProxy::trackingGeometry(), and StandAloneMuonTrajectoryBuilder::trajectories().

Referenced by clean().

Member Data Documentation

◆ theSeeder

MuonSeedFromRecHits ExhaustiveMuonTrajectoryBuilder::theSeeder
private

Definition at line 35 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

◆ theService

const MuonServiceProxy* ExhaustiveMuonTrajectoryBuilder::theService
private

Definition at line 36 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

◆ theTrajBuilder

StandAloneMuonTrajectoryBuilder ExhaustiveMuonTrajectoryBuilder::theTrajBuilder
private

Definition at line 34 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by setEvent(), and trajectories().

Vector3DBase< float, LocalTag >
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
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
TrajectorySeed::range
std::pair< const_iterator, const_iterator > range
Definition: TrajectorySeed.h:21
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
TrajectorySeed::const_iterator
recHitContainer::const_iterator const_iterator
Definition: TrajectorySeed.h:20
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
DetId
Definition: DetId.h:17
MuonTransientTrackingRecHit::MuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:21
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
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
StandAloneMuonTrajectoryBuilder::setEvent
void setEvent(const edm::Event &event) override
Pass the Event to the algo at each event.
Definition: StandAloneTrajectoryBuilder.cc:107
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
MuonServiceProxy::trackingGeometry
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
Definition: MuonServiceProxy.h:59
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
TrajectorySeed
Definition: TrajectorySeed.h:17
mps_fire.result
result
Definition: mps_fire.py:303
event
Definition: event.py:1
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
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