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