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<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"));
111  desc.add<bool>("scaleDT", true);
112  desc.add<edm::InputTag>("CSCRecSegmentLabel", edm::InputTag("cscSegments"));
113  desc.add<edm::InputTag>("DTRecSegmentLabel", edm::InputTag("dt4DSegments"));
114  desc.add<edm::InputTag>("ME0RecSegmentLabel", edm::InputTag("me0Segments"));
115  desc.add<bool>("EnableDTMeasurement", true);
116  desc.add<bool>("EnableCSCMeasurement", true);
117  desc.add<bool>("EnableME0Measurement", false);
118  desc.add<std::vector<double>>("crackEtas", {0.2, 1.6, 1.7});
119  desc.add<double>("crackWindow", 0.04);
120  desc.add<double>("deltaPhiSearchWindow", 0.25);
121  desc.add<double>("deltaEtaSearchWindow", 0.2);
122  desc.add<double>("deltaEtaCrackSearchWindow", 0.25);
123  descriptions.add("muonSeedGenerator", desc);
124 }
void setBeamSpot(const GlobalVector &gv)
virtual void produce(const edm::Event &event, const edm::EventSetup &eSetup, std::vector< MuonRecHitContainer > &result)=0
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken
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)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
Log< level::Info, false > LogInfo
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool isValid() const
Definition: HandleBase.h:70
virtual void clean(TrajectorySeedCollection &seeds)=0
HLT enums.
virtual void setBField(const MagneticField *field)=0
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