CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::EDGetTokenT
< PixelTrackFilter
theFilterToken
 
std::unique_ptr
< L1MuonPixelTrackFitter
theFitter
 
std::unique_ptr
< OrderedHitsGenerator
theHitGenerator
 
std::unique_ptr
< L1MuonSeedsMerger
theMerger
 
std::unique_ptr
< L1MuonRegionProducer
theRegionProducer
 
const SeedFromProtoTrack::Config theSFPTConfig
 
edm::InputTag theSourceTag
 
edm::EDGetTokenT
< l1extra::L1MuonParticleCollection
theSourceToken
 

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 26 of file TSGFromL1Muon.h.

Constructor & Destructor Documentation

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

Definition at line 41 of file TSGFromL1Muon.cc.

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

41  : theSFPTConfig(consumesCollector()) {
42  produces<L3MuonTrajectorySeedCollection>();
43  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
44 
45  edm::ConsumesCollector iC = consumesCollector();
46  theFilterToken = consumes<PixelTrackFilter>(cfg.getParameter<edm::InputTag>("Filter"));
47 
48  edm::ParameterSet hitsfactoryPSet = cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
49  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
50  theHitGenerator = OrderedHitsGeneratorFactory::get()->create(hitsfactoryName, hitsfactoryPSet, iC);
51 
53 
55  std::make_unique<L1MuonRegionProducer>(cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet"), iC);
56  theFitter = std::make_unique<L1MuonPixelTrackFitter>(cfg.getParameter<edm::ParameterSet>("FitterPSet"));
57 
58  edm::ParameterSet cleanerPSet = cfg.getParameter<edm::ParameterSet>("CleanerPSet");
59  theMerger = std::make_unique<L1MuonSeedsMerger>(cleanerPSet);
60 }
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:41
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:39
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:36
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:34
std::unique_ptr< OrderedHitsGenerator > theHitGenerator
Definition: TSGFromL1Muon.h:40
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:35
std::unique_ptr< L1MuonSeedsMerger > theMerger
Definition: TSGFromL1Muon.h:42
const SeedFromProtoTrack::Config theSFPTConfig
Definition: TSGFromL1Muon.h:37
#define get
TSGFromL1Muon::~TSGFromL1Muon ( )
overridedefault

Member Function Documentation

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

Definition at line 64 of file TSGFromL1Muon.cc.

References HLT_FULL_cff::candidates, alcazmumu_cfi::filter, edm::Event::getByToken(), mps_fire::i, SeedFromProtoTrack::isValid(), LogDebug, eostools::move(), HLT_FULL_cff::muon, nHits, edm::Event::put(), HLT_FULL_cff::region, HLT_FULL_cff::Regions, mps_fire::result, fileCollector::seed, OrderedSeedingHits::size(), SeedingHitSet::size(), theFilterToken, theFitter, theHitGenerator, theMerger, theRegionProducer, theSFPTConfig, theSourceToken, HLT_FULL_cff::track, tracks, and SeedFromProtoTrack::trajectorySeed().

64  {
65  auto result = std::make_unique<L3MuonTrajectorySeedCollection>();
66 
68  ev.getByToken(theSourceToken, l1muon);
69 
71  ev.getByToken(theFilterToken, hfilter);
72  const PixelTrackFilter& filter = *hfilter;
73 
74  LogDebug("TSGFromL1Muon") << l1muon->size() << " l1 muons to seed from.";
75 
76  L1MuonParticleCollection::const_iterator muItr = l1muon->begin();
77  L1MuonParticleCollection::const_iterator muEnd = l1muon->end();
78  for (size_t iL1 = 0; muItr < muEnd; ++muItr, ++iL1) {
79  if (muItr->gmtMuonCand().empty())
80  continue;
81 
82  const L1MuGMTCand& muon = muItr->gmtMuonCand();
83  l1extra::L1MuonParticleRef l1Ref(l1muon, iL1);
84 
85  theRegionProducer->setL1Constraint(muon);
86  theFitter->setL1Constraint(muon);
87 
88  typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
89  Regions regions = theRegionProducer->regions(es);
90  for (Regions::const_iterator ir = regions.begin(); ir != regions.end(); ++ir) {
92  const TrackingRegion& region = **ir;
93  const OrderedSeedingHits& candidates = theHitGenerator->run(region, ev, es);
94 
95  unsigned int nSets = candidates.size();
96  for (unsigned int ic = 0; ic < nSets; ic++) {
97  const SeedingHitSet& hits = candidates[ic];
98  std::vector<const TrackingRecHit*> trh;
99  for (unsigned int i = 0, nHits = hits.size(); i < nHits; ++i)
100  trh.push_back(hits[i]->hit());
101 
102  theFitter->setPxConstraint(hits);
103  reco::Track* track = theFitter->run(es, trh, region);
104  if (!track)
105  continue;
106 
107  if (!filter(track, trh)) {
108  delete track;
109  continue;
110  }
111  tracks.push_back(L1MuonSeedsMerger::TrackAndHits(track, hits));
112  }
113 
114  if (theMerger)
115  theMerger->resolve(tracks);
116  for (L1MuonSeedsMerger::TracksAndHits::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
117  SeedFromProtoTrack seed(theSFPTConfig, *(it->first), it->second, es);
118  if (seed.isValid())
119  (*result).push_back(L3MuonTrajectorySeed(seed.trajectorySeed(), l1Ref));
120 
121  // GlobalError vtxerr( sqr(region->originRBound()), 0, sqr(region->originRBound()),
122  // 0, 0, sqr(region->originZBound()));
123  // SeedFromConsecutiveHits seed( candidates[ic],region->origin(), vtxerr, es);
124  // if (seed.isValid()) (*result).push_back( seed.TrajSeed() );
125  delete it->first;
126  }
127  }
128  }
129 
130  LogDebug("TSGFromL1Muon") << result->size() << " seeds to the event.";
131  ev.put(std::move(result));
132 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
auto const & tracks
cannot be loose
virtual unsigned int size() const =0
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:41
tuple result
Definition: mps_fire.py:311
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:39
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:36
std::vector< TrackAndHits > TracksAndHits
def move
Definition: eostools.py:511
std::unique_ptr< OrderedHitsGenerator > theHitGenerator
Definition: TSGFromL1Muon.h:40
std::pair< const reco::Track *, SeedingHitSet > TrackAndHits
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:35
std::unique_ptr< L1MuonSeedsMerger > theMerger
Definition: TSGFromL1Muon.h:42
unsigned int size() const
Definition: SeedingHitSet.h:41
const SeedFromProtoTrack::Config theSFPTConfig
Definition: TSGFromL1Muon.h:37
#define LogDebug(id)

Member Data Documentation

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

Definition at line 36 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

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

Definition at line 41 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

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

Definition at line 40 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

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

Definition at line 42 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

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

Definition at line 39 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

const SeedFromProtoTrack::Config TSGFromL1Muon::theSFPTConfig
private

Definition at line 37 of file TSGFromL1Muon.h.

Referenced by produce().

edm::InputTag TSGFromL1Muon::theSourceTag
private

Definition at line 34 of file TSGFromL1Muon.h.

Referenced by TSGFromL1Muon().

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

Definition at line 35 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().