CMS 3D CMS Logo

MuonSeedFinder.cc
Go to the documentation of this file.
1 
12 
13 using namespace std;
14 
18 
20  theBarrel(),
21  theOverlap(),
22  theEndcap()
23 {
24 
25  // FIXME put it in a pSet
26  // theMinMomentum = pset.getParameter<double>("EndCapSeedMinPt"); //3.0
27  theMinMomentum = 3.0;
32 
33 }
34 
35 
37 {
38  theField = field;
39  theBarrel.setBField(field);
40  theOverlap.setBField(field);
41  theEndcap.setBField(field);
42 }
43 
44 
46  std::vector<TrajectorySeed> & result)
47 {
48  const std::string metname = "Muon|RecoMuon|MuonSeedFinder";
49 
50  // MuonDumper debug;
51 
52  unsigned int num_bar = 0;
53  for ( MuonRecHitContainer::const_iterator iter = hits.begin(); iter!= hits.end(); iter++ ){
54  if ( (*iter)->isDT() ) {
55  theBarrel.add(*iter);
56  theOverlap.add(*iter);
57  num_bar++;
58  }
59  }
60 
61  unsigned int num_endcap = 0;
62  for ( MuonRecHitContainer::const_iterator iter = hits.begin(); iter!= hits.end(); iter++ ){
63  if ( (*iter)->isCSC() || (*iter)->isME0() )
64  {
65  theEndcap.add(*iter);
66  theOverlap.add(*iter);
67  ++num_endcap;
68  }
69  }
70 
71  // don't do dim-2 seeds in the overlap
72  if ( num_bar >1 || (num_bar==1 && (num_endcap==0 || theBarrel.firstRecHit()->dimension() == 4))) {
73  LogDebug(metname)
74  << "Barrel Seeds " << num_bar << endl;
75  result.push_back(theBarrel.seed());
76 
77  }
78 
79  if(num_endcap > 1 || (num_endcap==1 && num_bar==0))
80  {
81  LogDebug(metname)
82  << "Endcap Seeds " << num_endcap << endl;
83  result.push_back(theEndcap.seed());
84  }
85 
86  if(num_bar > 0 && num_endcap > 0)
87  {
88  LogTrace(metname) << "Overlap Seed" << endl;
89  std::vector<TrajectorySeed> overlapSeeds = theOverlap.seeds();
90  result.insert(result.end(), overlapSeeds.begin(), overlapSeeds.end());
91  }
92 
93  theBarrel.clear();
94  theOverlap.clear();
95  theEndcap.clear();
96 
97 
98 }
99 
#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