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
45 
46 
47 // C++
48 #include <vector>
49 
50 using namespace std;
51 
55 
56 // Constructor
58 : theSeedFinder(new MuonSeedFinder(pset)),
59  theSeedCleaner(new MuonSeedSimpleCleaner()),
60  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag"))
61 {
62  produces<TrajectorySeedCollection>();
63 
64  edm::ConsumesCollector iC = consumesCollector();
66 
67  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
68 }
69 
70 // Destructor
72  delete thePatternRecognition;
73  delete theSeedFinder;
74  delete theSeedCleaner;
75 }
76 
77 
78 // reconstruct muon's seeds
80 {
81  // create the pointer to the Seed container
82  auto output = std::make_unique<TrajectorySeedCollection>();
83 
85  eSetup.get<IdealMagneticFieldRecord>().get(field);
86  theSeedFinder->setBField(&*field);
87 
89  edm::Handle<reco::BeamSpot> beamSpotHandle;
90  event.getByToken(beamspotToken, beamSpotHandle);
91  if ( beamSpotHandle.isValid() )
92  {
93  beamSpot = *beamSpotHandle;
94 
95  } else
96  {
97  edm::LogInfo("MuonSeedGenerator")
98  << "No beam spot available from EventSetup \n";
99  }
100 
101  // make it a vector so we can subtract it from position vectors
102  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
104 
105  std::vector<MuonRecHitContainer> patterns;
106  thePatternRecognition->produce(event, eSetup, patterns);
107 
108  for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
109  seedSegments != patterns.end(); ++seedSegments)
110  {
111  theSeedFinder->seeds(*seedSegments, *output);
112  }
113 
115 
116  event.put(std::move(output));
117 }
118 
119 
122  desc.setAllowAnything();
123  desc.add<bool>("EnableDTMeasurement",true);
124  desc.add<bool>("EnableCSCMeasurement",true);
125  desc.add<bool>("EnableME0Measurement",false);
126  descriptions.add("produceMuons", desc);
127 }
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
void setAllowAnything()
allow any parameter label/value pairs
MuonSeedVCleaner * theSeedCleaner
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muon&#39;s seeds
~MuonSeedGenerator() override
Destructor.
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void clean(TrajectorySeedCollection &seeds)=0
HLT enums.
virtual void setBField(const MagneticField *field)=0
T get() const
Definition: EventSetup.h:63
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