CMS 3D CMS Logo

MuonSeedFinder.cc
Go to the documentation of this file.
1 
11 
12 using namespace std;
13 
17 
18 MuonSeedFinder::MuonSeedFinder(const edm::ParameterSet& pset) : theBarrel(), theOverlap(), theEndcap() {
19  // FIXME put it in a pSet
20  // theMinMomentum = pset.getParameter<double>("EndCapSeedMinPt"); //3.0
21  theMinMomentum = 3.0;
26 }
27 
29  theField = field;
30  theBarrel.setBField(field);
31  theOverlap.setBField(field);
32  theEndcap.setBField(field);
33 }
34 
36  std::vector<TrajectorySeed>& result) {
37  const std::string metname = "Muon|RecoMuon|MuonSeedFinder";
38 
39  // MuonDumper debug;
40 
41  unsigned int num_bar = 0;
42  for (MuonRecHitContainer::const_iterator iter = hits.begin(); iter != hits.end(); iter++) {
43  if ((*iter)->isDT()) {
44  theBarrel.add(*iter);
45  theOverlap.add(*iter);
46  num_bar++;
47  }
48  }
49 
50  unsigned int num_endcap = 0;
51  for (MuonRecHitContainer::const_iterator iter = hits.begin(); iter != hits.end(); iter++) {
52  if ((*iter)->isCSC() || (*iter)->isME0()) {
53  theEndcap.add(*iter);
54  theOverlap.add(*iter);
55  ++num_endcap;
56  }
57  }
58 
59  // don't do dim-2 seeds in the overlap
60  if (num_bar > 1 || (num_bar == 1 && (num_endcap == 0 || theBarrel.firstRecHit()->dimension() == 4))) {
61  LogDebug(metname) << "Barrel Seeds " << num_bar << endl;
62  result.push_back(theBarrel.seed());
63  }
64 
65  if (num_endcap > 1 || (num_endcap == 1 && num_bar == 0)) {
66  LogDebug(metname) << "Endcap Seeds " << num_endcap << endl;
67  result.push_back(theEndcap.seed());
68  }
69 
70  if (num_bar > 0 && num_endcap > 0) {
71  LogTrace(metname) << "Overlap Seed" << endl;
72  std::vector<TrajectorySeed> overlapSeeds = theOverlap.seeds();
73  result.insert(result.end(), overlapSeeds.begin(), overlapSeeds.end());
74  }
75 
76  theBarrel.clear();
77  theOverlap.clear();
78  theEndcap.clear();
79 }
#define LogDebug(id)
virtual TrajectorySeed seed() const
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
const std::string metname
MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstRecHit() const
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
MuonOverlapSeedFromRecHits theOverlap
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result) override
#define LogTrace(id)
MuonSeedPtExtractor * thePtExtractor
void setBField(const MagneticField *field) override
void setBField(const MagneticField *field)
virtual TrajectorySeed seed() const
void setPtExtractor(const MuonSeedPtExtractor *extractor)
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
void add(MuonTransientTrackingRecHit::MuonRecHitPointer hit)
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
std::vector< TrajectorySeed > seeds() const
const MagneticField * theField
MuonSeedFinder(const edm::ParameterSet &pset)
Constructor.
MuonCSCSeedFromRecHits theEndcap
std::vector< MuonRecHitPointer > MuonRecHitContainer
MuonDTSeedFromRecHits theBarrel