35 nSigmas_( pset.getUntrackedParameter<unsigned
int>(
"nSigmasFitRange", 1) ) {
38 rootFile_ =
new TFile(rootFileName.c_str(),
"READ");
64 if(status != 0)
throw cms::Exception(
"DTCalibration") <<
"Could not find vDrift entry in DB for" 69 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: RZ superlayer\n" 70 <<
" Will use original vDrift and resolution.";
73 TH1F* vDriftCorrHisto =
getHisto(slId);
75 if(vDriftCorrHisto->GetEntries() == 0){
76 LogError(
"Calibration") <<
"[DTVDriftSegment]: Histogram " << vDriftCorrHisto->GetName() <<
" is empty.\n" 77 <<
" Will use original vDrift and resolution.";
81 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: Fitting histogram " << vDriftCorrHisto->GetName();
83 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: \n" 84 <<
" Fit Mean = " << fitResult.
fitMean <<
" +/- " 86 <<
" Fit Sigma = " << fitResult.
fitSigma <<
" +/- " 89 float vDriftCorr = fitResult.
fitMean;
90 float vDriftNew = vDrift*(1. - vDriftCorr);
98 TH1F*
histo =
static_cast<TH1F*
>(
rootFile_->Get(histoName.c_str()));
99 if(!histo)
throw cms::Exception(
"DTCalibration") <<
"v-drift correction histogram not found:" 100 << histoName << endl;
110 stringstream sector; sector << chId.
sector();
114 "_St" + station.str() +
115 "_Sec" + sector.str();
117 return (slId.
superLayer() != 2)?(
"hRPhiVDriftCorr" + chHistoName):(
"hRZVDriftCorr" + chHistoName);
virtual void setES(const edm::EventSetup &setup)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
def setup(process, global_tag, zero_tesla=False)
virtual ~DTVDriftSegment()
std::string getHistoName(const DTSuperLayerId &)
virtual DTVDriftData compute(const DTSuperLayerId &)
int superLayer() const
Return the superlayer number.
const DTMtime * mTimeMap_
DTResidualFitResult fitResiduals(TH1F &histo, int nSigmas=1)
DTResidualFitter * fitter_
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
int station() const
Return the station number.
TH1F * getHisto(const DTSuperLayerId &)
int wheel() const
Return the wheel number.