CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CandidatePtrTransientTrack.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(), ptr_(), theField(0), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset)
25 {
26 }
27 
28 
30  Track(* ptr->bestTrack()), ptr_(ptr), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset)
31 {
32 
34 }
36 Track(* ptr->bestTrack()), ptr_(ptr), theField(field), m_TSOS(kUnset), m_TSCP(kUnset), m_SCTBL(kUnset), theTrackingGeometry(tg)
37 {
38 
40 }
41 
42 
44  Track(tt), ptr_(tt.candidate()), theField(tt.field()),
45  initialFTS(tt.initialFreeState()), m_TSOS(kUnset), m_TSCP(kUnset)
46 {
47  // see ThreadSafe statement above about the order of operator= and store
48  if (kSet == tt.m_TSOS.load()) {
50  m_TSOS.store(kSet);
51  }
52  // see ThreadSafe statement above about the order of operator= and store
53  if (kSet == tt.m_TSCP.load()) {
55  m_TSCP.store(kSet);
56  }
57 }
58 
60 
62 
63 }
64 
66 
68 
69 }
70 
72 {
74  m_SCTBL = kUnset;
75 }
76 
78 {
79  // see ThreadSafe statement above about the order of operator= and store
80  if(kSet == m_TSOS.load()) return initialTSOS;
83  char expected = kUnset;
84  if(m_TSOS.compare_exchange_strong(expected, kSetting)) {
85  initialTSOS = tmp;
86  m_TSOS.store(kSet);
87  return initialTSOS;
88  }
89  return tmp;
90 }
91 
93 {
94  // see ThreadSafe statement above about the order of operator= and store
95  if(kSet == m_TSCP.load()) return initialTSCP;
97  char expected = kUnset;
98  if(m_TSCP.compare_exchange_strong(expected, kSetting)) {
99  initialTSCP = tmp;
100  m_TSCP.store(kSet);
101  return initialTSCP;
102  }
103  return tmp;
104 }
105 
107 {
108 
110 }
111 
113 {
114 
116 }
117 
120 {
122  return tipe.extrapolate(initialFTS, point);
123 }
124 
126 {
127  // see ThreadSafe statement above about the order of operator= and store
128  if(kSet == m_SCTBL.load()) return trajectoryStateClosestToBeamLine;
129  TSCBLBuilderNoMaterial blsBuilder;
130  const auto tmp = blsBuilder(initialFTS, theBeamSpot);
131  char expected = kUnset;
132  if(m_SCTBL.compare_exchange_strong(expected, kSetting)) {
134  m_SCTBL.store(kSet);
136  }
137  return tmp;
138 }
139 
TrajectoryStateClosestToPoint initialTSCP
void setTrackingGeometry(const edm::ESHandle< GlobalTrackingGeometry > &)
const char * ptr_
Definition: DataKey.cc:90
TrajectoryStateOnSurface outerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
TrajectoryStateOnSurface impactPointState() const
TrajectoryStateOnSurface outermostMeasurementState() const
TrajectoryStateOnSurface stateOnSurface(const GlobalPoint &point) const
TrajectoryStateClosestToBeamLine stateAtBeamLine() const
TrajectoryStateClosestToBeamLine trajectoryStateClosestToBeamLine
void setBeamSpot(const reco::BeamSpot &beamSpot)
GlobalPoint position() const
const T & get() const
Definition: EventSetup.h:55
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
TrajectoryStateOnSurface innermostMeasurementState() const
const MagneticField * field() const
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
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
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
TrajectoryStateClosestToPoint impactPointTSCP() const
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)