CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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(), tkr_(), theField(0), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset)
25 {
26 }
27 
29  Track(tk), tkr_(), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset)
30 {
31 
33 }
34 
35 
37  Track(*tk), tkr_(tk), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset)
38 {
39 
41 }
42 
44  Track(tk), tkr_(), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset), theTrackingGeometry(tg)
45 {
46 
48 }
49 
51  Track(*tk), tkr_(tk), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset), theTrackingGeometry(tg)
52 {
53 
55 }
56 
57 
59  Track(tt), tkr_(tt.persistentTrackRef()), theField(tt.field()),
60  initialFTS(tt.initialFreeState()), m_TSOS(kUnset), m_TSCP(kUnset)
61 {
62  // see ThreadSafe statement above about the order of operator= and store
63  if (kSet == tt.m_TSOS.load()) {
65  m_TSOS.store(kSet);
66  }
67  // see ThreadSafe statement above about the order of operator= and store
68  if (kSet == tt.m_TSCP.load()) {
70  m_TSCP.store(kSet);
71  }
72 }
73 
75 
77 
78 }
79 
81 
83 
84 }
85 
87 {
89  m_SCTBL = kUnset;
90 }
91 
93 {
94  // see ThreadSafe statement above about the order of operator= and store
95  if(kSet == m_TSOS.load()) return initialTSOS;
98  char expected = kUnset;
99  if(m_TSOS.compare_exchange_strong(expected, kSetting)) {
100  initialTSOS = tmp;
101  m_TSOS.store(kSet);
102  return initialTSOS;
103  }
104  return tmp;
105 }
106 
108 {
109  // see ThreadSafe statement above about the order of operator= and store
110  if(kSet == m_TSCP.load()) return initialTSCP;
112  char expected = kUnset;
113  if(m_TSCP.compare_exchange_strong(expected, kSetting)) {
114  initialTSCP = tmp;
115  m_TSCP.store(kSet);
116  return initialTSCP;
117  }
118  return tmp;
119 }
120 
122 {
123 
125 }
126 
128 {
129 
131 }
132 
135 {
137  return tipe.extrapolate(initialFTS, point);
138 }
139 
141 {
142  // see ThreadSafe statement above about the order of operator= and store
143  if(kSet == m_SCTBL.load()) return trajectoryStateClosestToBeamLine;
144  TSCBLBuilderNoMaterial blsBuilder;
145  const auto tmp = blsBuilder(initialFTS, theBeamSpot);
146  char expected = kUnset;
147  if(m_SCTBL.compare_exchange_strong(expected, kSetting)) {
149  m_SCTBL.store(kSet);
151  }
152  return tmp;
153 }
154 
void setTrackingGeometry(const edm::ESHandle< GlobalTrackingGeometry > &)
TrajectoryStateOnSurface impactPointState() const
TrajectoryStateClosestToPoint impactPointTSCP() const
TrajectoryStateOnSurface initialTSOS
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field)
TrajectoryStateOnSurface outermostMeasurementState() const
void setES(const edm::EventSetup &)
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TrajectoryStateOnSurface innermostMeasurementState() const
TrajectoryStateOnSurface stateOnSurface(const GlobalPoint &point) const
std::atomic< char > m_TSOS
TSCPBuilderNoMaterial builder
TrajectoryStateClosestToBeamLine trajectoryStateClosestToBeamLine
TrajectoryStateClosestToBeamLine stateAtBeamLine() const
const MagneticField * theField
GlobalPoint position() const
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field)
const T & get() const
Definition: EventSetup.h:55
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:17
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void setBeamSpot(const reco::BeamSpot &beamSpot)
std::atomic< char > m_TSCP
TrajectoryStateClosestToPoint initialTSCP
std::atomic< char > m_SCTBL
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
*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
FreeTrajectoryState initialFTS