CMS 3D CMS Logo

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 RecoPPS_Local_FastLineRecognition
10 #define RecoPPS_Local_FastLineRecognition
11 
14 
19 
24 class FastLineRecognition {
25 public:
26  FastLineRecognition(double cw_a = 0., double cw_b = 0.);
27 
29 
30  void resetGeometry(const CTPPSGeometry *_g) {
31  geometry = _g;
32  geometryMap.clear();
33  }
34 
36  double _z0,
37  double threshold,
39 
40 private:
42  static const double sigma0;
43 
45  double z0;
46 
48  double chw_a, chw_b;
49 
51  double threshold;
52 
54  const CTPPSGeometry *geometry;
55 
56  struct GeomData {
57  double z;
58  double s;
59  };
60 
62  std::map<unsigned int, GeomData> geometryMap;
63 
65  GeomData getGeomData(unsigned int id);
66 
67  struct Point {
68  unsigned int detId;
69  const TotemRPRecHit *hit;
70  double h;
71  double z;
72  double w;
73  bool usable;
74  Point(unsigned int _d = 0, const TotemRPRecHit *_hit = nullptr, double _h = 0., double _z = 0., double _w = 0.)
75  : detId(_d), hit(_hit), h(_h), z(_z), w(_w), usable(true) {}
76  };
77 
79  struct Cluster {
80  double Saw, Sbw, Sw, S1;
81  double weight;
82 
83  std::vector<const Point *> contents;
84 
85  Cluster() : Saw(0.), Sbw(0.), Sw(0.), S1(0.), weight(0.) {}
86 
87  void add(const Point *p1, const Point *p2, double a, double b, double w);
88 
89  bool operator<(const Cluster &c) const { return (this->Sw > c.Sw) ? true : false; }
90  };
91 
94  bool getOneLine(const std::vector<Point> &points, double threshold, Cluster &result);
95 };
96 
97 #endif
TotemRPRecHit
Reconstructed hit in TOTEM RP.
Definition: TotemRPRecHit.h:17
FastLineRecognition::sigma0
static const double sigma0
the uncertainty of 1-hit cluster, in mm
Definition: FastLineRecognition.h:46
edm::DetSetVector< TotemRPRecHit >
FastLineRecognition::chw_a
double chw_a
cluster half widths in a and b
Definition: FastLineRecognition.h:52
input
static const std::string input
Definition: EdmProvDump.cc:48
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
FastLineRecognition::geometry
const CTPPSGeometry * geometry
pointer to the geometry
Definition: FastLineRecognition.h:58
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21469
edm::DetSet
Definition: DetSet.h:23
FastLineRecognition::Point::w
double w
weight
Definition: FastLineRecognition.h:76
FastLineRecognition::resetGeometry
void resetGeometry(const CTPPSGeometry *_g)
Definition: FastLineRecognition.h:34
FastLineRecognition::z0
double z0
"typical" z
Definition: FastLineRecognition.h:49
geometry
Definition: geometry.py:1
FastLineRecognition::Point::hit
const TotemRPRecHit * hit
pointer to original reco hit
Definition: FastLineRecognition.h:73
FastLineRecognition::getGeomData
GeomData getGeomData(unsigned int id)
expects raw detector id
Definition: FastLineRecognition.cc:66
FastLineRecognition::~FastLineRecognition
~FastLineRecognition()
Definition: FastLineRecognition.cc:62
TotemRPRecHit.h
FastLineRecognition::Cluster::Sbw
double Sbw
Definition: FastLineRecognition.h:84
FastLineRecognition::threshold
double threshold
weight threshold for accepting pattern candidates (clusters)
Definition: FastLineRecognition.h:55
CTPPSGeometry.h
FastLineRecognition::Point::Point
Point(unsigned int _d=0, const TotemRPRecHit *_hit=nullptr, double _h=0., double _z=0., double _w=0.)
Definition: FastLineRecognition.h:78
w
const double w
Definition: UKUtility.cc:23
FastLineRecognition::Cluster::S1
double S1
Definition: FastLineRecognition.h:84
FastLineRecognition::chw_b
double chw_b
Definition: FastLineRecognition.h:52
FastLineRecognition::Cluster::operator<
bool operator<(const Cluster &c) const
Definition: FastLineRecognition.h:93
FastLineRecognition::FastLineRecognition
FastLineRecognition(double cw_a=0., double cw_b=0.)
Definition: FastLineRecognition.cc:57
p2
double p2[4]
Definition: TauolaWrapper.h:90
h
FastLineRecognition::Point::usable
bool usable
whether the point can still be used
Definition: FastLineRecognition.h:77
b
double b
Definition: hdecay.h:118
FastLineRecognition::Cluster
cluster of intersection points
Definition: FastLineRecognition.h:83
FastLineRecognition::Point::detId
unsigned int detId
raw detector id
Definition: FastLineRecognition.h:72
FastLineRecognition::Point
Definition: FastLineRecognition.h:71
funct::true
true
Definition: Factorize.h:173
FastLineRecognition::GeomData::s
double s
sensor's centre projected to its read-out direction
Definition: FastLineRecognition.h:62
a
double a
Definition: hdecay.h:119
FastLineRecognition::GeomData::z
double z
z position of a sensor (wrt. IP)
Definition: FastLineRecognition.h:61
FastLineRecognition::Cluster::contents
std::vector< const Point * > contents
Definition: FastLineRecognition.h:87
FastLineRecognition::Cluster::Cluster
Cluster()
Definition: FastLineRecognition.h:89
FastLineRecognition::Cluster::Saw
double Saw
Definition: FastLineRecognition.h:84
FastLineRecognition::Cluster::add
void add(const Point *p1, const Point *p2, double a, double b, double w)
Definition: FastLineRecognition.cc:30
FastLineRecognition::geometryMap
std::map< unsigned int, GeomData > geometryMap
map: raw detector id --> GeomData
Definition: FastLineRecognition.h:66
FastLineRecognition
Class performing optimized hough transform to recognize lines.
Definition: FastLineRecognition.h:23
FastLineRecognition::getPatterns
void getPatterns(const edm::DetSetVector< TotemRPRecHit > &input, double _z0, double threshold, edm::DetSet< TotemRPUVPattern > &patterns)
Definition: FastLineRecognition.cc:86
p1
double p1[4]
Definition: TauolaWrapper.h:89
FastLineRecognition::Cluster::Sw
double Sw
Definition: FastLineRecognition.h:84
DetSetVector.h
FastLineRecognition::Point::z
double z
z position with respect to z0
Definition: FastLineRecognition.h:75
FastLineRecognition::Cluster::weight
double weight
Definition: FastLineRecognition.h:85
TotemRPDetId.h
FastLineRecognition::Point::h
double h
hit position in global coordinate system
Definition: FastLineRecognition.h:74
TotemRPUVPattern.h
mps_fire.result
result
Definition: mps_fire.py:311
DetSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
FastLineRecognition::GeomData
Definition: FastLineRecognition.h:60
FastLineRecognition::getOneLine
bool getOneLine(const std::vector< Point > &points, double threshold, Cluster &result)
Definition: FastLineRecognition.cc:173
weight
Definition: weight.py:1
hit
Definition: SiStripHitEffFromCalibTree.cc:88