102 float tTrigMean,tTrigSigma,kFactor;
104 if(status != 0)
throw cms::Exception(
"[DTTTrigResidualCorrection]") <<
"Could not find tTrig entry in DB for"
107 float vDrift,hitResolution;
109 if(status != 0)
throw cms::Exception(
"[DTTTrigResidualCorrection]") <<
"Could not find vDrift entry in DB for"
111 TH1F residualHisto = *(
getHisto(slId));
112 double fitMean = -1.;
116 RooRealVar
x(
"x",
"residual",-1.,1.);
117 RooRealVar
mean(
"mean",
"mean",residualHisto.GetMean(),-0.3,0.3);
118 RooRealVar sigma1(
"sigma1",
"sigma1",0.,0.5);
119 RooRealVar sigma2(
"sigma2",
"sigma2",0.,0.5);
121 RooRealVar
frac(
"frac",
"frac",0.,1.);
123 RooGaussian myg1(
"myg1",
"Gaussian distribution",
x,
mean,sigma1);
124 RooGaussian myg2(
"myg2",
"Gaussian distribution",
x,
mean,sigma2);
126 RooAddPdf myg(
"myg",
"myg",RooArgList(myg1,myg2),RooArgList(
frac));
128 RooDataHist hdata(
"hdata",
"Binned data",RooArgList(
x),&residualHisto);
131 fitMean =
mean.getVal();
132 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: \n"
133 <<
" Mean, Fit Mean = " << residualHisto.GetMean()
134 <<
", " << fitMean <<
"\n"
135 <<
" RMS, Fit RMS = " << residualHisto.GetRMS()
136 <<
", " << sigma1.getVal();
154 int wheel = slId.
wheel();
155 int sector = slId.
sector();
161 double vdrift_eff =
vDriftEff_[wheel+2][sector-1][station-1][superLayer-1];
162 if(vdrift_eff == 0) vdrift_eff = vDrift;
164 if(vdrift_eff) resTime = ( (
useFit_) ? fitMean : residualHisto.GetMean() )/vdrift_eff;
166 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: Effective vDrift, correction to tTrig = "
167 << vdrift_eff <<
", " << resTime;
169 if(vDrift) resTime = ( (
useFit_) ? fitMean : residualHisto.GetMean() )/vDrift;
171 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: vDrift from DB, correction to tTrig = "
172 << vDrift <<
", " << resTime;
175 double corrMean = tTrigMean;
176 double corrSigma = (tTrigSigma != 0.) ? tTrigSigma : 1.;
177 double corrKFact = (tTrigSigma != 0.) ? (kFactor + resTime/tTrigSigma) : resTime;
const DTMtime * mTimeMap_
int superLayer() const
Return the superlayer number.
double vDriftEff_[5][14][4][3]
PixelRecoRange< float > Range
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
const DTTtrig * tTrigMap_
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
const TH1F * getHisto(const DTSuperLayerId &)
int station() const
Return the station number.
int wheel() const
Return the wheel number.