test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExhaustiveMuonTrajectoryBuilder.cc
Go to the documentation of this file.
5 
6 
8  const MuonServiceProxy* proxy,
10  : theTrajBuilder(pset, proxy,iC),
11  theSeeder(),
12  theService(proxy)
13 {
14 }
15 
16 
18 
19 
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  return result;
49 }
50 
51 
54 {
55  return CandidateContainer();
56 }
57 
58 
59 
61 {
62  theTrajBuilder.setEvent(event);
63 }
64 
65 
67 {
68  // choose the one with the most hits, and the smallest chi-squared
69  int best_nhits = 0;
70  unsigned best = 0;
71  unsigned ntraj = trajectories.size();
72  for(unsigned i = 0; i < ntraj; ++i)
73  {
74  int nhits = trajectories[i]->foundHits();
75  if(nhits > best_nhits)
76  {
77  best_nhits = nhits;
78  best = i;
79  }
80  else if(nhits == best_nhits && trajectories[i]->chiSquared() < trajectories[best]->chiSquared())
81  {
82  best = i;
83  }
84  }
86  for(unsigned i = 0; i < ntraj; ++i)
87  {
88  if(i == best) {
89  result.push_back(trajectories[best]);
90  } else {
91  delete trajectories[i];
92  }
93  }
94  trajectories.swap(result);
95 }
96 
MuonCandidate::CandidateContainer CandidateContainer
int i
Definition: DBlmapReader.cc:9
std::pair< const Trajectory *, reco::TrackRef > TrackCand
virtual void setEvent(const edm::Event &event)
pass the Event to the algo at each event
bool isBarrel(GeomDetEnumerators::SubDetector m)
StandAloneMuonTrajectoryBuilder theTrajBuilder
MuonCandidate::TrajectoryContainer TrajectoryContainer
tuple result
Definition: mps_fire.py:84
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
recHitContainer::const_iterator const_iterator
T sqrt(T t)
Definition: SSEVec.h:18
std::pair< const_iterator, const_iterator > range
unsigned int detId() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
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 ...
ExhaustiveMuonTrajectoryBuilder(const edm::ParameterSet &pset, const MuonServiceProxy *, edm::ConsumesCollector &)
const LocalTrajectoryParameters & parameters() const