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 *)
 
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 15 of file ExhaustiveMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file ExhaustiveMuonTrajectoryBuilder.cc.

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

Definition at line 16 of file ExhaustiveMuonTrajectoryBuilder.cc.

16 {}

Member Function Documentation

void ExhaustiveMuonTrajectoryBuilder::clean ( TrajectoryContainer trajectories) const
private

Definition at line 67 of file ExhaustiveMuonTrajectoryBuilder.cc.

References i, and query::result.

Referenced by trajectories().

68 {
69  // choose the one with the most hits, and the smallest chi-squared
70  int best_nhits = 0;
71  unsigned best = 0;
72  unsigned ntraj = trajectories.size();
73  for(unsigned i = 0; i < ntraj; ++i)
74  {
75  int nhits = trajectories[i]->foundHits();
76  if(nhits > best_nhits)
77  {
78  best_nhits = nhits;
79  best = i;
80  }
81  else if(nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared())
82  {
83  best = i;
84  }
85  }
87  for(unsigned i = 0; i < ntraj; ++i)
88  {
89  if(i == best) {
90  result.push_back(trajectories[best]);
91  } else {
92  delete trajectories[i];
93  }
94  }
95  trajectories.swap(result);
96 }
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 61 of file ExhaustiveMuonTrajectoryBuilder.cc.

References StandAloneMuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

62 {
63  theTrajBuilder.setEvent(event);
64 }
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 20 of file ExhaustiveMuonTrajectoryBuilder.cc.

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

21 {
22  LocalTrajectoryParameters localTrajectoryParameters(seed.startingState().parameters());
23  LocalVector p(localTrajectoryParameters.momentum());
24  int rawId = seed.startingState().detId();
25  DetId detId(rawId);
26  bool isBarrel = (detId.subdetId() == 1);
27  // homemade local-to-global
28  double pt = (isBarrel) ? -p.z() : p.perp();
29  pt *= localTrajectoryParameters.charge();
30  float err00 = seed.startingState().error(0);
31  // float p_err = sqr(sptmean/(ptmean*ptmean));
32  // mat[0][0]= p_err;
33  float sigmapt = sqrt(err00)*pt*pt;
34  TrajectorySeed::range range = seed.recHits();
36  // Make a new seed based on each segment, using the original pt and sigmapt
37  for(TrajectorySeed::const_iterator recHitItr = range.first;
38  recHitItr != range.second; ++recHitItr)
39  {
40  const GeomDet * geomDet = theService->trackingGeometry()->idToDet((*recHitItr).geographicalId());
42  = MuonTransientTrackingRecHit::specificBuild(geomDet,&*recHitItr);
43  TrajectorySeed tmpSeed(theSeeder.createSeed(pt, sigmapt, muonRecHit));
45  result.insert(result.end(), trajectories.begin(), trajectories.end());
46  }
47  // choose the best trajectory
48  if(!result.empty()) clean(result);
49  return result;
50 }
StandAloneMuonTrajectoryBuilder theTrajBuilder
MuonCandidate::TrajectoryContainer TrajectoryContainer
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:46
tuple result
Definition: query.py:137
std::pair< const_iterator, const_iterator > range
unsigned int detId() const
Definition: DetId.h:20
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 54 of file ExhaustiveMuonTrajectoryBuilder.cc.

55 {
56  return CandidateContainer();
57 }
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().