CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonSeedFinder.cc
Go to the documentation of this file.
1 
14 
15 using namespace std;
16 
20 
22  theBarrel(),
23  theOverlap(),
24  theEndcap()
25 {
26 
27  // FIXME put it in a pSet
28  // theMinMomentum = pset.getParameter<double>("EndCapSeedMinPt"); //3.0
29  theMinMomentum = 3.0;
34 
35 }
36 
37 
39 {
40  theField = field;
41  theBarrel.setBField(field);
42  theOverlap.setBField(field);
43  theEndcap.setBField(field);
44 }
45 
46 
48  std::vector<TrajectorySeed> & result)
49 {
50  const std::string metname = "Muon|RecoMuon|MuonSeedFinder";
51 
52  // MuonDumper debug;
53 
54  unsigned int num_bar = 0;
55  for ( MuonRecHitContainer::const_iterator iter = hits.begin(); iter!= hits.end(); iter++ ){
56  if ( (*iter)->isDT() ) {
57  theBarrel.add(*iter);
58  theOverlap.add(*iter);
59  num_bar++;
60  }
61  }
62 
63  unsigned int num_endcap = 0;
64  for ( MuonRecHitContainer::const_iterator iter = hits.begin(); iter!= hits.end(); iter++ ){
65  if ( (*iter)->isCSC() )
66  {
67 //std::cout << **iter << std::endl;
68  theEndcap.add(*iter);
69  theOverlap.add(*iter);
70  ++num_endcap;
71  }
72  }
73 
74  // don't do dim-2 seeds in the overlap
75  if ( num_bar >1 || (num_bar==1 && (num_endcap==0 || theBarrel.firstRecHit()->dimension() == 4))) {
76  LogDebug(metname)
77  << "Barrel Seeds " << num_bar << endl;
78  result.push_back(theBarrel.seed());
79 
80  }
81 
82  if(num_endcap > 1 || (num_endcap==1 && num_bar==0))
83  {
84  LogDebug(metname)
85  << "Endcap Seeds " << num_endcap << endl;
86  result.push_back(theEndcap.seed());
87  }
88 
89  if(num_bar > 0 && num_endcap > 0)
90  {
91  LogTrace(metname) << "Overlap Seed" << endl;
92  std::vector<TrajectorySeed> overlapSeeds = theOverlap.seeds();
93  result.insert(result.end(), overlapSeeds.begin(), overlapSeeds.end());
94  }
95 
96  theBarrel.clear();
97  theOverlap.clear();
98  theEndcap.clear();
99 
100 
101 }
102 
#define LogDebug(id)
virtual TrajectorySeed seed() const
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
const std::string metname
MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstRecHit() const
MuonOverlapSeedFromRecHits theOverlap
void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)
tuple result
Definition: query.py:137
#define LogTrace(id)
MuonSeedPtExtractor * thePtExtractor
void setBField(const MagneticField *field)
virtual TrajectorySeed seed() const
void setPtExtractor(const MuonSeedPtExtractor *extractor)
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
virtual void setBField(const MagneticField *field)
void add(MuonTransientTrackingRecHit::MuonRecHitPointer hit)
std::vector< TrajectorySeed > seeds() const
const MagneticField * theField
MuonSeedFinder(const edm::ParameterSet &pset)
Constructor.
MuonCSCSeedFromRecHits theEndcap
std::vector< MuonRecHitPointer > MuonRecHitContainer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
MuonDTSeedFromRecHits theBarrel