Skip to content

Commit

Permalink
Merge pull request #1193 from Dr15Jones/fixStaticsRecoLocalMuonDTRecHit
Browse files Browse the repository at this point in the history
Multithreading fixes -- Changed class statics to const member data to fix thread-safety issues
  • Loading branch information
ktf committed Oct 28, 2013
2 parents 498f9dc + ce8bf39 commit 4443785
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 77 deletions.
24 changes: 10 additions & 14 deletions RecoLocalMuon/DTRecHit/plugins/DTLinearDriftAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ using namespace std;
using namespace edm;

DTLinearDriftAlgo::DTLinearDriftAlgo(const ParameterSet& config) :
DTRecHitBaseAlgo(config) {
// Get the Drift Velocity from parameter set.
vDrift = config.getParameter<double>("driftVelocity"); // FIXME: Default was 0.00543 cm/ns
// vDriftMB1W1 = config.getParameter<double>("driftVelocityMB1W1"); // FIXME: Default was 0.00543 cm/ns

minTime = config.getParameter<double>("minTime"); // FIXME: Default was -3 ns

maxTime = config.getParameter<double>("maxTime"); // FIXME: Default was 415 ns

hitResolution = config.getParameter<double>("hitResolution"); // FIXME: Default is
// Set verbose output
debug = config.getUntrackedParameter<bool>("debug");

}
DTRecHitBaseAlgo(config),
// Get the Drift Velocity from parameter set.
vDrift(config.getParameter<double>("driftVelocity")), // FIXME: Default was 0.00543 cm/ns
hitResolution(config.getParameter<double>("hitResolution")), // FIXME: Default is
// vDriftMB1W1(config.getParameter<double>("driftVelocityMB1W1")), // FIXME: Default was 0.00543 cm/ns
minTime(config.getParameter<double>("minTime")), // FIXME: Default was -3 ns
maxTime(config.getParameter<double>("maxTime")), // FIXME: Default was 415 ns
// Set verbose output
debug(config.getUntrackedParameter<bool>("debug"))
{}



Expand Down
12 changes: 6 additions & 6 deletions RecoLocalMuon/DTRecHit/plugins/DTLinearDriftAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ class DTLinearDriftAlgo : public DTRecHitBaseAlgo {


// The Drift Velocity (cm/ns)
float vDrift;
const float vDrift;
// // The Drift Velocity (cm/ns) for MB1 Wheel1 (non fluxed chamber) 21-Dec-2006 SL
// float vDriftMB1W1;
// const float vDriftMB1W1;

// The resolution on the Hits (cm)
float hitResolution;
const float hitResolution;

// Times below MinTime (ns) are considered as coming from previous BXs.
float minTime;
const float minTime;

// Times above MaxTime (ns) are considered as coming from following BXs
float maxTime;
const float maxTime;

// Switch on/off the verbosity
bool debug;
const bool debug;
};
#endif

Expand Down
22 changes: 9 additions & 13 deletions RecoLocalMuon/DTRecHit/plugins/DTLinearDriftFromDBAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@ using namespace std;
using namespace edm;

DTLinearDriftFromDBAlgo::DTLinearDriftFromDBAlgo(const ParameterSet& config) :
DTRecHitBaseAlgo(config) {

minTime = config.getParameter<double>("minTime");

maxTime = config.getParameter<double>("maxTime");

doVdriftCorr = config.getParameter<bool>("doVdriftCorr");

// Option to force going back to digi time at Step 2
stepTwoFromDigi = config.getParameter<bool>("stepTwoFromDigi");

// Set verbose output
debug = config.getUntrackedParameter<bool>("debug");
DTRecHitBaseAlgo(config),
minTime(config.getParameter<double>("minTime")),
maxTime(config.getParameter<double>("maxTime")),
doVdriftCorr(config.getParameter<bool>("doVdriftCorr")),
// Option to force going back to digi time at Step 2
stepTwoFromDigi(config.getParameter<bool>("stepTwoFromDigi")),
// Set verbose output
debug(config.getUntrackedParameter<bool>("debug"))
{
if(debug)
cout<<"[DTLinearDriftFromDBAlgo] Constructor called"<<endl;
}
Expand Down
10 changes: 5 additions & 5 deletions RecoLocalMuon/DTRecHit/plugins/DTLinearDriftFromDBAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ class DTLinearDriftFromDBAlgo : public DTRecHitBaseAlgo {
const DTMtime *mTimeMap;

// Times below MinTime (ns) are considered as coming from previous BXs.
float minTime;
const float minTime;

// Times above MaxTime (ns) are considered as coming from following BXs
float maxTime;
const float maxTime;

// Perform a correction to vDrift for the external wheels
bool doVdriftCorr;
const bool doVdriftCorr;

// Switch recalculating hit parameters from digi time in Step 2
// (when off, Step 2 does nothing)
bool stepTwoFromDigi;
const bool stepTwoFromDigi;

// Switch on/off the verbosity
bool debug;
const bool debug;
};
#endif

Expand Down
20 changes: 7 additions & 13 deletions RecoLocalMuon/DTRecHit/plugins/DTNoDriftAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@ using namespace std;
using namespace edm;

DTNoDriftAlgo::DTNoDriftAlgo(const ParameterSet& config) :
DTRecHitBaseAlgo(config) {

minTime = config.getParameter<double>("minTime");

maxTime = config.getParameter<double>("maxTime");

fixedDrift = config.getParameter<double>("fixedDrift");

hitResolution = config.getParameter<double>("hitResolution"); // Set to size of (half)cell
// Set verbose output
debug = config.getUntrackedParameter<bool>("debug");

}
DTRecHitBaseAlgo(config),
fixedDrift(config.getParameter<double>("fixedDrift")),
hitResolution(config.getParameter<double>("hitResolution")), // Set to size of (half)cell
minTime(config.getParameter<double>("minTime")),
maxTime(config.getParameter<double>("maxTime")),
debug(config.getUntrackedParameter<bool>("debug")) // Set verbose output
{}



Expand Down
10 changes: 5 additions & 5 deletions RecoLocalMuon/DTRecHit/plugins/DTNoDriftAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ class DTNoDriftAlgo : public DTRecHitBaseAlgo {


// The Drift Velocity (cm/ns)
float fixedDrift;
const float fixedDrift;

// The resolution on the Hits (cm)
float hitResolution;
const float hitResolution;

// Times below MinTime (ns) are considered as coming from previous BXs.
float minTime;
const float minTime;

// Times above MaxTime (ns) are considered as coming from following BXs
float maxTime;
const float maxTime;

// Switch on/off the verbosity
bool debug;
const bool debug;
};
#endif

Expand Down
18 changes: 7 additions & 11 deletions RecoLocalMuon/DTRecHit/plugins/DTParametrizedDriftAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@ using namespace edm;


DTParametrizedDriftAlgo::DTParametrizedDriftAlgo(const ParameterSet& config) :
DTRecHitBaseAlgo(config) {
interpolate = config.getParameter<bool>("interpolate");

minTime = config.getParameter<double>("minTime"); // FIXME: Default was -3 ns

maxTime = config.getParameter<double>("maxTime"); // FIXME: Default was 415 ns

// Set verbose output
debug = config.getUntrackedParameter<bool>("debug","false");

}
DTRecHitBaseAlgo(config),
interpolate(config.getParameter<bool>("interpolate")),
minTime(config.getParameter<double>("minTime")), // FIXME: Default was -3 ns
maxTime(config.getParameter<double>("maxTime")), // FIXME: Default was 415 ns
// Set verbose output
debug(config.getUntrackedParameter<bool>("debug","false"))
{}



Expand Down
8 changes: 4 additions & 4 deletions RecoLocalMuon/DTRecHit/plugins/DTParametrizedDriftAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class DTParametrizedDriftAlgo : public DTRecHitBaseAlgo {

private:
// Interpolate parametrization function
bool interpolate;
const bool interpolate;

// Times below MinTime (ns) are considered as coming from previous BXs.
float minTime;
const float minTime;

// Times above MaxTime (ns) are considered as coming from following BXs
float maxTime;
const float maxTime;

// Do the actual work.
virtual bool compute(const DTLayer* layer,
Expand All @@ -97,7 +97,7 @@ class DTParametrizedDriftAlgo : public DTRecHitBaseAlgo {
int step) const;

// Switch on/off the verbosity
bool debug;
const bool debug;


// Pointer to the magnetic field (read from ES once per event)
Expand Down
9 changes: 4 additions & 5 deletions RecoLocalMuon/DTRecHit/plugins/DTRecHitProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ using namespace std;



DTRecHitProducer::DTRecHitProducer(const ParameterSet& config){
DTRecHitProducer::DTRecHitProducer(const ParameterSet& config) :
// Set verbose output
debug = config.getUntrackedParameter<bool>("debug", false);

debug(config.getUntrackedParameter<bool>("debug", false)),
theDTDigiLabel(config.getParameter<InputTag>("dtDigiLabel"))
{
if(debug)
cout << "[DTRecHitProducer] Constructor called" << endl;

produces<DTRecHitCollection>();

theDTDigiLabel = config.getParameter<InputTag>("dtDigiLabel");

// Get the concrete reconstruction algo from the factory
string theAlgoName = config.getParameter<string>("recAlgo");
theAlgo = DTRecHitAlgoFactory::get()->create(theAlgoName,
Expand Down
2 changes: 1 addition & 1 deletion RecoLocalMuon/DTRecHit/plugins/DTRecHitProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DTRecHitProducer : public edm::EDProducer {

private:
// Switch on verbosity
bool debug;
const bool debug;
// The label to be used to retrieve DT digis from the event
edm::InputTag theDTDigiLabel;
// The reconstruction algorithm
Expand Down

0 comments on commit 4443785

Please sign in to comment.