test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastLineRecognition.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
9 #ifndef RecoCTPPS_TotemRPLocal_FastLineRecognition
10 #define RecoCTPPS_TotemRPLocal_FastLineRecognition
11 
14 
18 
19 
25 {
26  public:
27  FastLineRecognition(double cw_a = 0., double cw_b = 0.);
28 
30 
32  {
33  geometry = _g;
34  geometryMap.clear();
35  }
36 
37  void getPatterns(const edm::DetSetVector<TotemRPRecHit> &input, double _z0, double threshold,
39 
40  protected:
42  static const double sigma0;
43 
45  double z0;
46 
48  double chw_a, chw_b;
49 
51  double threshold;
52 
55 
56  struct GeomData
57  {
58  double z;
59  double s;
60  };
61 
63  std::map<unsigned int, GeomData> geometryMap;
64 
66  GeomData getGeomData(unsigned int id);
67 
68  struct Point
69  {
70  unsigned int detId;
71  const TotemRPRecHit* hit;
72  double h;
73  double z;
74  double w;
75  bool usable;
76  Point(unsigned int _d=0, const TotemRPRecHit* _hit=NULL, double _h=0., double _z=0., double _w=0.) :
77  detId(_d), hit(_hit), h(_h), z(_z), w(_w), usable(true) {}
78  };
79 
81  struct Cluster
82  {
83  double Saw, Sbw, Sw, S1;
84  double weight;
85  double min_a, max_a, min_b, max_b;
86 
87  std::vector<const Point *> contents;
88 
89  Cluster() : Saw(0.), Sbw(0.), Sw(0.), S1(0.), weight(0.) {}
90 
91  void add(const Point *p1, const Point *p2, double a, double b, double w);
92 
93  bool operator<(const Cluster &c) const
94  {
95  return (this->Sw > c.Sw) ? true : false;
96  }
97  };
98 
101  bool getOneLine(const std::vector<Point> &points, double threshold, Cluster &result);
102 };
103 
104 #endif
105 
double chw_a
cluster half widths in a and b
PhiMemoryImage patterns[9]
const double w
Definition: UKUtility.cc:23
const TotemRPRecHit * hit
pointer to original reco hit
void resetGeometry(const TotemRPGeometry *_g)
double s
sensor&#39;s centre projected to its read-out direction
#define NULL
Definition: scimark2.h:8
Point(unsigned int _d=0, const TotemRPRecHit *_hit=NULL, double _h=0., double _z=0., double _w=0.)
cluster of intersection points
void getPatterns(const edm::DetSetVector< TotemRPRecHit > &input, double _z0, double threshold, edm::DetSet< TotemRPUVPattern > &patterns)
static std::string const input
Definition: EdmProvDump.cc:44
tuple result
Definition: mps_fire.py:84
bool getOneLine(const std::vector< Point > &points, double threshold, Cluster &result)
void add(const Point *p1, const Point *p2, double a, double b, double w)
double threshold
weight threshold for accepting pattern candidates (clusters)
double z0
&quot;typical&quot; z
std::map< unsigned int, GeomData > geometryMap
map: raw detector id –&gt; GeomData
Reconstructed hit in TOTEM RP.
Definition: TotemRPRecHit.h:18
bool usable
whether the point can still be used
double p2[4]
Definition: TauolaWrapper.h:90
Class performing optimized hough transform to recognize lines.
unsigned int detId
raw detector id
std::vector< const Point * > contents
static const double sigma0
the uncertainty of 1-hit cluster, in mm
GeomData getGeomData(unsigned int id)
expects raw detector id
double h
hit position in global coordinate system
FastLineRecognition(double cw_a=0., double cw_b=0.)
double b
Definition: hdecay.h:120
double z
z position with respect to z0
The manager class for TOTEM RP geometry.
double z
z position of a sensor (wrt. IP)
double p1[4]
Definition: TauolaWrapper.h:89
double a
Definition: hdecay.h:121
bool operator<(const Cluster &c) const
const TotemRPGeometry * geometry
pointer to the geometry