CMS 3D CMS Logo

MuonSeedGenerator.cc
Go to the documentation of this file.
1 
16 
17 // Data Formats
20 
22 
25 
26 // Geometry
29 
33 
34 // Framework
41 
42 // C++
43 #include <vector>
44 
45 using namespace std;
46 
50 
51 // Constructor
53  : theSeedFinder(new MuonSeedFinder(pset)),
54  theSeedCleaner(new MuonSeedSimpleCleaner()),
55  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag")) {
56  produces<TrajectorySeedCollection>();
57 
58  edm::ConsumesCollector iC = consumesCollector();
60 
61  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
62  magFieldToken = esConsumes<MagneticField, IdealMagneticFieldRecord>();
63 }
64 
65 // Destructor
67  delete thePatternRecognition;
68  delete theSeedFinder;
69  delete theSeedCleaner;
70 }
71 
72 // reconstruct muon's seeds
74  // create the pointer to the Seed container
75  auto output = std::make_unique<TrajectorySeedCollection>();
76 
78  theSeedFinder->setBField(&*field);
79 
81  edm::Handle<reco::BeamSpot> beamSpotHandle;
82  event.getByToken(beamspotToken, beamSpotHandle);
83  if (beamSpotHandle.isValid()) {
84  beamSpot = *beamSpotHandle;
85 
86  } else {
87  edm::LogInfo("MuonSeedGenerator") << "No beam spot available from EventSetup \n";
88  }
89 
90  // make it a vector so we can subtract it from position vectors
91  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
93 
94  std::vector<MuonRecHitContainer> patterns;
95  thePatternRecognition->produce(event, eSetup, patterns);
96 
97  for (std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin(); seedSegments != patterns.end();
98  ++seedSegments) {
99  theSeedFinder->seeds(*seedSegments, *output);
100  }
101 
103 
104  event.put(std::move(output));
105 }
106 
109  desc.setAllowAnything();
110  desc.add<bool>("EnableDTMeasurement", true);
111  desc.add<bool>("EnableCSCMeasurement", true);
112  desc.add<bool>("EnableME0Measurement", false);
113  descriptions.add("produceMuons", desc);
114 }
Vector3DBase
Definition: Vector3DBase.h:8
ConfigurationDescriptions.h
MuonSeedGenerator::thePatternRecognition
MuonSeedVPatternRecognition * thePatternRecognition
Definition: MuonSeedGenerator.h:42
Handle.h
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
MuonTransientTrackingRecHit::ConstMuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:22
MuonSeedOrcaPatternRecognition.h
ESHandle.h
MuonSeedVFinder::seeds
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
MuonSeedGenerator::theBeamSpotTag
edm::InputTag theBeamSpotTag
Definition: MuonSeedGenerator.h:46
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
MuonSeedFinder
Definition: MuonSeedFinder.h:22
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MuonTransientTrackingRecHit::MuonRecHitContainer
std::vector< MuonRecHitPointer > MuonRecHitContainer
Definition: MuonTransientTrackingRecHit.h:26
MuonSeedGenerator::~MuonSeedGenerator
~MuonSeedGenerator() override
Destructor.
Definition: MuonSeedGenerator.cc:66
MuonDetLayerGeometry.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MuonTransientTrackingRecHit.h
edm::Handle< reco::BeamSpot >
MuonSeedSimpleCleaner.h
MuonSeedGenerator::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MuonSeedGenerator.cc:107
MuonSeedVFinder::setBField
virtual void setBField(const MagneticField *field)=0
MuonTransientTrackingRecHit::MuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:21
MuonSeedGenerator::magFieldToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken
Definition: MuonSeedGenerator.h:48
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ESHandle< MagneticField >
ParameterSetDescription.h
TrajectorySeed.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
MuonSeedGenerator::theSeedCleaner
MuonSeedVCleaner * theSeedCleaner
Definition: MuonSeedGenerator.h:44
MuonSeedVCleaner::clean
virtual void clean(TrajectorySeedCollection &seeds)=0
ConstMuonRecHitPointer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
Definition: MuonSeedGenerator.cc:48
edm::ParameterSet
Definition: ParameterSet.h:47
MuonSeedSimpleCleaner
Definition: MuonSeedSimpleCleaner.h:6
MuonSeedFinder.h
MuonSeedGenerator.h
Event.h
MuonSeedGenerator::theSeedFinder
MuonSeedVFinder * theSeedFinder
Definition: MuonSeedGenerator.h:43
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
MuonSeedGenerator::MuonSeedGenerator
MuonSeedGenerator(const edm::ParameterSet &)
Constructor.
Definition: MuonSeedGenerator.cc:52
MuonRecoGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
MuonSeedGenerator::beamspotToken
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
Definition: MuonSeedGenerator.h:47
TrajectorySeedCollection.h
MuonSeedVFinder::setBeamSpot
void setBeamSpot(const GlobalVector &gv)
Definition: MuonSeedVFinder.h:27
MuonSeedGenerator::produce
void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muon's seeds
Definition: MuonSeedGenerator.cc:73
GeomDet.h
MuonSeedVPatternRecognition::produce
virtual void produce(const edm::Event &event, const edm::EventSetup &eSetup, std::vector< MuonRecHitContainer > &result)=0
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
MuonRecHitPointer
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
Definition: MuonSeedGenerator.cc:47
MuonDetLayerMeasurements.h
MuonSeedOrcaPatternRecognition
Definition: MuonSeedOrcaPatternRecognition.h:11
DetLayer.h
EventSetup.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: MuonSeedGenerator.cc:49