CMS 3D CMS Logo

TSGFromL1Muon Class Reference

Description: EDPRoducer to generate L3MuonTracjectorySeed from L1MuonParticles. More...

#include <RecoMuon/TrackerSeedGenerator/plugins/TSGFromL1Muon.h>

Inheritance diagram for TSGFromL1Muon:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob (const edm::EventSetup &es)
virtual void produce (edm::Event &ev, const edm::EventSetup &es)
 TSGFromL1Muon (const edm::ParameterSet &cfg)
virtual ~TSGFromL1Muon ()

Private Attributes

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


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::ParameterSet::getParameter(), and theSourceTag.

00050   : theConfig(cfg),theRegionProducer(0),theHitGenerator(0),theFitter(0),theFilter(0),theMerger(0)
00051 {
00052   produces<L3MuonTrajectorySeedCollection>();
00053   theSourceTag = cfg.getParameter<edm::InputTag>("L1MuonLabel");
00054 }

TSGFromL1Muon::~TSGFromL1Muon (  )  [virtual]

Definition at line 56 of file TSGFromL1Muon.cc.

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

00057 {
00058   delete theMerger;
00059   delete theFilter;
00060   delete theFitter;
00061   delete theHitGenerator;
00062   delete theRegionProducer;
00063 }


Member Function Documentation

void TSGFromL1Muon::beginJob ( const edm::EventSetup es  )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 65 of file TSGFromL1Muon.cc.

References f, DBSPlugin::get(), edm::ParameterSet::getParameter(), p, theConfig, theFilter, theFitter, theHitGenerator, theMerger, and theRegionProducer.

00066 {
00067   edm::ParameterSet regfactoryPSet = theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
00068   std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
00069   TrackingRegionProducer * p =
00070     TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet);
00071   theRegionProducer = dynamic_cast<L1MuonRegionProducer* >(p);
00072 
00073   edm::ParameterSet hitsfactoryPSet =
00074       theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
00075   std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
00076   theHitGenerator = OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
00077 
00078   edm::ParameterSet fitterPSet = theConfig.getParameter<edm::ParameterSet>("FitterPSet");
00079   std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
00080   PixelFitter * f = PixelFitterFactory::get()->create( fitterName, fitterPSet);
00081   theFitter = dynamic_cast<L1MuonPixelTrackFitter* >(f);
00082 
00083   edm::ParameterSet filterPSet = theConfig.getParameter<edm::ParameterSet>("FilterPSet");
00084   std::string  filterName = filterPSet.getParameter<std::string>("ComponentName");
00085   theFilter = PixelTrackFilterFactory::get()->create( filterName, filterPSet);
00086 
00087   edm::ParameterSet cleanerPSet = theConfig.getParameter<edm::ParameterSet>("CleanerPSet");
00088   std::string  cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
00089 //  theMerger = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);
00090   theMerger = new L1MuonSeedsMerger(cleanerPSet);
00091 }

void TSGFromL1Muon::produce ( edm::Event ev,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 94 of file TSGFromL1Muon.cc.

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

00095 {
00096   std::auto_ptr<L3MuonTrajectorySeedCollection> result(new L3MuonTrajectorySeedCollection());
00097 
00098   edm::Handle<L1MuonParticleCollection> l1muon;
00099   ev.getByLabel(theSourceTag, l1muon);
00100 
00101   LogDebug("TSGFromL1Muon")<<l1muon->size()<<" l1 muons to seed from.";
00102 
00103   L1MuonParticleCollection::const_iterator muItr = l1muon->begin(); 
00104   L1MuonParticleCollection::const_iterator muEnd = l1muon->end(); 
00105   for  ( size_t iL1 = 0;  muItr < muEnd; ++muItr, ++iL1) {
00106        
00107     if (muItr->gmtMuonCand().empty()) continue;
00108 
00109     const L1MuGMTCand & muon = muItr->gmtMuonCand();
00110     l1extra::L1MuonParticleRef l1Ref(l1muon, iL1);
00111 
00112     theRegionProducer->setL1Constraint(muon);
00113     theFitter->setL1Constraint(muon);
00114 
00115     typedef std::vector<TrackingRegion * > Regions;
00116     Regions regions = theRegionProducer->regions(ev,es);
00117     for (Regions::const_iterator ir=regions.begin(); ir != regions.end(); ++ir) {
00118 
00119       L1MuonSeedsMerger::TracksAndHits tracks;
00120       const TrackingRegion & region = **ir;
00121       const OrderedSeedingHits & candidates = theHitGenerator->run(region,ev,es);
00122 
00123       unsigned int nSets = candidates.size();
00124       for (unsigned int ic= 0; ic <nSets; ic++) {
00125 
00126         const std::vector<ctfseeding::SeedingHit>& hits = candidates[ic].hits();
00127         std::vector<const TrackingRecHit *> trh;
00128         for (unsigned int i= 0, nHits = hits.size(); i< nHits; ++i) trh.push_back( hits[i] );
00129 
00130         theFitter->setPxConstraint(hits);
00131         reco::Track* track = theFitter->run(es, trh, region);
00132         if (!track) continue;
00133 
00134         if (!(*theFilter)(track) ) { delete track; continue; }
00135         tracks.push_back(L1MuonSeedsMerger::TrackAndHits(track, hits));
00136       }
00137   
00138       if(theMerger) theMerger->resolve(tracks);
00139       for (L1MuonSeedsMerger::TracksAndHits::const_iterator it = tracks.begin();
00140         it != tracks.end(); ++it) {
00141 
00142         SeedFromProtoTrack seed( *(it->first), it->second, es);
00143         if (seed.isValid()) (*result).push_back(L3MuonTrajectorySeed(seed.trajectorySeed(),l1Ref));
00144 
00145 //      GlobalError vtxerr( sqr(region->originRBound()), 0, sqr(region->originRBound()),
00146 //                                               0, 0, sqr(region->originZBound()));
00147 //      SeedFromConsecutiveHits seed( candidates[ic],region->origin(), vtxerr, es);
00148 //      if (seed.isValid()) (*result).push_back( seed.TrajSeed() );
00149         delete it->first;
00150       }
00151     }
00152     for (Regions::const_iterator it=regions.begin(); it != regions.end(); ++it) delete (*it);
00153   }
00154 
00155   LogDebug("TSGFromL1Muon")<<result->size()<<" seeds to the event.";
00156   ev.put(result);
00157 }


Member Data Documentation

edm::ParameterSet TSGFromL1Muon::theConfig [private]

Definition at line 31 of file TSGFromL1Muon.h.

Referenced by beginJob().

PixelTrackFilter* TSGFromL1Muon::theFilter [private]

Definition at line 38 of file TSGFromL1Muon.h.

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

L1MuonPixelTrackFitter* TSGFromL1Muon::theFitter [private]

Definition at line 37 of file TSGFromL1Muon.h.

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

OrderedHitsGenerator* TSGFromL1Muon::theHitGenerator [private]

Definition at line 36 of file TSGFromL1Muon.h.

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

L1MuonSeedsMerger* TSGFromL1Muon::theMerger [private]

Definition at line 39 of file TSGFromL1Muon.h.

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

L1MuonRegionProducer* TSGFromL1Muon::theRegionProducer [private]

Definition at line 35 of file TSGFromL1Muon.h.

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

edm::InputTag TSGFromL1Muon::theSourceTag [private]

Definition at line 32 of file TSGFromL1Muon.h.

Referenced by produce(), and TSGFromL1Muon().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:34:38 2009 for CMSSW by  doxygen 1.5.4