Skip to content

Commit

Permalink
static data member is not thread safe and doesn't need to be static
Browse files Browse the repository at this point in the history
  • Loading branch information
wmtan committed Nov 7, 2013
1 parent 1391565 commit 48829b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions TrackingTools/GeomPropagators/interface/SmartPropagator.h
Expand Up @@ -140,12 +140,12 @@ class SmartPropagator GCC11_FINAL : public Propagator {

private:
///build the tracker volume
static void initTkVolume(float epsilon);
void initTkVolume(float epsilon);

Propagator* theTkProp;
Propagator* theGenProp;
const MagneticField* theField;
static ReferenceCountingPointer<Cylinder> & theTkVolume();
ReferenceCountingPointer<Cylinder> theTkVolume;

protected:

Expand Down
12 changes: 4 additions & 8 deletions TrackingTools/GeomPropagators/src/SmartPropagator.cc
Expand Up @@ -31,10 +31,6 @@
/* ====================================================================== */

/* static member */
ReferenceCountingPointer<BoundCylinder> & SmartPropagator::theTkVolume() {
static ReferenceCountingPointer<BoundCylinder> local=0;
return local;
}



Expand All @@ -43,7 +39,7 @@ SmartPropagator::SmartPropagator(const Propagator* aTkProp, const Propagator* aG
PropagationDirection dir, float epsilon) :
Propagator(dir), theTkProp(aTkProp->clone()), theGenProp(aGenProp->clone()), theField(field) {

if (theTkVolume()==0) initTkVolume(epsilon);
initTkVolume(epsilon);

}

Expand All @@ -52,7 +48,7 @@ SmartPropagator::SmartPropagator(const Propagator& aTkProp, const Propagator& aG
PropagationDirection dir, float epsilon) :
Propagator(dir), theTkProp(aTkProp.clone()), theGenProp(aGenProp.clone()), theField(field) {

if (theTkVolume()==0) initTkVolume(epsilon);
initTkVolume(epsilon);

}

Expand All @@ -66,7 +62,7 @@ SmartPropagator::SmartPropagator(const SmartPropagator& aProp) :

//SL since it's a copy constructor, then the TkVolume has been already
//initialized
//if (theTkVolume==0) initTkVolume(epsilon);
// initTkVolume(epsilon);

}

Expand Down Expand Up @@ -94,7 +90,7 @@ void SmartPropagator::initTkVolume(float epsilon) {
Surface::PositionType pos(0,0,0); // centered at the global origin
Surface::RotationType rot; // unit matrix - barrel cylinder orientation

theTkVolume() = Cylinder::build(radius, pos, rot, new SimpleCylinderBounds(r_in, r_out, z_min, z_max));
theTkVolume = Cylinder::build(radius, pos, rot, new SimpleCylinderBounds(r_in, r_out, z_min, z_max));

}

Expand Down

0 comments on commit 48829b3

Please sign in to comment.