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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
virtual void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 TSGFromL1Muon (const edm::ParameterSet &cfg)
 
virtual ~TSGFromL1Muon ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ParameterSet theConfig
 
edm::EDGetTokenT< PixelTrackFiltertheFilterToken
 
std::unique_ptr< L1MuonPixelTrackFittertheFitter
 
OrderedHitsGeneratortheHitGenerator
 
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: EDPRoducer to generate L3MuonTracjectorySeed from L1MuonParticles

Author
Marcin Konecki

Definition at line 24 of file TSGFromL1Muon.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file TSGFromL1Muon.cc.

References edm::EDConsumerBase::consumesCollector(), reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theConfig, theFilterToken, theFitter, theHitGenerator, theRegionProducer, theSourceTag, and theSourceToken.

41 {
42  produces<L3MuonTrajectorySeedCollection>();
43  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
44 
46  theFilterToken = consumes<PixelTrackFilter>(cfg.getParameter<edm::InputTag>("Filter"));
47 
48  edm::ParameterSet hitsfactoryPSet =
49  theConfig.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>(theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet"));
56  theFitter = std::make_unique<L1MuonPixelTrackFitter>(cfg.getParameter<edm::ParameterSet>("FitterPSet"));
57 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:33
std::unique_ptr< L1MuonPixelTrackFitter > theFitter
Definition: TSGFromL1Muon.h:40
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:39
std::unique_ptr< L1MuonRegionProducer > theRegionProducer
Definition: TSGFromL1Muon.h:38
edm::EDGetTokenT< PixelTrackFilter > theFilterToken
Definition: TSGFromL1Muon.h:36
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:41
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:34
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:35
T get(const Candidate &c)
Definition: component.h:55
TSGFromL1Muon::~TSGFromL1Muon ( )
virtual

Definition at line 59 of file TSGFromL1Muon.cc.

References theHitGenerator, and theMerger.

60 {
61  delete theMerger;
62  delete theHitGenerator;
63 }
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:39
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:41

Member Function Documentation

void TSGFromL1Muon::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Definition at line 65 of file TSGFromL1Muon.cc.

References edm::ParameterSet::getParameter(), theConfig, and theMerger.

66 {
67  edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
68  theMerger = new L1MuonSeedsMerger(cleanerPSet);
69 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:33
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:41
void TSGFromL1Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Definition at line 72 of file TSGFromL1Muon.cc.

References objects.IsoTrackAnalyzer::candidates, ALCARECOTkAlBeamHalo_cff::filter, edm::Event::getByToken(), hfClusterShapes_cfi::hits, mps_fire::i, SeedFromProtoTrack::isValid(), LogDebug, eostools::move(), edm::Event::put(), L1MuonSeedsMerger::resolve(), mps_fire::result, OrderedHitsGenerator::run(), SurveyInfoScenario_cff::seed, OrderedSeedingHits::size(), SeedingHitSet::size(), theFilterToken, theFitter, theHitGenerator, theMerger, theRegionProducer, theSourceToken, HiIsolationCommonParameters_cff::track, l1t::tracks, and SeedFromProtoTrack::trajectorySeed().

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

Member Data Documentation

edm::ParameterSet TSGFromL1Muon::theConfig
private

Definition at line 33 of file TSGFromL1Muon.h.

Referenced by beginRun(), and TSGFromL1Muon().

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

Referenced by produce(), and TSGFromL1Muon().

OrderedHitsGenerator* TSGFromL1Muon::theHitGenerator
private

Definition at line 39 of file TSGFromL1Muon.h.

Referenced by produce(), TSGFromL1Muon(), and ~TSGFromL1Muon().

L1MuonSeedsMerger* TSGFromL1Muon::theMerger
private

Definition at line 41 of file TSGFromL1Muon.h.

Referenced by beginRun(), produce(), and ~TSGFromL1Muon().

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

Definition at line 38 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

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().