CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/RecoLocalMuon/CSCSegment/src/CSCSegAlgoDF.h

Go to the documentation of this file.
00001 #ifndef CSCSegment_CSCSegAlgoDF_h
00002 #define CSCSegment_CSCSegAlgoDF_h
00003 
00038 #include <RecoLocalMuon/CSCSegment/src/CSCSegmentAlgorithm.h>
00039 #include <DataFormats/CSCRecHit/interface/CSCRecHit2D.h>
00040 
00041 #include <deque>
00042 #include <vector>
00043 
00044 class CSCSegAlgoPreClustering;
00045 class CSCSegAlgoShowering;
00046 
00047 class CSCSegAlgoDF : public CSCSegmentAlgorithm {
00048 
00049 public:
00050 
00051     
00053     
00054   typedef std::vector<int> LayerIndex;
00055   typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
00056   typedef std::vector<const CSCRecHit2D*>::const_iterator ChamberHitContainerCIt;
00057   typedef std::deque<bool> BoolContainer;
00058     
00060   explicit CSCSegAlgoDF(const edm::ParameterSet& ps);
00061 
00063   virtual ~CSCSegAlgoDF();
00064 
00069   std::vector<CSCSegment> buildSegments(ChamberHitContainer rechits);
00070 
00074   std::vector<CSCSegment> run(const CSCChamber* aChamber, ChamberHitContainer rechits); 
00075 
00076 private:
00077 
00079 
00092   void tryAddingHitsToSegment( const ChamberHitContainer& rechitsInChamber,
00093                                const ChamberHitContainerCIt i1, 
00094                                const ChamberHitContainerCIt i2,
00095                                LayerIndex layerIndex);
00096 
00100   void flagHitsAsUsed(const ChamberHitContainer& rechitsInChamber);
00101  
00105   void pruneFromResidual();
00106 
00107 
00111   void orderSecondSeed( GlobalPoint gp1, 
00112                                   const ChamberHitContainerCIt i1,
00113                                   const ChamberHitContainerCIt i2,
00114                                   const ChamberHitContainer& rechits,
00115                                   LayerIndex layerIndex );
00116 
00117         
00118   bool isHitNearSegment(const CSCRecHit2D* h) const;
00119   bool addHit(const CSCRecHit2D* hit, int layer);
00120   void updateParameters(void);
00121   bool hasHitOnLayer(int layer) const;
00122   void compareProtoSegment(const CSCRecHit2D* h, int layer);
00123   CLHEP::HepMatrix derivativeMatrix(void) const;
00124   AlgebraicSymMatrix weightMatrix(void) const;
00125   AlgebraicSymMatrix calculateError(void) const;
00126   void flipErrors(AlgebraicSymMatrix&) const;
00127 
00128   // Member variables
00129   const std::string myName; 
00130   const CSCChamber* theChamber;
00131   BoolContainer usedHits;
00132 
00133   ChamberHitContainer closeHits;
00134 
00135   ChamberHitContainer protoSegment;
00136   ChamberHitContainer secondSeedHits;
00137   float       protoSlope_u;
00138   float       protoSlope_v;
00139   LocalPoint  protoIntercept;           
00140   double      protoChi2;
00141   LocalVector protoDirection;
00142 
00143   // input from .cfi file
00144   bool   debug;
00145   bool   preClustering;
00146   int    minHitsForPreClustering;
00147   bool   testSeg;
00148   bool   Pruning;
00149   int    minLayersApart;
00150   int    nHitsPerClusterIsShower;
00151   float  nSigmaFromSegment;
00152   int    minHitsPerSegment;
00153   int    muonsPerChamberMax;
00154   double dRPhiFineMax;
00155   double dPhiFineMax;
00156   float tanPhiMax;
00157   float tanThetaMax;
00158   float chi2Max;
00159   float maxRatioResidual;
00160 
00161   CSCSegAlgoPreClustering* preCluster_;
00162   CSCSegAlgoShowering* showering_;
00163 
00164 };
00165 
00166 #endif