test
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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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
 
edm::EDGetTokenT
< l1extra::L1MuonParticleCollection
theSourceToken
 

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

Constructor & Destructor Documentation

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

Definition at line 48 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, theHitGenerator, theSourceTag, and theSourceToken.

50 {
51  produces<L3MuonTrajectorySeedCollection>();
52  theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
53 
55  edm::ParameterSet filterPSet = theConfig.getParameter<edm::ParameterSet>("FilterPSet");
56  std::string filterName = filterPSet.getParameter<std::string>("ComponentName");
57  theFilter.reset(PixelTrackFilterFactory::get()->create( filterName, filterPSet, iC));
58 
59  edm::ParameterSet hitsfactoryPSet =
60  theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
61  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
62  theHitGenerator = OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet, iC);
63 
65 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:33
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:37
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:38
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:39
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.
std::unique_ptr< PixelTrackFilter > theFilter
Definition: TSGFromL1Muon.h:40
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > theSourceToken
Definition: TSGFromL1Muon.h:35
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
TSGFromL1Muon::~TSGFromL1Muon ( )
virtual

Definition at line 67 of file TSGFromL1Muon.cc.

References theFitter, theHitGenerator, theMerger, and theRegionProducer.

68 {
69  delete theMerger;
70  delete theFitter;
71  delete theHitGenerator;
72  delete theRegionProducer;
73 }
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:37
OrderedHitsGenerator * theHitGenerator
Definition: TSGFromL1Muon.h:38
L1MuonPixelTrackFitter * theFitter
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

Reimplemented from edm::EDProducer.

Definition at line 75 of file TSGFromL1Muon.cc.

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

76 {
77  edm::ParameterSet regfactoryPSet = theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
78  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
80  TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector());
81  theRegionProducer = dynamic_cast<L1MuonRegionProducer* >(p);
82 
83  edm::ParameterSet fitterPSet = theConfig.getParameter<edm::ParameterSet>("FitterPSet");
84  std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
85  PixelFitter * f = PixelFitterFactory::get()->create( fitterName, fitterPSet);
86  theFitter = dynamic_cast<L1MuonPixelTrackFitter* >(f);
87 
88  edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
89  std::string cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
90 // theMerger = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);
91  theMerger = new L1MuonSeedsMerger(cleanerPSet);
92 }
T getParameter(std::string const &) const
edm::ParameterSet theConfig
Definition: TSGFromL1Muon.h:33
L1MuonRegionProducer * theRegionProducer
Definition: TSGFromL1Muon.h:37
L1MuonPixelTrackFitter * theFitter
Definition: TSGFromL1Muon.h:39
L1MuonSeedsMerger * theMerger
Definition: TSGFromL1Muon.h:41
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 95 of file TSGFromL1Muon.cc.

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

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

Member Data Documentation

edm::ParameterSet TSGFromL1Muon::theConfig
private

Definition at line 33 of file TSGFromL1Muon.h.

Referenced by beginRun(), and TSGFromL1Muon().

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

Definition at line 40 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().

L1MuonPixelTrackFitter* TSGFromL1Muon::theFitter
private

Definition at line 39 of file TSGFromL1Muon.h.

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

OrderedHitsGenerator* TSGFromL1Muon::theHitGenerator
private

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

L1MuonRegionProducer* TSGFromL1Muon::theRegionProducer
private

Definition at line 37 of file TSGFromL1Muon.h.

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