27 #include "RooRealVar.h" 28 #include "RooDataHist.h" 29 #include "RooGaussian.h" 30 #include "RooAddPdf.h" 31 #include "RooFitResult.h" 32 #include "RooGlobalFunc.h" 44 string residualsRootFile = pset.
getParameter<
string>(
"residualsRootFile");
45 rootFile_ =
new TFile(residualsRootFile.c_str(),
"READ");
57 int tmp_wheel = 0, tmp_sector = 0, tmp_station = 0, tmp_SL = 0;
58 double tmp_ttrig = 0., tmp_t0 = 0., tmp_kfact = 0.;
59 int tmp_a = 0, tmp_b = 0, tmp_c = 0, tmp_d = 0;
60 double tmp_v_eff = 0.;
61 while(!fileSlopes.eof()){
62 fileSlopes >> tmp_wheel >> tmp_sector >> tmp_station >> tmp_SL >> tmp_a >> tmp_b >>
63 tmp_ttrig >> tmp_t0 >> tmp_kfact >> tmp_c >> tmp_d >> tmp_v_eff;
64 vDriftEff_[tmp_wheel+2][tmp_sector-1][tmp_station-1][tmp_SL-1] = -tmp_v_eff;
73 DTTTrigResidualCorrection::~DTTTrigResidualCorrection() {
88 mTimeMap_ = &*mTimeHandle;
93 float tTrigMean,tTrigSigma,
kFactor;
95 if(status != 0)
throw cms::Exception(
"[DTTTrigResidualCorrection]") <<
"Could not find tTrig entry in DB for" 100 if(status != 0)
throw cms::Exception(
"[DTTTrigResidualCorrection]") <<
"Could not find vDrift entry in DB for" 102 TH1F residualHisto = *(getHisto(slId));
103 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: \n" 104 <<
" Mean, RMS = " << residualHisto.GetMean() <<
", " << residualHisto.GetRMS();
106 double fitMean = -1.;
107 double fitSigma = -1.;
109 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: Fitting histogram " << residualHisto.GetName();
116 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: \n" 117 <<
" Fit Mean = " << fitMean <<
"\n" 118 <<
" Fit Sigma = " << fitSigma;
120 double resMean = (useFit_) ? fitMean : residualHisto.GetMean();
123 int sector = slId.
sector();
128 double vdrift_eff = vDriftEff_[wheel+2][sector-1][station-1][superLayer-1];
129 if(vdrift_eff == 0) vdrift_eff = vDrift;
131 if(vdrift_eff) resTime = resMean/vdrift_eff;
133 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: Effective vDrift, correction to tTrig = " 134 << vdrift_eff <<
", " << resTime;
136 if(vDrift) resTime = resMean/vDrift;
138 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: vDrift from DB, correction to tTrig = " 139 << vDrift <<
", " << resTime;
142 double corrMean = tTrigMean;
143 double corrSigma = (tTrigSigma != 0.) ? tTrigSigma : 1.;
144 double corrKFact = (tTrigSigma != 0.) ? (kFactor + resTime/tTrigSigma) : resTime;
151 LogTrace(
"Calibration") <<
"[DTTTrigResidualCorrection]: Accessing histogram " << histoName.c_str();
152 TH1F*
histo =
static_cast<TH1F*
>(rootFile_->Get(histoName.c_str()));
153 if(!histo)
throw cms::Exception(
"[DTTTrigResidualCorrection]") <<
"residual histogram not found:" 154 << histoName << endl;
169 rootBaseDir_ +
"/Wheel" + wheel +
"/Station" + station +
"/Sector" + sector +
170 "/hResDist_STEP" + Step +
"_W" + wheel +
"_St" + station +
"_Sec" + sector +
"_SL" + superLayer;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
def setup(process, global_tag, zero_tesla=False)
def getHistoName(wheel, station, sector)
int superLayer() const
Return the superlayer number.
int superlayer() const
Return the superlayer number (deprecated method name)
std::string fullPath() const
int station() const
Return the station number.
int wheel() const
Return the wheel number.