CMS 3D CMS Logo

L2MuonProducer.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
16 //
17 //--------------------------------------------------
18 
20 
21 // Framework
27 
28 // TrackFinder and Specific STA/L2 Trajectory Builder
35 
37 
43 
44 #include <string>
45 
46 using namespace edm;
47 using namespace std;
48 
51  LogTrace("Muon|RecoMuon|L2MuonProducer") << "constructor called" << endl;
52 
53  // Parameter set for the Builder
54  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("L2TrajBuilderParameters");
55 
56  // MuonSeed Collection Label
57  theSeedCollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
58  seedsToken = consumes<edm::View<TrajectorySeed>>(theSeedCollectionLabel);
59  // service parameters
60  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
61 
62  // TrackLoader parameters
63  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
64 
65  // the services
66  theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
67 
68  std::unique_ptr<MuonTrajectoryBuilder> trajectoryBuilder = nullptr;
69  // instantiate the concrete trajectory builder in the Track Finder
70 
71  edm::ConsumesCollector iC = consumesCollector();
72  string typeOfBuilder = parameterSet.existsAs<string>("MuonTrajectoryBuilder")
73  ? parameterSet.getParameter<string>("MuonTrajectoryBuilder")
74  : "StandAloneMuonTrajectoryBuilder";
75  if (typeOfBuilder == "StandAloneMuonTrajectoryBuilder" || typeOfBuilder.empty())
76  trajectoryBuilder =
77  std::make_unique<StandAloneMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
78  else if (typeOfBuilder == "Exhaustive")
79  trajectoryBuilder =
80  std::make_unique<ExhaustiveMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
81  else {
82  LogWarning("Muon|RecoMuon|StandAloneMuonProducer")
83  << "No Trajectory builder associated with " << typeOfBuilder
84  << ". Falling down to the default (StandAloneMuonTrajectoryBuilder)";
85  trajectoryBuilder =
86  std::make_unique<StandAloneMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
87  }
88  theTrackFinder =
89  std::make_unique<MuonTrackFinder>(std::move(trajectoryBuilder),
90  std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()),
91  std::make_unique<MuonTrajectoryCleaner>(true),
92  iC);
93 
94  produces<reco::TrackCollection>();
95  produces<reco::TrackCollection>("UpdatedAtVtx");
96  produces<TrackingRecHitCollection>();
97  produces<reco::TrackExtraCollection>();
98  produces<reco::TrackToTrackMap>();
99 
100  produces<std::vector<Trajectory>>();
101  produces<TrajTrackAssociationCollection>();
102 
103  produces<edm::AssociationMap<edm::OneToMany<std::vector<L2MuonTrajectorySeed>, std::vector<L2MuonTrajectorySeed>>>>();
104 }
105 
108  LogTrace("Muon|RecoMuon|L2eMuonProducer") << "L2MuonProducer destructor called" << endl;
109 }
110 
112 void L2MuonProducer::produce(Event& event, const EventSetup& eventSetup) {
113  const std::string metname = "Muon|RecoMuon|L2MuonProducer";
114 
115  LogTrace(metname) << endl << endl << endl;
116  LogTrace(metname) << "L2 Muon Reconstruction Started" << endl;
117 
118  // Take the seeds container
119  LogTrace(metname) << "Taking the seeds: " << theSeedCollectionLabel.label() << endl;
121  event.getByToken(seedsToken, seeds);
122 
123  // Update the services
124  theService->update(eventSetup);
125 
126  // Reconstruct
127  LogTrace(metname) << "Track Reconstruction" << endl;
128  theTrackFinder->reconstruct(seeds, event, eventSetup);
129 
130  LogTrace(metname) << "Event loaded"
131  << "================================" << endl
132  << endl;
133 }
134 
137  {
139  psd0.addUntracked<std::vector<std::string>>("Propagators",
140  {
141  "hltESPFastSteppingHelixPropagatorAny"
142  "hltESPFastSteppingHelixPropagatorOpposite",
143  });
144  psd0.add<bool>("RPCLayers", true);
145  psd0.addUntracked<bool>("UseMuonNavigation", true);
146  desc.add<edm::ParameterSetDescription>("ServiceParameters", psd0);
147  }
148 
149  desc.add<edm::InputTag>("InputObjects", edm::InputTag("hltL2MuonSeeds"));
150  {
152  psd0.add<std::string>("Fitter", "hltESPKFFittingSmootherForL2Muon");
153  psd0.add<std::string>("MuonRecHitBuilder", "hltESPMuonTransientTrackingRecHitBuilder");
154  psd0.add<unsigned int>("NMinRecHits", 2);
155  psd0.add<bool>("UseSubRecHits", false);
156  psd0.add<std::string>("Propagator", "hltESPFastSteppingHelixPropagatorAny");
157  psd0.add<double>("RescaleError", 100.0);
158  desc.add<edm::ParameterSetDescription>("SeedTransformerParameters", psd0);
159  }
160 
161  {
163  psd0.add<bool>("DoRefit", false);
164  psd0.add<std::string>("SeedPropagator", "hltESPFastSteppingHelixPropagatorAny");
165  {
167  psd1.add<double>("NumberOfSigma", 3.0);
168  psd1.add<std::string>("FitDirection", "insideOut");
169  psd1.add<edm::InputTag>("DTRecSegmentLabel", edm::InputTag("hltDt4DSegments"));
170  psd1.add<double>("MaxChi2", 1000.0);
171  {
173  psd2.add<double>("MaxChi2", 25.0);
174  psd2.add<double>("RescaleErrorFactor", 100.0);
175  psd2.add<int>("Granularity", 0);
176  psd2.add<bool>("ExcludeRPCFromFit", false);
177  psd2.add<bool>("UseInvalidHits", true);
178  psd2.add<bool>("RescaleError", false);
179  psd1.add<edm::ParameterSetDescription>("MuonTrajectoryUpdatorParameters", psd2);
180  }
181  psd1.add<bool>("EnableRPCMeasurement", true);
182  psd1.add<edm::InputTag>("CSCRecSegmentLabel", edm::InputTag("hltCscSegments"));
183  psd1.add<bool>("EnableDTMeasurement", true);
184  psd1.add<edm::InputTag>("RPCRecSegmentLabel", edm::InputTag("hltRpcRecHits"));
185  psd1.add<std::string>("Propagator", "hltESPFastSteppingHelixPropagatorAny");
186  psd1.add<bool>("EnableGEMMeasurement", false);
187  psd1.add<edm::InputTag>("GEMRecSegmentLabel", edm::InputTag("gemRecHits"));
188  psd1.add<bool>("EnableME0Measurement", false);
189  psd1.add<edm::InputTag>("ME0RecSegmentLabel", edm::InputTag("me0Segments"));
190  psd1.add<bool>("EnableCSCMeasurement", true);
191  psd0.add<edm::ParameterSetDescription>("FilterParameters", psd1);
192  }
193  psd0.add<std::string>("NavigationType", "Standard");
194  {
196  psd1.add<std::string>("Fitter", "hltESPKFFittingSmootherForL2Muon");
197  psd1.add<std::string>("MuonRecHitBuilder", "hltESPMuonTransientTrackingRecHitBuilder");
198  psd1.add<unsigned int>("NMinRecHits", 2);
199  psd1.add<bool>("UseSubRecHits", false);
200  psd1.add<std::string>("Propagator", "hltESPFastSteppingHelixPropagatorAny");
201  psd1.add<double>("RescaleError", 100.0);
202  psd0.add<edm::ParameterSetDescription>("SeedTransformerParameters", psd1);
203  }
204  psd0.add<bool>("DoBackwardFilter", true);
205  psd0.add<std::string>("SeedPosition", "in");
206  {
208  psd1.add<double>("NumberOfSigma", 3.0);
209  psd1.add<edm::InputTag>("CSCRecSegmentLabel", edm::InputTag("hltCscSegments"));
210  psd1.add<std::string>("FitDirection", "outsideIn");
211  psd1.add<edm::InputTag>("DTRecSegmentLabel", edm::InputTag("hltDt4DSegments"));
212  psd1.add<double>("MaxChi2", 100.0);
213  {
215  psd2.add<double>("MaxChi2", 25.0);
216  psd2.add<double>("RescaleErrorFactor", 100.0);
217  psd2.add<int>("Granularity", 0);
218  psd2.add<bool>("ExcludeRPCFromFit", false);
219  psd2.add<bool>("UseInvalidHits", true);
220  psd2.add<bool>("RescaleError", false);
221  psd1.add<edm::ParameterSetDescription>("MuonTrajectoryUpdatorParameters", psd2);
222  }
223  psd1.add<bool>("EnableRPCMeasurement", true);
224  psd1.add<std::string>("BWSeedType", "fromGenerator");
225  psd1.add<bool>("EnableDTMeasurement", true);
226  psd1.add<edm::InputTag>("RPCRecSegmentLabel", edm::InputTag("hltRpcRecHits"));
227  psd1.add<std::string>("Propagator", "hltESPFastSteppingHelixPropagatorAny");
228  psd1.add<bool>("EnableGEMMeasurement", false);
229  psd1.add<edm::InputTag>("GEMRecSegmentLabel", edm::InputTag("gemRecHits"));
230  psd1.add<bool>("EnableME0Measurement", false);
231  psd1.add<edm::InputTag>("ME0RecSegmentLabel", edm::InputTag("me0Segments"));
232  psd1.add<bool>("EnableCSCMeasurement", true);
233  psd0.add<edm::ParameterSetDescription>("BWFilterParameters", psd1);
234  }
235  psd0.add<bool>("DoSeedRefit", false);
236  desc.add<edm::ParameterSetDescription>("L2TrajBuilderParameters", psd0);
237  }
238  desc.add<bool>("DoSeedRefit", false);
239  {
241  psd0.add<std::string>("Smoother", "hltESPKFTrajectorySmootherForMuonTrackLoader");
242  psd0.add<bool>("DoSmoothing", false);
243  psd0.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
244  {
246  psd1.add<double>("MaxChi2", 1000000.0);
247  psd1.add<std::vector<double>>("BeamSpotPosition",
248  {
249  0.0,
250  0.0,
251  0.0,
252  });
253  psd1.add<std::string>("Propagator", "hltESPFastSteppingHelixPropagatorOpposite");
254  psd1.add<std::vector<double>>("BeamSpotPositionErrors",
255  {
256  0.1,
257  0.1,
258  5.3,
259  });
260  psd0.add<edm::ParameterSetDescription>("MuonUpdatorAtVertexParameters", psd1);
261  }
262  psd0.add<bool>("VertexConstraint", true);
263  psd0.add<std::string>("TTRHBuilder", "hltESPTTRHBWithTrackAngle");
264  desc.add<edm::ParameterSetDescription>("TrackLoaderParameters", psd0);
265  }
266  desc.add<std::string>("MuonTrajectoryBuilder", "Exhaustive");
267  descriptions.add("L2MuonProducer", desc);
268 }
Handle.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
MuonTrajectoryCleaner.h
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
L2MuonTrajectorySeedCollection.h
Track.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
MuonTrackLoader.h
L2MuonProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muons
Definition: L2MuonProducer.cc:112
L2MuonProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L2MuonProducer.cc:135
TrajTrackAssociation.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:231
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
MuonTrackFinder.h
edm::EventSetup
Definition: EventSetup.h:58
L2MuonProducer::~L2MuonProducer
~L2MuonProducer() override
destructor
Definition: L2MuonProducer.cc:107
ExhaustiveMuonTrajectoryBuilder.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
L2MuonProducer::L2MuonProducer
L2MuonProducer(const edm::ParameterSet &)
constructor with config
Definition: L2MuonProducer.cc:50
MuonServiceProxy.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ConsumesCollector.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
View.h
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
L2MuonProducer.h
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
TrackToTrackMap.h
StandAloneTrajectoryBuilder.h
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40