34 namespace dtCalibration {
37 : nSigmas_(pset.getUntrackedParameter<unsigned int>(
"nSigmasFitRange", 1)),
41 rootFile_ =
new TFile(rootFileName.c_str(),
"READ");
69 throw cms::Exception(
"Configuration") <<
"only version 1 is presently supported for VDriftDB";
82 throw cms::Exception(
"DTCalibration") <<
"Could not find vDrift entry in DB for" << slId << endl;
89 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: RZ superlayer\n"
90 <<
" Will use original vDrift and resolution.";
93 TH1F* vDriftCorrHisto =
getHisto(slId);
95 if (vDriftCorrHisto->GetEntries() == 0) {
96 LogError(
"Calibration") <<
"[DTVDriftSegment]: Histogram " << vDriftCorrHisto->GetName() <<
" is empty.\n"
97 <<
" Will use original vDrift and resolution.";
101 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: Fitting histogram " << vDriftCorrHisto->GetName();
103 LogTrace(
"Calibration") <<
"[DTVDriftSegment]: \n"
107 float vDriftCorr = fitResult.
fitMean;
108 float vDriftNew = vDrift * (1. - vDriftCorr);
116 TH1F*
histo =
static_cast<TH1F*
>(
rootFile_->Get(histoName.c_str()));
118 throw cms::Exception(
"DTCalibration") <<
"v-drift correction histogram not found:" << histoName << endl;
130 string chHistoName =
"_W" + wheel +
"_St" + station +
"_Sec" + sector;
132 return (slId.
superLayer() != 2) ? (
"hRPhiVDriftCorr" + chHistoName) : (
"hRZVDriftCorr" + chHistoName);
T getUntrackedParameter(std::string const &, T const &) const
int version() const
Version numer specifying the structure of the payload. See .cc file for details.
DTChamberId chamberId() const
Return the corresponding ChamberId.
constexpr uint32_t rawId() const
get the raw id
std::string to_string(const V &value)
Log< level::Error, false > LogError
bool getData(T &iHolder) const
std::string getHistoName(const DTSuperLayerId &)
edm::ESGetToken< DTMtime, DTMtimeRcd > mTimeMapToken_
void setES(const edm::EventSetup &setup) override
int superLayer() const
Return the superlayer number.
edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcd > vDriftMapToken_
const DTRecoConditions * vDriftMap_
float get(const DTWireId &wireid, double *x=nullptr) const
Get the value correspoding to the given WireId, / using x[] as parameters of the parametrization whe...
const DTMtime * mTimeMap_
DTResidualFitResult fitResiduals(TH1F &histo, int nSigmas=1)
T getParameter(std::string const &) const
DTResidualFitter * fitter_
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
~DTVDriftSegment() override
int station() const
Return the station number.
TH1F * getHisto(const DTSuperLayerId &)
int wheel() const
Return the wheel number.
DTVDriftData compute(const DTSuperLayerId &) override