CMS 3D CMS Logo

MuonOverlapSeedFromRecHits.cc
Go to the documentation of this file.
11 #include <iomanip>
12 
14 
15 std::vector<TrajectorySeed> MuonOverlapSeedFromRecHits::seeds() const {
16  std::vector<TrajectorySeed> result;
17  //@@ doesn't handle overlap between ME11 and ME12 correctly
18  // sort by station
20  for (MuonRecHitContainer::const_iterator iter = theRhits.begin(), end = theRhits.end(); iter != end; ++iter) {
21  if ((*iter)->isDT()) {
22  DTChamberId dtId((**iter).geographicalId().rawId());
23  // try not doing seeds that start in DT station 2, if there'as a good single segment seed
24  if (dtId.station() == 1 || (dtId.station() == 2 && (*iter)->dimension() == 2)) {
25  barrelHits.push_back(*iter);
26  }
27  } else {
28  endcapHits.push_back(*iter);
29  }
30  }
31 
33  for (MuonRecHitContainer::const_iterator barrelHitItr = barrelHits.begin(), lastBarrelHit = barrelHits.end();
34  barrelHitItr != lastBarrelHit;
35  ++barrelHitItr) {
36  for (MuonRecHitContainer::const_iterator endcapHitItr = endcapHits.begin(), lastEndcapHit = endcapHits.end();
37  endcapHitItr != lastEndcapHit;
38  ++endcapHitItr) {
40  bool good = makeSeed(*barrelHitItr, *endcapHitItr, bestSegment, seed);
41  if (good)
42  result.push_back(seed);
43  // try just one seed
44  return result;
45  }
46  }
47 
48  //std::cout << "Overlap hits " << barrelHits.size() << " "
49  // << endcapHits.size() << std::endl;
50 
51  return result;
52 }
53 
57  TrajectorySeed& result) const {
58  std::vector<double> pts = thePtExtractor->pT_extract(barrelHit, endcapHit);
59  double minpt = 3.;
60  double pt = pts[0];
61  double sigmapt = pts[1];
62  // if too small, probably an error. Keep trying.
63  if (pt != 0) {
64  if (fabs(pt) > minpt) {
65  double maxpt = 2000.;
66  if (pt > maxpt) {
67  pt = maxpt;
68  sigmapt = maxpt;
69  }
70  if (pt < -maxpt) {
71  pt = -maxpt;
72  sigmapt = maxpt;
73  }
74  }
75 
76  result = createSeed(pt, sigmapt, bestSegment);
77  //std::cout << "OVERLAPFITTED PT " << pt << " dphi " << dphi << " eta " << eta << std::endl;
78  return true;
79  }
80  return false;
81 }
82 
86  MuonDTSeedFromRecHits dtSeeder;
87  MuonCSCSeedFromRecHits cscSeeder;
88 
90  if (barrelHits.size() > endcapHits.size()) {
91  result = dtSeeder.bestBarrelHit(barrelHits);
92  if (result->dimension() == 2)
93  result = cscSeeder.bestEndcapHit(endcapHits);
94  } else {
95  result = cscSeeder.bestEndcapHit(endcapHits);
96  }
97  return result;
98 }
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
std::vector< TrajectorySeed > seeds() const
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
const MuonSeedPtExtractor * thePtExtractor
static const double pts[33]
Definition: Constants.h:30
ConstMuonRecHitPointer bestHit(const MuonRecHitContainer &barrelHits, const MuonRecHitContainer &endcapHits) const
ConstMuonRecHitPointer bestEndcapHit(const MuonRecHitContainer &endcapHits) const
ConstMuonRecHitPointer bestBarrelHit(const MuonRecHitContainer &barrelHits) const
bool makeSeed(MuonTransientTrackingRecHit::ConstMuonRecHitPointer barrelHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer endcapHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer bestSegment, TrajectorySeed &result) const
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
virtual std::vector< double > pT_extract(MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer secondHit) const
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
std::vector< MuonRecHitPointer > MuonRecHitContainer