Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:07

0001 #ifndef MILLEPEDEVARIABLES_H
0002 #define MILLEPEDEVARIABLES_H
0003 
0004 /**
0005  * \class MillePedeVariables
0006  *
0007  * container for millepede specific variables attached to AlignmentParameters
0008  *
0009  *  \author    : Gero Flucke
0010  *  date       : November 2006
0011  *  $Revision: 1.3 $
0012  *  $Date: 2007/03/16 17:03:02 $
0013  *  (last update by $Author: flucke $)
0014  */
0015 
0016 #include "Alignment/CommonAlignment/interface/AlignmentUserVariables.h"
0017 
0018 #include <string>
0019 #include <vector>
0020 
0021 class MillePedeVariables : public AlignmentUserVariables {
0022 public:
0023   /** constructor */
0024   MillePedeVariables(unsigned int nParams, unsigned int label, const std::string& name);
0025   /** destructor */
0026   ~MillePedeVariables() override = default;
0027   /** clone method (using copy constructor) */
0028   MillePedeVariables* clone() const override { return new MillePedeVariables(*this); }
0029 
0030   /// set default values for all data concerning nParam (false if nParam out of range)
0031   bool setAllDefault(unsigned int nParam);
0032   /// number of parameters
0033   unsigned int size() const { return myIsValid.size(); }
0034 
0035   /// get valid flag array
0036   const std::vector<bool>& isValid() const { return myIsValid; }
0037   /// get valid flag array for changing it
0038   std::vector<bool>& isValid() { return myIsValid; }
0039 
0040   /// get array of differences to start value
0041   const std::vector<float>& diffBefore() const { return myDiffBefore; }
0042   /// get array of differences to start value for changing it
0043   std::vector<float>& diffBefore() { return myDiffBefore; }
0044 
0045   /// get global correlation array
0046   const std::vector<float>& globalCor() const { return myGlobalCor; }
0047   /// get global correlation array for changing it
0048   std::vector<float>& globalCor() { return myGlobalCor; }
0049 
0050   /// get array of presigmas (<= 0: means fixed)
0051   const std::vector<float>& preSigma() const { return myPreSigma; }
0052   /// get array of presigmas (<= 0: means fixed) for changing it
0053   std::vector<float>& preSigma() { return myPreSigma; }
0054 
0055   /// get array of sigmas
0056   const std::vector<float>& sigma() const { return mySigma; }
0057   /// get array of sigmas for changing it
0058   std::vector<float>& sigma() { return mySigma; }
0059 
0060   /// get array of parameters
0061   const std::vector<float>& parameter() const { return myParameter; }
0062   /// get array of parameters for changing it
0063   std::vector<float>& parameter() { return myParameter; }
0064 
0065   /// get alignable label as used by pede
0066   unsigned int label() const { return myLabel; }
0067   /// set alignable label as used by pede
0068   void setLabel(unsigned int label) { myLabel = label; }
0069 
0070   /// get alignable name
0071   const std::string& name() const { return myName; }
0072   /// set alignable name
0073   void setName(const std::string& name) { myName = name; }
0074 
0075   /// get number of hits for x-measurement
0076   unsigned int hitsX() const { return myHitsX; }
0077   /// increase hits for x-measurement
0078   void increaseHitsX(unsigned int add = 1) { myHitsX += add; }
0079   void setHitsX(unsigned int hitsX) { myHitsX = hitsX; }
0080 
0081   /// get number of hits for y-measurement
0082   unsigned int hitsY() const { return myHitsY; }
0083   /// increase hits for y-measurement
0084   void increaseHitsY(unsigned int add = 1) { myHitsY += add; }
0085   void setHitsY(unsigned int hitsY) { myHitsY = hitsY; }
0086 
0087   /// true if parameter is fixed
0088   bool isFixed(unsigned int nParam) const;
0089 
0090 private:
0091   MillePedeVariables() {}  // make unusable default constructor
0092 
0093   std::vector<bool> myIsValid;
0094   std::vector<float> myDiffBefore;
0095   std::vector<float> myGlobalCor;
0096   std::vector<float> myPreSigma;  /// <= 0 means fixed
0097   std::vector<float> myParameter;
0098   std::vector<float> mySigma;
0099   unsigned int myHitsX;
0100   unsigned int myHitsY;
0101   unsigned int myLabel;
0102   std::string myName;
0103 };
0104 
0105 #endif