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 }
MuonSeedFromRecHits::thePtExtractor
const MuonSeedPtExtractor * thePtExtractor
Definition: MuonSeedFromRecHits.h:43
MuonCSCSeedFromRecHits.h
MuonTransientTrackingRecHit::ConstMuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:22
MessageLogger.h
MuonPatternRecoDumper.h
HLT_FULL_cff.endcapHits
endcapHits
Definition: HLT_FULL_cff.py:81154
MuonOverlapSeedFromRecHits::seeds
std::vector< TrajectorySeed > seeds() const
Definition: MuonOverlapSeedFromRecHits.cc:15
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
MuonSeedFromRecHits::theRhits
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
Definition: MuonSeedFromRecHits.h:41
MuonTransientTrackingRecHit::MuonRecHitContainer
std::vector< MuonRecHitPointer > MuonRecHitContainer
Definition: MuonTransientTrackingRecHit.h:26
MuonCSCSeedFromRecHits::bestEndcapHit
ConstMuonRecHitPointer bestEndcapHit(const MuonRecHitContainer &endcapHits) const
Definition: MuonCSCSeedFromRecHits.cc:154
HiEvtPlane_cfi.minpt
minpt
Definition: HiEvtPlane_cfi.py:17
CSCDetId.h
MuonCSCSeedFromRecHits
Definition: MuonCSCSeedFromRecHits.h:6
fileCollector.seed
seed
Definition: fileCollector.py:127
TrackingRecHit.h
MuonDTSeedFromRecHits
Definition: MuonDTSeedFromRecHits.h:19
mps_fire.end
end
Definition: mps_fire.py:242
DTChamberId.h
MuonDTSeedFromRecHits::bestBarrelHit
ConstMuonRecHitPointer bestBarrelHit(const MuonRecHitContainer &barrelHits) const
Definition: MuonDTSeedFromRecHits.cc:73
HLT_FULL_cff.barrelHits
barrelHits
Definition: HLT_FULL_cff.py:81169
MuonOverlapSeedFromRecHits::MuonOverlapSeedFromRecHits
MuonOverlapSeedFromRecHits()
Definition: MuonOverlapSeedFromRecHits.cc:13
MuonSeedFromRecHits
Definition: MuonSeedFromRecHits.h:19
MuonOverlapSeedFromRecHits::bestHit
ConstMuonRecHitPointer bestHit(const MuonRecHitContainer &barrelHits, const MuonRecHitContainer &endcapHits) const
Definition: MuonOverlapSeedFromRecHits.cc:83
RPCpg::pts
static const double pts[33]
Definition: Constants.h:30
MuonSeedPtExtractor::pT_extract
virtual std::vector< double > pT_extract(MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer secondHit) const
Definition: MuonSeedPtExtractor.cc:118
MuonSeedPtExtractor.h
MuonOverlapSeedFromRecHits.h
HiEvtPlane_cfi.maxpt
maxpt
Definition: HiEvtPlane_cfi.py:18
MuonDTSeedFromRecHits.h
TrajectorySeed
Definition: TrajectorySeed.h:18
mps_fire.result
result
Definition: mps_fire.py:311
MuonSeedFromRecHits::ConstMuonRecHitPointer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
Definition: MuonSeedFromRecHits.h:39
CSCChamberSpecs.h
DTChamberId
Definition: DTChamberId.h:14
MuonOverlapSeedFromRecHits::makeSeed
bool makeSeed(MuonTransientTrackingRecHit::ConstMuonRecHitPointer barrelHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer endcapHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer bestSegment, TrajectorySeed &result) const
Definition: MuonOverlapSeedFromRecHits.cc:54
MuonSeedFromRecHits::MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: MuonSeedFromRecHits.h:37
MuonSeedFromRecHits::createSeed
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
Definition: MuonSeedFromRecHits.cc:38