CMS 3D CMS Logo

SeedForPhotonConversionFromQuadruplets.cc
Go to the documentation of this file.
2 
3 #include "Conv4HitsReco2.h"
4 
20 //ClusterShapeIncludes
30 
31 //#define mydebug_knuenz
32 //#define mydebug_sguazz
33 //#define quadDispLine
34 template <class T>
35 T sqr(T t) {
36  return t * t;
37 }
38 
42  iC,
43  SeedComparitorPSet,
44  cfg.getParameter<std::string>("propagator"),
45  cfg.existsAs<double>("SeedMomentumForBOFF") ? cfg.getParameter<double>("SeedMomentumForBOFF") : 5.0) {}
46 
50  const std::string& propagator,
51  double seedMomentumForBOFF)
52  : thePropagatorLabel(propagator), theBOFFMomentum(seedMomentumForBOFF) {
53  std::string comparitorName = SeedComparitorPSet.getParameter<std::string>("ComponentName");
54  if (comparitorName != "none") {
55  theComparitor = SeedComparitorFactory::get()->create(comparitorName, SeedComparitorPSet, iC);
56  }
57 }
58 
60 
62  const SeedingHitSet& phits,
63  const SeedingHitSet& mhits,
64  const TrackingRegion& region,
65  const edm::Event& ev,
66  const edm::EventSetup& es,
67  std::stringstream& ss,
68  std::vector<Quad>& quadV,
71 
72  bool rejectAllQuads = QuadCutPSet.getParameter<bool>("rejectAllQuads");
73  if (rejectAllQuads)
74  return nullptr;
75 
76  bool applyDeltaPhiCuts = QuadCutPSet.getParameter<bool>("apply_DeltaPhiCuts");
77  bool ClusterShapeFiltering = QuadCutPSet.getParameter<bool>("apply_ClusterShapeFilter");
78  bool applyArbitration = QuadCutPSet.getParameter<bool>("apply_Arbitration");
79  bool applydzCAcut = QuadCutPSet.getParameter<bool>("apply_zCACut");
80  double CleaningmaxRadialDistance = QuadCutPSet.getParameter<double>("Cut_DeltaRho"); //cm
81  double BeamPipeRadiusCut = QuadCutPSet.getParameter<double>("Cut_BeamPipeRadius"); //cm
82  double CleaningMinLegPt = QuadCutPSet.getParameter<double>("Cut_minLegPt"); //GeV
83  double maxLegPt = QuadCutPSet.getParameter<double>("Cut_maxLegPt"); //GeV
84  double dzcut = QuadCutPSet.getParameter<double>("Cut_zCA"); //cm
85 
86  double toleranceFactorOnDeltaPhiCuts = 0.1;
87 
88  // return 0; //FIXME, remove this line to make the code working.
89 
90  pss = &ss;
91 
92  if (phits.size() < 2)
93  return nullptr;
94  if (mhits.size() < 2)
95  return nullptr;
96 
97  //PUT HERE THE QUADRUPLET ALGORITHM, AND IN CASE USE THE METHODS ALREADY DEVELOPED, ADAPTING THEM
98 
99  //
100  // Rozzo ma efficace (per ora)
101  //
102 
103 #ifdef mydebug_sguazz
104  std::cout << " --------------------------------------------------------------------------"
105  << "\n";
106  std::cout << " Starting a hit quad fast reco "
107  << "\n";
108  std::cout << " --------------------------------------------------------------------------"
109  << "\n";
110 #endif
111 
112  //
113  // Let's build the 4 hits
114  SeedingHitSet::ConstRecHitPointer ptth1 = phits[0];
115  SeedingHitSet::ConstRecHitPointer ptth2 = phits[1];
116  SeedingHitSet::ConstRecHitPointer mtth1 = mhits[0];
117  SeedingHitSet::ConstRecHitPointer mtth2 = mhits[1];
118 
119  GlobalPoint vHit[4];
120  vHit[0] = ptth2->globalPosition();
121  vHit[1] = ptth1->globalPosition();
122  vHit[2] = mtth1->globalPosition();
123  vHit[3] = mtth2->globalPosition();
124 
125  //Photon source vertex primary vertex
126  const GlobalPoint& vgPhotVertex = region.origin();
127  math::XYZVector vPhotVertex(vgPhotVertex.x(), vgPhotVertex.y(), vgPhotVertex.z());
128 
129  math::XYZVector h1(vHit[0].x(), vHit[0].y(), vHit[0].z());
130  math::XYZVector h2(vHit[1].x(), vHit[1].y(), vHit[1].z());
131  math::XYZVector h3(vHit[2].x(), vHit[2].y(), vHit[2].z());
132  math::XYZVector h4(vHit[3].x(), vHit[3].y(), vHit[3].z());
133 
134  // At this point implement cleaning cuts before building the seed:::
135 
136  /*
137  Notes:
138 
139 h1, h2: positron
140 h3, h4: electron
141 
142 P1, P2: positron, ordered with radius
143 M1, M2: electron, ordered with radius
144 
145 Evan's notation:
146 V1=P1
147 V2=M1
148 V3=P2
149 V4=M2
150 
151 */
152 
153  math::XYZVector P1;
154  math::XYZVector P2;
155  math::XYZVector M1;
156  math::XYZVector M2;
157 
158  if (h1.x() * h1.x() + h1.y() * h1.y() < h2.x() * h2.x() + h2.y() * h2.y()) {
159  P1 = h1;
160  P2 = h2;
161  } else {
162  P1 = h2;
163  P2 = h1;
164  }
165 
166  if (h3.x() * h3.x() + h3.y() * h3.y() < h4.x() * h4.x() + h4.y() * h4.y()) {
167  M1 = h3;
168  M2 = h4;
169  } else {
170  M1 = h4;
171  M2 = h3;
172  }
173 
175  // Intersection-point:::
177  /*
178 Calculate the intersection point of the lines P2-P1 and M2-M1.
179 If this point is in the beam pipe, or if the distance of this
180 point to the layer of the most inner hit of the seed is less
181 than CleaningmaxRadialDistance cm, the combination is rejected.
182 */
183 
184  math::XYZVector IP(0, 0, 0);
185 
186  //Line1:
187  double kP = (P1.y() - P2.y()) / (P1.x() - P2.x());
188  double dP = P1.y() - kP * P1.x();
189  //Line2:
190  double kM = (M1.y() - M2.y()) / (M1.x() - M2.x());
191  double dM = M1.y() - kM * M1.x();
192  //Intersection:
193  double IPx = (dM - dP) / (kP - kM);
194  double IPy = kP * IPx + dP;
195 
196  IP.SetXYZ(IPx, IPy, 0);
197 
198  double IPrho = std::sqrt(IP.x() * IP.x() + IP.y() * IP.y());
199  double P1rho2 = P1.x() * P1.x() + P1.y() * P1.y();
200  double M1rho2 = M1.x() * M1.x() + M1.y() * M1.y();
201  double maxIPrho2 = IPrho + CleaningmaxRadialDistance;
202  maxIPrho2 *= maxIPrho2;
203 
204  if (IPrho < BeamPipeRadiusCut || P1rho2 > maxIPrho2 || M1rho2 > maxIPrho2) {
205  return nullptr;
206  }
207 
208  if (applyDeltaPhiCuts) {
209  kPI_ = std::atan(1.0) * 4;
210 
212  es.get<IdealMagneticFieldRecord>().get(bfield);
213  math::XYZVector QuadMean(0, 0, 0);
214  QuadMean.SetXYZ((M1.x() + M2.x() + P1.x() + P2.x()) / 4.,
215  (M1.y() + M2.y() + P1.y() + P2.y()) / 4.,
216  (M1.z() + M2.z() + P1.z() + P2.z()) / 4.);
217 
218  double fBField = bfield->inTesla(GlobalPoint(QuadMean.x(), QuadMean.y(), QuadMean.z())).z();
219 
220  double rMax = CleaningMinLegPt / (0.01 * 0.3 * fBField);
221  double rMax_squared = rMax * rMax;
222  double Mx = M1.x();
223  double My = M1.y();
224 
225  math::XYZVector B(0, 0, 0);
226  math::XYZVector C(0, 0, 0);
227 
228  if (rMax_squared * 4. > Mx * Mx + My * My) {
230  // Cleaning P1 points:::
232 
233  //Cx, Cy = Coordinates of circle center
234  //C_=line that contains the circle center
235 
236  //C_=k*x+d
237  double k = -Mx / My;
238  double d = My / 2. - k * Mx / 2.;
239 
240 #ifdef mydebug_knuenz
241  std::cout << "k" << k << std::endl;
242  std::cout << "d" << d << std::endl;
243 #endif
244 
245  //Cx1,2 and Cy1,2 are the two points that have a distance of rMax to 0,0
246  double CsolutionPart1 = -2 * k * d;
247  double CsolutionPart2 = std::sqrt(4 * k * k * d * d - 4 * (1 + k * k) * (d * d - rMax_squared));
248  double CsolutionPart3 = 2 * (1 + k * k);
249  double Cx1 = (CsolutionPart1 + CsolutionPart2) / CsolutionPart3;
250  double Cx2 = (CsolutionPart1 - CsolutionPart2) / CsolutionPart3;
251  double Cy1 = k * Cx1 + d;
252  double Cy2 = k * Cx2 + d;
253 
254  // Decide between solutions: phi(C) > phi(P)
255  double Cx, Cy;
256  math::XYZVector C1(Cx1, Cy1, 0);
257  if (C1.x() * M1.y() - C1.y() * M1.x() < 0) {
258  Cx = Cx1;
259  Cy = Cy1;
260  } else {
261  Cx = Cx2;
262  Cy = Cy2;
263  }
264  C.SetXYZ(Cx, Cy, 0);
265 
266 #ifdef mydebug_knuenz
267  std::cout << "Cx1" << Cx1 << std::endl;
268  std::cout << "Cx2" << Cx2 << std::endl;
269  std::cout << "Cy1" << Cy1 << std::endl;
270  std::cout << "Cy2" << Cy2 << std::endl;
271  std::cout << "Cx" << Cx << std::endl;
272  std::cout << "Cy" << Cy << std::endl;
273 #endif
274 
275  // Find Tangent at 0,0 to minPtCircle and point (Bx,By) on the first layer which bisects the allowed angle
276  k = -Cx / Cy;
277  d = 0;
278  double Bx1 = std::sqrt(Mx * Mx + My * My / (1 + k * k));
279  double Bx2 = -Bx1;
280  double By1 = k * Bx1 + d;
281  double By2 = k * Bx2 + d;
282 
283 #ifdef mydebug_knuenz
284  std::cout << "k" << k << std::endl;
285  std::cout << "d" << d << std::endl;
286 #endif
287 
288  // Decide between solutions: phi(B) < phi(P)
289  double Bx, By;
290  math::XYZVector B1(Bx1, By1, 0);
291  if (M1.x() * B1.y() - M1.y() * B1.x() < 0) {
292  Bx = Bx1;
293  By = By1;
294  } else {
295  Bx = Bx2;
296  By = By2;
297  }
298  B.SetXYZ(Bx, By, 0);
299 
300 #ifdef mydebug_knuenz
301  std::cout << "Bx1" << Bx1 << std::endl;
302  std::cout << "Bx2" << Bx2 << std::endl;
303  std::cout << "By1" << By1 << std::endl;
304  std::cout << "By2" << By2 << std::endl;
305  std::cout << "Bx" << Bx << std::endl;
306  std::cout << "By" << By << std::endl;
307 #endif
308 
309  double DeltaPhiMaxM1P1 = DeltaPhiManual(M1, B) * 2;
310 
311 #ifdef mydebug_knuenz
312  std::cout << "DeltaPhiMaxM1P1 " << DeltaPhiMaxM1P1 << std::endl;
313  std::cout << "M1.DeltaPhi(P1) " << DeltaPhiManual(M1, P1) << std::endl;
314  std::cout << "rho P1: " << std::sqrt(P1.x() * P1.x() + P1.y() * P1.y()) << "phi P1: " << P1.Phi() << std::endl;
315  std::cout << "rho M1: " << std::sqrt(M1.x() * M1.x() + M1.y() * M1.y()) << "phi M1: " << M1.Phi() << std::endl;
316 #endif
317 
318  //Finally Cut on DeltaPhi of P1 and M1
319 
320  double tol_DeltaPhiMaxM1P1 = DeltaPhiMaxM1P1 * toleranceFactorOnDeltaPhiCuts;
321  double DeltaPhiManualM1P1 = DeltaPhiManual(M1, P1);
322 
323  if (DeltaPhiManualM1P1 > DeltaPhiMaxM1P1 + tol_DeltaPhiMaxM1P1 || DeltaPhiManualM1P1 < 0 - tol_DeltaPhiMaxM1P1) {
324  return nullptr;
325  }
326 
327  } //if rMax > rLayerM1
328 
330  // Cleaning M2 points:::
332 
333  // if(B.DeltaPhi(P1)>0){//normal algo (with minPt circle)
334 
335  double rM2_squared = M2.x() * M2.x() + M2.y() * M2.y();
336  if (rMax_squared * 4. > rM2_squared) { //if minPt circle is smaller than 2*M2-layer radius, algo makes no sense
337 
338  //Chordales equation (line containing the two intersection points of the two circles)
339  double k = -C.x() / C.y();
340  double d = (rM2_squared - rMax_squared + C.x() * C.x() + C.y() * C.y()) / (2 * C.y());
341 
342  double M2solutionPart1 = -2 * k * d;
343  double M2solutionPart2 = std::sqrt(4 * k * k * d * d - 4 * (1 + k * k) * (d * d - rM2_squared));
344  double M2solutionPart3 = 2 + 2 * k * k;
345  double M2xMax1 = (M2solutionPart1 + M2solutionPart2) / M2solutionPart3;
346  double M2xMax2 = (M2solutionPart1 - M2solutionPart2) / M2solutionPart3;
347  double M2yMax1 = k * M2xMax1 + d;
348  double M2yMax2 = k * M2xMax2 + d;
349 
350  //double M2xMax,M2yMax;
351  math::XYZVector M2MaxVec1(M2xMax1, M2yMax1, 0);
352  math::XYZVector M2MaxVec2(M2xMax2, M2yMax2, 0);
353  math::XYZVector M2MaxVec(0, 0, 0);
354  if (M2MaxVec1.x() * M2MaxVec2.y() - M2MaxVec1.y() * M2MaxVec2.x() < 0) {
355  M2MaxVec.SetXYZ(M2xMax2, M2yMax2, 0);
356  } else {
357  M2MaxVec.SetXYZ(M2xMax1, M2yMax1, 0);
358  }
359 
360  double DeltaPhiMaxM2 = DeltaPhiManual(M2MaxVec, M1);
361 
362 #ifdef mydebug_knuenz
363  std::cout << "C.x() " << C.x() << std::endl;
364  std::cout << "C.y() " << C.y() << std::endl;
365  std::cout << "M1.x() " << M1.x() << std::endl;
366  std::cout << "M1.y() " << M1.y() << std::endl;
367  std::cout << "M2.x() " << M2.x() << std::endl;
368  std::cout << "M2.y() " << M2.y() << std::endl;
369  std::cout << "k " << k << std::endl;
370  std::cout << "d " << d << std::endl;
371  std::cout << "M2xMax1 " << M2xMax1 << std::endl;
372  std::cout << "M2xMax2 " << M2xMax2 << std::endl;
373  std::cout << "M2yMax1 " << M2yMax1 << std::endl;
374  std::cout << "M2yMax2 " << M2yMax2 << std::endl;
375  std::cout << "M2xMax " << M2MaxVec.x() << std::endl;
376  std::cout << "M2yMax " << M2MaxVec.y() << std::endl;
377  std::cout << "rM2_squared " << rM2_squared << std::endl;
378  std::cout << "rMax " << rMax << std::endl;
379  std::cout << "DeltaPhiMaxM2 " << DeltaPhiMaxM2 << std::endl;
380 #endif
381 
382  double tol_DeltaPhiMaxM2 = DeltaPhiMaxM2 * toleranceFactorOnDeltaPhiCuts;
383  double DeltaPhiManualM2M1 = DeltaPhiManual(M2, M1);
384 
385  if (DeltaPhiManualM2M1 > DeltaPhiMaxM2 + tol_DeltaPhiMaxM2 || DeltaPhiManualM2M1 < 0 - tol_DeltaPhiMaxM2) {
386  return nullptr;
387  }
388 
389  //Using the lazy solution for P2: DeltaPhiMaxP2=DeltaPhiMaxM2
390  double DeltaPhiManualP1P2 = DeltaPhiManual(P1, P2);
391  if (DeltaPhiManualP1P2 > DeltaPhiMaxM2 + tol_DeltaPhiMaxM2 || DeltaPhiManualP1P2 < 0 - tol_DeltaPhiMaxM2) {
392  return nullptr;
393  }
394  }
395  }
396 
397  // }
398 
399  // if(B.DeltaPhi(P1)<0){//different algo (without minPt circle)
400 
401  // }
402 
403  // End of pre-seed cleaning
404 
405  Conv4HitsReco2 quad(vPhotVertex, h1, h2, h3, h4);
406  quad.SetMaxNumberOfIterations(100);
407 #ifdef mydebug_sguazz
408  quad.Dump();
409 #endif
410  math::XYZVector candVtx;
411  double candPtPlus, candPtMinus;
412  //double rPlus, rMinus;
413  int nite = quad.ConversionCandidate(candVtx, candPtPlus, candPtMinus);
414 
415  if (!(nite && abs(nite) < 25 && nite != -1000 && nite != -2000))
416  return nullptr;
417 
418  // math::XYZVector plusCenter = quad.GetPlusCenter(rPlus);
419  // math::XYZVector minusCenter = quad.GetMinusCenter(rMinus);
420 
421 #ifdef mydebug_sguazz
422  std::cout << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
423  << "\n";
424  std::cout << " >>>>>>>>>>> Conv Cand: "
425  << " Vertex X: " << candVtx.X() << " [cm] Y: " << candVtx.Y() << " [cm] pt+: " << candPtPlus
426  << " [GeV] pt-: " << candPtMinus << " [GeV]; #its: " << nite << "\n";
427 #endif
428 
429  //Add here cuts
430  double minLegPt = CleaningMinLegPt;
431  double maxRadialDistance = CleaningmaxRadialDistance;
432 
433  //
434  // Cut on leg's transverse momenta
435  if (candPtPlus < minLegPt)
436  return nullptr;
437  if (candPtMinus < minLegPt)
438  return nullptr;
439  //
440  if (candPtPlus > maxLegPt)
441  return nullptr;
442  if (candPtMinus > maxLegPt)
443  return nullptr;
444  //
445  // Cut on radial distance between estimated conversion vertex and inner hits
446  double cr = std::sqrt(candVtx.Perp2());
447  double maxr2 = (maxRadialDistance + cr);
448  maxr2 *= maxr2;
449  if (h2.Perp2() > maxr2)
450  return nullptr;
451  if (h3.Perp2() > maxr2)
452  return nullptr;
453 
454  // At this point implement cleaning cuts after building the seed
455 
456  //ClusterShapeFilter_knuenz:::
458  es.get<IdealMagneticFieldRecord>().get(bfield);
459  float nomField = bfield->nominalValue();
460 
461  if (ClusterShapeFiltering) {
462  if (theComparitor)
463  theComparitor->init(ev, es);
464 
467 
468  // SeedingHitSet::ConstRecHitPointer ptth1 = phits[0]; // (never used???)
469  SeedingHitSet::ConstRecHitPointer ptth2 = phits[1];
470  SeedingHitSet::ConstRecHitPointer mtth1 = mhits[0];
471  SeedingHitSet::ConstRecHitPointer mtth2 = mhits[1];
472 
473  GlobalPoint vertexPos(candVtx.x(), candVtx.y(), candVtx.z());
474 
475  float ptMinReg = 0.1;
476  GlobalTrackingRegion region(ptMinReg, vertexPos, 0, 0, true);
477 
478  FastHelix phelix(ptth2->globalPosition(), mtth1->globalPosition(), vertexPos, nomField, &*bfield, vertexPos);
479  pkine = phelix.stateAtVertex();
480  FastHelix mhelix(mtth2->globalPosition(), mtth1->globalPosition(), vertexPos, nomField, &*bfield, vertexPos);
481  mkine = mhelix.stateAtVertex();
482 
483  if (theComparitor && !theComparitor->compatible(phits, pkine, phelix)) {
484  return nullptr;
485  }
486  if (theComparitor && !theComparitor->compatible(mhits, mkine, mhelix)) {
487  return nullptr;
488  }
489  }
490 
491  //Do a very simple fit to estimate the slope
492  double quadPhotCotTheta = 0.;
493  double quadZ0 = 0.;
494  simpleGetSlope(ptth2, ptth1, mtth1, mtth2, region, quadPhotCotTheta, quadZ0);
495 
496  double quadPhotPhi = (candVtx - vPhotVertex).Phi();
497 
498  math::XYZVector fittedPrimaryVertex(vgPhotVertex.x(), vgPhotVertex.y(), quadZ0);
499 
500  candVtx.SetZ(std::sqrt(candVtx.Perp2()) * quadPhotCotTheta + quadZ0);
501  GlobalPoint convVtxGlobalPoint(candVtx.X(), candVtx.Y(), candVtx.Z());
502 
503  //
504  // Comparing new quad with old quad
505  //
506  //Arbitration
507 
508  Quad thisQuad;
509  thisQuad.x = candVtx.X();
510  thisQuad.y = candVtx.Y();
511  thisQuad.z = candVtx.Z();
512  thisQuad.ptPlus = candPtPlus;
513  thisQuad.ptMinus = candPtMinus;
514  thisQuad.cot = quadPhotCotTheta;
515  if (similarQuadExist(thisQuad, quadV) && applyArbitration)
516  return nullptr;
517 
518  // not able to get the mag field... doing the dirty way
519  //
520  // Plus
521  FastHelix helixPlus(
522  ptth2->globalPosition(), ptth1->globalPosition(), convVtxGlobalPoint, nomField, &*bfield, convVtxGlobalPoint);
523  GlobalTrajectoryParameters kinePlus = helixPlus.stateAtVertex();
524  kinePlus = GlobalTrajectoryParameters(
525  convVtxGlobalPoint,
526  GlobalVector(candPtPlus * cos(quadPhotPhi), candPtPlus * sin(quadPhotPhi), candPtPlus * quadPhotCotTheta),
527  1, //1
528  &kinePlus.magneticField());
529 
530  //
531  // Minus
532  FastHelix helixMinus(
533  mtth2->globalPosition(), mtth1->globalPosition(), convVtxGlobalPoint, nomField, &*bfield, convVtxGlobalPoint);
534  GlobalTrajectoryParameters kineMinus = helixMinus.stateAtVertex();
535  kineMinus = GlobalTrajectoryParameters(
536  convVtxGlobalPoint,
537  GlobalVector(candPtMinus * cos(quadPhotPhi), candPtMinus * sin(quadPhotPhi), candPtMinus * quadPhotCotTheta),
538  -1, //-1
539  &kineMinus.magneticField());
540 
541  float sinThetaPlus = sin(kinePlus.momentum().theta());
542  float sinThetaMinus = sin(kineMinus.momentum().theta());
543  float ptmin = region.ptMin();
544  //vertexBounds da region
545  GlobalVector vertexBounds(region.originRBound(), region.originRBound(), region.originZBound());
546 
547  CurvilinearTrajectoryError errorPlus = initialError(vertexBounds, ptmin, sinThetaPlus);
548  CurvilinearTrajectoryError errorMinus = initialError(vertexBounds, ptmin, sinThetaMinus);
549  FreeTrajectoryState ftsPlus(kinePlus, errorPlus);
550  FreeTrajectoryState ftsMinus(kineMinus, errorMinus);
551 
552  //FIXME: here probably you want to go in parallel with phits and mhits
553  //NB: the seedCollection is filled (the important thing) the return of the last TrajectorySeed is not used, but is needed
554  //to maintain the inheritance
555 
556 #ifdef quadDispLine
557  double vError = region.originZBound();
558  if (vError > 15.)
559  vError = 1.;
560  std::cout << "QuadDispLine " << vgPhotVertex.x() << " " << vgPhotVertex.y() << " " << vgPhotVertex.z() << " "
561  << vError << " " << vHit[0].x() << " " << vHit[0].y() << " " << vHit[0].z() << " "
562  << sqrt(getSqrEffectiveErrorOnZ(ptth2, region)) << " " << vHit[1].x() << " " << vHit[1].y() << " "
563  << vHit[1].z() << " " << sqrt(getSqrEffectiveErrorOnZ(ptth1, region)) << " " << vHit[2].x() << " "
564  << vHit[2].y() << " " << vHit[2].z() << " " << sqrt(getSqrEffectiveErrorOnZ(mtth1, region)) << " "
565  << vHit[3].x() << " " << vHit[3].y() << " " << vHit[3].z() << " "
566  << sqrt(getSqrEffectiveErrorOnZ(mtth2, region)) << " " << candVtx.X() << " " << candVtx.Y() << " "
567  << candVtx.Z() << " " << fittedPrimaryVertex.X() << " " << fittedPrimaryVertex.Y() << " "
568  << fittedPrimaryVertex.Z()
569  << " "
570  // << candPtPlus << " " << rPlus << " " << plusCenter.X() << " " << plusCenter.Y() << " "
571  // << candPtMinus << " " << rMinus << " " << minusCenter.X() << " " << minusCenter.Y() << " "
572  << nite << " " << chi2 << "\n";
573 #endif
574 #ifdef mydebug_sguazz
575  std::cout << " >>>>> Hit quad fast reco done >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
576  << "\n";
577  uint32_t detid;
578  std::cout << "[SeedForPhotonConversionFromQuadruplets]\n ptth1 ";
579  detid = ptth1->geographicalId().rawId();
580  // po.print(std::cout , detid );
581  std::cout << " \t " << detid << " " << ptth1->localPosition() << " " << ptth1->globalPosition();
582  detid = ptth2->geographicalId().rawId();
583  std::cout << " \n\t ptth2 ";
584  // po.print(std::cout , detid );
585  std::cout << " \t " << detid << " " << ptth2->localPosition() << " " << ptth2->globalPosition() << "\nhelix momentum "
586  << kinePlus.momentum() << " pt " << kinePlus.momentum().perp() << " radius "
587  << 1 / kinePlus.transverseCurvature() << " q " << kinePlus.charge();
588  std::cout << " \n\t mtth1 ";
589  detid = mtth1->geographicalId().rawId();
590  std::cout << " \t " << detid << " " << mtth1->localPosition() << " " << mtth1->globalPosition();
591  std::cout << " \n\t mtth2 ";
592  detid = mtth2->geographicalId().rawId();
593  // po.print(std::cout , detid );
594  std::cout << " \t " << detid << " " << mtth2->localPosition() << " " << mtth2->globalPosition() << "\nhelix momentum "
595  << kineMinus.momentum() << " pt " << kineMinus.momentum().perp() << " radius "
596  << 1 / kineMinus.transverseCurvature() << " q " << kineMinus.charge();
597  std::cout << "\n <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
598  << "\n";
599 #endif
600 
601  // get cloner (FIXME: add to config)
602  auto TTRHBuilder = "WithTrackAngle";
604  es.get<TransientRecHitRecord>().get(TTRHBuilder, builderH);
605  auto builder = (TkTransientTrackingRecHitBuilder const*)(builderH.product());
606  cloner = (*builder).cloner();
607 
608  bool buildSeedBoolPos = buildSeedBool(seedCollection, phits, ftsPlus, es, applydzCAcut, region, dzcut);
609  bool buildSeedBoolNeg = buildSeedBool(seedCollection, mhits, ftsMinus, es, applydzCAcut, region, dzcut);
610 
611  if (buildSeedBoolPos && buildSeedBoolNeg) {
612  buildSeed(seedCollection, phits, ftsPlus, es, false, region);
613  buildSeed(seedCollection, mhits, ftsMinus, es, false, region);
614  }
615 
616  return nullptr;
617 }
618 
620  const GlobalPoint& vertexPos,
621  const edm::EventSetup& es,
622  const float cotTheta) const {
624 
625  SeedingHitSet::ConstRecHitPointer tth1 = hits[0];
626  SeedingHitSet::ConstRecHitPointer tth2 = hits[1];
627 
629  es.get<IdealMagneticFieldRecord>().get(bfield);
630  float nomField = bfield->nominalValue();
631  bool isBOFF = (0 == nomField);
632 
633  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, nomField, &*bfield, vertexPos);
634  kine = helix.stateAtVertex();
635 
636  //force the pz/pt equal to the measured one
637  if (fabs(cotTheta) < cotTheta_Max)
639  kine.position(),
640  GlobalVector(kine.momentum().x(), kine.momentum().y(), kine.momentum().perp() * cotTheta),
641  kine.charge(),
642  &kine.magneticField());
643  else
645  kine.position(),
646  GlobalVector(kine.momentum().x(), kine.momentum().y(), kine.momentum().perp() * cotTheta_Max),
647  kine.charge(),
648  &kine.magneticField());
649 
650 #ifdef mydebug_seed
651  uint32_t detid;
652  (*pss) << "[SeedForPhotonConversionFromQuadruplets] initialKinematic tth1 ";
653  detid = tth1->geographicalId().rawId();
654  po.print(*pss, detid);
655  (*pss) << " \t " << detid << " " << tth1->localPosition() << " " << tth1->globalPosition();
656  detid = tth2->geographicalId().rawId();
657  (*pss) << " \n\t tth2 ";
658  po.print(*pss, detid);
659  (*pss) << " \t " << detid << " " << tth2->localPosition() << " " << tth2->globalPosition() << "\nhelix momentum "
660  << kine.momentum() << " pt " << kine.momentum().perp() << " radius " << 1 / kine.transverseCurvature();
661 #endif
662 
663  if (isBOFF && (theBOFFMomentum > 0)) {
664  kine =
665  GlobalTrajectoryParameters(kine.position(), kine.momentum().unit() * theBOFFMomentum, kine.charge(), &*bfield);
666  }
667  return kine;
668 }
669 
671  float ptMin,
672  float sinTheta) const {
673  // Set initial uncertainty on track parameters, using only P.V. constraint and no hit
674  // information.
675  GlobalError vertexErr(sqr(vertexBounds.x()), 0, sqr(vertexBounds.y()), 0, 0, sqr(vertexBounds.z()));
676 
677  AlgebraicSymMatrix55 C = ROOT::Math::SMatrixIdentity();
678 
679  // FIXME: minC00. Prevent apriori uncertainty in 1/P from being too small,
680  // to avoid instabilities.
681  // N.B. This parameter needs optimising ...
682  float sin2th = sqr(sinTheta);
683  float minC00 = 1.0;
684  C[0][0] = std::max(sin2th / sqr(ptMin), minC00);
685  float zErr = vertexErr.czz();
686  float transverseErr = vertexErr.cxx(); // assume equal cxx cyy
687  C[3][3] = transverseErr;
688  C[4][4] = zErr * sin2th + transverseErr * (1 - sin2th);
689 
690  return CurvilinearTrajectoryError(C);
691 }
692 
694  const SeedingHitSet& hits,
695  const FreeTrajectoryState& fts,
696  const edm::EventSetup& es,
697  bool apply_dzCut,
698  const TrackingRegion& region) const {
699  // get tracker
701  es.get<TrackerDigiGeometryRecord>().get(tracker);
702 
703  // get propagator
704  edm::ESHandle<Propagator> propagatorHandle;
705  es.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagatorHandle);
706  const Propagator* propagator = &(*propagatorHandle);
707 
708  // get updator
710 
711  // Now update initial state track using information from seed hits.
712 
715 
716  const TrackingRecHit* hit = nullptr;
717  for (unsigned int iHit = 0; iHit < hits.size() && iHit < 2; iHit++) {
718  hit = hits[iHit];
720  (iHit == 0) ? propagator->propagate(fts, tracker->idToDet(hit->geographicalId())->surface())
721  : propagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
722 
723  SeedingHitSet::ConstRecHitPointer tth = hits[iHit];
724 
725  SeedingHitSet::RecHitPointer newtth = refitHit(tth, state);
726 
727  updatedState = updator.update(state, *newtth);
728 
729  seedHits.push_back(newtth);
730 #ifdef mydebug_seed
731  uint32_t detid = hit->geographicalId().rawId();
732  (*pss) << "\n[SeedForPhotonConversionFromQuadruplets] hit " << iHit;
733  po.print(*pss, detid);
734  (*pss) << " " << detid << "\t lp " << hit->localPosition() << " tth " << tth->localPosition() << " newtth "
735  << newtth->localPosition() << " state " << state.globalMomentum().perp();
736 #endif
737  }
738 
739  if (!hit)
740  return nullptr;
741 
742  PTrajectoryStateOnDet const& PTraj =
744 
745  seedCollection.push_back(TrajectorySeed(PTraj, seedHits, alongMomentum));
746  return &seedCollection.back();
747 }
748 
750  const SeedingHitSet& hits,
751  const FreeTrajectoryState& fts,
752  const edm::EventSetup& es,
753  bool apply_dzCut,
754  const TrackingRegion& region,
755  double dzcut) const {
756  // get tracker
758  es.get<TrackerDigiGeometryRecord>().get(tracker);
759 
760  // get propagator
761  edm::ESHandle<Propagator> propagatorHandle;
762  es.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagatorHandle);
763  const Propagator* propagator = &(*propagatorHandle);
764 
765  // get updator
767 
768  // Now update initial state track using information from seed hits.
769 
772 
773  const TrackingRecHit* hit = nullptr;
774  for (unsigned int iHit = 0; iHit < hits.size() && iHit < 2; iHit++) {
775  hit = hits[iHit]->hit();
777  (iHit == 0) ? propagator->propagate(fts, tracker->idToDet(hit->geographicalId())->surface())
778  : propagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
779  if (!state.isValid()) {
780  return false;
781  }
782 
783  SeedingHitSet::ConstRecHitPointer tth = hits[iHit];
784 
785  SeedingHitSet::RecHitPointer newtth = refitHit(tth, state);
786 
787  if (!checkHit(state, newtth, es)) {
788  return false;
789  }
790 
791  updatedState = updator.update(state, *newtth);
792  if (!updatedState.isValid()) {
793  return false;
794  }
795 
796  seedHits.push_back(newtth->hit()->clone());
797  }
798 
799  if (apply_dzCut) {
801 
802  double zCA;
803 
804  math::XYZVector EstMomGam(
805  updatedState.globalMomentum().x(), updatedState.globalMomentum().y(), updatedState.globalMomentum().z());
806  math::XYZVector EstPosGam(
807  updatedState.globalPosition().x(), updatedState.globalPosition().y(), updatedState.globalPosition().z());
808 
809  double EstMomGamLength =
810  std::sqrt(EstMomGam.x() * EstMomGam.x() + EstMomGam.y() * EstMomGam.y() + EstMomGam.z() * EstMomGam.z());
811  math::XYZVector EstMomGamNorm(
812  EstMomGam.x() / EstMomGamLength, EstMomGam.y() / EstMomGamLength, EstMomGam.z() / EstMomGamLength);
813 
814  //Calculate dz of point of closest approach of the two lines (WA approach) -> cut on dz
815 
816  const GlobalPoint EstPosGamGlobalPoint(
817  updatedState.globalPosition().x(), updatedState.globalPosition().y(), updatedState.globalPosition().z());
818  const GlobalVector EstMomGamGlobalVector(
819  updatedState.globalMomentum().x(), updatedState.globalMomentum().y(), updatedState.globalMomentum().z());
820 
822  es.get<IdealMagneticFieldRecord>().get(bfield);
823  const MagneticField* magField = bfield.product();
824  TrackCharge qCharge = 0;
825 
826  const GlobalTrajectoryParameters myGlobalTrajectoryParameter(
827  EstPosGamGlobalPoint, EstMomGamGlobalVector, qCharge, magField);
828 
829  AlgebraicSymMatrix66 aCovarianceMatrix;
830 
831  for (int i = 0; i < 6; ++i)
832  for (int j = 0; j < 6; ++j)
833  aCovarianceMatrix(i, j) = 1e-4;
834 
835  CartesianTrajectoryError myCartesianError(aCovarianceMatrix);
836 
837  const FreeTrajectoryState stateForProjectionToBeamLine(myGlobalTrajectoryParameter, myCartesianError);
838 
839  const GlobalPoint BeamSpotGlobalPoint(0, 0, 0);
840 
841  const reco::BeamSpot::Point BeamSpotPoint(region.origin().x(), region.origin().y(), region.origin().z());
842 
843  TSCBLBuilderNoMaterial tscblBuilder;
844 
845  double CovMatEntry = 0.;
847  for (int i = 0; i < 3; ++i) {
848  cov(i, i) = CovMatEntry;
849  }
851 
852  reco::BeamSpot myBeamSpot(BeamSpotPoint, 0., 0., 0., 0., cov, BeamType_);
853 
854  TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(stateForProjectionToBeamLine, myBeamSpot);
855  if (tscbl.isValid() == false) {
856  zCA = 0;
857  } else {
858  GlobalPoint v = tscbl.trackStateAtPCA().position(); // Position of closest approach to BS
859  zCA = v.z();
860  }
861 
862  /* //Calculate dz of point of closest approach of the two lines -> cut on dz
863 
864  double newX,newY,newR;
865  double Rbuff=std::sqrt(EstPosGam.x()*EstPosGam.x()+EstPosGam.y()*EstPosGam.y());
866  double deltas,s,sbuff;
867  double rMin=1e9;
868 
869  double InitXp=EstPosGam.x()+1*EstMomGamNorm.x();
870  double InitXm=EstPosGam.x()-1*EstMomGamNorm.x();
871  double InitYp=EstPosGam.y()+1*EstMomGamNorm.y();
872  double InitYm=EstPosGam.y()-1*EstMomGamNorm.y();
873 
874  if(InitXp*InitXp+InitYp*InitYp < InitXm*InitXm+InitYm*InitYm) {s=5; deltas=5;}
875  else {s=-5; deltas=-5;}
876 
877  int nTurns=0;
878  int nIterZ=0;
879  for (int i_dz=0;i_dz<1000;i_dz++){
880  newX=EstPosGam.x()+s*EstMomGamNorm.x();
881  newY=EstPosGam.y()+s*EstMomGamNorm.y();
882  newR=std::sqrt(newX*newX+newY*newY);
883  if(newR>Rbuff) {deltas=-1*deltas/10;nTurns++;}
884  else {Rbuff=newR;}
885  if(newR<rMin) {rMin=newR; sbuff=s;}
886  s=s+deltas;
887  nIterZ++;
888  if(nTurns>1) break;
889  }
890 
891  zCA=EstPosGam.z()+sbuff*EstMomGamNorm.z();
892 */
893 
894 #ifdef mydebug_knuenz
895  std::cout << "zCA: " << zCA << std::endl;
896 #endif
897 
898  if (std::fabs(zCA) > dzcut)
899  return false;
900  }
901 
902  return true;
903 }
904 
907  //const TransientTrackingRecHit* a= hit.get();
908  //return const_cast<TransientTrackingRecHit*> (a);
909  //This was modified otherwise the rechit will have just the local x component and local y=0
910  // To understand how to modify for pixels
911 
912  //const TSiStripRecHit2DLocalPos* b = dynamic_cast<const TSiStripRecHit2DLocalPos*>(a);
913  //return const_cast<TSiStripRecHit2DLocalPos*>(b);
914  return (SeedingHitSet::RecHitPointer)(cloner(*hit, state));
915 }
916 
917 //
918 // Below: stupid utils method by sguazz
919 //
920 //
922  (*pss) << "\n" << s << "\t";
923  for (size_t i = 0; i < 2; ++i)
924  (*pss) << std::setw(60) << d[i] << std::setw(1) << " | ";
925 }
926 
928  (*pss) << "\n" << s << "\t";
929  for (size_t i = 0; i < 2; ++i)
930  (*pss) << std::setw(60) << d[i] << std::setw(1) << " | ";
931 }
932 
934  (*pss) << "\n" << s << "\t";
935  for (size_t i = 0; i < 2; ++i)
936  (*pss) << std::setw(20) << d[i] << " r " << d[i].perp() << " phi " << d[i].phi() << " | ";
937 }
938 
940  (*pss) << "\n" << s << "\n";
941  for (int i = 0; i < n; ++i)
942  (*pss) << std::setw(20) << d[i] << " r " << d[i].perp() << " phi " << d[i].phi() << "\n";
943 }
944 
946 
948  bool swapped = true;
949  int j = 0;
951  while (swapped) {
952  swapped = false;
953  j++;
954  for (int i = 0; i < n - j; i++) {
955  if (reco::deltaPhi((arr[i] - vtx).barePhi(), (arr[i + 1] - vtx).barePhi()) > 0.) {
956  tmp = arr[i];
957  arr[i] = arr[i + 1];
958  arr[i + 1] = tmp;
959  swapped = true;
960  }
961  }
962  }
963 }
964 
966  bool swapped = true;
967  int j = 0;
969  while (swapped) {
970  swapped = false;
971  j++;
972  for (int i = 0; i < n - j; i++) {
973  if (reco::deltaPhi((arr[i] - vtx).barePhi(), (arr[i + 1] - vtx).barePhi()) < 0.) {
974  tmp = arr[i];
975  arr[i] = arr[i + 1];
976  arr[i + 1] = tmp;
977  swapped = true;
978  }
979  }
980  }
981 }
982 
987  const TrackingRegion& region,
988  double& cotTheta,
989  double& z0) {
990  double x[5], y[5], e2y[5];
991 
992  //The fit is done filling x with r values, y with z values of the four hits and the vertex
993  //
994  //Hits
995  x[0] = ohit->globalPosition().perp();
996  y[0] = ohit->globalPosition().z();
997  e2y[0] = getSqrEffectiveErrorOnZ(ohit, region);
998  //
999  x[1] = nohit->globalPosition().perp();
1000  y[1] = nohit->globalPosition().z();
1001  e2y[1] = getSqrEffectiveErrorOnZ(nohit, region);
1002  //
1003  x[2] = nihit->globalPosition().perp();
1004  y[2] = nihit->globalPosition().z();
1005  e2y[2] = getSqrEffectiveErrorOnZ(nihit, region);
1006  //
1007  x[3] = ihit->globalPosition().perp();
1008  y[3] = ihit->globalPosition().z();
1009  e2y[3] = getSqrEffectiveErrorOnZ(ihit, region);
1010  //
1011  //Vertex
1012  x[4] = region.origin().perp();
1013  y[4] = region.origin().z();
1014  double vError = region.originZBound();
1015  if (vError > 15.)
1016  vError = 1.;
1017  e2y[4] = sqr(vError);
1018 
1019  double e2z0;
1020  double chi2 = verySimpleFit(5, x, y, e2y, z0, e2z0, cotTheta);
1021 
1022  return chi2;
1023 }
1024 
1026  int size, double* ax, double* ay, double* e2y, double& p0, double& e2p0, double& p1) {
1027  //#include "verySimpleFit.icc"
1028  return 0;
1029 }
1030 
1032  const TrackingRegion& region) {
1033  //
1034  //Fit-wise the effective error on Z is the sum in quadrature of the error on Z
1035  //and the error on R correctly projected by using hit-vertex direction
1036 
1037  double sqrProjFactor =
1038  sqr((hit->globalPosition().z() - region.origin().z()) / (hit->globalPosition().perp() - region.origin().perp()));
1039  return (hit->globalPositionError().czz() + sqrProjFactor * hit->globalPositionError().rerr(hit->globalPosition()));
1040 }
1041 
1042 bool SeedForPhotonConversionFromQuadruplets::similarQuadExist(Quad& thisQuad, std::vector<Quad>& quadV) {
1043  for (auto const& quad : quadV) {
1044  double dx = thisQuad.x - quad.x;
1045  double dy = thisQuad.y - quad.y;
1046  //double dz = abs(thisQuad.z-quad.z);
1047  //std::cout<<"thisQuad.x="<<thisQuad.x<<" "<<"quad.x="<<quad.x<<" "<<"thisQuad.y="<<thisQuad.y<<" "<<"quad.y="<<quad.y<<" "<<"thisQuad.z"<<thisQuad.z<<" "<<"quad.z="<<quad.z<<" "<<"thisQuad.ptPlus"<<thisQuad.ptPlus<<" "<<"quad.ptPlus="<<quad.ptPlus<<" "<<"thisQuad.ptMinus="<<thisQuad.ptMinus<<" "<<"quad.ptMinus="<<quad.ptMinus<<" "<<"thisQuad.cot="<<thisQuad.cot<<" "<<"quad.cot="<<quad.cot<<std::endl; //ValDebug
1048  //std::cout<<"x1-x2="<<dx<<"y1-y2="<<dy<<"dx*dx+dy*dy="<<dx*dx+dy*dy<<std::endl; //ValDebug
1049  //std::cout<<"thisQuad.ptPlus-quad.ptPlus="<<thisQuad.ptPlus-quad.ptPlus<<"abs(thisQuad.ptPlus-quad.ptPlus)="<<abs(thisQuad.ptPlus-quad.ptPlus)<<std::endl; //ValDebug
1050  //std::cout <<sqrt(dx*dx+dy*dy)<<" <1? "<<dz<<" <3? "<<abs(thisQuad.ptPlus-quad.ptPlus)<<" <0.5? "<<abs(thisQuad.ptMinus-quad.ptMinus)<<" <0.5? "<<abs(thisQuad.cot-quad.cot)<<" <0.3? "<<std::endl; //ValDebug
1051  //if ( sqrt(dx*dx+dy*dy)<1.)
1052  // std::cout <<sqrt(dx*dx+dy*dy)<<" <1? "<<dz<<" <3? "<<abs(thisQuad.ptPlus-quad.ptPlus)<<" <"<<0.5*quad.ptPlus<<"? "<<abs(thisQuad.ptMinus-quad.ptMinus)<<" <"<<0.5*quad.ptMinus<<"? "<<abs(thisQuad.cot-quad.cot)<<" <"<<0.3*quad.cot<<"? "<<std::endl; //ValDebug
1053  // ( sqrt(dx*dx+dy*dy)<1. &&
1054  //z<3. &&
1055  //bs(thisQuad.ptPlus-quad.ptPlus)<0.5*quad.ptPlus &&
1056  //bs(thisQuad.ptMinus-quad.ptMinus)<0.5*quad.ptMinus &&
1057  //bs(thisQuad.cot-quad.cot)<0.3*quad.cot
1058  //
1059  // {
1060  // //std::cout<<"Seed rejected due to arbitration"<<std::endl;
1061  // return true;
1062  // }
1063  if (sqrt(dx * dx + dy * dy) < 1. && fabs(thisQuad.ptPlus - quad.ptPlus) < 0.5 * quad.ptPlus &&
1064  fabs(thisQuad.ptMinus - quad.ptMinus) < 0.5 * quad.ptMinus) {
1065  //std::cout<<"Seed rejected due to arbitration"<<std::endl;
1066  return true;
1067  }
1068  }
1069  quadV.push_back(thisQuad);
1070  return false;
1071 }
1072 
1074  double kTWOPI = 2. * kPI_;
1075  double DeltaPhiMan = v1.Phi() - v2.Phi();
1076  while (DeltaPhiMan >= kPI_)
1077  DeltaPhiMan -= kTWOPI;
1078  while (DeltaPhiMan < -kPI_)
1079  DeltaPhiMan += kTWOPI;
1080 
1081  return DeltaPhiMan;
1082 }
size
Write out results.
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
float originRBound() const
bounds the particle vertex in the transverse plane
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
T getParameter(std::string const &) const
T barePhi() const
BeamType
beam spot flags
Definition: BeamSpot.h:24
CurvilinearTrajectoryError initialError(const GlobalVector &vertexBounds, float ptMin, float sinTheta) const
const TrajectorySeed * trajectorySeed(TrajectorySeedCollection &seedCollection, const SeedingHitSet &phits, const SeedingHitSet &mhits, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es, std::stringstream &ss, std::vector< Quad > &quadV, edm::ParameterSet &QuadCutPSet)
bool buildSeedBool(TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es, bool apply_dzCut, const TrackingRegion &region, double dzcut) const
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:25
T perp() const
Definition: PV3DBase.h:69
GlobalPoint const & origin() const
double DeltaPhiManual(const math::XYZVector &v1, const math::XYZVector &v2)
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
void bubbleReverseSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx)
double ptMinus
Definition: Quad.h:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
bool ev
double ptPlus
Definition: Quad.h:8
void bubbleSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx)
int ConversionCandidate(math::XYZVector &, double &, double &)
int TrackCharge
Definition: TrackCharge.h:4
void push_back(D *&d)
Definition: OwnVector.h:326
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:177
double simpleGetSlope(const SeedingHitSet::ConstRecHitPointer &ohit, const SeedingHitSet::ConstRecHitPointer &nohit, const SeedingHitSet::ConstRecHitPointer &ihit, const SeedingHitSet::ConstRecHitPointer &nihit, const TrackingRegion &region, double &cotTheta, double &z0)
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
GlobalTrajectoryParameters initialKinematic(const SeedingHitSet &hits, const GlobalPoint &vertexPos, const edm::EventSetup &es, const float cotTheta) const
double verySimpleFit(int size, double *ax, double *ay, double *e2y, double &p0, double &e2p0, double &p1)
std::vector< TrajectorySeed > TrajectorySeedCollection
void SetMaxNumberOfIterations(int val)
double x
Definition: Quad.h:5
T sqrt(T t)
Definition: SSEVec.h:19
BaseTrackerRecHit const * hit() const final
T z() const
Definition: PV3DBase.h:61
virtual TrackingRecHit * clone() const =0
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void print(std::stringstream &ss, const SiStripCluster &clus)
bool checkHit(const TrajectoryStateOnSurface &, const SeedingHitSet::ConstRecHitPointer &hit, const edm::EventSetup &es) const
static const std::string B
virtual LocalPoint localPosition() const =0
d
Definition: ztail.py:151
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const TrajectorySeed * buildSeed(TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es, bool apply_dzCut, const TrackingRegion &region) const
float originZBound() const
bounds the particle vertex in the longitudinal plane
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Vector3DBase unit() const
Definition: Vector3DBase.h:54
GlobalPoint position() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
float ptMin() const
minimal pt of interest
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
double y
Definition: Quad.h:6
double ptmin
Definition: HydjetWrapper.h:84
double p1[4]
Definition: TauolaWrapper.h:89
GlobalVector globalMomentum() const
double getSqrEffectiveErrorOnZ(const SeedingHitSet::ConstRecHitPointer &hit, const TrackingRegion &region)
T get() const
Definition: EventSetup.h:73
bool similarQuadExist(Quad &thisQuad, std::vector< Quad > &quadV)
unsigned int size() const
Definition: SeedingHitSet.h:41
const TrackerGeomDet * idToDet(DetId) const override
LocalPoint localPosition() const final
const MagneticField & magneticField() const
DetId geographicalId() const
SeedingHitSet::RecHitPointer refitHit(SeedingHitSet::ConstRecHitPointer hit, const TrajectoryStateOnSurface &state) const
Definition: Quad.h:4
tmp
align.sh
Definition: createJobs.py:716
long double T
T x() const
Definition: PV3DBase.h:59
T const * product() const
Definition: ESHandle.h:86
Global3DVector GlobalVector
Definition: GlobalVector.h:10
SeedForPhotonConversionFromQuadruplets(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC, const edm::ParameterSet &SeedComparitorPSet)