CMS 3D CMS Logo

MuonSeedGenerator.cc
Go to the documentation of this file.
1 
17 
18 
19 // Data Formats
22 
24 
27 
28 // Geometry
31 
36 
37 
38 // Framework
43 
44 
45 // C++
46 #include <vector>
47 
48 using namespace std;
49 
53 
54 // Constructor
56 : theSeedFinder(new MuonSeedFinder(pset)),
57  theSeedCleaner(new MuonSeedSimpleCleaner()),
58  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag"))
59 {
60  produces<TrajectorySeedCollection>();
61 
64 
65  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
66 }
67 
68 // Destructor
70  delete thePatternRecognition;
71  delete theSeedFinder;
72  delete theSeedCleaner;
73 }
74 
75 
76 // reconstruct muon's seeds
78 {
79  // create the pointer to the Seed container
80  auto output = std::make_unique<TrajectorySeedCollection>();
81 
83  eSetup.get<IdealMagneticFieldRecord>().get(field);
84  theSeedFinder->setBField(&*field);
85 
87  edm::Handle<reco::BeamSpot> beamSpotHandle;
88  event.getByToken(beamspotToken, beamSpotHandle);
89  if ( beamSpotHandle.isValid() )
90  {
91  beamSpot = *beamSpotHandle;
92 
93  } else
94  {
95  edm::LogInfo("MuonSeedGenerator")
96  << "No beam spot available from EventSetup \n";
97  }
98 
99  // make it a vector so we can subtract it from position vectors
100  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
102 
103  std::vector<MuonRecHitContainer> patterns;
104  thePatternRecognition->produce(event, eSetup, patterns);
105 
106  for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
107  seedSegments != patterns.end(); ++seedSegments)
108  {
109  theSeedFinder->seeds(*seedSegments, *output);
110  }
111 
113 
114  event.put(std::move(output));
115 }
116 
117 
void setBeamSpot(const GlobalVector &gv)
double z0() const
z coordinate
Definition: BeamSpot.h:68
virtual void produce(const edm::Event &event, const edm::EventSetup &eSetup, std::vector< MuonRecHitContainer > &result)=0
MuonSeedVCleaner * theSeedCleaner
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
const PhiMemoryImage patterns[9]
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
virtual void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muon&#39;s seeds
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual ~MuonSeedGenerator()
Destructor.
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
bool isValid() const
Definition: HandleBase.h:74
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
const T & get() const
Definition: EventSetup.h:56
virtual void clean(TrajectorySeedCollection &seeds)=0
HLT enums.
virtual void setBField(const MagneticField *field)=0
double y0() const
y coordinate
Definition: BeamSpot.h:66
MuonSeedVFinder * theSeedFinder
MuonSeedVPatternRecognition * thePatternRecognition
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
MuonSeedGenerator(const edm::ParameterSet &)
Constructor.
std::vector< MuonRecHitPointer > MuonRecHitContainer
def move(src, dest)
Definition: eostools.py:510
edm::InputTag theBeamSpotTag
Definition: event.py:1
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
double x0() const
x coordinate
Definition: BeamSpot.h:64