CMS 3D CMS Logo

MagneticField.cc
Go to the documentation of this file.
1 
7 
8 MagneticField::MagneticField() : nominalValueCompiuted(kUnset), theNominalValue(0) {}
9 
11  if (orig.nominalValueCompiuted.load() == kSet) {
14  }
15 }
16 
18 
20  int tmp = int((inTesla(GlobalPoint(0.f, 0.f, 0.f))).z() * 10.f + 0.5f);
21 
22  //Try to cache
23  char expected = kUnset;
24  if (nominalValueCompiuted.compare_exchange_strong(expected, kSetting)) {
25  //it is our job to set the value
27 
28  //this must be after the swap
30  return theNominalValue;
31  }
32  //another thread beat us to trying to set theNominalValue
33  // since we don't know when the other thread will finish
34  // we just return tmp
35  return tmp;
36 }
virtual ~MagneticField()
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::atomic< char > nominalValueCompiuted
Definition: MagneticField.h:58
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
virtual int computeNominalValue() const
double f[11][100]
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
tmp
align.sh
Definition: createJobs.py:716