39 granularity_(
pset.getUntrackedParameter<
string>(
"calibGranularity",
"bySL")),
45 LogVerbatim(
"Calibration") <<
"[DTVDriftWriter]Constructor called!";
47 if (granularity_ !=
"bySL")
49 <<
"[DTVDriftWriter] Check parameter calibGranularity: " << granularity_ <<
" option not available.";
52 writeLegacyVDriftDB =
pset.getParameter<
bool>(
"writeLegacyVDriftDB");
66 throw cms::Exception(
"Configuration") <<
"only version 1 is presently supported for VDriftDB";
79 std::unique_ptr<DTMtime> mTimeNewMap;
80 std::unique_ptr<DTRecoConditions> vDriftNewMap;
82 mTimeNewMap = std::make_unique<DTMtime>();
84 vDriftNewMap = std::make_unique<DTRecoConditions>();
85 vDriftNewMap->setFormulaExpr(
"[0]");
87 vDriftNewMap->setVersion(1);
93 auto sl = superLayers.begin();
94 auto sl_end = superLayers.end();
95 for (; sl != sl_end; ++sl) {
99 float vDriftNew = -1.;
100 float resolutionNew = -1;
103 vDriftNew = vDriftData.
vdrift;
105 LogVerbatim(
"Calibration") <<
"vDrift for: " << slId <<
" Mean " << vDriftNew <<
" Resolution " 108 LogError(
"Calibration") <<
e.explainSelf();
122 LogVerbatim(
"Calibration") <<
"Keep original vDrift for: " << slId <<
" Mean " << vDriftNew <<
" Resolution " 130 vector<double>
params = {vDriftNew};
137 LogVerbatim(
"Calibration") <<
"[DTVDriftWriter]Writing vdrift object to DB!";
139 string record =
"DTMtimeRcd";
140 DTCalibDBUtils::writeToDB<DTMtime>(
record, *mTimeNewMap);
142 DTCalibDBUtils::writeToDB<DTRecoConditions>(
"DTRecoConditionsVdriftRcd", *vDriftNewMap);
const edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcd > vDriftMapToken_
Log< level::Info, true > LogVerbatim
float get(const DTWireId &wireid, double *x=nullptr) const
Get the value correspoding to the given WireId, / using x[] as parameters of the parametrization when...
edm::ESHandle< DTGeometry > dtGeom_
const DTRecoConditions * vDriftMap_
int version() const
Version numer specifying the structure of the payload. See .cc file for details.
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Log< level::Error, false > LogError
DTVDriftWriter(const edm::ParameterSet &pset)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const edm::ESGetToken< DTMtime, DTMtimeRcd > mTimeMapToken_
~DTVDriftWriter() override
std::unique_ptr< dtCalibration::DTVDriftBaseAlgo > vDriftAlgo_
constexpr uint32_t rawId() const
get the raw id
const DTMtime * mTimeMap_
void beginRun(const edm::Run &run, const edm::EventSetup &setup) override
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.