Skip to content

ATLASRECTS-7817 : NswErrorCalibration introduce database infrastructure

Johannes Junggeburth requested to merge jojungge/athena:NswErrorDb into main

Hi everybody,

this MR introduces the Athena infrastrucutre to calibrate the NSW measurement uncertainties. Functions are predefined in the NswErrorCalibData. For the moment, these functions are just polynomials of the track inclanation angle, expressed in a frame where the z-axis always points to the big-wheels (cf. NswClusteringUtils)

errorParametrizer NswErrorCalibData::getParametrizer(const std::string& funcName) {
    if (funcName == "tanThetaPolynomial") {
        return [](const Input & input, const std::vector<double>& pars){
            return evalPoly(std::tan(input.locTheta), pars);
        };
    } else if (funcName == "thetaPolynomial") {
        return [](const Input & input, const std::vector<double>& pars){
            return evalPoly(input.locTheta, pars);
        };
    }
    /// Return a surprise box if the function is unknown
    return [funcName](const Input&, const std::vector<double>& ) {
        std::stringstream except_str{};
        except_str<<"NswErrorCalibData::parametrizer() - The function '"<<funcName<<"' is unknown.";
        except_str<<"Please check"<<__FILE__<<" for the set of valid function names. ";
        throw std::runtime_error(except_str.str());
        return 0.;
    };
}

For each NSW gasGap, we're going to upload a JSON blob into COOL decoding the parametrization function and the free parameters.

   {
     "station"        : "MMS",
     "eta"            : -2,
     "phi"            : 1,
     "multilayer"     : 1,
     "gasGap"         : 2,
     "minStrip"       : 1,
     "maxStrip"       : 8192,
     "modelName"      : "thetaPolynomial", 
     "modelPars"      : [0.074, 0.66, -0.15], 
     "clusterAuthor"  : 0
   },

The mapping of the modelName will be frozen to ensure that we're going to maintain the Tier0 policy in simulation allbeit the calibration cosntants in data are going to be updated for data. In principle, different error parametrizations can be defined for a constrained channel range + different sets of calibration constants can be loaded at the RDO->PRD & PRD -> ROT creation stage.

Further, the MR includes a clean-up of the Micromega cluster Builders:

  • Useage of move semantics where possible
  • Restructure, the central clustering part of the algorithm. Unroll the nested for loops into a single consecutive for loop.
  • Remove obsolete micromega cluster builders

Tagging: @kluit, @stavrop, @pscholer, @apsallid, @mvozak Target: https://its.cern.ch/jira/browse/ATLASRECTS-7817

Edited by Johannes Junggeburth

Merge request reports