CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoMuon/MuonSeedGenerator/src/RPCSeedPattern.h

Go to the documentation of this file.
00001 #ifndef MRecoMuon_MuonSeedGenerator_RPCSeedPattern_H
00002 #define MRecoMuon_MuonSeedGenerator_RPCSeedPattern_H
00003 
00012 #include "FWCore/Framework/interface/EventSetup.h"
00013 #include <DataFormats/TrajectorySeed/interface/TrajectorySeed.h>
00014 #include <RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h>
00015 #include <MagneticField/Engine/interface/MagneticField.h>
00016 #include <FWCore/Framework/interface/ESHandle.h>
00017 #include <FWCore/ParameterSet/interface/ParameterSet.h>
00018 #include <TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h>
00019 #include <vector>
00020 
00021 #ifndef upper_limit_pt
00022 #define upper_limit_pt 100
00023 #endif
00024 
00025 #ifndef lower_limit_pt
00026 #define lower_limit_pt 3.0
00027 #endif
00028 
00029 
00030 class RPCSeedPattern {
00031 
00032     typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer;
00033     typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer;
00034     typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
00035     typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer;
00036 
00037     public:
00038     typedef std::pair<ConstMuonRecHitPointer, ConstMuonRecHitPointer> RPCSegment;
00039     typedef std::pair<TrajectorySeed, double> weightedTrajectorySeed;
00040 
00041     public:
00042     RPCSeedPattern(); 
00043     ~RPCSeedPattern();
00044     void configure(const edm::ParameterSet& iConfig);
00045     void clear() { theRecHits.clear(); }
00046     void add(const ConstMuonRecHitPointer& hit) { theRecHits.push_back(hit); }   
00047     unsigned int nrhit() const { return theRecHits.size(); }
00048 
00049     private:
00050     friend class RPCSeedFinder;
00051     weightedTrajectorySeed seed(const edm::EventSetup& eSetup, int& isGoodSeed); 
00052     void ThreePointsAlgorithm();
00053     void MiddlePointsAlgorithm();
00054     void SegmentAlgorithm();
00055     void SegmentAlgorithmSpecial(const edm::EventSetup& eSetup);
00056     bool checkSegment() const;
00057     ConstMuonRecHitPointer FirstRecHit() const; 
00058     ConstMuonRecHitPointer BestRefRecHit() const;
00059     LocalTrajectoryError getSpecialAlgorithmErrorMatrix(const ConstMuonRecHitPointer& first, const ConstMuonRecHitPointer& best);
00060     weightedTrajectorySeed createFakeSeed(int& isGoodSeed, const edm::EventSetup& eSetup);
00061     weightedTrajectorySeed createSeed(int& isGoodSeed, const edm::EventSetup& eSetup);
00062     double getDistance(const ConstMuonRecHitPointer& precHit, const GlobalVector& Center) const;
00063     bool checkStraightwithThreerecHits(ConstMuonRecHitPointer (&precHit)[3], double MinDeltaPhi) const;
00064     GlobalVector computePtwithThreerecHits(double& pt, double& pt_err, ConstMuonRecHitPointer (&precHit)[3]) const;
00065     bool checkStraightwithSegment(const RPCSegment& Segment1, const RPCSegment& Segment2, double MinDeltaPhi) const;
00066     GlobalVector computePtwithSegment(const RPCSegment& Segment1, const RPCSegment& Segment2) const;
00067     bool checkStraightwithThreerecHits(double (&x)[3], double (&y)[3], double MinDeltaPhi) const;
00068     GlobalVector computePtWithThreerecHits(double& pt, double& pt_err, double (&x)[3], double (&y)[3]) const;
00069 
00070     void checkSimplePattern(const edm::EventSetup& eSetup);
00071     void checkSegmentAlgorithmSpecial(const edm::EventSetup& eSetup);
00072     double extropolateStep(const GlobalPoint& startPosition, const GlobalVector& startMomentum, ConstMuonRecHitContainer::const_iterator iter, const int ClockwiseDirection, double& tracklength, const edm::EventSetup& eSetup);
00073     
00074     //void computeBestPt(double* pt, double* spt, double& ptmean0, double& sptmean0, unsigned int NumberofPt) const;
00075 
00076     // ----------member data ---------------------------
00077 
00078     // parameters for configuration
00079     double MaxRSD;
00080     double deltaRThreshold;
00081     unsigned int AlgorithmType;
00082     bool autoAlgorithmChoose;
00083     double ZError;
00084     double MinDeltaPhi;
00085     double stepLength;
00086     unsigned int sampleCount;
00087     // Signals for run seed()
00088     bool isConfigured;
00089     // recHits of a pattern
00090     ConstMuonRecHitContainer theRecHits;
00091     // Complex pattern
00092     double MagnecticFieldThreshold;
00093     GlobalVector meanMagneticField2;
00094     bool isStraight2;
00095     GlobalVector Center2;
00096     double meanRadius2;
00097     RPCSegment SegmentRB[2];
00098     GlobalPoint entryPosition;
00099     GlobalPoint leavePosition;
00100     double lastPhi;
00101     double S;
00102     // Simple pattern
00103     bool isStraight;
00104     GlobalVector Center;
00105     double meanRadius;
00106     double meanBz;
00107     double deltaBz;
00108     // Pattern estimation part
00109     bool isPatternChecked;
00110     int isGoodPattern;
00111     int isClockwise;
00112     int isParralZ;
00113     int Charge;
00114     double meanPt;
00115     double meanSpt;
00116     GlobalVector Momentum;
00117 };
00118 
00119 #endif