33 bool add1 =
true, add2 =
true;
34 for (vector<const Point *>::const_iterator it =
contents.begin(); it !=
contents.end() && (add1 || add2); ++it) {
35 if ((*it)->hit == p1->
hit)
38 if ((*it)->hit == p2->
hit)
59 : chw_a(cw_a / 2.), chw_b(cw_b / 2.),
geometry(nullptr) {}
69 map<unsigned int, GeomData>::iterator it =
geometryMap.find(
id);
78 gd.
s =
d.x() * c.x() +
d.y() * c.y();
92 std::vector<Point> points;
93 for (
auto &ds : input) {
94 unsigned int detId = ds.detId();
101 double z = gd.
z -
z0;
104 points.push_back(
Point(detId, hit, p, z, w));
109 printf(
">> FastLineRecognition::getPatterns(z0 = %E)\n", z0);
110 printf(
">>>>>>>>>>>>>>>>>>>\n");
125 printf(
"\tpoints of the selected cluster: %lu\n", c.
contents.size());
130 printf(
"\t\t%.1f\n", pit->z);
132 pattern.
addHit(pit->detId, *(pit->hit));
138 unsigned int u_points_b = 0;
139 for (vector<Point>::iterator dit = points.begin(); dit != points.end(); ++dit)
142 printf(
"\tusable points before: %u\n", u_points_b);
147 for (vector<Point>::iterator dit = points.begin(); dit != points.end(); ++dit) {
149 if ((*hit)->hit == dit->hit) {
158 unsigned int u_points_a = 0;
159 for (vector<Point>::iterator dit = points.begin(); dit != points.end(); ++dit)
162 printf(
"\tusable points after: %u\n", u_points_a);
167 printf(
"patterns at end: %lu\n", patterns.
size());
168 printf(
"<<<<<<<<<<<<<<<<<<<\n");
178 printf(
"\tFastLineRecognition::getOneLine\n");
181 if (points.size() < 2)
187 for (vector<Point>::const_iterator it1 = points.begin(); it1 != points.end(); ++it1) {
191 for (vector<Point>::const_iterator it2 = it1; it2 != points.end(); ++it2) {
195 const double &z1 = it1->z;
196 const double &z2 = it2->z;
201 const double &
p1 = it1->h;
202 const double &
p2 = it2->h;
204 const double &w1 = it1->w;
205 const double &
w2 = it2->w;
208 double a = (p2 -
p1) / (z2 - z1);
209 double b = p1 - z1 *
a;
213 printf(
"\t\t\tz: 1=%+5.1f, 2=%+5.1f | U/V: 1=%+6.3f, 2=%+6.3f | a=%+6.3f rad, b=%+6.3f mm, w=%.1f\n",
224 bool newCluster =
true;
225 for (
unsigned int k = 0;
k < clusters.size();
k++) {
227 if (c.
S1 < 1. || c.
Sw <= 0.)
232 printf(
"\t\t\t\ttest cluster %u at a=%+6.3f, b=%+6.3f : %+6.3f, %+6.3f : %i, %i\n",
244 clusters[
k].add(&(*it1), &(*it2), a, b, w);
246 printf(
"\t\t\t\t--> cluster %u\n",
k);
255 printf(
"\t\t\t\t--> new cluster %lu\n", clusters.size());
258 clusters.back().add(&(*it1), &(*it2), a, b, w);
264 printf(
"\t\tclusters: %lu\n", clusters.size());
270 for (
unsigned int k = 0;
k < clusters.size();
k++) {
272 for (vector<const Point *>::iterator it = clusters[
k].
contents.begin(); it != clusters[
k].contents.end(); ++it)
274 clusters[
k].weight = w;
283 printf(
"\t\tmw = %.1f, mk = %u\n", mw, mk);
287 if (mw >= threshold) {
288 result = clusters[mk];
Detector ID class for TOTEM Si strip detectors.
void addHit(edm::det_id_type detId, const TotemRPRecHit &hit)
double chw_a
cluster half widths in a and b
const edm::EventSetup & c
void push_back(const T &t)
common ppss p3p6s2 common epss epspn46 common const1 w2
uint16_t *__restrict__ id
const Translation & translation() const
const TotemRPRecHit * hit
pointer to original reco hit
double s
sensor's centre projected to its read-out direction
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation
cluster of intersection points
void getPatterns(const edm::DetSetVector< TotemRPRecHit > &input, double _z0, double threshold, edm::DetSet< TotemRPUVPattern > &patterns)
DetGeomDesc::Translation Vector
static std::string const input
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 z0
"typical" z
std::map< unsigned int, GeomData > geometryMap
map: raw detector id –> GeomData
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
if(conf_.getParameter< bool >("UseStripCablingDB"))
Reconstructed hit in TOTEM RP.
Abs< T >::type abs(const T &t)
std::vector< const Point * > contents
A linear pattern in U or V projection. The intercept b is taken at the middle of a RP: (geometry->Get...
static const double sigma0
the uncertainty of 1-hit cluster, in mm
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
GeomData getGeomData(unsigned int id)
expects raw detector id
FastLineRecognition(double cw_a=0., double cw_b=0.)
const CTPPSGeometry * geometry
pointer to the geometry
Vector localToGlobalDirection(unsigned int id, const Vector &) const
double z
z position of a sensor (wrt. IP)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.