Skip to content

Commit

Permalink
Merge pull request #9314 from namapane/DTSkipVdriftBCorrection
Browse files Browse the repository at this point in the history
Do not apply DT vdrift correction (that accounts for field in phi SLs…
  • Loading branch information
davidlange6 committed May 29, 2015
2 parents dd1b6d7 + bd7772d commit 9dfb003
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion RecoLocalMuon/DTRecHit/plugins/DTLinearDriftFromDBAlgo.cc
Expand Up @@ -17,12 +17,17 @@
#include "CondFormats/DTObjects/interface/DTRecoUncertainties.h"
#include "CondFormats/DataRecord/interface/DTRecoUncertaintiesRcd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"

using namespace std;
using namespace edm;

DTLinearDriftFromDBAlgo::DTLinearDriftFromDBAlgo(const ParameterSet& config) :
DTRecHitBaseAlgo(config),
mTimeMap(0),
field(0),
nominalB(-1),
minTime(config.getParameter<double>("minTime")),
maxTime(config.getParameter<double>("maxTime")),
doVdriftCorr(config.getParameter<bool>("doVdriftCorr")),
Expand Down Expand Up @@ -57,6 +62,11 @@ void DTLinearDriftFromDBAlgo::setES(const EventSetup& setup) {
setup.get<DTMtimeRcd>().get(mTimeHandle);
mTimeMap = &*mTimeHandle;

ESHandle<MagneticField> magfield;
setup.get<IdealMagneticFieldRecord>().get(magfield);
field = &*magfield;
nominalB = field->nominalValue();

if (useUncertDB) {
ESHandle<DTRecoUncertainties> uncerts;
setup.get<DTRecoUncertaintiesRcd>().get(uncerts);
Expand Down Expand Up @@ -172,7 +182,7 @@ bool DTLinearDriftFromDBAlgo::compute(const DTLayer* layer,
}

//only in step 3
if(doVdriftCorr && step == 3){
if(doVdriftCorr && step == 3 && nominalB !=0){
if (abs(wireId.wheel()) == 2 &&
wireId.station() == 1 &&
wireId.superLayer() != 2) {
Expand Down
5 changes: 5 additions & 0 deletions RecoLocalMuon/DTRecHit/plugins/DTLinearDriftFromDBAlgo.h
Expand Up @@ -13,6 +13,7 @@

class DTMtime;
class DTRecoUncertainties;
class MagneticField;

class DTLinearDriftFromDBAlgo : public DTRecHitBaseAlgo {
public:
Expand Down Expand Up @@ -83,6 +84,10 @@ class DTLinearDriftFromDBAlgo : public DTRecHitBaseAlgo {
//Map of meantimes
const DTMtime *mTimeMap;

// MF field
const MagneticField* field;
int nominalB;

// Map of hit uncertainties
const DTRecoUncertainties *uncertMap;

Expand Down

0 comments on commit 9dfb003

Please sign in to comment.