Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _MEASUREMENT_HH
00014 #define _MEASUREMENT_HH
00015
00016 #include <vector>
00017 #include <cstdlib>
00018
00019 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
00020 #include "Alignment/CocoaUtilities/interface/ALIUtils.h"
00021 class OpticalObject;
00022 class Entry;
00023 class EntryLength;
00024 class OpticalAlignMeasurementInfo;
00025 class OpticalAlignParam;
00026
00027 class Measurement
00028 {
00029 public:
00030
00031 Measurement( const ALIint measdim, ALIstring& type, ALIstring& name );
00032 Measurement(){ };
00033 virtual ~Measurement();
00034
00035
00036 void construct();
00037 void postConstruct();
00038
00039 virtual void buildOptONamesList( const std::vector<ALIstring>& wl );
00040
00041 void fillData(ALIuint coor, const std::vector<ALIstring>& wl );
00042 void fillData( ALIuint coor, OpticalAlignParam* oaParam);
00043
00044
00045 void buildOptOList();
00046
00047 void buildAffectingEntryList();
00048 void addAffectingEntriesFromOptO( const OpticalObject* optoP );
00049
00050
00051 virtual void calculateSimulatedValue( ALIbool firstTime ) {};
00052
00053 void calculateOriginalSimulatedValue();
00054
00055
00056 void DumpBadOrderOptOs();
00057
00058
00059 std::vector<ALIdouble> DerivativeRespectEntry( Entry* entry );
00060
00061
00062 ALIstring getMeasuringBehaviour( const std::vector< OpticalObject* >::const_iterator vocite);
00063
00064
00065 const OpticalObject* getPreviousOptO( const OpticalObject* Popto ) const;
00066
00067 virtual void correctValueAndSigma(){};
00068
00069
00070 virtual void setConversionFactor( const std::vector<ALIstring>& wordlist ){
00071 std::cerr << " Measurement::setConversionFactor should never be called " << std::endl;
00072 exit(1); };
00073
00075 static void setCurrentDate( const std::vector<ALIstring>& wl );
00076
00077 void copyMeas( Measurement* meas, const std::string& subsstr1, const std::string& subsstr2 );
00078
00079 void constructFromOA( OpticalAlignMeasurementInfo& measInfo);
00080
00081
00082 const ALIuint dim() const {
00083 return theDim;
00084 }
00085
00086 const ALIstring& type() const {
00087 return theType;
00088 }
00089
00090 const ALIstring& name() const {
00091 return theName;
00092 }
00093
00094 const ALIstring& sensorName() {
00095 ALIstring sensName = theName;
00096 ALIint colon = theName.find(':');
00097 theName = theName.substr(colon+1, theName.length()-colon);
00098 return theName;
00099 }
00100
00101
00102
00103
00104
00105 const std::vector<ALIstring>& OptONameList() const {
00106 return _OptONameList;
00107 }
00108
00109 const std::vector<OpticalObject*>& OptOList() const {
00110 return _OptOList;
00111 }
00112
00113 const std::vector<Entry*>& affectingEntryList() const {
00114 return theAffectingEntryList;
00115 }
00116
00117 const ALIdouble valueSimulated( ALIuint ii ) const {
00118 return theValueSimulated[ii];
00119 }
00120
00121 const ALIdouble valueSimulated_orig( ALIuint ii ) const {
00122 return theValueSimulated_orig[ii];
00123 }
00124
00125 const ALIdouble* value() const {
00126 return theValue;
00127 }
00128 const ALIdouble value( ALIuint ii ) const {
00129 return theValue[ii];
00130 }
00131
00132 const ALIdouble* sigma() const {
00133 return theSigma;
00134 }
00135
00136 const ALIdouble sigma( ALIuint ii) const {
00137 return theSigma[ii];
00138 }
00139
00140 const ALIstring valueType( ALIuint ii) const {
00141 return theValueType[ii];
00142 }
00143
00144 virtual const ALIdouble valueDimensionFactor() const{
00145 return ALIUtils::LengthValueDimensionFactor();
00146 }
00147
00148 virtual const ALIdouble sigmaDimensionFactor() const{
00149 return ALIUtils::LengthSigmaDimensionFactor();
00150 }
00151
00152 static ALIstring getCurrentDate(){
00153 return theCurrentDate;
00154 }
00155 static ALIstring getCurrentTime(){
00156 return theCurrentTime;
00157 }
00158
00159 const CLHEP::Hep3Vector& getLightRayPosition( ) const{
00160 return theLightRayPosition;
00161 }
00162 const CLHEP::Hep3Vector& getLightRayDirection( ) const{
00163 return theLightRayDirection;
00164 }
00165
00166
00167 void setValue( ALIint coor, ALIdouble val) {
00168 theValue[coor] = val;
00169 }
00170
00171 void setSigma( ALIint coor, ALIdouble val) {
00172 theSigma[coor] = val;
00173
00174 }
00175
00176 void setType( ALIstring type ) {
00177 theType = type;
00178 }
00179
00180 void SetDimension(ALIuint dim) {
00181 theDim = dim;
00182 }
00183
00184 void AddOptONameListItem(ALIstring optos) {
00185 _OptONameList.push_back( optos );
00186 }
00187
00188 void AddOptOListItem(OpticalObject* opto) {
00189 _OptOList.push_back( opto );
00190 }
00191
00192 void setValueSimulated_orig( ALIint coor, ALIdouble value) {
00193 theValueSimulated_orig[coor] = value;
00194 }
00195
00196 void setValueSimulated( ALIint coor, ALIdouble value) {
00197 theValueSimulated[coor] = value;
00198 }
00199 virtual int xlaserLine( ALIuint ii) { std::cerr << "!!!! Measurement::xlaserLine is not returning anything " << std::endl; abort(); };
00200
00201
00202 void setName();
00203
00204
00205 bool valueIsSimulated(ALIint coor) {
00206 return theValueIsSimulated[coor];
00207 }
00208
00209 virtual void setXlaserLine( ALIuint ii, int val ) { };
00210
00211 static ALIdouble cameraScaleFactor;
00212
00213 static ALIstring& measurementsFileName() {
00214 return theMeasurementsFileName;
00215 }
00216 static void setMeasurementsFileName( const ALIstring& filename ) {
00217
00218 theMeasurementsFileName = filename;
00219
00220 }
00221
00222 void setLightRayPosition( const CLHEP::Hep3Vector& lightRayPosition )
00223 { theLightRayPosition = lightRayPosition; }
00224 void setLightRayDirection( const CLHEP::Hep3Vector& lightRayDirection )
00225 { theLightRayDirection = lightRayDirection; }
00226
00227 protected:
00228
00229 void Substitute2p( ALIstring& ref, const ALIstring& firstref, int NtwoPoints);
00230 void printStartCalculateSimulatedValue( const Measurement* meas);
00231
00232
00233
00234 private:
00235 ALIuint theDim;
00236 ALIstring theType;
00237 ALIdouble* theValue;
00238 ALIdouble* theSigma;
00239 ALIstring theName;
00240 ALIstring* theValueType;
00241
00242
00243 ALIdouble* theValueSimulated;
00244
00245 ALIdouble* theValueSimulated_orig;
00246
00247
00248
00249
00250
00251 ALIbool* theValueIsSimulated;
00252
00253
00254 std::vector<ALIstring> _OptONameList;
00255
00256 std::vector<OpticalObject*> _OptOList;
00257
00258 std::vector<Entry*> theAffectingEntryList;
00259
00260 CLHEP::Hep3Vector theLightRayPosition;
00261 CLHEP::Hep3Vector theLightRayDirection;
00262 static ALIstring theMeasurementsFileName;
00263
00264 static ALIstring theCurrentDate;
00265 static ALIstring theCurrentTime;
00266 public:
00267 static ALIbool only1;
00268 static ALIstring only1Date;
00269 static ALIstring only1Time;
00270
00271 };
00272
00273 #endif