Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:26

0001 //  COCOA class header file

0002 //Id:  Entry.h

0003 //CAT: Model

0004 //

0005 //   Base class for entries

0006 //

0007 //   History: v1.0

0008 //   Pedro Arce

0009 
0010 #ifndef _ENTRY_HH
0011 #define _ENTRY_HH
0012 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
0013 #include <vector>
0014 class OpticalObject;
0015 class EntryData;
0016 enum EntryDim { ED_length, ED_angle, ED_nodim };
0017 
0018 class Entry {
0019   friend std::ostream& operator<<(std::ostream& os, const Entry& c);
0020 
0021 public:
0022   //----- Constructor / destructor

0023   //-  Entry(){ };

0024   Entry(const ALIstring& type);
0025   virtual ~Entry();
0026 
0027   //----- Fill the attributes

0028   void fill(const std::vector<ALIstring>& wordlist);
0029   //----- Fill the name (in derived classes is not simply calling setName)

0030   virtual void fillName(const ALIstring& name);
0031   //----- Fill the attributes setting them to 0.

0032   void fillNull();
0033 
0034   //----- Return value and sigma dimension factor (implemented in derived classes

0035   virtual ALIdouble ValueDimensionFactor() const { return 1.; }
0036   virtual ALIdouble SigmaDimensionFactor() const { return 1.; }
0037   virtual ALIdouble OutputValueDimensionFactor() const { return 1.; }
0038   virtual ALIdouble OutputSigmaDimensionFactor() const { return 1.; }
0039 
0040   //----- Displace the value by 'disp' (affine frame entries do it theirselves)

0041   virtual void displace(ALIdouble disp);
0042   //----- Tell the corresponding OptO to displace the Extra Entry (affine frame entries do it theirselves)

0043   virtual void displaceOriginal(ALIdouble disp);
0044   virtual void displaceOriginalOriginal(ALIdouble disp);
0045 
0046   //----- return the value, that is in Global Reference Frame

0047   virtual ALIdouble valueInGlobalReferenceFrame() const { return value(); };
0048 
0049   // Access DATA MEMBERS

0050   const ALIstring& name() const { return name_; }
0051   const ALIstring longName() const;
0052   const ALIstring& type() const { return type_; }
0053   ALIdouble value() const { return value_; }
0054   ALIdouble valueOriginalOriginal() const { return valueOriginalOriginal_; }
0055   ALIdouble sigma() const { return sigma_; }
0056   ALIdouble sigmaOriginalOriginal() const { return sigmaOriginalOriginal_; }
0057   ALIint quality() const { return quality_; }
0058   ALIint fitPos() const { return fitPos_; }
0059   OpticalObject* OptOCurrent() const {
0060     return OptOCurrent_;
0061   }  // non const, Displace( ) modifies it return _OptOCurrent;

0062   virtual ALIdouble valueDisplaced() const;
0063   ALIdouble valueDisplacementByFitting() const {
0064     //-    cout << this << " " << name() << " get valueDisplacementByFitting " << theValueDisplacementByFitting << endl;

0065     return valueDisplacementByFitting_;
0066   }
0067   void resetValueDisplacementByFitting();
0068   virtual ALIdouble startingDisplacement() { return 0.; };
0069   ALIdouble lastAdditionToValueDisplacementByFitting() const { return lastAdditionToValueDisplacementByFitting_; }
0070   void setLastAdditionToValueDisplacementByFitting(const ALIdouble val) {
0071     lastAdditionToValueDisplacementByFitting_ = val;
0072   }
0073 
0074 public:
0075   // Set DATA MEMBERS

0076   void setName(const ALIstring& name) { name_ = name; }
0077   void setType(ALIstring type) { type_ = type; }
0078   void setValue(ALIdouble val) { value_ = val; }
0079   void setSigma(ALIdouble sig) { sigma_ = sig; }
0080   void setQuality(ALIuint qual) { quality_ = qual; }
0081   void setFitPos(const ALIint fitpos) { fitPos_ = fitpos; }
0082   void setOptOCurrent(OpticalObject* opto) { OptOCurrent_ = opto; }
0083   void addFittedDisplacementToValue(const ALIdouble val);
0084 
0085   void substractToHalfFittedDisplacementToValue();
0086 
0087   EntryDim getDimType() const { return theDimType; }
0088 
0089 private:
0090   //-----  Fill the attributes with values read from a 'report.out' file

0091   void fillFromReportOutFileValue(EntryData* entryData);
0092   void fillFromReportOutFileSigma(const EntryData* entryData);
0093   void fillFromReportOutFileQuality(const EntryData* entryData);
0094   //-----  Fill the attributes with values read from the input file

0095   void fillFromInputFileValue(const std::vector<ALIstring>& wordlist);
0096   void fillFromInputFileSigma(const std::vector<ALIstring>& wordlist);
0097   void fillFromInputFileQuality(const std::vector<ALIstring>& wordlist);
0098 
0099 private:
0100   // private DATA MEMBERS

0101 protected:
0102   ALIstring name_;
0103   ALIstring type_;
0104   ALIdouble value_;
0105   ALIdouble valueOriginalOriginal_;
0106   ALIdouble sigma_;
0107   ALIdouble sigmaOriginalOriginal_;
0108   ALIuint quality_;
0109   OpticalObject* OptOCurrent_;
0110   ALIint fitPos_;
0111 
0112   ALIdouble valueDisplacementByFitting_;
0113   ALIdouble lastAdditionToValueDisplacementByFitting_;
0114 
0115   /*  

0116   virtual void DisplaceParameter( ALIint paramNo, ALIdouble displace ){ };  

0117   virtual ALIdouble Check_displacementDimensions( ALIdouble displace ){

0118     return displace; }

0119   */
0120   EntryDim theDimType;
0121 };
0122 
0123 #endif