Go to the documentation of this file.00001 #ifndef CSCSegment_CSCSegAlgoTC_h
00002 #define CSCSegment_CSCSegAlgoTC_h
00003
00027 #include <RecoLocalMuon/CSCSegment/src/CSCSegmentAlgorithm.h>
00028
00029 #include <DataFormats/CSCRecHit/interface/CSCRecHit2D.h>
00030
00031 #include <deque>
00032 #include <vector>
00033
00034
00035 class CSCSegAlgoTC : public CSCSegmentAlgorithm {
00036 public:
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00050 typedef std::vector<int> LayerIndex;
00051 typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
00052 typedef ChamberHitContainer::const_iterator ChamberHitContainerCIt;
00053
00054
00055
00056
00057
00058
00059 typedef std::deque<bool> BoolContainer;
00060
00062 explicit CSCSegAlgoTC(const edm::ParameterSet& ps);
00064 virtual ~CSCSegAlgoTC() {};
00065
00070 std::vector<CSCSegment> buildSegments(ChamberHitContainer rechits);
00071
00075 std::vector<CSCSegment> run(const CSCChamber* aChamber, ChamberHitContainer rechits);
00076
00077 private:
00078
00080
00081 bool addHit(const CSCRecHit2D* aHit, int layer);
00082 bool replaceHit(const CSCRecHit2D* h, int layer);
00083 void compareProtoSegment(const CSCRecHit2D* h, int layer);
00084 void increaseProtoSegment(const CSCRecHit2D* h, int layer);
00085 AlgebraicSymMatrix calculateError() const;
00086 CLHEP::HepMatrix derivativeMatrix() const;
00087 AlgebraicSymMatrix weightMatrix() const;
00088 void flipErrors(AlgebraicSymMatrix&) const;
00089
00093 bool areHitsCloseInLocalX(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
00094
00098 bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
00099
00100 bool hasHitOnLayer(int layer) const;
00101
00108 bool isHitNearSegment(const CSCRecHit2D* h) const;
00109
00113 void dumpHits(const ChamberHitContainer& rechits) const;
00114
00118 void tryAddingHitsToSegment(const ChamberHitContainer& rechits,
00119 const ChamberHitContainerCIt i1,
00120 const ChamberHitContainerCIt i2);
00121
00127 bool isSegmentGood(std::vector<ChamberHitContainer>::iterator is,
00128 std::vector<double>::iterator ichi,
00129 const ChamberHitContainer& rechitsInChamber,
00130 BoolContainer& used) const;
00131
00135 void flagHitsAsUsed(std::vector<ChamberHitContainer>::iterator is,
00136 const ChamberHitContainer& rechitsInChamber, BoolContainer& used) const;
00137
00142 void pruneTheSegments(const ChamberHitContainer& rechitsInChamber);
00146 void segmentSort();
00147
00148 float phiAtZ(float z) const;
00149 void fillLocalDirection();
00150 void fillChiSquared();
00151 void fitSlopes();
00152 void updateParameters();
00153
00155
00156
00157 const CSCChamber* theChamber;
00158 std::vector<ChamberHitContainer> candidates;
00159 std::vector<LocalPoint> origins;
00160 std::vector<LocalVector> directions;
00161 std::vector<AlgebraicSymMatrix> errors;
00162 std::vector<double> chi2s;
00163
00164 ChamberHitContainer proto_segment;
00165 double theChi2;
00166 LocalPoint theOrigin;
00167 LocalVector theDirection;
00168 float uz, vz;
00169
00172 float chi2Max;
00173
00177 float chi2ndfProbMin;
00178
00182 float dRPhiFineMax;
00183
00187 float dPhiFineMax;
00188
00192 float dRPhiMax;
00193
00196 float dPhiMax;
00197
00200 int minLayersApart;
00201
00208 int SegmentSorting;
00209
00212 const std::string myName;
00213 bool debugInfo;
00214 };
00215
00216 #endif