CMS 3D CMS Logo

TrackTransientTrack.cc
Go to the documentation of this file.
6 #include <iostream>
7 
8 /*
9  * ThreadSafe statement:
10  * This class is using mutable member data: initialTSOS, initialTSCP,
11  * trajectoryStateClosestToBeamLine. To guarantee thread safeness we
12  * rely on helper member data: m_TSOS, m_TSCP and m_SCTBL, respectively.
13  * Each time we'll change mutable member data we rely on specific order of the
14  * operator= and the store. It is important since C++11 will guarantee that
15  * the value changed by the operator= will be seen by all threads as occuring
16  * before the call to store and therefore the kSet == m_TSOS.load is always
17  * guaranteed to be true if and only if the thread will see the most recent
18  * value of initialTSOS
19  */
20 
21 using namespace reco;
22 
24  : Track(),
25  tkr_(),
26  hasTime(false),
27  timeExt_(0.),
28  dtErrorExt_(0.),
29  theField(nullptr),
30  m_TSOS(kUnset),
31  m_TSCP(kUnset),
32  m_SCTBL(kUnset)
33 
34 {}
35 
37  : Track(tk),
38  tkr_(),
39  hasTime(false),
40  timeExt_(0.),
41  dtErrorExt_(0.),
42  theField(field),
43  m_TSOS(kUnset),
44  m_TSCP(kUnset),
45  m_SCTBL(kUnset) {
47 }
48 
50  const double time,
51  const double dtime,
52  const MagneticField* field)
53  : Track(tk),
54  tkr_(),
55  hasTime(true),
56  timeExt_(time),
57  dtErrorExt_(dtime),
58  theField(field),
59  m_TSOS(kUnset),
60  m_TSCP(kUnset),
61  m_SCTBL(kUnset) {
63 }
64 
66  : Track(*tk),
67  tkr_(tk),
68  hasTime(false),
69  timeExt_(0.),
70  dtErrorExt_(0.),
71  theField(field),
72  m_TSOS(kUnset),
73  m_TSCP(kUnset),
74  m_SCTBL(kUnset) {
76 }
77 
79  const double time,
80  const double dtime,
81  const MagneticField* field)
82  : Track(*tk),
83  tkr_(tk),
84  hasTime(true),
85  timeExt_(time),
86  dtErrorExt_(dtime),
87  theField(field),
88  m_TSOS(kUnset),
89  m_TSCP(kUnset),
90  m_SCTBL(kUnset) {
92 }
93 
95  const MagneticField* field,
97  : Track(tk),
98  tkr_(),
99  hasTime(false),
100  timeExt_(0.),
101  dtErrorExt_(0.),
102  theField(field),
103  m_TSOS(kUnset),
104  m_TSCP(kUnset),
105  m_SCTBL(kUnset),
106  theTrackingGeometry(tg) {
108 }
109 
111  const MagneticField* field,
113  : Track(*tk),
114  tkr_(tk),
115  hasTime(false),
116  timeExt_(0.),
117  dtErrorExt_(0.),
118  theField(field),
119  m_TSOS(kUnset),
120  m_TSCP(kUnset),
121  m_SCTBL(kUnset),
122  theTrackingGeometry(tg) {
124 }
125 
127  const double time,
128  const double dtime,
129  const MagneticField* field,
131  : Track(tk),
132  tkr_(),
133  hasTime(true),
134  timeExt_(time),
135  dtErrorExt_(dtime),
136  theField(field),
137  m_TSOS(kUnset),
138  m_TSCP(kUnset),
139  m_SCTBL(kUnset),
140  theTrackingGeometry(tg) {
142 }
143 
145  const double time,
146  const double dtime,
147  const MagneticField* field,
149  : Track(*tk),
150  tkr_(tk),
151  hasTime(true),
152  timeExt_(time),
153  dtErrorExt_(dtime),
154  theField(field),
155  m_TSOS(kUnset),
156  m_TSCP(kUnset),
157  m_SCTBL(kUnset),
158  theTrackingGeometry(tg) {
160 }
161 
163  : Track(tt),
164  tkr_(tt.persistentTrackRef()),
165  hasTime(tt.hasTime),
166  timeExt_(tt.timeExt()),
167  dtErrorExt_(tt.dtErrorExt()),
168  theField(tt.field()),
169  initialFTS(tt.initialFreeState()),
170  m_TSOS(kUnset),
171  m_TSCP(kUnset) {
172  // see ThreadSafe statement above about the order of operator= and store
173  if (kSet == tt.m_TSOS.load()) {
174  initialTSOS = tt.impactPointState();
175  m_TSOS.store(kSet);
176  }
177  // see ThreadSafe statement above about the order of operator= and store
178  if (kSet == tt.m_TSCP.load()) {
179  initialTSCP = tt.impactPointTSCP();
180  m_TSCP.store(kSet);
181  }
182 }
183 
185  theTrackingGeometry = tg;
186 }
187 
190  m_SCTBL = kUnset;
191 }
192 
194  // see ThreadSafe statement above about the order of operator= and store
195  if (kSet == m_TSOS.load())
196  return initialTSOS;
198  auto tmp = tipe.extrapolate(initialFTS, initialFTS.position());
199  char expected = kUnset;
200  if (m_TSOS.compare_exchange_strong(expected, kSetting)) {
201  initialTSOS = tmp;
202  m_TSOS.store(kSet);
203  return initialTSOS;
204  }
205  return tmp;
206 }
207 
209  // see ThreadSafe statement above about the order of operator= and store
210  if (kSet == m_TSCP.load())
211  return initialTSCP;
213  char expected = kUnset;
214  if (m_TSCP.compare_exchange_strong(expected, kSetting)) {
215  initialTSCP = tmp;
216  m_TSCP.store(kSet);
217  return initialTSCP;
218  }
219  return tmp;
220 }
221 
224 }
225 
228 }
229 
232  return tipe.extrapolate(initialFTS, point);
233 }
234 
236  // see ThreadSafe statement above about the order of operator= and store
237  if (kSet == m_SCTBL.load())
239  TSCBLBuilderNoMaterial blsBuilder;
240  const auto tmp = blsBuilder(initialFTS, theBeamSpot);
241  char expected = kUnset;
242  if (m_SCTBL.compare_exchange_strong(expected, kSetting)) {
244  m_SCTBL.store(kSet);
246  }
247  return tmp;
248 }
TSCBLBuilderNoMaterial.h
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
reco::TrackTransientTrack::kSet
Definition: TrackTransientTrack.h:116
reco::TrackTransientTrack::builder
TSCPBuilderNoMaterial builder
Definition: TrackTransientTrack.h:111
reco::TrackTransientTrack::m_TSCP
std::atomic< char > m_TSCP
Definition: TrackTransientTrack.h:108
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
funct::false
false
Definition: Factorize.h:29
trajectoryStateTransform::initialFreeState
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:58
reco::TrackTransientTrack::impactPointState
TrajectoryStateOnSurface impactPointState() const override
Definition: TrackTransientTrack.cc:193
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
reco::TrackTransientTrack::m_TSOS
std::atomic< char > m_TSOS
Definition: TrackTransientTrack.h:107
reco::TrackTransientTrack::stateAtBeamLine
TrajectoryStateClosestToBeamLine stateAtBeamLine() const override
Definition: TrackTransientTrack.cc:235
protons_cff.time
time
Definition: protons_cff.py:35
reco::TrackTransientTrack::field
const MagneticField * field() const override
Definition: TrackTransientTrack.h:84
reco::TrackTransientTrack::theBeamSpot
reco::BeamSpot theBeamSpot
Definition: TrackTransientTrack.h:113
TransverseImpactPointExtrapolator
Definition: TransverseImpactPointExtrapolator.h:26
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Ref< TrackCollection >
trajectoryStateTransform::outerStateOnSurface
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:118
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::TrackTransientTrack::trajectoryStateClosestToBeamLine
TrajectoryStateClosestToBeamLine trajectoryStateClosestToBeamLine
Definition: TrackTransientTrack.h:105
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
edm::ESHandle< GlobalTrackingGeometry >
GlobalTrackingGeometryRecord.h
reco::TrackTransientTrack::theField
const MagneticField * theField
Definition: TrackTransientTrack.h:97
funct::true
true
Definition: Factorize.h:173
reco::TrackTransientTrack::theTrackingGeometry
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
Definition: TrackTransientTrack.h:112
reco::TrackTransientTrack::setBeamSpot
void setBeamSpot(const reco::BeamSpot &beamSpot) override
Definition: TrackTransientTrack.cc:188
reco::TrackTransientTrack::initialTSOS
TrajectoryStateOnSurface initialTSOS
Definition: TrackTransientTrack.h:103
TrackTransientTrack.h
reco::TrackTransientTrack::TrackTransientTrack
TrackTransientTrack()
Definition: TrackTransientTrack.cc:23
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
reco::TrackTransientTrack::m_SCTBL
std::atomic< char > m_SCTBL
Definition: TrackTransientTrack.h:109
reco::TrackTransientTrack::stateOnSurface
TrajectoryStateOnSurface stateOnSurface(const GlobalPoint &point) const override
Definition: TrackTransientTrack.cc:230
reco::TrackTransientTrack::initialFTS
FreeTrajectoryState initialFTS
Definition: TrackTransientTrack.h:99
reco::TrackTransientTrack::setTrackingGeometry
void setTrackingGeometry(const edm::ESHandle< GlobalTrackingGeometry > &) override
Definition: TrackTransientTrack.cc:184
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
TransverseImpactPointExtrapolator.h
TransverseImpactPointExtrapolator::extrapolate
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
Definition: TransverseImpactPointExtrapolator.cc:23
reco::TrackTransientTrack::impactPointTSCP
TrajectoryStateClosestToPoint impactPointTSCP() const override
Definition: TrackTransientTrack.cc:208
TrajectoryStateTransform.h
reco::TrackTransientTrack::kUnset
Definition: TrackTransientTrack.h:116
math::GlobalPoint
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
reco::TrackTransientTrack::outermostMeasurementState
TrajectoryStateOnSurface outermostMeasurementState() const override
Definition: TrackTransientTrack.cc:222
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
reco::TrackTransientTrack::kSetting
Definition: TrackTransientTrack.h:116
MagneticField
Definition: MagneticField.h:19
reco::TrackTransientTrack
Definition: TrackTransientTrack.h:18
reco::TrackTransientTrack::initialTSCP
TrajectoryStateClosestToPoint initialTSCP
Definition: TrackTransientTrack.h:104
reco::TrackTransientTrack::innermostMeasurementState
TrajectoryStateOnSurface innermostMeasurementState() const override
Definition: TrackTransientTrack.cc:226