private function getCalcId($dsBegin, $treeType)
    {
        $codeRegular = $codeForecast = '';
        if ($treeType == OptionTreeType::VAL_PLAIN) {
            $codeRegular = Cfg::CODE_TYPE_CALC_PV_WRITE_OFF;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PLAIN;
        } elseif ($treeType == OptionTreeType::VAL_COMPRESS) {
            $codeRegular = Cfg::CODE_TYPE_CALC_COMPRESS_PHASE1;
            $codeForecast = Cfg::CODE_TYPE_CALC_FORECAST_PHASE1;
        }
        $query = $this->qGetId->build();
        $conn = $query->getConnection();
        $bind = [
            QGetId::BND_DS_BEGIN => $dsBegin,
            QGetId::BND_TYPE_CODE_REGULAR => $codeRegular,
            QGetId::BND_TYPE_CODE_FORECAST => $codeForecast
        ];
        $result = $conn->fetchOne($query, $bind);
        return $result;
    }