CMS 3D CMS Logo

MuonSeedGenerator.cc
Go to the documentation of this file.
1 
16 
17 // Data Formats
20 
22 
25 
26 // Geometry
29 
34 
35 // Framework
42 
43 // C++
44 #include <vector>
45 
46 using namespace std;
47 
51 
52 // Constructor
54  : theSeedFinder(new MuonSeedFinder(pset)),
55  theSeedCleaner(new MuonSeedSimpleCleaner()),
56  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag")) {
57  produces<TrajectorySeedCollection>();
58 
59  edm::ConsumesCollector iC = consumesCollector();
61 
62  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
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  eSetup.get<IdealMagneticFieldRecord>().get(field);
79  theSeedFinder->setBField(&*field);
80 
82  edm::Handle<reco::BeamSpot> beamSpotHandle;
83  event.getByToken(beamspotToken, beamSpotHandle);
84  if (beamSpotHandle.isValid()) {
85  beamSpot = *beamSpotHandle;
86 
87  } else {
88  edm::LogInfo("MuonSeedGenerator") << "No beam spot available from EventSetup \n";
89  }
90 
91  // make it a vector so we can subtract it from position vectors
92  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
94 
95  std::vector<MuonRecHitContainer> patterns;
96  thePatternRecognition->produce(event, eSetup, patterns);
97 
98  for (std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin(); seedSegments != patterns.end();
99  ++seedSegments) {
100  theSeedFinder->seeds(*seedSegments, *output);
101  }
102 
104 
105  event.put(std::move(output));
106 }
107 
110  desc.setAllowAnything();
111  desc.add<bool>("EnableDTMeasurement", true);
112  desc.add<bool>("EnableCSCMeasurement", true);
113  desc.add<bool>("EnableME0Measurement", false);
114  descriptions.add("produceMuons", desc);
115 }
Vector3DBase
Definition: Vector3DBase.h:8
ConfigurationDescriptions.h
MuonSeedGenerator::thePatternRecognition
MuonSeedVPatternRecognition * thePatternRecognition
Definition: MuonSeedGenerator.h:39
Handle.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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:32
MuonSeedGenerator::theBeamSpotTag
edm::InputTag theBeamSpotTag
Definition: MuonSeedGenerator.h:43
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::LogInfo
Definition: MessageLogger.h:254
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
MuonTransientTrackingRecHit.h
edm::Handle< reco::BeamSpot >
MuonSeedSimpleCleaner.h
MuonSeedGenerator::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MuonSeedGenerator.cc:108
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
MuonSeedVFinder::setBField
virtual void setBField(const MagneticField *field)=0
MuonTransientTrackingRecHit::MuonRecHitPointer
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
Definition: MuonTransientTrackingRecHit.h:21
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
ParameterSetDescription.h
TrajectorySeed.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
MuonSeedGenerator::theSeedCleaner
MuonSeedVCleaner * theSeedCleaner
Definition: MuonSeedGenerator.h:41
MuonSeedVCleaner::clean
virtual void clean(TrajectorySeedCollection &seeds)=0
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
ConstMuonRecHitPointer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
Definition: MuonSeedGenerator.cc:49
edm::ParameterSet
Definition: ParameterSet.h:36
MuonSeedSimpleCleaner
Definition: MuonSeedSimpleCleaner.h:6
MuonSeedFinder.h
MuonSeedGenerator.h
Event.h
MuonSeedGenerator::theSeedFinder
MuonSeedVFinder * theSeedFinder
Definition: MuonSeedGenerator.h:40
MuonSeedGenerator::MuonSeedGenerator
MuonSeedGenerator(const edm::ParameterSet &)
Constructor.
Definition: MuonSeedGenerator.cc:53
MuonRecoGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
MuonSeedGenerator::beamspotToken
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
Definition: MuonSeedGenerator.h:44
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
get
#define get
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
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
MuonRecHitPointer
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
Definition: MuonSeedGenerator.cc:48
MuonDetLayerMeasurements.h
MuonSeedOrcaPatternRecognition
Definition: MuonSeedOrcaPatternRecognition.h:8
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:39
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: MuonSeedGenerator.cc:50