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;
108 stringstream wheel; wheel << chId.
wheel();
110 stringstream sector; sector << chId.
sector();
114 "_St" + station.str() +
115 "_Sec" + sector.str();
117 return (slId.
superLayer() != 2)?(
"hRPhiVDriftCorr" + chHistoName):(
"hRZVDriftCorr" + chHistoName);
DTResidualFitter * fitter_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual ~DTVDriftSegment()
DTChamberId chamberId() const
Return the corresponding ChamberId.
TH1F * getHisto(const DTSuperLayerId &)
std::string getHistoName(const DTSuperLayerId &)
virtual DTVDriftData compute(const DTSuperLayerId &)
int superLayer() const
Return the superlayer number.
DTVDriftSegment(edm::ParameterSet const &)
DTResidualFitResult fitResiduals(TH1F &histo, int nSigmas=1)
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
virtual void setES(const edm::EventSetup &setup)
const DTMtime * mTimeMap_
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")