![]() |
![]() |
00001 // COCOA class header file 00002 //Id: Entry.h 00003 //CAT: Model 00004 // 00005 // Base class for entries 00006 // 00007 // History: v1.0 00008 // Pedro Arce 00009 00010 #ifndef _ENTRY_HH 00011 #define _ENTRY_HH 00012 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h" 00013 #include <vector> 00014 class OpticalObject; 00015 class EntryData; 00016 enum EntryDim { ED_length, ED_angle, ED_nodim }; 00017 00018 class Entry 00019 { 00020 00021 friend std::ostream& operator << (std::ostream& os, const Entry& c); 00022 00023 public: 00024 //----- Constructor / destructor 00025 //- Entry(){ }; 00026 Entry( const ALIstring& type ); 00027 virtual ~Entry(); 00028 00029 //----- Fill the attributes 00030 void fill( const std::vector<ALIstring>& wordlist); 00031 //----- Fill the name (in derived classes is not simply calling setName) 00032 virtual void fillName( const ALIstring& name ); 00033 //----- Fill the attributes setting them to 0. 00034 void fillNull( ); 00035 00036 //----- Return value and sigma dimension factor (implemented in derived classes 00037 virtual ALIdouble ValueDimensionFactor() const{ return 1.; } 00038 virtual ALIdouble SigmaDimensionFactor() const{ return 1.; } 00039 virtual ALIdouble OutputValueDimensionFactor() const{ return 1.; } 00040 virtual ALIdouble OutputSigmaDimensionFactor() const{ return 1.; } 00041 00042 //----- Displace the value by 'disp' (affine frame entries do it theirselves) 00043 virtual void displace( ALIdouble disp ); 00044 //----- Tell the corresponding OptO to displace the Extra Entry (affine frame entries do it theirselves) 00045 virtual void displaceOriginal( ALIdouble disp ); 00046 virtual void displaceOriginalOriginal( ALIdouble disp ); 00047 00048 //----- return the value, that is in Global Reference Frame 00049 virtual ALIdouble valueInGlobalReferenceFrame() const {return value();}; 00050 00051 // Access DATA MEMBERS 00052 const ALIstring& name() const { return name_; } 00053 const ALIstring longName() const; 00054 const ALIstring& type() const { return type_; } 00055 ALIdouble value() const { return value_; } 00056 ALIdouble valueOriginalOriginal() const { return valueOriginalOriginal_; } 00057 ALIdouble sigma() const { return sigma_; } 00058 ALIdouble sigmaOriginalOriginal() const { return sigmaOriginalOriginal_; } 00059 ALIint quality() const { return quality_; } 00060 ALIint fitPos() const { return fitPos_; } 00061 OpticalObject* OptOCurrent() const{ return OptOCurrent_; } // non const, Displace( ) modifies it return _OptOCurrent; 00062 virtual ALIdouble valueDisplaced() const; 00063 ALIdouble valueDisplacementByFitting() const{ 00064 //- cout << this << " " << name() << " get valueDisplacementByFitting " << theValueDisplacementByFitting << endl; 00065 return valueDisplacementByFitting_; } 00066 void resetValueDisplacementByFitting(); 00067 virtual ALIdouble startingDisplacement(){ return 0.; }; 00068 ALIdouble lastAdditionToValueDisplacementByFitting() const { 00069 return lastAdditionToValueDisplacementByFitting_; } 00070 void setLastAdditionToValueDisplacementByFitting( const ALIdouble val ){ 00071 lastAdditionToValueDisplacementByFitting_ = val; } 00072 00073 public: 00074 // Set DATA MEMBERS 00075 void setName( const ALIstring& name ) { name_ = name; } 00076 void setType( ALIstring type ){ type_ = type; } 00077 void setValue( ALIdouble val ){ value_ = val; } 00078 void setSigma( ALIdouble sig ){ sigma_ = sig; } 00079 void setQuality( ALIuint qual ){ quality_ = qual; } 00080 void setFitPos( const ALIint fitpos ) { fitPos_ = fitpos; } 00081 void setOptOCurrent( OpticalObject* opto ){ OptOCurrent_ = opto; } 00082 void addFittedDisplacementToValue(const ALIdouble val); 00083 00084 void substractToHalfFittedDisplacementToValue(); 00085 00086 EntryDim getDimType() const { return theDimType;} 00087 00088 private: 00089 //----- Fill the attributes with values read from a 'report.out' file 00090 void fillFromReportOutFileValue( EntryData* entryData ); 00091 void fillFromReportOutFileSigma( const EntryData* entryData ); 00092 void fillFromReportOutFileQuality( const EntryData* entryData ); 00093 //----- Fill the attributes with values read from the input file 00094 void fillFromInputFileValue( const std::vector<ALIstring>& wordlist ); 00095 void fillFromInputFileSigma( const std::vector<ALIstring>& wordlist ); 00096 void fillFromInputFileQuality( const std::vector<ALIstring>& wordlist ); 00097 00098 private: 00099 // private DATA MEMBERS 00100 protected: 00101 ALIstring name_; 00102 ALIstring type_; 00103 ALIdouble value_; 00104 ALIdouble valueOriginalOriginal_; 00105 ALIdouble sigma_; 00106 ALIdouble sigmaOriginalOriginal_; 00107 ALIuint quality_; 00108 OpticalObject* OptOCurrent_; 00109 ALIint fitPos_; 00110 00111 ALIdouble valueDisplacementByFitting_; 00112 ALIdouble lastAdditionToValueDisplacementByFitting_; 00113 00114 /* 00115 virtual void DisplaceParameter( ALIint paramNo, ALIdouble displace ){ }; 00116 virtual ALIdouble Check_displacementDimensions( ALIdouble displace ){ 00117 return displace; } 00118 */ 00119 EntryDim theDimType; 00120 00121 }; 00122 00123 #endif