#include <Alignment/CocoaModel/interface/MeasurementCOPS.h>
Public Member Functions | |
virtual void | calculateSimulatedValue (ALIbool firstTime) |
virtual void | correctValueAndSigma () |
MeasurementCOPS () | |
MeasurementCOPS (const ALIint measdim, ALIstring &type, ALIstring &name) | |
virtual void | setConversionFactor (const std::vector< ALIstring > &wordlist) |
virtual void | setXlaserLine (uint ii, int val) |
virtual int | xlaserLine (uint ii) |
~MeasurementCOPS () | |
Private Attributes | |
ALIdouble | theDisplace [4] |
ALIint | theXlaserLine [4] |
Definition at line 18 of file MeasurementCOPS.h.
MeasurementCOPS::MeasurementCOPS | ( | const ALIint | measdim, | |
ALIstring & | type, | |||
ALIstring & | name | |||
) | [inline] |
Definition at line 21 of file MeasurementCOPS.h.
References theXlaserLine.
00022 : Measurement( measdim, type, name ){ 00023 for(uint ii=0; ii<4; ii++) theXlaserLine[ii] = -1; 00024 };
MeasurementCOPS::MeasurementCOPS | ( | ) | [inline] |
MeasurementCOPS::~MeasurementCOPS | ( | ) | [inline] |
Reimplemented from Measurement.
Definition at line 24 of file MeasurementCOPS.cc.
References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), end, lat::endl(), cmsRelvalreport::exit, ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), Measurement::getMeasuringBehaviour(), GlobalOptionMgr::GlobalOptions(), Measurement::name(), Measurement::OptOList(), LightRay::point(), Measurement::printStartCalculateSimulatedValue(), size, and Measurement::type().
00025 { 00026 00027 if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas 00028 00029 //---------- Create light ray 00030 LightRay lightray; 00031 00032 //---------- Define types of OptO that may take part in the Measurement 00033 ALIuint isec = 0; //security variable to check OptOList().size() 00034 00035 //---------- Loop list of OptO that take part in measurement 00036 std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin(); 00037 if( ALIUtils::debug >= 5) std::cout << "OptOList size" <<OptOList().size() << std::endl; 00038 00039 //----- Check that first object is 'Xlaser' 00040 if( (*vocite)->type() != "Xlaser" ) { 00041 std::cerr << "!!ERROR MeasurementCOPS: first Optical object should be 'Xlaser'" << std::endl; 00042 DumpBadOrderOptOs(); 00043 exit(1); 00044 } 00045 00046 //---------- Check that last object is a COPS Sensor (that makes measuremnt and kill the lightray) 00047 if( ( *(OptOList().end() -1) )->type() != "COPS" ) { 00048 std::cerr << "!!ERROR MeasurementCOPS: last Optical object should be 'COPS'" << std::endl; 00049 DumpBadOrderOptOs(); 00050 exit(1); 00051 } 00052 00053 #ifdef COCOA_VIS 00054 ALIVisLightPath* vispath = 0; 00055 if( ALIUtils::getFirstTime() ) { 00056 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00057 if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) { 00058 vispath = IgCocoaFileMgr::getInstance().newLightPath( name() ); 00059 } 00060 } 00061 #endif 00062 std::cout << (vocite == OptOList().end()) << " vocite " << (*vocite)->name() << std::endl; 00063 while( vocite != OptOList().end() ) { 00064 if( ALIUtils::debug >= -2) std::cout << std::endl << "@@@@ LR:OBJECT " << (*vocite)->name() << std::endl; 00065 isec ++; 00066 00067 //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...) 00068 ALIstring behav = getMeasuringBehaviour(vocite); 00069 00070 if( &lightray ) { 00071 (*vocite)->participateInMeasurement( lightray, *this, behav ); 00072 #ifdef COCOA_VIS 00073 if( ALIUtils::getFirstTime() ) { 00074 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00075 if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) { 00076 ALIVRMLMgr::getInstance().addLightPoint( lightray.point()); 00077 // std::cout << "ALIVRMLMg addLightPoint " << lightray.point() << (*vocite)->name() << std::endl; 00078 } 00079 if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) { 00080 vispath->addLightPoint( lightray.point(), *vocite ); 00081 } 00082 } 00083 #endif 00084 } else { 00085 std::cerr << "!! Last object is not Sensor 2D in measurement " << name() << std::endl; 00086 DumpBadOrderOptOs(); 00087 exit(1); 00088 } 00089 00090 vocite++; 00091 if ( isec > OptOList().size() ) { 00092 std::cerr << "ERROR DE PROGRAMACION EN GetSimulatedValue" << std::endl; 00093 exit(5); 00094 } 00095 } 00096 00097 00098 if(ALIUtils::debug >= 9) std::cout << "end calculateSimulatedValue" <<std::endl; 00099 00100 }
void MeasurementCOPS::correctValueAndSigma | ( | ) | [virtual] |
Reimplemented from Measurement.
Definition at line 137 of file MeasurementCOPS.cc.
References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::dim(), lat::endl(), Measurement::setValue(), theDisplace, and Measurement::value().
00138 { 00139 //---------- Make displacement 00140 ALIuint ii; 00141 for( ii = 0; ii < dim(); ii++) { 00142 ALIdouble val = value()[ii]; 00143 val += theDisplace[ii]; 00144 if(ALIUtils::debug >= 9) std::cout << "MeasurementCOPS::correctValueAndSigma: old value X " << value()[ii] << " new " << val << " +- " << std::endl; 00145 setValue( ii, val ); 00146 } 00147 00148 }
Reimplemented from Measurement.
Definition at line 109 of file MeasurementCOPS.cc.
References TestMuL1L2Filter_cff::cerr, Measurement::dim(), ALIUtils::dumpVS(), lat::endl(), cmsRelvalreport::exit, ALIUtils::IsNumber(), theDisplace, and Measurement::valueDimensionFactor().
00110 { 00111 //--------- Set it to 0 00112 ALIuint ii; 00113 for( ii = 0; ii < dim(); ii++) { 00114 theDisplace[ii] = 0.; 00115 } 00116 00117 //--------- Check that the format is OK 00118 if(wordlist.size() == 1) return; 00119 if( wordlist.size() != 3 00120 || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[2]) 00121 || !ALIUtils::IsNumber(wordlist[3]) || !ALIUtils::IsNumber(wordlist[4]) ) { 00122 std::cerr << "!! SensorCOPS Measurement setConversionFactor: WRONG FORMAT "<< std::endl 00123 << "It should be: SENSOR2D displace_U displace_D displace_L displace_R " << std::endl 00124 << "It is: "; 00125 ALIUtils::dumpVS( wordlist, " ", std::cerr ); 00126 exit(1); 00127 } 00128 00129 for( ii = 0; ii < dim(); ii++) { 00130 theDisplace[ii] = atof(wordlist[ii+1].c_str())* valueDimensionFactor(); 00131 } 00132 00133 }
Reimplemented from Measurement.
Definition at line 39 of file MeasurementCOPS.h.
00039 { 00040 theXlaserLine[ii] = val;};
virtual int MeasurementCOPS::xlaserLine | ( | uint | ii | ) | [inline, virtual] |
Reimplemented from Measurement.
Definition at line 36 of file MeasurementCOPS.h.
References theXlaserLine.
00036 { 00037 return theXlaserLine[ii]; 00038 }
ALIdouble MeasurementCOPS::theDisplace[4] [private] |
Definition at line 40 of file MeasurementCOPS.h.
Referenced by correctValueAndSigma(), and setConversionFactor().
ALIint MeasurementCOPS::theXlaserLine[4] [private] |