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 ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::ParameterSet theConfig
 
std::unique_ptr< PixelTrackFiltertheFilter
 
L1MuonPixelTrackFittertheFitter
 
OrderedHitsGeneratortheHitGenerator
 
L1MuonSeedsMergertheMerger
 
L1MuonRegionProducertheRegionProducer
 
edm::InputTag theSourceTag
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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 49 of file TSGFromL1Muon.cc.

References edm::EDConsumerBase::consumesCollector(), SurfaceDeformationFactory::create(), reco_skim_cfg_mod::filterName, reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theConfig, theFilter, and theSourceTag.

51 {
52  produces<L3MuonTrajectorySeedCollection>();
53  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
54 
56  edm::ParameterSet filterPSet = theConfig.getParameter<edm::ParameterSet>("FilterPSet");
57  std::string filterName = filterPSet.getParameter<std::string>("ComponentName");
58  theFilter.reset(PixelTrackFilterFactory::get()->create( filterName, filterPSet, iC));
59 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:31
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
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< PixelTrackFilter > theFilter
Definition: TSGFromL1Muon.h:38
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
TSGFromL1Muon::~TSGFromL1Muon ( )
virtual

Definition at line 61 of file TSGFromL1Muon.cc.

References theFitter, theHitGenerator, theMerger, and theRegionProducer.

62 {
63  delete theMerger;
64  delete theFitter;
65  delete theHitGenerator;
66  delete theRegionProducer;
67 }
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 69 of file TSGFromL1Muon.cc.

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

70 {
71  edm::ParameterSet regfactoryPSet = theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
72  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
74  TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector());
75  theRegionProducer = dynamic_cast<L1MuonRegionProducer* >(p);
76 
77  edm::ParameterSet hitsfactoryPSet =
78  theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
79  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
80  theHitGenerator = OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
81 
82  edm::ParameterSet fitterPSet = theConfig.getParameter<edm::ParameterSet>("FitterPSet");
83  std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
84  PixelFitter * f = PixelFitterFactory::get()->create( fitterName, fitterPSet);
85  theFitter = dynamic_cast<L1MuonPixelTrackFitter* >(f);
86 
87  edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
88  std::string cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
89 // theMerger = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);
90  theMerger = new L1MuonSeedsMerger(cleanerPSet);
91 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:31
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:35
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:36
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:37
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:39
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
double f[11][100]
T get(const Candidate &c)
Definition: component.h:55
void TSGFromL1Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 94 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().

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

std::unique_ptr<PixelTrackFilter> TSGFromL1Muon::theFilter
private

Definition at line 38 of file TSGFromL1Muon.h.

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