Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
/**
 * \file MillePedeVariables.cc
 *
 *
 *  \author    : Gero Flucke
 *  date       : November 2006
 *  $Revision: 1.4 $
 *  $Date: 2007/08/17 17:20:05 $
 *  (last update by $Author: flucke $)
 */

#include "Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeVariables.h"

//__________________________________________________________________________________________________
MillePedeVariables::MillePedeVariables(unsigned int nParams, unsigned int label, const std::string& name)
    : myIsValid(nParams),
      myDiffBefore(nParams),
      myGlobalCor(nParams),
      myPreSigma(nParams),
      myParameter(nParams),
      mySigma(nParams),
      myHitsX(0),
      myHitsY(0),
      myLabel(label),
      myName(name) {
  for (unsigned int i = 0; i < nParams; ++i) {
    this->setAllDefault(i);
  }
}

//__________________________________________________________________________________________________
bool MillePedeVariables::setAllDefault(unsigned int nParam) {
  if (nParam >= this->size())
    return false;

  myIsValid[nParam] = true;
  myDiffBefore[nParam] = -999999.;
  myGlobalCor[nParam] = -.2;  // -1. seems to occur also in pede output
  myPreSigma[nParam] = -11.;  // -1 means fixed in pede
  myParameter[nParam] = -999999.;
  mySigma[nParam] = -1.;

  return true;
}

//__________________________________________________________________________________________________
bool MillePedeVariables::isFixed(unsigned int nParam) const {
  if (nParam >= this->size())
    return false;

  return (this->preSigma()[nParam] < 0.);
}