CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TSGFromL1Muon Class Reference

#include <TSGFromL1Muon.h>

Inheritance diagram for TSGFromL1Muon:
edm::EDProducer 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::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::ParameterSet theConfig
 
PixelTrackFiltertheFilter
 
L1MuonPixelTrackFittertheFitter
 
OrderedHitsGeneratortheHitGenerator
 
L1MuonSeedsMergertheMerger
 
L1MuonRegionProducertheRegionProducer
 
edm::InputTag theSourceTag
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 22 of file TSGFromL1Muon.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file TSGFromL1Muon.cc.

References edm::ParameterSet::getParameter(), and theSourceTag.

50 {
51  produces<L3MuonTrajectorySeedCollection>();
52  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
53 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:31
PixelTrackFilter * theFilter
Definition: TSGFromL1Muon.h:38
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:35
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:36
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:37
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:39
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:32
TSGFromL1Muon::~TSGFromL1Muon ( )
virtual

Definition at line 55 of file TSGFromL1Muon.cc.

References theFilter, theFitter, theHitGenerator, theMerger, and theRegionProducer.

56 {
57  delete theMerger;
58  delete theFilter;
59  delete theFitter;
60  delete theHitGenerator;
61  delete theRegionProducer;
62 }
PixelTrackFilter * theFilter
Definition: TSGFromL1Muon.h:38
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:35
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:36
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:37
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:39

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 64 of file TSGFromL1Muon.cc.

References f, reco_skim_cfg_mod::filterName, reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, AlCaHLTBitMon_QueryRunRegistry::string, theConfig, theFilter, theFitter, theHitGenerator, theMerger, and theRegionProducer.

65 {
66  edm::ParameterSet regfactoryPSet = theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
67  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
69  TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet);
70  theRegionProducer = dynamic_cast<L1MuonRegionProducer* >(p);
71 
72  edm::ParameterSet hitsfactoryPSet =
73  theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
74  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
75  theHitGenerator = OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
76 
77  edm::ParameterSet fitterPSet = theConfig.getParameter<edm::ParameterSet>("FitterPSet");
78  std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
79  PixelFitter * f = PixelFitterFactory::get()->create( fitterName, fitterPSet);
80  theFitter = dynamic_cast<L1MuonPixelTrackFitter* >(f);
81 
82  edm::ParameterSet filterPSet = theConfig.getParameter<edm::ParameterSet>("FilterPSet");
83  std::string filterName = filterPSet.getParameter<std::string>("ComponentName");
84  theFilter = PixelTrackFilterFactory::get()->create( filterName, filterPSet);
85 
86  edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
87  std::string cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
88 // theMerger = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);
89  theMerger = new L1MuonSeedsMerger(cleanerPSet);
90 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:31
PixelTrackFilter * theFilter
Definition: TSGFromL1Muon.h:38
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:35
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:36
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:37
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:39
double f[11][100]
T get(const Candidate &c)
Definition: component.h:56
void TSGFromL1Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 93 of file TSGFromL1Muon.cc.

References edm::Event::getByLabel(), i, SeedFromProtoTrack::isValid(), LogDebug, metsig::muon, edm::Event::put(), L1MuonRegionProducer::regions(), L1MuonSeedsMerger::resolve(), query::result, OrderedHitsGenerator::run(), L1MuonPixelTrackFitter::run(), L1MuonRegionProducer::setL1Constraint(), L1MuonPixelTrackFitter::setL1Constraint(), L1MuonPixelTrackFitter::setPxConstraint(), OrderedSeedingHits::size(), SeedingHitSet::size(), theFilter, theFitter, theHitGenerator, theMerger, theRegionProducer, theSourceTag, testEve_cfg::tracks, and SeedFromProtoTrack::trajectorySeed().

94 {
95  std::auto_ptr<L3MuonTrajectorySeedCollection> result(new L3MuonTrajectorySeedCollection());
96 
98  ev.getByLabel(theSourceTag, l1muon);
99 
100  LogDebug("TSGFromL1Muon")<<l1muon->size()<<" l1 muons to seed from.";
101 
102  L1MuonParticleCollection::const_iterator muItr = l1muon->begin();
103  L1MuonParticleCollection::const_iterator muEnd = l1muon->end();
104  for ( size_t iL1 = 0; muItr < muEnd; ++muItr, ++iL1) {
105 
106  if (muItr->gmtMuonCand().empty()) continue;
107 
108  const L1MuGMTCand & muon = muItr->gmtMuonCand();
109  l1extra::L1MuonParticleRef l1Ref(l1muon, iL1);
110 
112  theFitter->setL1Constraint(muon);
113 
114  typedef std::vector<TrackingRegion * > Regions;
115  Regions regions = theRegionProducer->regions(ev,es);
116  for (Regions::const_iterator ir=regions.begin(); ir != regions.end(); ++ir) {
117 
119  const TrackingRegion & region = **ir;
120  const OrderedSeedingHits & candidates = theHitGenerator->run(region,ev,es);
121 
122  unsigned int nSets = candidates.size();
123  for (unsigned int ic= 0; ic <nSets; ic++) {
124 
125  const SeedingHitSet & hits = candidates[ic];
126  std::vector<const TrackingRecHit *> trh;
127  for (unsigned int i= 0, nHits = hits.size(); i< nHits; ++i) trh.push_back( hits[i]->hit() );
128 
129  theFitter->setPxConstraint(hits);
130  reco::Track* track = theFitter->run(es, trh, region);
131  if (!track) continue;
132 
133  if (!(*theFilter)(track) ) { delete track; continue; }
134  tracks.push_back(L1MuonSeedsMerger::TrackAndHits(track, hits));
135  }
136 
137  if(theMerger) theMerger->resolve(tracks);
138  for (L1MuonSeedsMerger::TracksAndHits::const_iterator it = tracks.begin();
139  it != tracks.end(); ++it) {
140 
141  SeedFromProtoTrack seed( *(it->first), it->second, es);
142  if (seed.isValid()) (*result).push_back(L3MuonTrajectorySeed(seed.trajectorySeed(),l1Ref));
143 
144 // GlobalError vtxerr( sqr(region->originRBound()), 0, sqr(region->originRBound()),
145 // 0, 0, sqr(region->originZBound()));
146 // SeedFromConsecutiveHits seed( candidates[ic],region->origin(), vtxerr, es);
147 // if (seed.isValid()) (*result).push_back( seed.TrajSeed() );
148  delete it->first;
149  }
150  }
151  for (Regions::const_iterator it=regions.begin(); it != regions.end(); ++it) delete (*it);
152  }
153 
154  LogDebug("TSGFromL1Muon")<<result->size()<<" seeds to the event.";
155  ev.put(result);
156 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void setPxConstraint(const SeedingHitSet &hits)
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
PixelTrackFilter * theFilter
Definition: TSGFromL1Muon.h:38
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:35
std::vector< L3MuonTrajectorySeed > L3MuonTrajectorySeedCollection
std::pair< const reco::Track *, SeedingHitSet > TrackAndHits
virtual unsigned int size() const =0
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:36
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:37
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:39
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::InputTag theSourceTag
Definition: TSGFromL1Muon.h:32
virtual reco::Track * run(const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
tuple result
Definition: query.py:137
virtual void resolve(TracksAndHits &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple tracks
Definition: testEve_cfg.py:39
unsigned int size() const
Definition: SeedingHitSet.h:40
void setL1Constraint(const L1MuGMTCand &muon)
void setL1Constraint(const L1MuGMTCand &muon)

Member Data Documentation

edm::ParameterSet TSGFromL1Muon::theConfig
private

Definition at line 31 of file TSGFromL1Muon.h.

Referenced by beginRun().

PixelTrackFilter* TSGFromL1Muon::theFilter
private

Definition at line 38 of file TSGFromL1Muon.h.

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

L1MuonPixelTrackFitter* TSGFromL1Muon::theFitter
private

Definition at line 37 of file TSGFromL1Muon.h.

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

OrderedHitsGenerator* TSGFromL1Muon::theHitGenerator
private

Definition at line 36 of file TSGFromL1Muon.h.

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

L1MuonSeedsMerger* TSGFromL1Muon::theMerger
private

Definition at line 39 of file TSGFromL1Muon.h.

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

L1MuonRegionProducer* TSGFromL1Muon::theRegionProducer
private

Definition at line 35 of file TSGFromL1Muon.h.

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

edm::InputTag TSGFromL1Muon::theSourceTag
private

Definition at line 32 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().