CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
void setBeamSpot(const GlobalVector &gv)
double z0() const
z coordinate
Definition: BeamSpot.h:65
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:70
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:73
double y0() const
y coordinate
Definition: BeamSpot.h:63
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:511
edm::InputTag theBeamSpotTag
Definition: event.py:1
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
double x0() const
x coordinate
Definition: BeamSpot.h:61