CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.h

Go to the documentation of this file.
00001 #ifndef RecoMuon_MuonSeedBuilder_H
00002 #define RecoMuon_MuonSeedBuilder_H
00003 
00015 #include <FWCore/ParameterSet/interface/ParameterSet.h>
00016 #include <RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h>
00017 #include <DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h>
00018 
00019 //muon service
00020 #include <RecoMuon/TrackingTools/interface/MuonServiceProxy.h>
00021 
00022 #include<vector>
00023 
00024 class DetLayer; 
00025 class MuonDetLayerGeometry;
00026 class MagneticField;
00027 class MuonSeedCreator;
00028 class MuonSeedCleaner;
00029 
00030 typedef std::vector<TrajectorySeed> SeedContainer;
00031 
00032 class MuonSeedBuilder
00033 {
00034 
00035  public:
00036 
00037   typedef MuonTransientTrackingRecHit::MuonRecHitContainer SegmentContainer;
00038   typedef std::deque<bool> BoolContainer;
00039 
00041   explicit MuonSeedBuilder(const edm::ParameterSet&);
00042   
00044   ~MuonSeedBuilder();
00045   
00046   // Operations
00047 
00049   void setGeometry( const MuonDetLayerGeometry* lgeom ) {muonLayers = lgeom;}
00050 
00052   void setBField( const MagneticField* theField ) {BField = theField;}
00053 
00055   int build( edm::Event& event, const edm::EventSetup& eventSetup, TrajectorySeedCollection& seeds );
00056 
00057   std::vector<int> badSeedLayer;
00058 
00059 
00060  private:
00061 
00063   bool foundMatchingSegment( int type, SegmentContainer& protoTrack, SegmentContainer& segments,
00064        BoolContainer& usedSeg, float& eta_temp, float& phi_temp, int& lastLayer, bool& showeringBefore );
00065 
00067   std::vector<TrajectorySeed> seedCleaner(const edm::EventSetup& eventSetup, std::vector<TrajectorySeed>& seeds );   
00068 
00070   double etaError(const GlobalPoint gp, double rErr);
00071 
00073   bool IdentifyShowering( SegmentContainer& segs, BoolContainer& usedSeg, float& eta_last, float& phi_last, int layer, int& NShoweringSegments  );
00074 
00075   
00077   //std::vector<SeedContainer> GroupSeeds( std::vector<TrajectorySeed>& seeds );
00079   //TrajectorySeed BetterDirection( std::vector<TrajectorySeed>& seeds ) ;
00080   //TrajectorySeed BetterChi2( std::vector<TrajectorySeed>& seeds );
00082   //bool MomentumFilter(std::vector<TrajectorySeed>& seeds );
00083 
00084 
00086   //SeedContainer LengthFilter(std::vector<TrajectorySeed>& seeds );
00088   //SeedContainer SeedCandidates( std::vector<TrajectorySeed>& seeds, bool good );
00090   //unsigned int OverlapSegments( TrajectorySeed seed1, TrajectorySeed seed2 );
00091 
00093   //int NRecHitsFromSegment( const TrackingRecHit& rhit );
00094   //int NRecHitsFromSegment( MuonTransientTrackingRecHit *rhit );
00095   //int NRecHitsFromSegment( const MuonTransientTrackingRecHit& rhit );
00096   //double NChi2OfSegment( const TrackingRecHit& rhit );
00097 
00099   //GlobalPoint SeedPosition( TrajectorySeed seed );
00101   //GlobalVector SeedMomentum( TrajectorySeed seed );
00102 
00103   // This Producer private debug flag
00104   bool debug;
00105 
00106   // Enable the DT measurement
00107   bool enableDTMeasurement;
00108 
00109   // Enable the CSC measurement
00110   bool enableCSCMeasurement;
00111 
00112   // Minimum # of hits to consider a CSC Segment;
00113   int minCSCHitsPerSegment;
00114 
00115   // Minimum # of hits to consider a DT Segment;
00116   int minDTHitsPerSegment;
00117 
00118   // Maximum distance from initial segment
00119   float maxDeltaEtaCSC;
00120   float maxDeltaPhiCSC;
00121   float maxDeltaEtaOverlap;
00122   float maxDeltaPhiOverlap;
00123   float maxDeltaEtaDT;
00124   float maxDeltaPhiDT;
00125 
00126   // Number of Segments from a shower
00127   int NShowerSeg;
00128   SegmentContainer ShoweringSegments;   
00129   std::vector<int> ShoweringLayers; 
00131   edm::InputTag theDTSegmentLabel;
00132 
00134   edm::InputTag theCSCSegmentLabel;
00135 
00137   MuonSeedCreator* muonSeedCreate_;
00138   MuonSeedCleaner* muonSeedClean_;
00139 
00140   // Cache geometry for current event
00141   const MuonDetLayerGeometry* muonLayers;
00142 
00143   // Cache Magnetic Field for current event
00144   const MagneticField* BField;
00145  
00146   // muon service
00147   MuonServiceProxy* theService;
00148 
00149   // Minimum separation when we can distinguish between 2 muon seeds
00150   // (to suppress combinatorics)
00151   float maxEtaResolutionDT;
00152   float maxEtaResolutionCSC;
00153   float maxPhiResolutionDT;
00154   float maxPhiResolutionCSC;
00155   float theMinMomentum;
00156 
00157 };
00158 #endif
00159