CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CTPPSDiamondTrackRecognition Class Reference

Class performing smart reconstruction for PPS Diamond Detectors. More...

#include <CTPPSDiamondTrackRecognition.h>

Inheritance diagram for CTPPSDiamondTrackRecognition:
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >

Public Member Functions

void addHit (const CTPPSDiamondRecHit &recHit) override
 Feed a new hit to the tracks recognition algorithm. More...
 
void clear () override
 Reset internal state of a class instance. More...
 
 CTPPSDiamondTrackRecognition (const edm::ParameterSet &iConfig)
 
int produceTracks (edm::DetSet< CTPPSDiamondLocalTrack > &tracks) override
 Produce a collection of tracks for the current station, given its hits collection. More...
 
- Public Member Functions inherited from CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >
 CTPPSTimingTrackRecognition (const edm::ParameterSet &iConfig)
 
virtual ~CTPPSTimingTrackRecognition ()=default
 

Private Attributes

bool excludeSingleEdgeHits_
 
std::unordered_map< int, int > mhMap_
 

Additional Inherited Members

- Protected Types inherited from CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >
typedef std::vector< CTPPSDiamondRecHitHitVector
 
typedef std::unordered_map< int, HitVectorHitVectorMap
 
typedef std::vector< CTPPSDiamondLocalTrackTrackVector
 
- Protected Member Functions inherited from CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >
SpatialRange getHitSpatialRange (const HitVector &hits)
 
void producePartialTracks (const HitVector &hits, const DimensionParameters &param, float(*getHitCenter)(const CTPPSDiamondRecHit &), float(*getHitRangeWidth)(const CTPPSDiamondRecHit &), void(*setTrackCenter)(CTPPSDiamondLocalTrack &, float), void(*setTrackSigma)(CTPPSDiamondLocalTrack &, float), TrackVector &result)
 
bool timeEval (const HitVector &hits, float &meanTime, float &timeSigma) const
 
- Protected Attributes inherited from CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >
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 performing smart reconstruction for PPS Diamond Detectors.

Date
Jan 2017

Definition at line 26 of file CTPPSDiamondTrackRecognition.h.

Constructor & Destructor Documentation

◆ CTPPSDiamondTrackRecognition()

CTPPSDiamondTrackRecognition::CTPPSDiamondTrackRecognition ( const edm::ParameterSet iConfig)

Member Function Documentation

◆ addHit()

void CTPPSDiamondTrackRecognition::addHit ( const CTPPSDiamondRecHit recHit)
overridevirtual

Feed a new hit to the tracks recognition algorithm.

Implements CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >.

Definition at line 27 of file CTPPSDiamondTrackRecognition.cc.

28  {
29  if (excludeSingleEdgeHits_ && recHit.toT() <= 0.)
30  return;
31  // store hit parameters
32  hitVectorMap_[recHit.ootIndex()].emplace_back(recHit);

References excludeSingleEdgeHits_, CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::hitVectorMap_, and rpcPointValidation_cfi::recHit.

◆ clear()

void CTPPSDiamondTrackRecognition::clear ( void  )
overridevirtual

◆ produceTracks()

int CTPPSDiamondTrackRecognition::produceTracks ( edm::DetSet< CTPPSDiamondLocalTrack > &  tracks)
overridevirtual

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

Implements CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >.

Definition at line 36 of file CTPPSDiamondTrackRecognition.cc.

37  {
38  int numberOfTracks = 0;
39  DimensionParameters param;
40 
41  auto getX = [](const CTPPSDiamondRecHit& hit) { return hit.x(); };
42  auto getXWidth = [](const CTPPSDiamondRecHit& hit) { return hit.xWidth(); };
43  auto setX = [](CTPPSDiamondLocalTrack& track, float x) { track.setPosition(math::XYZPoint(x, 0., 0.)); };
44  auto setXSigma = [](CTPPSDiamondLocalTrack& track, float sigma) {
45  track.setPositionSigma(math::XYZPoint(sigma, 0., 0.));
46  };
47 
48  for (const auto& hitBatch : hitVectorMap_) {
49  // separate the tracking for each bunch crossing
50  const auto& oot = hitBatch.first;
51  const auto& hits = hitBatch.second;
52 
53  auto hitRange = getHitSpatialRange(hits);
54 
55  TrackVector xPartTracks;
56 
57  // produce tracks in x dimension
58  param.rangeBegin = hitRange.xBegin;
59  param.rangeEnd = hitRange.xEnd;
60  producePartialTracks(hits, param, getX, getXWidth, setX, setXSigma, xPartTracks);
61 
62  if (xPartTracks.empty())
63  continue;
64 
65  const float yRangeCenter = 0.5f * (hitRange.yBegin + hitRange.yEnd);
66  const float zRangeCenter = 0.5f * (hitRange.zBegin + hitRange.zEnd);
67  const float ySigma = 0.5f * (hitRange.yEnd - hitRange.yBegin);
68  const float zSigma = 0.5f * (hitRange.zEnd - hitRange.zBegin);
69 
70  for (const auto& xTrack : xPartTracks) {
71  math::XYZPoint position(xTrack.x0(), yRangeCenter, zRangeCenter);
72  math::XYZPoint positionSigma(xTrack.x0Sigma(), ySigma, zSigma);
73 
74  const int multipleHits = (mhMap_.find(oot) != mhMap_.end()) ? mhMap_[oot] : 0;
75  CTPPSDiamondLocalTrack newTrack(position, positionSigma, 0.f, 0.f, oot, multipleHits);
76 
77  // find contributing hits
78  HitVector componentHits;
79  for (const auto& hit : hits)
80  if (newTrack.containsHit(hit, tolerance_) && (!excludeSingleEdgeHits_ || hit.toT() > 0.))
81  componentHits.emplace_back(hit);
82  // compute timing information
83  float mean_time = 0.f, time_sigma = 0.f;
84  bool valid_hits = timeEval(componentHits, mean_time, time_sigma);
85  newTrack.setValid(valid_hits);
86  newTrack.setTime(mean_time);
87  newTrack.setTimeSigma(time_sigma);
88 
89  tracks.push_back(newTrack);
90  }
91  }
92 
93  return numberOfTracks;

References CTPPSDiamondLocalTrack::containsHit(), excludeSingleEdgeHits_, f, CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::getHitSpatialRange(), hfClusterShapes_cfi::hits, CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::hitVectorMap_, mhMap_, position, CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::producePartialTracks(), CTPPSTimingLocalTrack::setTime(), CTPPSTimingLocalTrack::setTimeSigma(), CTPPSTimingLocalTrack::setValid(), CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::timeEval(), CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::tolerance_, HLT_FULL_cff::track, tracks, x, and hit::x.

Member Data Documentation

◆ excludeSingleEdgeHits_

bool CTPPSDiamondTrackRecognition::excludeSingleEdgeHits_
private

Definition at line 45 of file CTPPSDiamondTrackRecognition.h.

Referenced by addHit(), and produceTracks().

◆ mhMap_

std::unordered_map<int, int> CTPPSDiamondTrackRecognition::mhMap_
private

Definition at line 44 of file CTPPSDiamondTrackRecognition.h.

Referenced by clear(), and produceTracks().

CTPPSDiamondLocalTrack
Definition: CTPPSDiamondLocalTrack.h:20
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
CTPPSDiamondRecHit
Reconstructed hit in diamond detectors.
Definition: CTPPSDiamondRecHit.h:16
CTPPSDiamondTrackRecognition::mhMap_
std::unordered_map< int, int > mhMap_
Definition: CTPPSDiamondTrackRecognition.h:44
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >
DDAxes::x
CTPPSTimingTrackRecognition::clear
virtual void clear()
Reset internal state of a class instance.
Definition: CTPPSTimingTrackRecognition.h:56
CTPPSDiamondTrackRecognition::excludeSingleEdgeHits_
bool excludeSingleEdgeHits_
Definition: CTPPSDiamondTrackRecognition.h:45
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::HitVector
std::vector< CTPPSDiamondRecHit > HitVector
Definition: CTPPSTimingTrackRecognition.h:72
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::getHitSpatialRange
SpatialRange getHitSpatialRange(const HitVector &hits)
Definition: CTPPSTimingTrackRecognition.h:196
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::tolerance_
const float tolerance_
Definition: CTPPSTimingTrackRecognition.h:68
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::timeEval
bool timeEval(const HitVector &hits, float &meanTime, float &timeSigma) const
Definition: CTPPSTimingTrackRecognition.h:227
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::producePartialTracks
void producePartialTracks(const HitVector &hits, const DimensionParameters &param, float(*getHitCenter)(const CTPPSDiamondRecHit &), float(*getHitRangeWidth)(const CTPPSDiamondRecHit &), void(*setTrackCenter)(CTPPSDiamondLocalTrack &, float), void(*setTrackSigma)(CTPPSDiamondLocalTrack &, float), TrackVector &result)
Definition: CTPPSTimingTrackRecognition.h:117
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::TrackVector
std::vector< CTPPSDiamondLocalTrack > TrackVector
Definition: CTPPSTimingTrackRecognition.h:71
CTPPSTimingTrackRecognition< CTPPSDiamondLocalTrack, CTPPSDiamondRecHit >::hitVectorMap_
HitVectorMap hitVectorMap_
RecHit vectors that should be processed separately while reconstructing tracks.
Definition: CTPPSTimingTrackRecognition.h:76
hit
Definition: SiStripHitEffFromCalibTree.cc:88