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 
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() )
64  {
65 //std::cout << **iter << std::endl;
66  theEndcap.add(*iter);
67  theOverlap.add(*iter);
68  ++num_endcap;
69  }
70  }
71 
72  // don't do dim-2 seeds in the overlap
73  if ( num_bar >1 || (num_bar==1 && (num_endcap==0 || theBarrel.firstRecHit()->dimension() == 4))) {
74  LogDebug(metname)
75  << "Barrel Seeds " << num_bar << endl;
76  result.push_back(theBarrel.seed());
77 
78  }
79 
80  if(num_endcap > 1 || (num_endcap==1 && num_bar==0))
81  {
82  LogDebug(metname)
83  << "Endcap Seeds " << num_endcap << endl;
84  result.push_back(theEndcap.seed());
85  }
86 
87  if(num_bar > 0 && num_endcap > 0)
88  {
89  LogTrace(metname) << "Overlap Seed" << endl;
90  std::vector<TrajectorySeed> overlapSeeds = theOverlap.seeds();
91  result.insert(result.end(), overlapSeeds.begin(), overlapSeeds.end());
92  }
93 
94  theBarrel.clear();
95  theOverlap.clear();
96  theEndcap.clear();
97 
98 
99 }
100 
#define LogDebug(id)
virtual TrajectorySeed seed() const
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
const std::string metname
MuonTransientTrackingRecHit::ConstMuonRecHitPointer firstRecHit() const
MuonOverlapSeedFromRecHits theOverlap
tuple field
Definition: statics.py:62
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