CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSegAlgoRU.h
Go to the documentation of this file.
1 #ifndef CSCSegment_CSCSegAlgoRU_h
2 #define CSCSegment_CSCSegAlgoRU_h
3 
25 #include "CSCSegFit.h"
26 
27 #include <Math/Functions.h>
28 #include <Math/SVector.h>
29 #include <Math/SMatrix.h>
30 
31 #include <vector>
32 
33 
34 class CSCSegFit;
35 
37 
38 public:
39 
40  // Tim tried using map as basic container of all (space-point) RecHit's in a chamber:
41  // The 'key' is a pseudo-layer number (1-6 but with 1 always closest to IP).
42  // The 'value' is a vector of the RecHit's on that layer.
43  // Using the layer number like this removes the need to sort in global z.
44  // Instead we just have to ensure the layer index is correctly adjusted
45  // to enforce the requirement that 'layer 1' is closest in the chamber
46  // to the IP.
47 
49 
50 
51  // 4-dim vector
52  typedef ROOT::Math::SVector<double,6> SVector6;
53 
54  typedef std::vector<int> LayerIndex;
55  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
56  typedef std::vector<const CSCRecHit2D*>::const_iterator ChamberHitContainerCIt;
57 
58  // We need to be able to flag a hit as 'used' and so need a container of bool's.
59  typedef std::vector<bool> BoolContainer;
60 
62  explicit CSCSegAlgoRU(const edm::ParameterSet& ps);
64  virtual ~CSCSegAlgoRU() {};
65 
70  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
71 
72  // std::vector<CSCSegment> assambleRechitsInSegments(const ChamberHitContainer& rechits, int iadd, BoolContainer& used, BoolContainer& used3p, int *recHits_per_layer, const LayerIndex& layerIndex, std::vector<CSCSegment> segments);
73 
77  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits);
78 
79 private:
80 
82  // Could be static at the moment, but in principle one
83  // might like CSCSegmentizer-specific behaviour?
84  bool areHitsCloseInR(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
85  bool areHitsCloseInGlobalPhi(const CSCRecHit2D* h1, const CSCRecHit2D* h2) const;
86  bool isHitNearSegment(const CSCRecHit2D* h) const;
87 
91  void tryAddingHitsToSegment(const ChamberHitContainer& rechitsInChamber,
92  const BoolContainer& used, const LayerIndex& layerIndex,
94 
99  bool isSegmentGood(const ChamberHitContainer& rechitsInChamber) const;
100 
104  void flagHitsAsUsed(const ChamberHitContainer& rechitsInChamber, BoolContainer& used) const;
105 
107  bool addHit(const CSCRecHit2D* hit, int layer);
108  void updateParameters(void);
109  float fit_r_phi(SVector6 points, int layer) const;
110  float fitX(SVector6 points, SVector6 errors, int ir, int ir2, float &chi2_str);
111  void baseline(int n_seg_min);//function for arasing bad hits in case of bad chi2/NDOF
116  float phiAtZ(float z) const;
117  bool hasHitOnLayer(int layer) const;
118  bool replaceHit(const CSCRecHit2D* h, int layer);
119  void compareProtoSegment(const CSCRecHit2D* h, int layer);
120  void increaseProtoSegment(const CSCRecHit2D* h, int layer, int chi2_factor);
121 
122 
123  // Member variables
124  // ================
125 
129 
130  double theChi2;
133  float uz, vz;
134  float windowScale;
135  int chi2D_iadd=1;
136  int strip_iadd=1;
138  float dRMax ;
139  float dPhiMax;
140  float dRIntMax;
141  float dPhiIntMax;
142  float chi2Max;
143  float chi2_str_;
144  float chi2Norm_2D_;
145  float wideSeg;
147  bool debugInfo;
148 
149  std::unique_ptr<CSCSegFit> sfit_;
150 
151 };
152 
153 #endif
bool areHitsCloseInR(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
float windowScale
Definition: CSCSegAlgoRU.h:134
ROOT::Math::SVector< double, 6 > SVector6
Typedefs.
Definition: CSCSegAlgoRU.h:52
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
Definition: CSCSegAlgoRU.h:56
double theChi2
Definition: CSCSegAlgoRU.h:130
LocalVector theDirection
Definition: CSCSegAlgoRU.h:132
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
const std::string myName
Definition: CSCSegAlgoRU.h:128
void updateParameters(void)
float dPhiIntMax
Definition: CSCSegAlgoRU.h:141
virtual ~CSCSegAlgoRU()
Destructor.
Definition: CSCSegAlgoRU.h:64
LocalPoint theOrigin
Definition: CSCSegAlgoRU.h:131
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Definition: CSCSegAlgoRU.cc:57
bool isHitNearSegment(const CSCRecHit2D *h) const
bool replaceHit(const CSCRecHit2D *h, int layer)
ChamberHitContainer proto_segment
Definition: CSCSegAlgoRU.h:127
float fit_r_phi(SVector6 points, int layer) const
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Definition: CSCSegAlgoRU.cc:62
const CSCChamber * theChamber
Definition: CSCSegAlgoRU.h:126
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const BoolContainer &used, const LayerIndex &layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
void compareProtoSegment(const CSCRecHit2D *h, int layer)
CSCSegAlgoRU(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoRU.cc:21
std::vector< const CSCRecHit2D * > ChamberHitContainer
Definition: CSCSegAlgoRU.h:55
std::vector< bool > BoolContainer
Definition: CSCSegAlgoRU.h:59
std::vector< int > LayerIndex
Definition: CSCSegAlgoRU.h:54
float phiAtZ(float z) const
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
float chi2Norm_2D_
Definition: CSCSegAlgoRU.h:144
float fitX(SVector6 points, SVector6 errors, int ir, int ir2, float &chi2_str)
bool hasHitOnLayer(int layer) const
void baseline(int n_seg_min)
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
std::unique_ptr< CSCSegFit > sfit_
Definition: CSCSegAlgoRU.h:149
void increaseProtoSegment(const CSCRecHit2D *h, int layer, int chi2_factor)