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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::ParameterSet theConfig
 
edm::EDGetTokenT< PixelTrackFiltertheFilterToken
 
std::unique_ptr< L1MuonPixelTrackFittertheFitter
 
std::unique_ptr< OrderedHitsGeneratortheHitGenerator
 
std::unique_ptr< L1MuonSeedsMergertheMerger
 
std::unique_ptr< L1MuonRegionProducertheRegionProducer
 
edm::InputTag theSourceTag
 
edm::EDGetTokenT< l1extra::L1MuonParticleCollectiontheSourceToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Description: EDPRoducer to generate L3MuonTracjectorySeed from L1MuonParticles

Author
Marcin Konecki

Definition at line 25 of file TSGFromL1Muon.h.

Constructor & Destructor Documentation

◆ TSGFromL1Muon()

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

Definition at line 42 of file TSGFromL1Muon.cc.

42  {
43  produces<L3MuonTrajectorySeedCollection>();
44  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
45 
46  edm::ConsumesCollector iC = consumesCollector();
47  theFilterToken = consumes<PixelTrackFilter>(cfg.getParameter<edm::InputTag>("Filter"));
48 
49  edm::ParameterSet hitsfactoryPSet = cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
50  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
51  theHitGenerator = OrderedHitsGeneratorFactory::get()->create(hitsfactoryName, hitsfactoryPSet, iC);
52 
54 
55  theRegionProducer = std::make_unique<L1MuonRegionProducer>(cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet"));
56  theFitter = std::make_unique<L1MuonPixelTrackFitter>(cfg.getParameter<edm::ParameterSet>("FitterPSet"));
57 
58  edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
59  theMerger = std::make_unique<L1MuonSeedsMerger>(cleanerPSet);
60 }

References looper::cfg, get, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~TSGFromL1Muon()

TSGFromL1Muon::~TSGFromL1Muon ( )
overridedefault

Member Function Documentation

◆ produce()

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

Definition at line 64 of file TSGFromL1Muon.cc.

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();
90  for (Regions::const_iterator ir = regions.begin(); ir != regions.end(); ++ir) {
92  const TrackingRegion& region = **ir;
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  }
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(*(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 }

References HLT_FULL_cff::candidates, ev, ALCARECOTkAlBeamHalo_cff::filter, hfClusterShapes_cfi::hits, mps_fire::i, LogDebug, eostools::move(), HLT_FULL_cff::region, SiPixelRawToDigiRegional_cfi::Regions, mps_fire::result, fileCollector::seed, HLT_FULL_cff::track, and PDWG_EXOHSCP_cff::tracks.

Member Data Documentation

◆ theConfig

edm::ParameterSet TSGFromL1Muon::theConfig
private

Definition at line 33 of file TSGFromL1Muon.h.

◆ theFilterToken

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

Definition at line 36 of file TSGFromL1Muon.h.

◆ theFitter

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

Definition at line 40 of file TSGFromL1Muon.h.

◆ theHitGenerator

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

Definition at line 39 of file TSGFromL1Muon.h.

◆ theMerger

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

Definition at line 41 of file TSGFromL1Muon.h.

◆ theRegionProducer

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

Definition at line 38 of file TSGFromL1Muon.h.

◆ theSourceTag

edm::InputTag TSGFromL1Muon::theSourceTag
private

Definition at line 34 of file TSGFromL1Muon.h.

◆ theSourceToken

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

Definition at line 35 of file TSGFromL1Muon.h.

TSGFromL1Muon::theRegionProducer
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:38
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:428
SeedFromProtoTrack
Definition: SeedFromProtoTrack.h:16
L1MuonParticleCollection
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
muon
Definition: MuonCocktails.h:17
SeedingHitSet
Definition: SeedingHitSet.h:6
TSGFromL1Muon::theSourceTag
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:34
edm::Handle
Definition: AssociativeIterator.h:50
L1MuGMTCand
Definition: L1MuGMTCand.h:39
edm::Ref< L1MuonParticleCollection >
fileCollector.seed
seed
Definition: fileCollector.py:127
L1MuonSeedsMerger::TracksAndHits
std::vector< TrackAndHits > TracksAndHits
Definition: L1MuonSeedsMerger.h:15
OrderedSeedingHits
Definition: OrderedSeedingHits.h:7
reco::Track
Definition: Track.h:27
TSGFromL1Muon::theSourceToken
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:35
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
TSGFromL1Muon::theMerger
std::unique_ptr< L1MuonSeedsMerger > theMerger
Definition: TSGFromL1Muon.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TSGFromL1Muon::theHitGenerator
std::unique_ptr< OrderedHitsGenerator > theHitGenerator
Definition: TSGFromL1Muon.h:39
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
L1MuonSeedsMerger::TrackAndHits
std::pair< const reco::Track *, SeedingHitSet > TrackAndHits
Definition: L1MuonSeedsMerger.h:14
TSGFromL1Muon::theFitter
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:40
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88338
TSGFromL1Muon::theFilterToken
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:36
get
#define get
looper.cfg
cfg
Definition: looper.py:297
eostools.move
def move(src, dest)
Definition: eostools.py:511
TSGFromL1Muon::theConfig
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:33
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:55051
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackingRegion
Definition: TrackingRegion.h:41
mps_fire.result
result
Definition: mps_fire.py:311
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
L3MuonTrajectorySeed
Definition: L3MuonTrajectorySeed.h:16
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
PixelTrackFilter
Definition: PixelTrackFilter.h:8
SiPixelRawToDigiRegional_cfi.Regions
Regions
Definition: SiPixelRawToDigiRegional_cfi.py:7