CMS 3D CMS Logo

ConverterToTTTrack.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
6 namespace tmtt {
7 
8  //=== Convert L1fittedTrack or L1track3D (track candidates after/before fit) to TTTrack format.
9 
10  TTTrack<Ref_Phase2TrackerDigi_> ConverterToTTTrack::makeTTTrack(const L1trackBase* trk,
11  unsigned int iPhiSec,
12  unsigned int iEtaReg) const {
13  unsigned int nPar, hitPattern;
14  double d0, z0, tanL, chi2rphi, chi2rz;
15 
16  const L1fittedTrack* fitTrk = dynamic_cast<const L1fittedTrack*>(trk);
17 
18  // Handle variables that differ for L1fittedTrack & L1track3D
19  if (fitTrk == nullptr) {
20  // This is an L1track3D type (track before fit)
21  nPar = 4; // Before fit, TMTT algorithm assumes 4 helix params
22  // Set to zero variables that are unavailable for this track type.
23  hitPattern = 0;
24  d0 = 0.;
25  z0 = 0;
26  tanL = 0;
27  chi2rphi = 0.;
28  chi2rz = 0;
29  } else {
30  // This is an L1fittedTrack type (track after fit)
31  if (not fitTrk->accepted())
32  throw cms::Exception("LogicError") << "ConverterToTTTrack ERROR: requested to convert invalid L1fittedTrack";
33  nPar = fitTrk->nHelixParam(); // Number of helix parameters in track fit
34  hitPattern = fitTrk->hitPattern();
35  d0 = fitTrk->d0();
36  z0 = fitTrk->z0();
37  tanL = fitTrk->tanLambda();
38  chi2rphi = fitTrk->chi2rphi();
39  chi2rz = fitTrk->chi2rz();
40  }
41 
42  const double& rinv = invPtToInvR_ * trk->qOverPt();
43  const double& phi0 = trk->phi0();
44  constexpr double mva = -1.; // MVA quality flags not yet set.
45  const double& magneticField = settings_->magneticField();
46 
48  rinv, phi0, tanL, z0, d0, chi2rphi, chi2rz, mva, mva, mva, hitPattern, nPar, magneticField);
49 
50  // Set references to stubs on this track.
51  std::vector<TTStubRef> ttstubrefs = this->stubRefs(trk);
52  track.setStubRefs(ttstubrefs);
53 
54  // Note which (eta,phi) sector this track was reconstructed in.
55  track.setPhiSector(iPhiSec);
56  track.setEtaSector(iEtaReg);
57 
58  track.setStubPtConsistency(-1); // not yet filled.
59 
60  return track;
61  }
62 
63  //=== Get references to stubs on track. (Works for either L1track3D or L1fittedTrack).
64 
65  std::vector<TTStubRef> ConverterToTTTrack::stubRefs(const L1trackBase* trk) const {
66  std::vector<TTStubRef> ttstubrefs;
67  const std::vector<Stub*>& stubs = trk->stubs();
68  for (Stub* s : stubs) {
69  const TTStubRef& ref = s->ttStubRef();
70  ttstubrefs.push_back(ref);
71  }
72  return ttstubrefs;
73  }
74 
75 } // namespace tmtt
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
tmtt::L1fittedTrack::z0
float z0() const
Definition: L1fittedTrack.h:232
tmtt::L1fittedTrack::tanLambda
float tanLambda() const
Definition: L1fittedTrack.h:233
tmtt::L1fittedTrack::accepted
bool accepted() const
Definition: L1fittedTrack.h:297
TTTrack
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:26
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:122
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
tmtt::L1fittedTrack::chi2rphi
float chi2rphi() const
Definition: L1fittedTrack.h:275
tmtt::L1fittedTrack::nHelixParam
float nHelixParam() const
Definition: L1fittedTrack.h:269
edm::Ref< TTStubDetSetVec, TTStub< Ref_Phase2TrackerDigi_ > >
HcalResponse_cfi.nPar
nPar
Definition: HcalResponse_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
ConverterToTTTrack.h
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
tmtt::L1fittedTrack::hitPattern
unsigned int hitPattern() const
Definition: L1fittedTrack.h:184
tmtt::L1fittedTrack
Definition: L1fittedTrack.h:30
trklet::rinv
double rinv(double phi1, double phi2, double r1, double r2)
Definition: Util.h:167
tmtt::L1trackBase
Definition: L1trackBase.h:17
tmtt::L1trackBase::phi0
virtual float phi0() const =0
tmtt::L1trackBase::stubs
virtual const std::vector< Stub * > & stubs() const =0
std
Definition: JetResolutionObject.h:76
Exception.h
tmtt::L1trackBase::qOverPt
virtual float qOverPt() const =0
cms::Exception
Definition: Exception.h:70
tmtt::L1fittedTrack::d0
float d0() const
Definition: L1fittedTrack.h:230
tmtt::Stub
Definition: Stub.h:43
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
tmtt::L1fittedTrack::chi2rz
float chi2rz() const
Definition: L1fittedTrack.h:276
tmtt
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: ChiSquaredFit4.h:6