#include <Alignment/CocoaModel/interface/MeasurementDistancemeter3dim.h>
Public Member Functions | |
virtual void | calculateSimulatedValue (ALIbool firstTime) |
virtual void | correctValueAndSigma () |
MeasurementDistancemeter3dim () | |
MeasurementDistancemeter3dim (const ALIint measdim, ALIstring &type, ALIstring &name) | |
virtual void | setConversionFactor (const std::vector< ALIstring > &wordlist) |
~MeasurementDistancemeter3dim () | |
Private Attributes | |
ALIdouble | theFactor |
ALIdouble | theFactorSigma |
Definition at line 18 of file MeasurementDistancemeter3dim.h.
MeasurementDistancemeter3dim::MeasurementDistancemeter3dim | ( | const ALIint | measdim, | |
ALIstring & | type, | |||
ALIstring & | name | |||
) | [inline] |
Definition at line 21 of file MeasurementDistancemeter3dim.h.
00022 : Measurement( measdim, type, name ), theFactor(1.), theFactorSigma(0.){ };
MeasurementDistancemeter3dim::MeasurementDistancemeter3dim | ( | ) | [inline] |
MeasurementDistancemeter3dim::~MeasurementDistancemeter3dim | ( | ) | [inline] |
Reimplemented from Measurement.
Definition at line 25 of file MeasurementDistancemeter3dim.cc.
References begin, TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), lat::endl(), exception, ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), Measurement::getMeasuringBehaviour(), GlobalOptionMgr::GlobalOptions(), Measurement::name(), Measurement::OptOList(), LightRay::point(), Measurement::printStartCalculateSimulatedValue(), size, and Measurement::type().
00026 { 00027 00028 if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas 00029 00030 //---------- Loop list of OptO that take part in measurement 00031 std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin(); 00032 if( ALIUtils::debug >= 5) std::cout << "OptOList size" <<OptOList().size() << std::endl; 00033 00034 //----- Check that there are only two measurements that are 'distance_target' and 'distancemeter3dim' 00035 ALIbool right_objects = 0; 00036 if( OptOList().size() == 2 ) { 00037 if( (*vocite)->type() == "distance_target" 00038 && ( (*(vocite+1))->type() == "distancemeter3dim" ) ) { 00039 right_objects = 1; 00040 } 00041 } 00042 if( !right_objects ) { 00043 std::cerr << "!!! ERROR in MeasurementDistancemeter3dim: " << name() << " There should only be two objects of type 'distance_target' and 'distancemeter3dim' " << std::endl; 00044 std::cerr << " 1st " << (*vocite)->name() << " 2nd " << (*vocite+1)->name() << std::endl; 00045 std::cerr << " 1st " << (*vocite)->type() << " 2nd " << (*vocite+1)->type() << std::endl; 00046 00047 DumpBadOrderOptOs(); 00048 std::exception(); 00049 } 00050 00051 #ifdef COCOA_VIS 00052 ALIVisLightPath* vispath = 0; 00053 if( ALIUtils::getFirstTime() ) { 00054 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00055 if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) { 00056 vispath = IgCocoaFileMgr::getInstance().newLightPath( name() ); 00057 } 00058 } 00059 #endif 00060 00061 ALIuint isec = 0; //security variable to check OptOList().size() 00062 for( vocite = OptOList().begin(); vocite != OptOList().end(); vocite++) { 00063 if( ALIUtils::debug >= 2) std::cout << std::endl << "@@@@ LR:OBJECT " << (*vocite)->name() << std::endl; 00064 isec ++; 00065 00066 //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...) 00067 ALIstring behav = getMeasuringBehaviour(vocite); 00068 00069 //---------- participate in measurement 00070 LightRay lightray; //it is not used in this measurement type 00071 (*vocite)->participateInMeasurement( lightray, *this, behav); 00072 00073 #ifdef COCOA_VIS 00074 if( ALIUtils::getFirstTime() ) { 00075 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00076 if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) { 00077 ALIVRMLMgr::getInstance().addLightPoint( lightray.point() ); 00078 if(ALIUtils::debug >= 5)std::cout << "ALIVRMLMg addLightPoint " << lightray.point() << (*vocite)->name() << std::endl; 00079 } 00080 if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) { 00081 vispath->addLightPoint( lightray.point(), *vocite ); 00082 } 00083 } 00084 #endif 00085 00086 if ( isec > OptOList().size() ) { 00087 std::cerr << "ERROR DE PROGRAMACION EN GetSimulatedValue" << std::endl; 00088 std::exception(); 00089 } 00090 } 00091 00092 if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl; 00093 00094 }
void MeasurementDistancemeter3dim::correctValueAndSigma | ( | ) | [virtual] |
Reimplemented from Measurement.
Definition at line 137 of file MeasurementDistancemeter3dim.cc.
References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, lat::endl(), Measurement::setSigma(), Measurement::setValue(), Measurement::sigma(), theFactor, and Measurement::value().
00138 { 00139 ALIdouble val = value()[0]; 00140 ALIdouble sig = sigma()[0]; 00141 if(ALIUtils::debug >= 4) std::cout << "MeasurementDistancemeter3dim::correctValueAndSigma: old value" << val << " +- " << sig << std::endl; 00142 00143 //- std::cout << "FACTOR " << theFactor << "correct " << val << " " << thePedestal << std::endl; 00144 val *= theFactor; 00145 //-------- Do not correct the sigma!!!! 00146 //- sig *= theFactor; 00147 if(ALIUtils::debug >= 4) std::cout << "MeasuremenDistancemeter3dim::correctValueAndSigma: new value " << val << " +- " << sig << std::endl; 00148 setValue( 0, val ); 00149 setSigma( 0, sig ); 00150 00151 }
void MeasurementDistancemeter3dim::setConversionFactor | ( | const std::vector< ALIstring > & | wordlist | ) | [virtual] |
Reimplemented from Measurement.
Definition at line 102 of file MeasurementDistancemeter3dim.cc.
References TestMuL1L2Filter_cff::cerr, ALIUtils::dumpVS(), lat::endl(), exception, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), ALIUtils::IsNumber(), theFactor, and theFactorSigma.
00103 { 00104 //--------- Check that the format is OK 00105 if(wordlist.size() == 1) return; 00106 if( wordlist.size() != 4 00107 || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[3]) 00108 || wordlist[2] != ALIstring("+-") ){ 00109 std::cerr << "!! Distancemeter3dim Measurement setConversionFactor: WRONG FORMAT "<< std::endl 00110 << "It should be: DISTANCEMETER3DIM factor +- error " << std::endl 00111 << "It is: "; 00112 ALIUtils::dumpVS( wordlist, " ", std::cerr ); 00113 std::exception(); 00114 } 00115 theFactor = atof(wordlist[1].c_str()); 00116 //------ correct by dimension of value of tiltmeter 00117 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00118 ALIint dimfac = ALIint( gomgr->GlobalOptions()[ ALIstring("distancemeter_meas_value_dimension") ] ); 00119 if( dimfac == 0 ) { 00120 theFactor *= 1.; 00121 } else if( dimfac == 1 ) { 00122 theFactor *= 1.E-3; 00123 } else if( dimfac == 2 ) { 00124 theFactor *= 1.E-6; 00125 } else { 00126 std::cerr << " !!!EXITING: error in global option distancemeter3dim_meas_value_dimension, it can only take values 0,1,2, not " << dimfac; 00127 std::exception(); 00128 } 00129 theFactorSigma = atof(wordlist[3].c_str()); 00130 00131 }
Definition at line 36 of file MeasurementDistancemeter3dim.h.
Referenced by correctValueAndSigma(), and setConversionFactor().