CMS 3D CMS Logo

List of all members | Public Member Functions
TotemTimingTrackRecognition Class Reference

#include <TotemTimingTrackRecognition.h>

Inheritance diagram for TotemTimingTrackRecognition:
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >

Public Member Functions

void addHit (const TotemTimingRecHit &recHit) override
 Add new hit to the set from which the tracks are reconstructed. More...
 
int produceTracks (edm::DetSet< TotemTimingLocalTrack > &tracks) override
 Produces a collection of tracks for the current station, given its hits collection. More...
 
 TotemTimingTrackRecognition (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >
virtual void clear ()
 Reset internal state of a class instance. More...
 
 CTPPSTimingTrackRecognition (const edm::ParameterSet &iConfig)
 
virtual ~CTPPSTimingTrackRecognition ()=default
 

Additional Inherited Members

- Protected Types inherited from CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >
typedef std::vector< TotemTimingRecHitHitVector
 
typedef std::unordered_map< int, HitVectorHitVectorMap
 
typedef std::vector< TotemTimingLocalTrackTrackVector
 
- Protected Member Functions inherited from CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >
SpatialRange getHitSpatialRange (const HitVector &hits)
 
void producePartialTracks (const HitVector &hits, const DimensionParameters &param, float(*getHitCenter)(const TotemTimingRecHit &), float(*getHitRangeWidth)(const TotemTimingRecHit &), void(*setTrackCenter)(TotemTimingLocalTrack &, float), void(*setTrackSigma)(TotemTimingLocalTrack &, float), TrackVector &result)
 
bool timeEval (const HitVector &hits, float &meanTime, float &timeSigma) const
 
- Protected Attributes inherited from CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >
HitVectorMap hitVectorMap_
 RecHit vectors that should be processed separately while reconstructing tracks. More...
 
reco::FormulaEvaluator pixelEfficiencyFunction_
 
const float resolution_
 
const float sigma_
 
const float threshold_
 
const float thresholdFromMaximum_
 
const float tolerance_
 

Detailed Description

Class intended to perform general CTPPS timing detectors track recognition, as well as construction of specialized classes (for now CTPPSDiamond and TotemTiming local tracks).

Definition at line 23 of file TotemTimingTrackRecognition.h.

Constructor & Destructor Documentation

◆ TotemTimingTrackRecognition()

TotemTimingTrackRecognition::TotemTimingTrackRecognition ( const edm::ParameterSet iConfig)

Member Function Documentation

◆ addHit()

void TotemTimingTrackRecognition::addHit ( const TotemTimingRecHit recHit)
overridevirtual

◆ produceTracks()

int TotemTimingTrackRecognition::produceTracks ( edm::DetSet< TotemTimingLocalTrack > &  tracks)
overridevirtual

Produces a collection of tracks for the current station, given its hits collection.

Implements CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >.

Definition at line 26 of file TotemTimingTrackRecognition.cc.

27  {
28  int numberOfTracks = 0;
29  DimensionParameters param;
30 
31  auto getX = [](const TotemTimingRecHit& hit) { return hit.x(); };
32  auto getXWidth = [](const TotemTimingRecHit& hit) { return hit.xWidth(); };
33  auto setX = [](TotemTimingLocalTrack& track, float x) { track.setPosition(math::XYZPoint(x, 0., 0.)); };
34  auto setXSigma = [](TotemTimingLocalTrack& track, float sigma) {
35  track.setPositionSigma(math::XYZPoint(sigma, 0., 0.));
36  };
37  auto getY = [](const TotemTimingRecHit& hit) { return hit.y(); };
38  auto getYWidth = [](const TotemTimingRecHit& hit) { return hit.yWidth(); };
39  auto setY = [](TotemTimingLocalTrack& track, float y) { track.setPosition(math::XYZPoint(0., y, 0.)); };
40  auto setYSigma = [](TotemTimingLocalTrack& track, float sigma) {
41  track.setPositionSigma(math::XYZPoint(0., sigma, 0.));
42  };
43 
44  for (const auto& hitBatch : hitVectorMap_) {
45  const auto& hits = hitBatch.second;
46  const auto& hitRange = getHitSpatialRange(hits);
47 
48  TrackVector xPartTracks, yPartTracks;
49 
50  param.rangeBegin = hitRange.xBegin;
51  param.rangeEnd = hitRange.xEnd;
52  producePartialTracks(hits, param, getX, getXWidth, setX, setXSigma, xPartTracks);
53 
54  param.rangeBegin = hitRange.yBegin;
55  param.rangeEnd = hitRange.yEnd;
56  producePartialTracks(hits, param, getY, getYWidth, setY, setYSigma, yPartTracks);
57 
58  if (xPartTracks.empty() && yPartTracks.empty())
59  continue;
60 
61  unsigned int validHitsNumber = (unsigned int)threshold_ + 1;
62 
63  for (const auto& xTrack : xPartTracks) {
64  for (const auto& yTrack : yPartTracks) {
65  math::XYZPoint position(xTrack.x0(), yTrack.y0(), 0.5f * (hitRange.zBegin + hitRange.zEnd));
66  math::XYZPoint positionSigma(xTrack.x0Sigma(), yTrack.y0Sigma(), 0.5f * (hitRange.zEnd - hitRange.zBegin));
67 
68  TotemTimingLocalTrack newTrack(position, positionSigma, 0., 0.);
69 
70  HitVector componentHits;
71  for (const auto& hit : hits)
72  if (newTrack.containsHit(hit, tolerance_))
73  componentHits.emplace_back(hit);
74  if (componentHits.size() < validHitsNumber)
75  continue;
76 
77  float mean_time = 0.f, time_sigma = 0.f;
78  bool valid_hits = timeEval(componentHits, mean_time, time_sigma);
79  newTrack.setValid(valid_hits);
80  newTrack.setTime(mean_time);
81  newTrack.setTimeSigma(time_sigma);
82  // in a next iteration, we will be setting validity / numHits / numPlanes
83  tracks.push_back(newTrack);
84  }
85  }
86  }
87 
88  return numberOfTracks;

References CTPPSTimingLocalTrack::containsHit(), CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::getHitSpatialRange(), hfClusterShapes_cfi::hits, CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::hitVectorMap_, createfilelist::int, position, CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::producePartialTracks(), CTPPSTimingLocalTrack::setTime(), CTPPSTimingLocalTrack::setTimeSigma(), CTPPSTimingLocalTrack::setValid(), CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::threshold_, CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::timeEval(), CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::tolerance_, HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, x, hit::x, y, and hit::y.

DDAxes::y
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >
DDAxes::x
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::HitVector
std::vector< TotemTimingRecHit > HitVector
Definition: CTPPSTimingTrackRecognition.h:72
TotemTimingLocalTrack
Definition: TotemTimingLocalTrack.h:16
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::getHitSpatialRange
SpatialRange getHitSpatialRange(const HitVector &hits)
Definition: CTPPSTimingTrackRecognition.h:196
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::tolerance_
const float tolerance_
Definition: CTPPSTimingTrackRecognition.h:68
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::timeEval
bool timeEval(const HitVector &hits, float &meanTime, float &timeSigma) const
Definition: CTPPSTimingTrackRecognition.h:227
TotemTimingRecHit
Definition: TotemTimingRecHit.h:16
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::producePartialTracks
void producePartialTracks(const HitVector &hits, const DimensionParameters &param, float(*getHitCenter)(const TotemTimingRecHit &), float(*getHitRangeWidth)(const TotemTimingRecHit &), void(*setTrackCenter)(TotemTimingLocalTrack &, float), void(*setTrackSigma)(TotemTimingLocalTrack &, float), TrackVector &result)
Definition: CTPPSTimingTrackRecognition.h:117
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
createfilelist.int
int
Definition: createfilelist.py:10
TotemTimingRecHit::NO_T_AVAILABLE
Definition: TotemTimingRecHit.h:25
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::TrackVector
std::vector< TotemTimingLocalTrack > TrackVector
Definition: CTPPSTimingTrackRecognition.h:71
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::threshold_
const float threshold_
Definition: CTPPSTimingTrackRecognition.h:64
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
CTPPSTimingTrackRecognition< TotemTimingLocalTrack, TotemTimingRecHit >::hitVectorMap_
HitVectorMap hitVectorMap_
RecHit vectors that should be processed separately while reconstructing tracks.
Definition: CTPPSTimingTrackRecognition.h:76
hit
Definition: SiStripHitEffFromCalibTree.cc:88