CMS 3D CMS Logo

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

#include <TSGFromL1Muon.h>

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

Public Member Functions

void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 TSGFromL1Muon (const edm::ParameterSet &cfg)
 
 ~TSGFromL1Muon () override
 
- 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
 

Private Attributes

edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheFieldToken
 
edm::EDGetTokenT< PixelTrackFiltertheFilterToken
 
std::unique_ptr< L1MuonPixelTrackFittertheFitter
 
std::unique_ptr< OrderedHitsGeneratortheHitGenerator
 
std::unique_ptr< L1MuonSeedsMergertheMerger
 
std::unique_ptr< L1MuonRegionProducertheRegionProducer
 
const SeedFromProtoTrack::Config theSFPTConfig
 
edm::InputTag theSourceTag
 
edm::EDGetTokenT< l1extra::L1MuonParticleCollectiontheSourceToken
 

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

Description: EDPRoducer to generate L3MuonTracjectorySeed from L1MuonParticles

Author
Marcin Konecki

Definition at line 28 of file TSGFromL1Muon.h.

Constructor & Destructor Documentation

◆ TSGFromL1Muon()

TSGFromL1Muon::TSGFromL1Muon ( const edm::ParameterSet cfg)

Definition at line 43 of file TSGFromL1Muon.cc.

References looper::cfg, get, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theFilterToken, theFitter, theHitGenerator, theMerger, theRegionProducer, theSourceTag, and theSourceToken.

44  : theFieldToken(esConsumes()), theSFPTConfig(consumesCollector()) {
45  produces<L3MuonTrajectorySeedCollection>();
46  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
47 
48  edm::ConsumesCollector iC = consumesCollector();
49  theFilterToken = consumes<PixelTrackFilter>(cfg.getParameter<edm::InputTag>("Filter"));
50 
51  edm::ParameterSet hitsfactoryPSet = cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
52  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
53  theHitGenerator = OrderedHitsGeneratorFactory::get()->create(hitsfactoryName, hitsfactoryPSet, iC);
54 
56 
58  std::make_unique<L1MuonRegionProducer>(cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet"), iC);
59  theFitter = std::make_unique<L1MuonPixelTrackFitter>(cfg.getParameter<edm::ParameterSet>("FitterPSet"));
60 
61  edm::ParameterSet cleanerPSet = cfg.getParameter<edm::ParameterSet>("CleanerPSet");
62  theMerger = std::make_unique<L1MuonSeedsMerger>(cleanerPSet);
63 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:44
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:42
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:38
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
Definition: TSGFromL1Muon.h:39
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:36
std::unique_ptr< OrderedHitsGenerator > theHitGenerator
Definition: TSGFromL1Muon.h:43
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:37
std::unique_ptr< L1MuonSeedsMerger > theMerger
Definition: TSGFromL1Muon.h:45
const SeedFromProtoTrack::Config theSFPTConfig
Definition: TSGFromL1Muon.h:40
#define get

◆ ~TSGFromL1Muon()

TSGFromL1Muon::~TSGFromL1Muon ( )
overridedefault

Member Function Documentation

◆ produce()

void TSGFromL1Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

Definition at line 67 of file TSGFromL1Muon.cc.

References HLT_2024v11_cff::candidates, makeMEIFBenchmarkPlots::ev, ALCARECOTkAlBeamHalo_cff::filter, edm::EventSetup::getData(), hfClusterShapes_cfi::hits, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogDebug, eostools::move(), nHits, nano_mu_digi_cff::region, SiPixelRawToDigiRegional_cfi::Regions, mps_fire::result, fileCollector::seed, theFieldToken, theFilterToken, theFitter, theHitGenerator, theMerger, theRegionProducer, theSFPTConfig, theSourceToken, HLT_2024v11_cff::track, and DiMuonV_cfg::tracks.

67  {
68  auto result = std::make_unique<L3MuonTrajectorySeedCollection>();
69 
71  ev.getByToken(theSourceToken, l1muon);
72 
74  ev.getByToken(theFilterToken, hfilter);
75  const PixelTrackFilter& filter = *hfilter;
76 
77  const auto& field = es.getData(theFieldToken);
78  LogDebug("TSGFromL1Muon") << l1muon->size() << " l1 muons to seed from.";
79 
80  L1MuonParticleCollection::const_iterator muItr = l1muon->begin();
81  L1MuonParticleCollection::const_iterator muEnd = l1muon->end();
82  for (size_t iL1 = 0; muItr < muEnd; ++muItr, ++iL1) {
83  if (muItr->gmtMuonCand().empty())
84  continue;
85 
86  const L1MuGMTCand& muon = muItr->gmtMuonCand();
87  l1extra::L1MuonParticleRef l1Ref(l1muon, iL1);
88 
89  theRegionProducer->setL1Constraint(muon);
90  theFitter->setL1Constraint(muon);
91 
92  typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
93  Regions regions = theRegionProducer->regions(es);
94  for (Regions::const_iterator ir = regions.begin(); ir != regions.end(); ++ir) {
96  const TrackingRegion& region = **ir;
98 
99  unsigned int nSets = candidates.size();
100  for (unsigned int ic = 0; ic < nSets; ic++) {
101  const SeedingHitSet& hits = candidates[ic];
102  std::vector<const TrackingRecHit*> trh;
103  for (unsigned int i = 0, nHits = hits.size(); i < nHits; ++i)
104  trh.push_back(hits[i]->hit());
105 
106  theFitter->setPxConstraint(hits);
107  reco::Track* track = theFitter->run(field, trh, region);
108  if (!track)
109  continue;
110 
111  if (!filter(track, trh)) {
112  delete track;
113  continue;
114  }
116  }
117 
118  if (theMerger)
119  theMerger->resolve(tracks);
120  for (L1MuonSeedsMerger::TracksAndHits::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
121  SeedFromProtoTrack seed(theSFPTConfig, *(it->first), it->second, es);
122  if (seed.isValid())
123  (*result).push_back(L3MuonTrajectorySeed(seed.trajectorySeed(), l1Ref));
124 
125  // GlobalError vtxerr( sqr(region->originRBound()), 0, sqr(region->originRBound()),
126  // 0, 0, sqr(region->originZBound()));
127  // SeedFromConsecutiveHits seed( candidates[ic],region->origin(), vtxerr, es);
128  // if (seed.isValid()) (*result).push_back( seed.TrajSeed() );
129  delete it->first;
130  }
131  }
132  }
133 
134  LogDebug("TSGFromL1Muon") << result->size() << " seeds to the event.";
135  ev.put(std::move(result));
136 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:44
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:42
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:38
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
Definition: TSGFromL1Muon.h:39
std::vector< TrackAndHits > TracksAndHits
std::unique_ptr< OrderedHitsGenerator > theHitGenerator
Definition: TSGFromL1Muon.h:43
std::pair< const reco::Track *, SeedingHitSet > TrackAndHits
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:37
std::unique_ptr< L1MuonSeedsMerger > theMerger
Definition: TSGFromL1Muon.h:45
const SeedFromProtoTrack::Config theSFPTConfig
Definition: TSGFromL1Muon.h:40
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ theFieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TSGFromL1Muon::theFieldToken
private

Definition at line 39 of file TSGFromL1Muon.h.

Referenced by produce().

◆ theFilterToken

edm::EDGetTokenT<PixelTrackFilter> TSGFromL1Muon::theFilterToken
private

Definition at line 38 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

◆ theFitter

std::unique_ptr<L1MuonPixelTrackFitter> TSGFromL1Muon::theFitter
private

Definition at line 44 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

◆ theHitGenerator

std::unique_ptr<OrderedHitsGenerator> TSGFromL1Muon::theHitGenerator
private

Definition at line 43 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

◆ theMerger

std::unique_ptr<L1MuonSeedsMerger> TSGFromL1Muon::theMerger
private

Definition at line 45 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

◆ theRegionProducer

std::unique_ptr<L1MuonRegionProducer> TSGFromL1Muon::theRegionProducer
private

Definition at line 42 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

◆ theSFPTConfig

const SeedFromProtoTrack::Config TSGFromL1Muon::theSFPTConfig
private

Definition at line 40 of file TSGFromL1Muon.h.

Referenced by produce().

◆ theSourceTag

edm::InputTag TSGFromL1Muon::theSourceTag
private

Definition at line 36 of file TSGFromL1Muon.h.

Referenced by TSGFromL1Muon().

◆ theSourceToken

edm::EDGetTokenT<l1extra::L1MuonParticleCollection> TSGFromL1Muon::theSourceToken
private

Definition at line 37 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().