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 
186 }
187 
189  theTrackingGeometry = tg;
190 }
191 
194  m_SCTBL = kUnset;
195 }
196 
198  // see ThreadSafe statement above about the order of operator= and store
199  if (kSet == m_TSOS.load())
200  return initialTSOS;
202  auto tmp = tipe.extrapolate(initialFTS, initialFTS.position());
203  char expected = kUnset;
204  if (m_TSOS.compare_exchange_strong(expected, kSetting)) {
205  initialTSOS = tmp;
206  m_TSOS.store(kSet);
207  return initialTSOS;
208  }
209  return tmp;
210 }
211 
213  // see ThreadSafe statement above about the order of operator= and store
214  if (kSet == m_TSCP.load())
215  return initialTSCP;
217  char expected = kUnset;
218  if (m_TSCP.compare_exchange_strong(expected, kSetting)) {
219  initialTSCP = tmp;
220  m_TSCP.store(kSet);
221  return initialTSCP;
222  }
223  return tmp;
224 }
225 
228 }
229 
232 }
233 
236  return tipe.extrapolate(initialFTS, point);
237 }
238 
240  // see ThreadSafe statement above about the order of operator= and store
241  if (kSet == m_SCTBL.load())
243  TSCBLBuilderNoMaterial blsBuilder;
244  const auto tmp = blsBuilder(initialFTS, theBeamSpot);
245  char expected = kUnset;
246  if (m_SCTBL.compare_exchange_strong(expected, kSetting)) {
248  m_SCTBL.store(kSet);
250  }
251  return tmp;
252 }
TSCBLBuilderNoMaterial.h
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
reco::TrackTransientTrack::kSet
Definition: TrackTransientTrack.h:118
reco::TrackTransientTrack::builder
TSCPBuilderNoMaterial builder
Definition: TrackTransientTrack.h:113
reco::TrackTransientTrack::m_TSCP
std::atomic< char > m_TSCP
Definition: TrackTransientTrack.h:110
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:197
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
reco::TrackTransientTrack::m_TSOS
std::atomic< char > m_TSOS
Definition: TrackTransientTrack.h:109
reco::TrackTransientTrack::setES
void setES(const edm::EventSetup &) override
Definition: TrackTransientTrack.cc:184
reco::TrackTransientTrack::stateAtBeamLine
TrajectoryStateClosestToBeamLine stateAtBeamLine() const override
Definition: TrackTransientTrack.cc:239
reco::TrackTransientTrack::field
const MagneticField * field() const override
Definition: TrackTransientTrack.h:86
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
reco::TrackTransientTrack::theBeamSpot
reco::BeamSpot theBeamSpot
Definition: TrackTransientTrack.h:115
TransverseImpactPointExtrapolator
Definition: TransverseImpactPointExtrapolator.h:26
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
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:107
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:99
funct::true
true
Definition: Factorize.h:173
reco::TrackTransientTrack::theTrackingGeometry
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
Definition: TrackTransientTrack.h:114
reco::TrackTransientTrack::setBeamSpot
void setBeamSpot(const reco::BeamSpot &beamSpot) override
Definition: TrackTransientTrack.cc:192
reco::TrackTransientTrack::initialTSOS
TrajectoryStateOnSurface initialTSOS
Definition: TrackTransientTrack.h:105
TrackTransientTrack.h
reco::TrackTransientTrack::TrackTransientTrack
TrackTransientTrack()
Definition: TrackTransientTrack.cc:23
edm::EventSetup
Definition: EventSetup.h:57
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
reco::TrackTransientTrack::m_SCTBL
std::atomic< char > m_SCTBL
Definition: TrackTransientTrack.h:111
reco::get
T get(const Candidate &c)
Definition: component.h:60
reco::TrackTransientTrack::stateOnSurface
TrajectoryStateOnSurface stateOnSurface(const GlobalPoint &point) const override
Definition: TrackTransientTrack.cc:234
reco::TrackTransientTrack::initialFTS
FreeTrajectoryState initialFTS
Definition: TrackTransientTrack.h:101
reco::TrackTransientTrack::setTrackingGeometry
void setTrackingGeometry(const edm::ESHandle< GlobalTrackingGeometry > &) override
Definition: TrackTransientTrack.cc:188
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:212
TrajectoryStateTransform.h
reco::TrackTransientTrack::kUnset
Definition: TrackTransientTrack.h:118
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:226
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
ntuplemaker.time
time
Definition: ntuplemaker.py:310
reco::TrackTransientTrack::kSetting
Definition: TrackTransientTrack.h:118
MagneticField
Definition: MagneticField.h:19
reco::TrackTransientTrack
Definition: TrackTransientTrack.h:18
reco::TrackTransientTrack::initialTSCP
TrajectoryStateClosestToPoint initialTSCP
Definition: TrackTransientTrack.h:106
reco::TrackTransientTrack::innermostMeasurementState
TrajectoryStateOnSurface innermostMeasurementState() const override
Definition: TrackTransientTrack.cc:230