CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual void setEvent (const edm::Event &event)
 pass the Event to the algo at each event More...
 
virtual TrajectoryContainer trajectories (const TrajectorySeed &)
 return a container of the reconstructed trajectories compatible with a given seed More...
 
virtual CandidateContainer trajectories (const TrackCand &)
 return a container reconstructed muons starting from a given track More...
 
virtual ~ExhaustiveMuonTrajectoryBuilder ()
 
- 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::TrackRef
TrackCand
 
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 7 of file ExhaustiveMuonTrajectoryBuilder.cc.

10  : theTrajBuilder(pset, proxy,iC),
11  theSeeder(),
12  theService(proxy)
13 {
14 }
StandAloneMuonTrajectoryBuilder theTrajBuilder
ExhaustiveMuonTrajectoryBuilder::~ExhaustiveMuonTrajectoryBuilder ( )
virtual

Definition at line 17 of file ExhaustiveMuonTrajectoryBuilder.cc.

17 {}

Member Function Documentation

void ExhaustiveMuonTrajectoryBuilder::clean ( TrajectoryContainer trajectories) const
private

Definition at line 68 of file ExhaustiveMuonTrajectoryBuilder.cc.

References i, and query::result.

Referenced by trajectories().

69 {
70  // choose the one with the most hits, and the smallest chi-squared
71  int best_nhits = 0;
72  unsigned best = 0;
73  unsigned ntraj = trajectories.size();
74  for(unsigned i = 0; i < ntraj; ++i)
75  {
76  int nhits = trajectories[i]->foundHits();
77  if(nhits > best_nhits)
78  {
79  best_nhits = nhits;
80  best = i;
81  }
82  else if(nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared())
83  {
84  best = i;
85  }
86  }
88  for(unsigned i = 0; i < ntraj; ++i)
89  {
90  if(i == best) {
91  result.push_back(trajectories[best]);
92  } else {
93  delete trajectories[i];
94  }
95  }
96  trajectories.swap(result);
97 }
int i
Definition: DBlmapReader.cc:9
MuonCandidate::TrajectoryContainer TrajectoryContainer
tuple result
Definition: query.py:137
virtual TrajectoryContainer trajectories(const TrajectorySeed &)
return a container of the reconstructed trajectories compatible with a given seed ...
void ExhaustiveMuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 62 of file ExhaustiveMuonTrajectoryBuilder.cc.

References StandAloneMuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

63 {
64  theTrajBuilder.setEvent(event);
65 }
StandAloneMuonTrajectoryBuilder theTrajBuilder
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
MuonTrajectoryBuilder::TrajectoryContainer ExhaustiveMuonTrajectoryBuilder::trajectories ( const TrajectorySeed seed)
virtual

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

Implements MuonTrajectoryBuilder.

Definition at line 21 of file ExhaustiveMuonTrajectoryBuilder.cc.

References clean(), MuonSeedFromRecHits::createSeed(), PTrajectoryStateOnDet::detId(), PTrajectoryStateOnDet::error(), AlCaHLTBitMon_ParallelJobs::p, PTrajectoryStateOnDet::parameters(), RecoTauCleanerPlugins::pt, TrajectorySeed::recHits(), query::result, MuonTransientTrackingRecHit::specificBuild(), mathSSE::sqrt(), TrajectorySeed::startingState(), DetId::subdetId(), theSeeder, theService, theTrajBuilder, MuonServiceProxy::trackingGeometry(), and StandAloneMuonTrajectoryBuilder::trajectories().

22 {
23  LocalTrajectoryParameters localTrajectoryParameters(seed.startingState().parameters());
24  LocalVector p(localTrajectoryParameters.momentum());
25  int rawId = seed.startingState().detId();
26  DetId detId(rawId);
27  bool isBarrel = (detId.subdetId() == 1);
28  // homemade local-to-global
29  double pt = (isBarrel) ? -p.z() : p.perp();
30  pt *= localTrajectoryParameters.charge();
31  float err00 = seed.startingState().error(0);
32  // float p_err = sqr(sptmean/(ptmean*ptmean));
33  // mat[0][0]= p_err;
34  float sigmapt = sqrt(err00)*pt*pt;
35  TrajectorySeed::range range = seed.recHits();
37  // Make a new seed based on each segment, using the original pt and sigmapt
38  for(TrajectorySeed::const_iterator recHitItr = range.first;
39  recHitItr != range.second; ++recHitItr)
40  {
41  const GeomDet * geomDet = theService->trackingGeometry()->idToDet((*recHitItr).geographicalId());
43  = MuonTransientTrackingRecHit::specificBuild(geomDet,&*recHitItr);
44  TrajectorySeed tmpSeed(theSeeder.createSeed(pt, sigmapt, muonRecHit));
46  result.insert(result.end(), trajectories.begin(), trajectories.end());
47  }
48  // choose the best trajectory
49  if(!result.empty()) clean(result);
50  return result;
51 }
StandAloneMuonTrajectoryBuilder theTrajBuilder
MuonCandidate::TrajectoryContainer TrajectoryContainer
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:48
tuple result
Definition: query.py:137
std::pair< const_iterator, const_iterator > range
unsigned int detId() const
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
range recHits() const
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
void clean(TrajectoryContainer &trajectories) const
TrajectoryContainer trajectories(const TrajectorySeed &)
return a container of the reconstructed trajectories compatible with a given seed ...
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
virtual TrajectoryContainer trajectories(const TrajectorySeed &)
return a container of the reconstructed trajectories compatible with a given seed ...
const LocalTrajectoryParameters & parameters() const
MuonTrajectoryBuilder::CandidateContainer ExhaustiveMuonTrajectoryBuilder::trajectories ( const TrackCand )
virtual

return a container reconstructed muons starting from a given track

Implements MuonTrajectoryBuilder.

Definition at line 55 of file ExhaustiveMuonTrajectoryBuilder.cc.

56 {
57  return CandidateContainer();
58 }
MuonCandidate::CandidateContainer CandidateContainer

Member Data Documentation

MuonSeedFromRecHits ExhaustiveMuonTrajectoryBuilder::theSeeder
private

Definition at line 37 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

const MuonServiceProxy* ExhaustiveMuonTrajectoryBuilder::theService
private

Definition at line 38 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by trajectories().

StandAloneMuonTrajectoryBuilder ExhaustiveMuonTrajectoryBuilder::theTrajBuilder
private

Definition at line 36 of file ExhaustiveMuonTrajectoryBuilder.h.

Referenced by setEvent(), and trajectories().