CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
L3MuonProducer Class Reference

#include <L3MuonProducer.h>

Inheritance diagram for L3MuonProducer:
edm::stream::EDProducer<>

Public Member Functions

 L3MuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 reconstruct muons More...
 
 ~L3MuonProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< TrajTrackAssociationCollectionl2AssoMapToken_
 
edm::EDGetTokenT< reco::TrackCollectionl2MuonToken_
 
edm::EDGetTokenT< std::vector< Trajectory > > l2MuonTrajToken_
 
edm::InputTag theL2CollectionLabel
 Seed STA Label. More...
 
std::string theL2SeededTkLabel
 Label for L2SeededTracks. More...
 
std::unique_ptr< MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
std::unique_ptr< MuonTrackFindertheTrackFinder
 
edm::EDGetTokenT< reco::TrackToTrackMapupdatedL2AssoMapToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

L3 muon reconstructor: reconstructs muons using DT, CSC, RPC and tracker information,
starting from a L2 reonstructed muon.

Author
A. Everett - Purdue University

Definition at line 36 of file L3MuonProducer.h.

Constructor & Destructor Documentation

◆ L3MuonProducer()

L3MuonProducer::L3MuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 35 of file L3MuonProducer.cc.

References edm::ParameterSet::getParameter(), LogTrace, eostools::move(), edm::parameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

35  {
36  LogTrace("L3MuonProducer") << "constructor called" << endl;
37 
38  // Parameter set for the Builder
39  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("L3TrajBuilderParameters");
40 
41  // L2 Muon Collection Label
42  theL2CollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
43  l2MuonToken_ = consumes<reco::TrackCollection>(theL2CollectionLabel);
44  l2MuonTrajToken_ = consumes<std::vector<Trajectory>>(theL2CollectionLabel.label());
45  l2AssoMapToken_ = consumes<TrajTrackAssociationCollection>(theL2CollectionLabel.label());
46  updatedL2AssoMapToken_ = consumes<reco::TrackToTrackMap>(theL2CollectionLabel.label());
47 
48  // service parameters
49  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
50 
51  // TrackLoader parameters
52  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
53 
54  // the services
55  theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
56  ConsumesCollector iC = consumesCollector();
57 
58  // instantiate the concrete trajectory builder in the Track Finder
59  auto mtl = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get());
60  auto l3mtb = std::make_unique<L3MuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
61  theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(l3mtb), std::move(mtl), iC);
62 
64  trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance", std::string());
65 
66  produces<TrackingRecHitCollection>(theL2SeededTkLabel);
67  produces<reco::TrackExtraCollection>(theL2SeededTkLabel);
68  // TrackCollection refers to TrackingRechit and TrackExtra
69  // collections, need to declare its production after them to work
70  // around a rare race condition in framework scheduling
71  produces<reco::TrackCollection>(theL2SeededTkLabel);
72  produces<vector<Trajectory>>(theL2SeededTkLabel);
73  produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);
74 
75  produces<TrackingRecHitCollection>();
76  produces<reco::TrackExtraCollection>();
77  // TrackCollection refers to TrackingRechit and TrackExtra
78  // collections, need to declare its production after them to work
79  // around a rare race condition in framework scheduling
80  produces<reco::TrackCollection>();
81  produces<vector<Trajectory>>();
82  produces<TrajTrackAssociationCollection>();
83 
84  produces<reco::MuonTrackLinksCollection>();
85 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::TrackToTrackMap > updatedL2AssoMapToken_
edm::EDGetTokenT< reco::TrackCollection > l2MuonToken_
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< std::vector< Trajectory > > l2MuonTrajToken_
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
#define LogTrace(id)
std::unique_ptr< MuonTrackFinder > theTrackFinder
edm::EDGetTokenT< TrajTrackAssociationCollection > l2AssoMapToken_
edm::InputTag theL2CollectionLabel
Seed STA Label.
std::string theL2SeededTkLabel
Label for L2SeededTracks.
def move(src, dest)
Definition: eostools.py:511

◆ ~L3MuonProducer()

L3MuonProducer::~L3MuonProducer ( )
override

destructor

Definition at line 90 of file L3MuonProducer.cc.

References LogTrace.

90 { LogTrace("L3MuonProducer") << "destructor called" << endl; }
#define LogTrace(id)

Member Function Documentation

◆ fillDescriptions()

void L3MuonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 150 of file L3MuonProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, TrackTransformer::fillPSetDescription(), HLT_2022v14_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

150  {
152  {
154  psd0.addUntracked<std::vector<std::string>>("Propagators",
155  {
156  "hltESPSmartPropagatorAny",
157  "SteppingHelixPropagatorAny",
158  "hltESPSmartPropagator",
159  "hltESPSteppingHelixPropagatorOpposite",
160  });
161  psd0.add<bool>("RPCLayers", true);
162  psd0.addUntracked<bool>("UseMuonNavigation", true);
163  desc.add<edm::ParameterSetDescription>("ServiceParameters", psd0);
164  }
165  desc.add<edm::InputTag>("MuonCollectionLabel", edm::InputTag("hltL2Muons", "UpdatedAtVtx"));
166  {
168  psd0.addUntracked<bool>("PutTkTrackIntoEvent", false);
169  psd0.add<std::string>("TTRHBuilder", "hltESPTTRHBWithTrackAngle");
170  psd0.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
171  psd0.addUntracked<bool>("SmoothTkTrack", false);
172  psd0.addUntracked<std::string>("MuonSeededTracksInstance", "L2Seeded");
173  psd0.add<std::string>("Smoother", "hltESPKFTrajectorySmootherForMuonTrackLoader");
174  {
176  psd1.add<double>("MaxChi2", 1000000.0);
177  psd1.add<std::string>("Propagator", "hltESPSteppingHelixPropagatorOpposite");
178  psd1.add<std::vector<double>>("BeamSpotPositionErrors",
179  {
180  0.1,
181  0.1,
182  5.3,
183  });
184  psd0.add<edm::ParameterSetDescription>("MuonUpdatorAtVertexParameters", psd1);
185  }
186  psd0.add<bool>("VertexConstraint", false);
187  psd0.add<bool>("DoSmoothing", false);
188  desc.add<edm::ParameterSetDescription>("TrackLoaderParameters", psd0);
189  }
190  {
192  psd0.add<double>("ScaleTECyFactor", -1.0);
193  psd0.add<edm::InputTag>("tkTrajVertex", edm::InputTag("hltPixelVertices"));
194  psd0.add<bool>("tkTrajUseVertex", false);
195  {
197  psd1.add<int>("TrackerSkipSection", -1);
198  psd1.add<bool>("DoPredictionsOnly", false);
199  psd1.add<bool>("PropDirForCosmics", false);
200  psd1.add<int>("HitThreshold", 1);
201  psd1.add<int>("MuonHitsOption", 1);
202  psd1.add<bool>("RefitFlag", true);
203  psd1.add<std::string>("Fitter", "hltESPL3MuKFTrajectoryFitter");
204  psd1.add<int>("SkipStation", -1);
205  psd1.add<std::string>("TrackerRecHitBuilder", "hltESPTTRHBWithTrackAngle");
206  psd1.add<double>("Chi2CutRPC", 1.0);
207  psd1.add<std::string>("MuonRecHitBuilder", "hltESPMuonTransientTrackingRecHitBuilder");
208  psd1.add<std::string>("RefitDirection", "insideOut");
209  psd1.add<edm::InputTag>("CSCRecSegmentLabel", edm::InputTag("hltCscSegments"));
210  psd1.add<edm::InputTag>("GEMRecHitLabel", edm::InputTag("gemRecHits"));
211  psd1.add<edm::InputTag>("ME0RecHitLabel", edm::InputTag("me0Segments"));
212  psd1.add<std::vector<int>>("DYTthrs",
213  {
214  30,
215  15,
216  });
217  psd1.add<int>("DYTselector", 1);
218  psd1.add<bool>("DYTupdator", false);
219  psd1.add<bool>("DYTuseAPE", false);
220  psd1.add<bool>("DYTuseThrsParametrization", true);
221  {
223  psd2.add<std::vector<double>>("eta0p8", {1, -0.919853, 0.990742});
224  psd2.add<std::vector<double>>("eta1p2", {1, -0.897354, 0.987738});
225  psd2.add<std::vector<double>>("eta2p0", {1, -0.986855, 0.998516});
226  psd2.add<std::vector<double>>("eta2p2", {1, -0.940342, 0.992955});
227  psd2.add<std::vector<double>>("eta2p4", {1, -0.947633, 0.993762});
228  psd1.add<edm::ParameterSetDescription>("DYTthrsParameters", psd2);
229  }
230  psd1.add<double>("Chi2CutCSC", 150.0);
231  psd1.add<double>("Chi2CutDT", 10.0);
232  psd1.add<double>("Chi2CutGEM", 1.0);
233  psd1.add<double>("Chi2CutME0", 1.0);
234  psd1.add<bool>("RefitRPCHits", true);
235  psd1.add<edm::InputTag>("DTRecSegmentLabel", edm::InputTag("hltDt4DSegments"));
236  psd1.add<std::string>("Propagator", "hltESPSmartPropagatorAny");
237  psd1.add<int>("TrackerSkipSystem", -1);
238  psd0.add<edm::ParameterSetDescription>("GlbRefitterParameters", psd1);
239  }
240  psd0.add<double>("tkTrajMaxChi2", 9999.0);
241  psd0.add<double>("ScaleTECxFactor", -1.0);
242  psd0.add<std::string>("TrackerRecHitBuilder", "hltESPTTRHBWithTrackAngle");
243  psd0.add<edm::InputTag>("tkTrajBeamSpot", edm::InputTag("hltOnlineBeamSpot"));
244  psd0.add<std::string>("MuonRecHitBuilder", "hltESPMuonTransientTrackingRecHitBuilder");
245  psd0.add<double>("tkTrajMaxDXYBeamSpot", 9999.0);
246  psd0.add<std::string>("TrackerPropagator", "SteppingHelixPropagatorAny");
247  {
249  psd1.add<bool>("precise", true);
250  psd1.add<bool>("Eta_fixed", true);
251  psd1.add<double>("Eta_min", 0.1);
252  psd1.add<bool>("Z_fixed", false);
253  psd1.add<edm::InputTag>("MeasurementTrackerName", edm::InputTag("hltESPMeasurementTracker"));
254  psd1.add<int>("maxRegions", 2);
255  psd1.add<double>("Pt_min", 3.0);
256  psd1.add<double>("Rescale_Dz", 4.0);
257  psd1.add<double>("PhiR_UpperLimit_Par1", 0.6);
258  psd1.add<double>("PhiR_UpperLimit_Par2", 0.2);
259  psd1.add<edm::InputTag>("vertexCollection", edm::InputTag("pixelVertices"));
260  psd1.add<bool>("Phi_fixed", true);
261  psd1.add<edm::InputTag>("input", edm::InputTag("hltL2Muons", "UpdatedAtVtx"));
262  psd1.add<double>("DeltaR", 0.025);
263  psd1.add<int>("OnDemand", -1);
264  psd1.add<double>("DeltaZ", 24.2);
265  psd1.add<double>("Rescale_phi", 3.0);
266  psd1.add<double>("Rescale_eta", 3.0);
267  psd1.add<double>("DeltaEta", 0.04);
268  psd1.add<double>("DeltaPhi", 0.15);
269  psd1.add<double>("Phi_min", 0.1);
270  psd1.add<bool>("UseVertex", false);
271  psd1.add<double>("EtaR_UpperLimit_Par1", 0.25);
272  psd1.add<double>("EtaR_UpperLimit_Par2", 0.15);
273  psd1.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
274  psd1.add<bool>("Pt_fixed", false);
275  psd0.add<edm::ParameterSetDescription>("MuonTrackingRegionBuilder", psd1);
276  }
277  psd0.add<bool>("RefitRPCHits", true);
278  psd0.add<double>("PCut", 2.5);
279  {
282  false, // do predictions only
283  "hltESPL3MuKFTrajectoryFitter", // fitter
284  "hltESPKFTrajectorySmootherForMuonTrackLoader", // smoother
285  "hltESPSmartPropagatorAny", // propagator
286  "insideOut", // refit direction
287  true, // refit rpc hits
288  "hltESPTTRHBWithTrackAngle", // tracker rechit builder
289  "hltESPMuonTransientTrackingRecHitBuilder" // muon rechit builder
290  );
291  psd0.add<edm::ParameterSetDescription>("TrackTransformer", psd1);
292  }
293  {
295  psd1.add<double>("Quality_3", 7.0);
296  psd1.add<double>("DeltaRCut_1", 0.1);
297  psd1.add<double>("MinP", 2.5);
298  psd1.add<double>("MinPt", 1.0);
299  psd1.add<double>("Quality_2", 15.0);
300  psd1.add<double>("Pt_threshold2", 999999999.0);
301  psd1.add<double>("LocChi2Cut", 0.001);
302  psd1.add<double>("Eta_threshold", 1.2);
303  psd1.add<double>("Pt_threshold1", 0.0);
304  psd1.add<double>("Chi2Cut_1", 50.0);
305  psd1.add<double>("Quality_1", 20.0);
306  psd1.add<double>("Chi2Cut_3", 200.0);
307  psd1.add<double>("DeltaRCut_3", 1.0);
308  psd1.add<double>("DeltaRCut_2", 0.2);
309  psd1.add<double>("DeltaDCut_1", 40.0);
310  psd1.add<double>("DeltaDCut_2", 10.0);
311  psd1.add<double>("DeltaDCut_3", 15.0);
312  psd1.add<double>("Chi2Cut_2", 50.0);
313  psd1.add<std::string>("Propagator", "hltESPSmartPropagator");
314  psd0.add<edm::ParameterSetDescription>("GlobalMuonTrackMatcher", psd1);
315  }
316  psd0.add<double>("PtCut", 1.0);
317  psd0.add<bool>("matchToSeeds", true);
318  psd0.add<edm::InputTag>("tkTrajLabel", edm::InputTag("hltBRSMuonSeededTracksOutIn"));
319  desc.add<edm::ParameterSetDescription>("L3TrajBuilderParameters", psd0);
320  }
321  descriptions.add("L3MuonProducer", desc);
322 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillPSetDescription(edm::ParameterSetDescription &descriptions, bool doPredictionsOnly=false, const std::string &fitter="KFFitterForRefitInsideOut", const std::string &smoother="KFSmootherForRefitInsideOut", const std::string &propagator="SmartPropagatorAnyRK", const std::string &refitDirection="alongMomentum", bool refitRPCHits=true, const std::string &trackerRecHitBuilder="WithTrackAngle", const std::string &muonRecHitBuilder="MuonRecHitBuilder", const std::string &mtdRecHitBuilder="MTDRecHitBuilder")
fillDescriptions

◆ produce()

void L3MuonProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

reconstruct muons

Definition at line 95 of file L3MuonProducer.cc.

References edm::AssociationMap< Tag >::begin(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, edm::AssociationMap< Tag >::end(), options_cfi::eventSetup, edm::AssociationMap< Tag >::find(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), L2Muons_cfi::L2Muons, LogTrace, and metname.

95  {
96  const string metname = "Muon|RecoMuon|L3MuonProducer";
97  LogTrace(metname) << endl << endl << endl;
98  LogTrace(metname) << "L3 Muon Reconstruction started" << endl;
99 
100  typedef vector<Trajectory> TrajColl;
101 
102  // Update the services
103  theService->update(eventSetup);
104 
105  // Take the L2 muon container(s)
106  LogTrace(metname) << "Taking the L2 Muons " << theL2CollectionLabel << endl;
107 
109  event.getByToken(l2MuonToken_, L2Muons);
110 
111  Handle<vector<Trajectory>> L2MuonsTraj;
112  vector<MuonTrajectoryBuilder::TrackCand> L2TrackCands;
113 
114  event.getByToken(l2MuonTrajToken_, L2MuonsTraj);
115 
117  event.getByToken(l2AssoMapToken_, L2AssoMap);
118 
119  edm::Handle<reco::TrackToTrackMap> updatedL2AssoMap;
120  event.getByToken(updatedL2AssoMapToken_, updatedL2AssoMap);
121 
122  for (TrajTrackAssociationCollection::const_iterator it = L2AssoMap->begin(); it != L2AssoMap->end(); ++it) {
123  const Ref<vector<Trajectory>> traj = it->key;
124  const reco::TrackRef tkRegular = it->val;
125  reco::TrackRef tkUpdated;
128  if (theL2CollectionLabel.instance() == "UpdatedAtVtx") {
129  iEnd = updatedL2AssoMap->end();
130  iii = updatedL2AssoMap->find(it->val);
131  if (iii != iEnd)
132  tkUpdated = (*updatedL2AssoMap)[it->val];
133  }
134 
135  const reco::TrackRef tk = (tkUpdated.isNonnull()) ? tkUpdated : tkRegular;
136 
138  if (traj->isValid())
139  L2Cand.first = &*traj;
140  L2TrackCands.push_back(L2Cand);
141  }
142 
143  theTrackFinder->reconstruct(L2TrackCands, event, eventSetup);
144 
145  LogTrace(metname) << "Event loaded"
146  << "================================" << endl
147  << endl;
148 }
edm::EDGetTokenT< reco::TrackToTrackMap > updatedL2AssoMapToken_
std::pair< const Trajectory *, reco::TrackRef > TrackCand
edm::EDGetTokenT< reco::TrackCollection > l2MuonToken_
const std::string metname
std::string const & instance() const
Definition: InputTag.h:37
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
edm::EDGetTokenT< std::vector< Trajectory > > l2MuonTrajToken_
key_type key() const
Accessor for product key.
Definition: Ref.h:250
const_iterator find(const key_type &k) const
find element with specified reference key
#define LogTrace(id)
const_iterator end() const
last iterator over the map (read only)
std::unique_ptr< MuonTrackFinder > theTrackFinder
edm::EDGetTokenT< TrajTrackAssociationCollection > l2AssoMapToken_
edm::InputTag theL2CollectionLabel
Seed STA Label.
const_iterator begin() const
first iterator over the map (read only)
Definition: event.py:1

Member Data Documentation

◆ l2AssoMapToken_

edm::EDGetTokenT<TrajTrackAssociationCollection> L3MuonProducer::l2AssoMapToken_
private

Definition at line 57 of file L3MuonProducer.h.

◆ l2MuonToken_

edm::EDGetTokenT<reco::TrackCollection> L3MuonProducer::l2MuonToken_
private

Definition at line 55 of file L3MuonProducer.h.

◆ l2MuonTrajToken_

edm::EDGetTokenT<std::vector<Trajectory> > L3MuonProducer::l2MuonTrajToken_
private

Definition at line 56 of file L3MuonProducer.h.

◆ theL2CollectionLabel

edm::InputTag L3MuonProducer::theL2CollectionLabel
private

Seed STA Label.

Definition at line 50 of file L3MuonProducer.h.

◆ theL2SeededTkLabel

std::string L3MuonProducer::theL2SeededTkLabel
private

Label for L2SeededTracks.

Definition at line 53 of file L3MuonProducer.h.

◆ theService

std::unique_ptr<MuonServiceProxy> L3MuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 63 of file L3MuonProducer.h.

◆ theTrackFinder

std::unique_ptr<MuonTrackFinder> L3MuonProducer::theTrackFinder
private

Definition at line 60 of file L3MuonProducer.h.

◆ updatedL2AssoMapToken_

edm::EDGetTokenT<reco::TrackToTrackMap> L3MuonProducer::updatedL2AssoMapToken_
private

Definition at line 58 of file L3MuonProducer.h.