CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoMuon/MuonSeedGenerator/plugins/CosmicMuonSeedGenerator.h

Go to the documentation of this file.
00001 #ifndef MuonSeedGenerator_CosmicMuonSeedGenerator_H
00002 #define MuonSeedGenerator_CosmicMuonSeedGenerator_H
00003 
00012 #include "FWCore/Framework/interface/EDProducer.h"
00013 #include "FWCore/Framework/interface/ESHandle.h"
00014 #include "FWCore/Utilities/interface/InputTag.h"
00015 
00016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00017 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00018 
00019 #include <vector>
00020 
00021 class MuonDetLayerGeometry;
00022 
00023 class TrajectoryStateTransform;
00024 
00025 namespace edm {class ParameterSet; class Event; class EventSetup;}
00026 
00027 class CosmicMuonSeedGenerator: public edm::EDProducer {
00028  public:
00029 
00031   CosmicMuonSeedGenerator(const edm::ParameterSet&);
00032   
00034   virtual ~CosmicMuonSeedGenerator();
00035   
00036   // Operations
00037 
00039   virtual void produce(edm::Event&, const edm::EventSetup&);
00040 
00041  private:
00042 
00043   struct MuonRecHitPair {
00044      MuonRecHitPair(const MuonTransientTrackingRecHit::MuonRecHitPointer& a, const MuonTransientTrackingRecHit::MuonRecHitPointer& b, std::string c = "") :  first(a), second (b), type(c) {}
00045 
00046      MuonTransientTrackingRecHit::MuonRecHitPointer first;
00047      MuonTransientTrackingRecHit::MuonRecHitPointer second;
00048      std::string type;
00049   };
00050 
00051   typedef std::vector<MuonRecHitPair> MuonRecHitPairVector;
00052 
00054   void createSeeds(TrajectorySeedCollection& results,
00055                    const MuonTransientTrackingRecHit::MuonRecHitContainer& hits,
00056                    const edm::EventSetup& eSetup) const;
00057 
00058 
00059   void createSeeds(TrajectorySeedCollection& results,
00060                    const CosmicMuonSeedGenerator::MuonRecHitPairVector& hits,
00061                    const edm::EventSetup& eSetup) const;
00062 
00064   bool checkQuality(const MuonTransientTrackingRecHit::MuonRecHitPointer&) const;
00065 
00067   MuonTransientTrackingRecHit::MuonRecHitContainer selectSegments(const MuonTransientTrackingRecHit::MuonRecHitContainer&) const;
00068 
00070   std::vector<TrajectorySeed> createSeed(const MuonTransientTrackingRecHit::MuonRecHitPointer&,
00071                                          const edm::EventSetup&) const;
00072 
00073 
00074   std::vector<MuonRecHitPair> makeSegPairs(const MuonTransientTrackingRecHit::MuonRecHitContainer&, const MuonTransientTrackingRecHit::MuonRecHitContainer&, std::string) const;
00075 
00077   std::vector<TrajectorySeed> createSeed(const MuonRecHitPair&,
00078                                          const edm::EventSetup&) const;
00079 
00080   TrajectorySeed tsosToSeed(const TrajectoryStateOnSurface&, uint32_t) const;
00081 
00083   bool areCorrelated(const MuonTransientTrackingRecHit::MuonRecHitPointer&,
00084                      const MuonTransientTrackingRecHit::MuonRecHitPointer&) const;
00085 
00087   bool leftIsBetter(const MuonTransientTrackingRecHit::MuonRecHitPointer&,
00088                     const MuonTransientTrackingRecHit::MuonRecHitPointer&) const;
00089 
00090   struct DecreasingGlobalY{
00091     bool operator()(const MuonTransientTrackingRecHit::ConstMuonRecHitPointer &lhs,
00092                     const MuonTransientTrackingRecHit::ConstMuonRecHitPointer &rhs) const{ 
00093       return lhs->globalPosition().y() > rhs->globalPosition().y(); 
00094     }
00095   };
00096 
00097  private: 
00099   bool theEnableDTFlag;
00100 
00102   bool theEnableCSCFlag;
00103 
00105   edm::InputTag theDTRecSegmentLabel;
00106 
00108   edm::InputTag theCSCRecSegmentLabel;
00109 
00111   unsigned int theMaxSeeds;
00112   
00114   double theMaxDTChi2;
00115   double theMaxCSCChi2;
00116   edm::ESHandle<MuonDetLayerGeometry> theMuonLayers;
00117   edm::ESHandle<MagneticField> theField;
00118 
00119   TrajectoryStateTransform* theTSTransform;
00120 
00121   std::map<std::string, float> theParameters;
00122 
00123 };
00124 #endif
00125