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...
 
TrajectoryContainer trajectories (const TrajectorySeed &) override
 return a container of the reconstructed trajectories compatible with a given seed More...
 
CandidateContainer trajectories (const TrackCand &) override
 return a container reconstructed muons starting from a given track 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 ( 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) {}
StandAloneMuonTrajectoryBuilder theTrajBuilder
ExhaustiveMuonTrajectoryBuilder::~ExhaustiveMuonTrajectoryBuilder ( )
override

Definition at line 11 of file ExhaustiveMuonTrajectoryBuilder.cc.

11 {}

Member Function Documentation

void ExhaustiveMuonTrajectoryBuilder::clean ( TrajectoryContainer trajectories) const
private

Definition at line 46 of file ExhaustiveMuonTrajectoryBuilder.cc.

References mps_fire::i, nhits, and mps_fire::result.

46  {
47  // choose the one with the most hits, and the smallest chi-squared
48  int best_nhits = 0;
49  unsigned best = 0;
50  unsigned ntraj = trajectories.size();
51  for (unsigned i = 0; i < ntraj; ++i) {
52  int nhits = trajectories[i]->foundHits();
53  if (nhits > best_nhits) {
54  best_nhits = nhits;
55  best = i;
56  } else if (nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared()) {
57  best = i;
58  }
59  }
61  for (unsigned i = 0; i < ntraj; ++i) {
62  if (i == best) {
63  result.push_back(trajectories[best]);
64  } else {
65  delete trajectories[i];
66  }
67  }
68  trajectories.swap(result);
69 }
MuonCandidate::TrajectoryContainer TrajectoryContainer
TrajectoryContainer trajectories(const TrajectorySeed &) override
return a container of the reconstructed trajectories compatible with a given seed ...
void ExhaustiveMuonTrajectoryBuilder::setEvent ( const edm::Event event)
overridevirtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 44 of file ExhaustiveMuonTrajectoryBuilder.cc.

References StandAloneMuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

44 { theTrajBuilder.setEvent(event); }
StandAloneMuonTrajectoryBuilder theTrajBuilder
void setEvent(const edm::Event &event) override
Pass the Event to the algo at each event.
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.

References MuonSeedFromRecHits::createSeed(), PTrajectoryStateOnDet::detId(), PTrajectoryStateOnDet::error(), GlobalTrackingGeometry::idToDet(), PixelPluginsPhase0_cfi::isBarrel, AlCaHLTBitMon_ParallelJobs::p, PTrajectoryStateOnDet::parameters(), DiDispStaMuonMonitor_cfi::pt, FastTimerService_cff::range, TrajectorySeed::recHits(), mps_fire::result, MuonTransientTrackingRecHit::specificBuild(), mathSSE::sqrt(), TrajectorySeed::startingState(), DetId::subdetId(), theSeeder, theService, theTrajBuilder, MuonServiceProxy::trackingGeometry(), and StandAloneMuonTrajectoryBuilder::trajectories().

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;
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(result.end(), trajectories.begin(), trajectories.end());
36  }
37  return result;
38 }
std::pair< const_iterator, const_iterator > range
StandAloneMuonTrajectoryBuilder theTrajBuilder
MuonCandidate::TrajectoryContainer TrajectoryContainer
TrajectoryContainer trajectories(const TrajectorySeed &) override
return a container of the reconstructed trajectories compatible with a given seed ...
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:19
unsigned int detId() const
TrajectoryContainer trajectories(const TrajectorySeed &) override
return a container of the reconstructed trajectories compatible with a given seed ...
Definition: DetId.h:17
PTrajectoryStateOnDet const & startingState() const
range recHits() const
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
const GeomDet * idToDet(DetId) const override
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
const LocalTrajectoryParameters & parameters() const
MuonTrajectoryBuilder::CandidateContainer ExhaustiveMuonTrajectoryBuilder::trajectories ( const TrackCand )
overridevirtual

return a container reconstructed muons starting from a given track

Implements MuonTrajectoryBuilder.

Definition at line 40 of file ExhaustiveMuonTrajectoryBuilder.cc.

40  {
41  return CandidateContainer();
42 }
MuonCandidate::CandidateContainer CandidateContainer

Member Data Documentation

MuonSeedFromRecHits ExhaustiveMuonTrajectoryBuilder::theSeeder
private

Definition at line 35 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

const MuonServiceProxy* ExhaustiveMuonTrajectoryBuilder::theService
private

Definition at line 36 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

StandAloneMuonTrajectoryBuilder ExhaustiveMuonTrajectoryBuilder::theTrajBuilder
private

Definition at line 34 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by setEvent(), and trajectories().