CMS 3D CMS Logo

MuonSeedGenerator.cc

Go to the documentation of this file.
00001 
00014 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedGenerator.h"
00015 
00016 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedFinder.h"
00017 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedFromRecHits.h"
00018 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedOrcaPatternRecognition.h"
00019 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedFinder.h"
00020 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedSimpleCleaner.h"
00021 
00022 
00023 // Data Formats 
00024 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00025 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00026 
00027 #include "DataFormats/Common/interface/Handle.h"
00028 
00029 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00030 #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h"
00031 
00032 // Geometry
00033 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00034 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00035 
00036 #include "RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h"
00037 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
00038 #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h"
00039 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00040 
00041 
00042 // Framework
00043 #include "FWCore/Framework/interface/EventSetup.h"
00044 #include "FWCore/Framework/interface/Event.h"
00045 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00046 #include "FWCore/Framework/interface/ESHandle.h"
00047 
00048 // C++
00049 #include <vector>
00050 
00051 using namespace std;
00052 
00053 typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer;
00054 typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer;
00055 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
00056 
00057 // Constructor
00058 MuonSeedGenerator::MuonSeedGenerator(const edm::ParameterSet& pset)
00059 : thePatternRecognition(new MuonSeedOrcaPatternRecognition(pset)),
00060   theSeedFinder(new MuonSeedFinder(pset)),
00061   theSeedCleaner(new MuonSeedSimpleCleaner())
00062 {
00063   produces<TrajectorySeedCollection>(); 
00064 }
00065 
00066 // Destructor
00067 MuonSeedGenerator::~MuonSeedGenerator(){
00068   delete thePatternRecognition;
00069   delete theSeedFinder;
00070   delete theSeedCleaner;
00071 }
00072 
00073 
00074 // reconstruct muon's seeds
00075 void MuonSeedGenerator::produce(edm::Event& event, const edm::EventSetup& eSetup)
00076 {
00077   // create the pointer to the Seed container
00078   auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
00079   
00080   edm::ESHandle<MagneticField> field;
00081   eSetup.get<IdealMagneticFieldRecord>().get(field);
00082   
00083   theSeedFinder->setBField(&*field);
00084 
00085   std::vector<MuonRecHitContainer> patterns;
00086   thePatternRecognition->produce(event, eSetup, patterns);
00087 
00088   for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
00089       seedSegments != patterns.end(); ++seedSegments)
00090   {
00091     theSeedFinder->seeds(*seedSegments, *output);
00092   }
00093 
00094   theSeedCleaner->clean(*output);
00095 
00096   event.put(output);
00097 }
00098 
00099   

Generated on Tue Jun 9 17:44:28 2009 for CMSSW by  doxygen 1.5.4