![]() |
![]() |
#include <Alignment/CocoaModel/interface/MeasurementTiltmeter.h>
Public Member Functions | |
virtual void | calculateSimulatedValue (ALIbool firstTime) |
virtual void | correctValueAndSigma () |
MeasurementTiltmeter () | |
MeasurementTiltmeter (const ALIint measdim, ALIstring &type, ALIstring &name) | |
virtual void | setConversionFactor (const std::vector< ALIstring > &wordlist) |
~MeasurementTiltmeter () | |
Private Attributes | |
ALIdouble | theConstantTerm |
ALIdouble | theConstantTermSigma |
ALIdouble | theFactor |
ALIdouble | theFactorSigma |
ALIdouble | thePedestal |
ALIdouble | thePedestalSigma |
Definition at line 18 of file MeasurementTiltmeter.h.
MeasurementTiltmeter::MeasurementTiltmeter | ( | const ALIint | measdim, | |
ALIstring & | type, | |||
ALIstring & | name | |||
) | [inline] |
Definition at line 21 of file MeasurementTiltmeter.h.
00021 : Measurement( measdim, type, name ), theFactor(1.), theFactorSigma(0.), theConstantTerm(0.), theConstantTermSigma(0.), thePedestal(0.), thePedestalSigma(0.) 00022 { };
MeasurementTiltmeter::MeasurementTiltmeter | ( | ) | [inline] |
MeasurementTiltmeter::~MeasurementTiltmeter | ( | ) | [inline] |
Reimplemented from Measurement.
Definition at line 19 of file MeasurementTiltmeter.cc.
References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), lat::endl(), cmsRelvalreport::exit, Measurement::getMeasuringBehaviour(), Measurement::name(), Measurement::OptOList(), Measurement::printStartCalculateSimulatedValue(), and size.
00020 { 00021 00022 if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas 00023 00024 //--------- Check there is only one OptO of type 'tiltmeter' 00025 std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin(); 00026 if( OptOList().size() != 1 || 00027 (*vocite)->type() == "distancemeter") { 00028 std::cerr << "!!! ERROR in MeasurementTiltmeter: " << name() << " There should only be one object of type 'tiltmeter' " << std::endl; 00029 DumpBadOrderOptOs(); 00030 exit(1); 00031 } 00032 00033 //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...) 00034 ALIstring behav = getMeasuringBehaviour(vocite); 00035 00036 //---------- participate in Measurement 00037 LightRay ll; 00038 (*vocite)->participateInMeasurement( ll, *this, behav ); 00039 00040 if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl; 00041 00042 }
void MeasurementTiltmeter::correctValueAndSigma | ( | ) | [virtual] |
Reimplemented from Measurement.
Definition at line 99 of file MeasurementTiltmeter.cc.
References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, lat::endl(), Measurement::setSigma(), Measurement::setValue(), Measurement::sigma(), funct::sqrt(), theConstantTerm, theConstantTermSigma, theFactor, and Measurement::value().
00100 { 00101 ALIdouble val = value()[0]; 00102 ALIdouble sig = sigma()[0]; 00103 if(ALIUtils::debug >= 4) std::cout << "MeasurementTiltmeter::correctValueAndSigma: old value" << val << " +- " << sig << std::endl; 00104 //---------- Substract pedestal 00105 val -= theConstantTerm; 00106 //- sig = sqrt(sig*sig + thePedestalSigma*thePedestalSigma ); 00107 //- std::cout << " sigma + pedestalSigma " << sig << " " << thePedestalSigma << std::endl; 00108 //-if( thePedestal != 0. ) { 00109 //- sig += sqrt( sig*sig + val*val*thePedestalSigma*thePedestalSigma/thePedestal/thePedestal ); 00110 //-} 00111 //---------- Add error in constant term 00112 sig = sqrt( sig*sig + theConstantTermSigma*theConstantTermSigma ); 00113 //- std::cout << " sigma + costantTermSigma " << sig << " " << theConstantTermSigma << std::endl; 00114 00115 //---------- Convert to rad 00116 //- std::cout << "FACTOR " << theFactor << "correct " << val << " " << thePedestal << std::endl; 00117 val *= theFactor; 00118 //-------- Do not correct the sigma!!!! 00119 //- sig /= theFactor; 00120 if(ALIUtils::debug >= 4) std::cout << "MeasurementTiltmeter::correctValueAndSigma: new value " << val << " +- " << sig << std::endl; 00121 setValue( 0, val ); 00122 setSigma( 0, sig ); 00123 00124 }
void MeasurementTiltmeter::setConversionFactor | ( | const std::vector< ALIstring > & | wordlist | ) | [virtual] |
Reimplemented from Measurement.
Definition at line 51 of file MeasurementTiltmeter.cc.
References TestMuL1L2Filter_cff::cerr, ALIUtils::dumpVS(), lat::endl(), cmsRelvalreport::exit, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), ALIUtils::IsNumber(), Measurement::sigmaDimensionFactor(), theConstantTerm, theConstantTermSigma, theFactor, theFactorSigma, and Measurement::valueDimensionFactor().
00052 { 00053 //--------- Check that the format is OK 00054 if(wordlist.size() == 1) return; 00055 if( wordlist.size() != 7 00056 || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[3]) 00057 || !ALIUtils::IsNumber(wordlist[4]) || !ALIUtils::IsNumber(wordlist[6]) 00058 || wordlist[2] != ALIstring("+-")|| wordlist[5] != ALIstring("+-") ){ 00059 std::cerr << "!! Tiltmeter Measurement setConversionFactor: WRONG FORMAT "<< std::endl 00060 << "It should be: TILTEMETER factor +- error constant_term +- error" 00061 << (wordlist.size() != 7) 00062 << !ALIUtils::IsNumber(wordlist[1]) << !ALIUtils::IsNumber(wordlist[3]) 00063 << !ALIUtils::IsNumber(wordlist[4]) << !ALIUtils::IsNumber(wordlist[6]) 00064 // << (wordlist[2] != ALIstring("+-")) << (wordlist[5] != ALIstring("+-")) 00065 << std::endl 00066 << "It is: "; 00067 ALIUtils::dumpVS( wordlist, " ", std::cerr ); 00068 exit(1); 00069 } 00070 theFactor = atof(wordlist[1].c_str()); 00071 00072 //------ correct by dimension of value of tiltmeter 00073 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00074 ALIint dimfac = ALIint( gomgr->GlobalOptions()[ ALIstring("tiltmeter_meas_value_dimension") ] ); 00075 if( dimfac == 0 ) { 00076 theFactor *= 1.; 00077 } else if( dimfac == 1 ) { 00078 theFactor *= 1.E-3; 00079 } else if( dimfac == 2 ) { 00080 theFactor *= 1.E-6; 00081 } else { 00082 std::cerr << " !!!EXITING: error in global option tiltmeter_meas_value_dimension, it can only take values 0,1,2, not " << dimfac; 00083 } 00084 theFactorSigma = atof(wordlist[3].c_str()); 00085 theConstantTerm = atof(wordlist[4].c_str()) * valueDimensionFactor(); 00086 theConstantTermSigma = atof(wordlist[6].c_str()) * sigmaDimensionFactor(); 00087 //- std::cout << "correctVal theConstantTerm" << theConstantTerm << valueDimensionFactor() << std::endl; 00088 //----- Change value and sigma to dimensions used in SDF, because constant term and pedestal are in dimensions of SDF 00089 //- thePedestal = atof(wordlist[7].c_str()) * valueDimensionFactor(); 00090 //-thePedestalSigma = atof(wordlist[9].c_str()) * sigmaDimensionFactor(); 00091 // std::cout << "reading thePedestalSigma " << thePedestalSigma << "= " << wordlist[9] << std::endl; 00092 // TILTMETER 458.84 +- 1.58 0. +- 0. 1 +- 0 00093 }
Definition at line 38 of file MeasurementTiltmeter.h.
Referenced by correctValueAndSigma(), and setConversionFactor().
Definition at line 39 of file MeasurementTiltmeter.h.
Referenced by correctValueAndSigma(), and setConversionFactor().
ALIdouble MeasurementTiltmeter::theFactor [private] |
Definition at line 36 of file MeasurementTiltmeter.h.
Referenced by correctValueAndSigma(), and setConversionFactor().
ALIdouble MeasurementTiltmeter::thePedestal [private] |
Definition at line 40 of file MeasurementTiltmeter.h.
Definition at line 41 of file MeasurementTiltmeter.h.