#include <Measurement.h>
Definition at line 27 of file Measurement.h.
Definition at line 44 of file Measurement.cc.
References theDim, theSigma, theValue, theValueIsSimulated, theValueSimulated, theValueSimulated_orig, and theValueType.
: theDim(measdim), theType(type), theName( name ) { // _OptOnames = new ALIstring[theDim]; theValue = new ALIdouble[theDim]; theSigma = new ALIdouble[theDim]; theValueType = new ALIstring[theDim]; theValueSimulated = new ALIdouble[theDim]; theValueSimulated_orig = new ALIdouble[theDim]; theValueIsSimulated = new ALIbool[theDim]; }
Measurement::Measurement | ( | ) | [inline] |
Definition at line 32 of file Measurement.h.
{ };
Measurement::~Measurement | ( | ) | [virtual] |
void Measurement::addAffectingEntriesFromOptO | ( | const OpticalObject * | optoP | ) |
Definition at line 389 of file Measurement.cc.
References OpticalObject::CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, OpticalObject::ExtraEntryList(), spr::find(), OpticalObject::name(), OpticalObject::parent(), and theAffectingEntryList.
Referenced by buildAffectingEntryList().
{ if(ALIUtils::debug >= 3) std::cout << "Measurement::addAffectingEntriesFromOptO: OptO taking part in Measurement: " << optoP->name() << std::endl; //---------- Loop entries in this OptO std::vector< Entry* >::const_iterator vecite; std::vector< Entry* >::const_iterator fvecite; for (vecite = optoP->CoordinateEntryList().begin(); vecite != optoP->CoordinateEntryList().end(); vecite++) { //T if( find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) ) == theAffectingEntryList.end() ){ //t theAffectingEntryList.push_back(*vecite); //T } fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) ); if (fvecite == theAffectingEntryList.end() ){ theAffectingEntryList.push_back(*vecite); if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl; } } for (vecite = optoP->ExtraEntryList().begin(); vecite != optoP->ExtraEntryList().end(); vecite++) { fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) ); if (fvecite == theAffectingEntryList.end() ){ theAffectingEntryList.push_back(*vecite); if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl; } } if(optoP->parent() != 0) { addAffectingEntriesFromOptO( optoP->parent() ); } }
void Measurement::AddOptOListItem | ( | OpticalObject * | opto | ) | [inline] |
Definition at line 188 of file Measurement.h.
References _OptOList.
{ _OptOList.push_back( opto ); }
void Measurement::AddOptONameListItem | ( | ALIstring | optos | ) | [inline] |
Definition at line 184 of file Measurement.h.
References _OptONameList.
Referenced by MeasurementDiffEntry::buildOptONamesList().
{ _OptONameList.push_back( optos ); }
const std::vector<Entry*>& Measurement::affectingEntryList | ( | ) | const [inline] |
Definition at line 113 of file Measurement.h.
References theAffectingEntryList.
{ return theAffectingEntryList; }
void Measurement::buildAffectingEntryList | ( | ) |
Definition at line 374 of file Measurement.cc.
References _OptOList, and addAffectingEntriesFromOptO().
Referenced by postConstruct().
{ //---------- Loop OptO MeasuredList std::vector< OpticalObject* >::const_iterator vocite; for (vocite = _OptOList.begin(); vocite != _OptOList.end(); vocite++) { addAffectingEntriesFromOptO( *vocite ); } }
void Measurement::buildOptOList | ( | ) |
Definition at line 316 of file Measurement.cc.
References _OptOList, _OptONameList, dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, Model::getOptOByName(), OpticalObject::name(), and Substitute2p().
Referenced by postConstruct().
{ //- if ( ALIUtils::debug >= 3 ) std::cout << std::endl << " MEASUREMENT: " << " " << this->name() << std::endl; ALIstring twopoints(".."); // .. goes one level up in the tree fo OptOs //---------------------------------------- Loop OptONameList std::vector<ALIstring>::iterator vsite; for (vsite = _OptONameList.begin(); vsite != _OptONameList.end(); vsite++) { //----------------------------------- Count how many '..' there are in the name ALIuint ii = 0; // ALIuint slen = (*vsite).length(); ALIuint Ntwopoints = 0; //---- No '..' in ALIstring for(;;) { int i2p = (*vsite).find_first_of( twopoints, 3*ii ); // if it is ., it also finds it!!! if ( i2p < 0 ) break; if ( i2p != ALIint(3*ii)) { std::cerr << i2p << "!!! Bad position of '..' in reference ALIstring: " << (*vsite).c_str() << std::endl; exit(2); } else { Ntwopoints++; if ( ALIUtils::debug >=9 ) std::cout << "N2p" << Ntwopoints; } ii++; } //------ Substitute '..' by reference (the last OptO in list) if (Ntwopoints != 0) { Substitute2p( (*vsite), *(_OptONameList.end()-1), Ntwopoints); } //----- Get OpticalObject* that correspond to ALIstring and fill list ALIstring referenceOptO = (*vsite); //--- a ':' is used in OptOs that have several possible behavious ALIint colon = referenceOptO.find(':'); if ( colon != -1 ) { if (ALIUtils::debug >=99) { std::cout << "colon in reference OptO name " << colon << referenceOptO.c_str() << std::endl; } referenceOptO = referenceOptO.substr( 0, colon ); } OpticalObject* OptOitem = Model::getOptOByName( referenceOptO ); if ( ALIUtils::debug >= 3 ) std::cout << "Measurement::buildOptOList: OptO in Measurement: " << OptOitem->name() << std::endl; if ( OptOitem != (OpticalObject*)0 ) { _OptOList.push_back( OptOitem); } else { std::cerr << "!!! Error in Measurement: can't find Optical Object " << (*vsite).c_str() << std::endl; exit(2); } } }
void Measurement::buildOptONamesList | ( | const std::vector< ALIstring > & | wl | ) | [virtual] |
Reimplemented in MeasurementDiffEntry.
Definition at line 177 of file Measurement.cc.
References _OptONameList, dtNoiseDBValidation_cfg::cerr, and cmsRelvalreport::exit.
Referenced by construct(), constructFromOA(), and copyMeas().
{ int NPairs = (wl.size()+1)/2; // Number of OptO names ( pair of name and '&' ) //--------- Fill list with names for ( int ii=0; ii<NPairs; ii++ ) { _OptONameList.push_back( wl[ii*2] ); // Check for separating '&' if (ii != NPairs-1 && wl[2*ii+1] != ALIstring("&") ) { // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine(); std::cerr << "!!! Measured Optical Objects should be separated by '&', not by" << wl[2*ii+1] << std::endl; exit(2); } } }
void Measurement::calculateOriginalSimulatedValue | ( | ) |
Definition at line 452 of file Measurement.cc.
References calculateSimulatedValue(), gather_cfg::cout, ALIUtils::debug, dim(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), setValue(), setValueSimulated_orig(), valueIsSimulated(), and valueSimulated().
{ //---------- Calculate the simulated value of the Measurement calculateSimulatedValue( 1 ); #ifdef COCOA_VIS if( ALIUtils::getFirstTime() ) { GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) { ALIVRMLMgr::getInstance().newLightRay(); } /*- if(Model::GlobalOptions()["VisWriteIguana"] > 1) { IgCocoaFileMgr::getInstance().newLightPath( theName ); } */ } #endif //---------- Set original simulated values to it //- if(ALIUtils::debug >= 5) std::cout << "MEAS DIMENSION" << dim() << std::endl; for ( ALIuint ii = 0; ii < dim(); ii++) { setValueSimulated_orig( ii, valueSimulated(ii) ); if ( ALIUtils::debug >= 4 ) std::cout << "SETsimuvalOriginal" << valueSimulated(ii) << std::endl; //----- If Measurement has as value 'simulated_value', set the value to the simulated one if( valueIsSimulated(ii) == 1 ){ setValue( ii, valueSimulated(ii) ); //- std::cout << ii << " setting value as simulated " << valueSimulated(ii) << " " << value(ii) << this << std::endl; } } }
virtual void Measurement::calculateSimulatedValue | ( | ALIbool | firstTime | ) | [inline, virtual] |
Reimplemented in MeasurementCOPS, MeasurementDiffEntry, MeasurementDistancemeter, MeasurementDistancemeter3dim, MeasurementSensor2D, and MeasurementTiltmeter.
Definition at line 51 of file Measurement.h.
Referenced by calculateOriginalSimulatedValue(), and DerivativeRespectEntry().
{};
void Measurement::construct | ( | ) |
Definition at line 62 of file Measurement.cc.
References buildOptONamesList(), filterCSVwithJSON::copy, correctValueAndSigma(), gather_cfg::cout, ALIUtils::debug, dim(), fillData(), ALIFileIn::getInstance(), ALIFileIn::getWordsInLine(), name(), postConstruct(), Model::SDFName(), type(), and valueIsSimulated().
Referenced by Model::readSystemDescription().
{ ALIFileIn& filein = ALIFileIn::getInstance( Model::SDFName() ); //---------- Read OptOs that take part in this Measurement std::vector<ALIstring> wordlist; filein.getWordsInLine( wordlist ); //--------- Fill the list of names of OptOs that take part in this measurement ( names only ) buildOptONamesList( wordlist ); if(ALIUtils::debug >= 3) { std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << std::endl << " MEASURED OPTO NAMES: "; std::ostream_iterator<ALIstring> outs(std::cout," "); copy(wordlist.begin(), wordlist.end(), outs); std::cout << std::endl; } //---------- Read the data for ( unsigned int ii=0; ii<dim(); ii++){ filein.getWordsInLine( wordlist ); fillData( ii, wordlist ); } if( !valueIsSimulated(0) ) correctValueAndSigma(); postConstruct(); }
void Measurement::constructFromOA | ( | OpticalAlignMeasurementInfo & | measInfo | ) |
Definition at line 95 of file Measurement.cc.
References _OptONameList, buildOptONamesList(), gather_cfg::cout, ALIUtils::debug, dim(), ALIUtils::dumpVS(), fillData(), OpticalAlignMeasurementInfo::isSimulatedValue_, OpticalAlignMeasurementInfo::measObjectNames_, name(), postConstruct(), sigmaDimensionFactor(), type(), valueDimensionFactor(), and OpticalAlignMeasurementInfo::values_.
Referenced by Model::BuildMeasurementsFromOA().
{ //---- Build wordlist to build object name list std::vector<std::string> objNames = measInfo.measObjectNames_; std::vector<std::string>::const_iterator site; std::vector<ALIstring> wordlist; //--- Fill the list of names of OptOs that take part in this measurement ( names only ) for( site = objNames.begin(); site != objNames.end(); site++) { if( site != objNames.begin() ) wordlist.push_back("&"); wordlist.push_back(*site); } buildOptONamesList( wordlist ); if(ALIUtils::debug >= 3) { std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << " " << measInfo << std::endl << " MEASURED OPTO NAMES: "; for( size_t ii = 0; ii < _OptONameList.size(); ii++ ){ std::cout << _OptONameList[ii] << " "; } std::cout << std::endl; } //---------- No data, set to simulated_value for ( unsigned int ii=0; ii<dim(); ii++){ wordlist.clear(); wordlist.push_back( (measInfo.values_)[ii].name_ ); char ctmp[20]; if( measInfo.isSimulatedValue_[ii] ){ if ( ALIUtils::debug >= 5 ) { std::cout << "Measurement::constructFromOA: meas value " << ii << " " << dim() << " = simulated_value" << std::endl; } wordlist.push_back("simulated_value"); } else { if ( ALIUtils::debug >= 5 ) { std::cout << "Measurement::constructFromOA: meas value " << ii << " " << dim() << " = " << measInfo.values_.size() << std::endl; } ALIdouble val = (measInfo.values_)[ii].value_ / valueDimensionFactor(); //in XML values are without dimensions, so neutralize multiplying by valueDimensionFactor() in fillData gcvt( val, 10, ctmp ); wordlist.push_back( ctmp ); } ALIdouble err = (measInfo.values_)[ii].error_ / sigmaDimensionFactor(); //in XML values are without dimensions, so neutralize multiplying by valueDimensionFactor() in fillData gcvt( err, 10, ctmp ); wordlist.push_back( ctmp ); std::cout << " sigma " << err << " = " << ctmp << " " << (measInfo.values_)[ii].error_ << std::endl; //- wordlist.push_back( "simulated_value" ); //- wordlist.push_back( "1." ); if ( ALIUtils::debug >= 5 ) ALIUtils::dumpVS(wordlist, " Measurement: calling fillData "); //- std::cout << " MEAS INFO " << measInfo << std::endl; //- std::cout << ii << " MEAS INFO PARAM " << (measInfo.values_)[ii] << std::endl; //- std::cout << ii << " MEAS INFO PARAM VALUE " << (measInfo.values_)[ii].value_ << std::endl; fillData( ii, wordlist ); } postConstruct(); }
void Measurement::copyMeas | ( | Measurement * | meas, |
const std::string & | subsstr1, | ||
const std::string & | subsstr2 | ||
) |
Definition at line 649 of file Measurement.cc.
References buildOptONamesList(), ALIUtils::changeName(), filterCSVwithJSON::copy, gather_cfg::cout, ALIUtils::debug, dim(), name(), OptOList(), postConstruct(), sigma(), theDim, theName, theSigma, theType, theValue, theValueIsSimulated, theValueSimulated, theValueSimulated_orig, type(), value(), valueIsSimulated(), valueSimulated(), and valueSimulated_orig().
Referenced by Model::copyMeasurements().
{ theDim = meas->dim(); theType = meas->type(); theName = ALIUtils::changeName( meas->name(), subsstr1, subsstr2); // _OptOnames = new ALIstring[theDim]; theValueSimulated = new ALIdouble[theDim]; theValueSimulated_orig = new ALIdouble[theDim]; theValueIsSimulated = new ALIbool[theDim]; theValue = const_cast<ALIdouble*>(meas->value()); theSigma = const_cast<ALIdouble*>(meas->sigma()); unsigned int ii; for(ii = 0; ii < theDim; ii++) { theValueSimulated[ii] = meas->valueSimulated( ii ); theValueSimulated_orig[ii] = meas->valueSimulated_orig( ii ); theValueIsSimulated[ii] = meas->valueIsSimulated( ii ); } //--------- Fill the list of names of OptOs that take part in this measurement ( names only ) std::vector<std::string> wordlist; auto &optolist = meas->OptOList(); ALIuint nOptos = optolist.size(); for ( ALIuint ii = 0; ii < nOptos; ii++ ) { wordlist.push_back( ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) ); std::cout << " copymeas " << ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) << std::endl; if( ii != nOptos -1 ) wordlist.push_back("&"); } buildOptONamesList( wordlist ); if(ALIUtils::debug >= 3) { std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << std::endl << " MEASURED OPTO NAMES: "; std::ostream_iterator<ALIstring> outs(std::cout," "); copy(wordlist.begin(), wordlist.end(), outs); std::cout << std::endl; } postConstruct(); }
virtual void Measurement::correctValueAndSigma | ( | ) | [inline, virtual] |
Reimplemented in MeasurementCOPS, MeasurementDistancemeter, MeasurementDistancemeter3dim, MeasurementSensor2D, and MeasurementTiltmeter.
Definition at line 67 of file Measurement.h.
Referenced by construct(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{};
Definition at line 511 of file Measurement.cc.
References calculateSimulatedValue(), dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, Entry::displace(), cmsRelvalreport::exit, ALIUtils::getMaximumDeviationDerivative(), OpticalObject::name(), Entry::name(), name(), Entry::OptOCurrent(), OpticalObject::resetGlobalCoordinates(), Entry::startingDisplacement(), theDim, theValueSimulated, and theValueSimulated_orig.
{ //---------- std::vector of derivatives to return std::vector<ALIdouble> deriv; ALIdouble sumderiv; //---------- displacement to start with ALIdouble displacement = entry->startingDisplacement(); //----- all angles are in radians, so, if displace is not, rescale it before making the displacement //- displacement *= entry->SigmaDimensionFactor(); if( ALIUtils::debug >= 3) std::cout << std::endl << "%%% Derivative w.r.t. entry " << entry->name() << ": displacement = " << displacement << std::endl; ALIint count_itera = 0; //---------- Loop decreasing the displacement a factor 2, until the precision set is reached do { count_itera++; entry->displace( displacement ); if ( ALIUtils::debug >= 5) std::cout << "Get simulated value for displacement " << displacement << std::endl; calculateSimulatedValue( 0 ); //---------- Get sum of derivatives sumderiv = 0; for ( ALIuint ii = 0; ii < theDim; ii++) { sumderiv += fabs( theValueSimulated[ii] - theValueSimulated_orig[ii] ); if( ALIUtils::debug >= 4 ) { std::cout << "iteration " << count_itera << " COOR " << ii << " difference =" << ( theValueSimulated[ii] - theValueSimulated_orig[ii] ) //- << " " << theValueSimulated[ii] << " " << theValueSimulated_orig[ii] << " derivative = " << (theValueSimulated[ii] - theValueSimulated_orig[ii]) /displacement << " disp " << displacement << " sum derivatives = " << sumderiv << std::endl; } if( ALIUtils::debug >= 5 ) { std::cout << " new simu value= " << theValueSimulated[ii] << " orig simu value " << theValueSimulated_orig[ii] << std::endl; } } if (count_itera >= 100) { std::cerr << "EXITING: too many iterations in derivative, displacement is " << displacement << " sum of derivatives is " << sumderiv << std::endl; exit(3); } displacement /= 2.; //- std::cout << "sumderiv " << sumderiv << " maximu " << Fit::maximum_deviation_derivative << std::endl; }while( sumderiv > ALIUtils::getMaximumDeviationDerivative() ); displacement *= 2; //---------- Enough precision reached: pass result for ( ALIuint ii = 0; ii < theDim; ii++) { deriv.push_back( ( theValueSimulated[ii] - theValueSimulated_orig[ii] ) / displacement ); //----- change it to entry sigma dimensions // deriv[ii] /= entry->SigmaDimensionFactor(); if( ALIUtils::debug >= 1) std::cout << name() << ": " << entry->OptOCurrent()->name() << " " << entry->name() << " " << ii << "### DERIVATIVE: " << deriv[ii] << std::endl; } //- if(ALIUtils::debug >= 5) std::cout << "END derivative: " << deriv << "disp" << displacement << std::endl; //--------------------- Reset _centreGlob and _rmGlob of OptO entry belongs to (and component OptOs) entry->OptOCurrent()->resetGlobalCoordinates(); return deriv; }
const ALIuint Measurement::dim | ( | ) | const [inline] |
Definition at line 82 of file Measurement.h.
References theDim.
Referenced by calculateOriginalSimulatedValue(), construct(), constructFromOA(), copyMeas(), MeasurementCOPS::correctValueAndSigma(), CocoaToDDLMgr::measurementsAsSpecPars(), Model::readMeasurementsFromFile(), CocoaDaqReaderText::ReadNextEvent(), MeasurementCOPS::setConversionFactor(), and SetDimension().
{ return theDim; }
void Measurement::DumpBadOrderOptOs | ( | ) |
Definition at line 487 of file Measurement.cc.
References begin, dtNoiseDBValidation_cfg::cerr, ALIUtils::debug, cmsRelvalreport::exit, and OptONameList().
Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), and MeasurementDiffEntry::calculateSimulatedValue().
{ std::cerr << " Detector can not make measurement with these optical objects " << std::endl; if (ALIUtils::debug >= 1) { // std::vector<OpticalObject*>::iterator voite; // for ( voite = _OptOList.begin(); // voite != _OptOList.end(); voite++) { // std::cout << (*voite)->type() << " : " << (*voite)->name() << std::endl; // } std::vector<ALIstring>::const_iterator vsite; for ( vsite = OptONameList().begin(); vsite != OptONameList().end(); vsite++) { std::cerr << (*vsite) << " : " ; } std::cerr << std::endl; } exit(2); }
Definition at line 200 of file Measurement.cc.
References dtNoiseDBValidation_cfg::cerr, filterCSVwithJSON::copy, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, ParameterMgr::getInstance(), ParameterMgr::getParameterValue(), ALIUtils::IsNumber(), sigmaDimensionFactor(), theDim, theSigma, theValue, theValueIsSimulated, theValueType, and valueDimensionFactor().
Referenced by construct(), constructFromOA(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{ if ( ALIUtils::debug >= 3 ) { std::cout << "@@ Filling coordinate " << coor << std::endl ; //- ostream_iterator<ALIstring> outs(std::cout," "); //- copy(wordlist.begin(), wordlist.end(), outs); } ParameterMgr* parmgr = ParameterMgr::getInstance(); //---------- Check that there are 3 attributes: name, value, error if( wordlist.size() != 3 ) { // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine(); std::cerr << " Incorrect format for Measurement value:" << std::endl; std::ostream_iterator<ALIstring> outs(std::cout," "); copy(wordlist.begin(), wordlist.end(), outs); std::cout << std::endl << "There should be three words: name value sigma " << std::endl; exit(2); } //---------- check coor value if (coor >= theDim ) { // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine(); std::cerr << "Trying to fill Measurement coordinate No " << coor << " but the dimension is " << theDim << std::endl; exit(2); } //---------- set data members //----- Set valueType theValueType[coor] = wordlist[0]; //----- Set value (translate it if a PARAMETER is used) ALIdouble val = 0.; theValueIsSimulated[coor] = 0; if( !ALIUtils::IsNumber(wordlist[1]) ) { if ( parmgr->getParameterValue( wordlist[1], val ) == 0 ) { if( wordlist[1] == ALIstring("simulated_value") ) { theValueIsSimulated[coor] = 1; } else { // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine(); std::cerr << "!!! parameter for value not found: " << wordlist[1].c_str() << std::endl; exit(2); } } //d val *= valueDimensionFactor(); } else { //d val = DimensionMgr()::getInstance()->extractValue( wordlist[1], ValueDimensionFactor() ); val = atof( wordlist[1].c_str() ); } val *= valueDimensionFactor(); if( ALIUtils::debug >= 3 ) std::cout << "Meas VALUE= " << val << " (ValueDimensionFactor= " << valueDimensionFactor() <<std::endl; //----- Set sigma (translate it if a PARAMETER is used) ALIdouble sig = 0.; if( !ALIUtils::IsNumber(wordlist[2]) ) { if ( parmgr->getParameterValue( wordlist[2], sig ) == 0 ) { // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine(); std::cerr << "!!! parameter for sigma not found: " << wordlist[2].c_str() << std::endl; exit(2); } //d sig *= sigmaDimensionFactor(); } else { // sig = DimensionMgr()::getInstance()->extractValue( wordlist[2], ValueDimensionFactor() ); sig = atof( wordlist[2].c_str() ); } sig *= sigmaDimensionFactor(); if( ALIUtils::debug >= 3) std::cout << "SIGMA= " << sig << " (SigmaDimensionFactor= " << sigmaDimensionFactor() <<std::endl; //----- set theValue & theSigma theValue[coor] = val; theSigma[coor] = sig; }
void Measurement::fillData | ( | ALIuint | coor, |
OpticalAlignParam * | oaParam | ||
) |
Definition at line 277 of file Measurement.cc.
References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), OpticalAlignParam::sigma(), sigmaDimensionFactor(), theDim, theSigma, theValue, theValueIsSimulated, OpticalAlignParam::value(), and valueDimensionFactor().
{ if ( ALIUtils::debug >= 3 ) { std::cout << "@@ Filling coordinate " << coor << std::endl ; } // ParameterMgr* parmgr = ParameterMgr::getInstance(); //---------- check coor value if (coor >= theDim ) { std::cerr << "Trying to fill Measurement coordinate No " << coor << " but the dimension is " << theDim << std::endl; exit(2); } //---------- set data members //----- Set value (translate it if a PARAMETER is used) ALIdouble val = 0.; theValueIsSimulated[coor] = 0; val = oaParam->value(); val *= valueDimensionFactor(); theValue[coor] = val; if( ALIUtils::debug >= 3 ) std::cout << "Meas VALUE= " << val << " (ValueDimensionFactor= " << valueDimensionFactor() <<std::endl; ALIbool sigmaFF = GlobalOptionMgr::getInstance()->GlobalOptions()["measurementErrorFromFile"]; if( sigmaFF ) { //----- Set sigma (translate it if a PARAMETER is used) ALIdouble sig = 0.; sig = oaParam->sigma(); // it is in mm always sig *= sigmaDimensionFactor(); theSigma[coor] = sig; if( ALIUtils::debug >= 3) std::cout << "SIGMA= " << sig << " (SigmaDimensionFactor= " << sigmaDimensionFactor() <<std::endl; } }
static ALIstring Measurement::getCurrentDate | ( | ) | [inline, static] |
Definition at line 152 of file Measurement.h.
References theCurrentDate.
Referenced by FittedEntriesSet::FittedEntriesSet().
{ return theCurrentDate; }
static ALIstring Measurement::getCurrentTime | ( | ) | [inline, static] |
const CLHEP::Hep3Vector& Measurement::getLightRayDirection | ( | ) | const [inline] |
Definition at line 162 of file Measurement.h.
References theLightRayDirection.
{ return theLightRayDirection; }
const CLHEP::Hep3Vector& Measurement::getLightRayPosition | ( | ) | const [inline] |
Definition at line 159 of file Measurement.h.
References theLightRayPosition.
{ return theLightRayPosition; }
ALIstring Measurement::getMeasuringBehaviour | ( | const std::vector< OpticalObject * >::const_iterator | vocite | ) |
Definition at line 591 of file Measurement.cc.
References _OptOList, and _OptONameList.
Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), and MeasurementDistancemeter::calculateSimulatedValue().
{ std::vector<ALIstring>::const_iterator vscite = _OptONameList.begin() + ( vocite - _OptOList.begin() ); // point to corresponding name of this OptO ALIint colon = (*vscite).find(':'); ALIstring behav; if(colon != -1 ) { behav = (*vscite).substr(colon+1,(*vscite).size()); } else { behav = " "; } return behav; }
const OpticalObject * Measurement::getPreviousOptO | ( | const OpticalObject * | Popto | ) | const |
Definition at line 608 of file Measurement.cc.
References _OptOList, dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, OpticalObject::name(), and name().
Referenced by OptODistancemeter::makeMeasurement(), and OptODistancemeter3dim::makeMeasurement().
{ //--------- Loop OptOs that take part in this measurement std::vector<OpticalObject*>::const_iterator vocite; for( vocite = _OptOList.begin(); vocite != _OptOList.end(); vocite++ ){ if( *vocite == Popto ) { if( vocite == _OptOList.begin() ) { std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl; std::cerr << " OptO " << Popto->name() << " is the first one " << std::endl; exit(1); } else { return *(vocite-1); } } } std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl; std::cerr << " OptO " << Popto->name() << " not found " << std::endl; exit(1); }
static ALIstring& Measurement::measurementsFileName | ( | ) | [inline, static] |
Definition at line 213 of file Measurement.h.
References theMeasurementsFileName.
Referenced by Model::readMeasurementsFromFile().
{ return theMeasurementsFileName; }
const ALIstring& Measurement::name | ( | ) | const [inline] |
Definition at line 90 of file Measurement.h.
References theName.
Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDiffEntry::calculateSimulatedValue(), construct(), constructFromOA(), copyMeas(), Model::copyMeasurements(), DerivativeRespectEntry(), getPreviousOptO(), CocoaToDDLMgr::measurementsAsSpecPars(), printStartCalculateSimulatedValue(), and OptOUserDefined::userDefinedBehaviour().
{ return theName; }
const std::vector<OpticalObject*>& Measurement::OptOList | ( | ) | const [inline] |
Definition at line 109 of file Measurement.h.
References _OptOList.
Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDiffEntry::calculateSimulatedValue(), copyMeas(), and OptOCOPS::makeMeasurement().
{ return _OptOList; }
const std::vector<ALIstring>& Measurement::OptONameList | ( | ) | const [inline] |
Definition at line 105 of file Measurement.h.
References _OptONameList.
Referenced by DumpBadOrderOptOs(), and CocoaToDDLMgr::measurementsAsSpecPars().
{ return _OptONameList; }
void Measurement::postConstruct | ( | ) |
Definition at line 154 of file Measurement.cc.
References Model::addMeasurementToList(), buildAffectingEntryList(), buildOptOList(), gather_cfg::cout, ALIUtils::debug, Model::MeasurementList(), and setName().
Referenced by construct(), constructFromOA(), and copyMeas().
{ //---------- Set name as name of last OptO setName(); //---------- Transform for each Measurement the Measured OptO names to Measured OptO pointers buildOptOList(); //---------- Build list of Entries that affect a Measurement buildAffectingEntryList(); //---------- add this measurement to the global list of measurements Model::addMeasurementToList( this ); if ( ALIUtils::debug >= 10 ) { std::cout << Model::MeasurementList().size() << std::endl; } }
void Measurement::printStartCalculateSimulatedValue | ( | const Measurement * | meas | ) | [protected] |
Definition at line 444 of file Measurement.cc.
References gather_cfg::cout, name(), and type().
Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), and MeasurementDiffEntry::calculateSimulatedValue().
const ALIstring& Measurement::sensorName | ( | ) | [inline] |
virtual void Measurement::setConversionFactor | ( | const std::vector< ALIstring > & | wordlist | ) | [inline, virtual] |
Reimplemented in MeasurementCOPS, MeasurementDistancemeter, MeasurementDistancemeter3dim, MeasurementSensor2D, and MeasurementTiltmeter.
Definition at line 70 of file Measurement.h.
References dtNoiseDBValidation_cfg::cerr, and cmsRelvalreport::exit.
Referenced by Model::readSystemDescription().
void Measurement::setCurrentDate | ( | const std::vector< ALIstring > & | wl | ) | [static] |
set the date of the current measurement
Definition at line 631 of file Measurement.cc.
References dtNoiseDBValidation_cfg::cerr, ALIUtils::dumpVS(), cmsRelvalreport::exit, theCurrentDate, and theCurrentTime.
Referenced by Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{ if( wl.size() != 3 ){ std::cerr << "!!!EXITING: reading DATE of measurements set: it must have three words, it is though " << std::endl; ALIUtils::dumpVS(wl, " "); exit(1); } else if(wl[0] != "DATE:" ){ std::cerr << "!!!EXITING: reading DATE of measurements set: first word must be 'DATE:', it is though " << std::endl; ALIUtils::dumpVS( wl, " "); exit(1); } else { theCurrentDate = wl[1]; theCurrentTime = wl[2]; } }
void Measurement::SetDimension | ( | ALIuint | dim | ) | [inline] |
void Measurement::setLightRayDirection | ( | const CLHEP::Hep3Vector & | lightRayDirection | ) | [inline] |
Definition at line 224 of file Measurement.h.
References theLightRayDirection.
Referenced by OptOSensor2D::makeMeasurement().
{ theLightRayDirection = lightRayDirection; }
void Measurement::setLightRayPosition | ( | const CLHEP::Hep3Vector & | lightRayPosition | ) | [inline] |
Definition at line 222 of file Measurement.h.
References theLightRayPosition.
Referenced by OptOSensor2D::makeMeasurement().
{ theLightRayPosition = lightRayPosition; }
static void Measurement::setMeasurementsFileName | ( | const ALIstring & | filename | ) | [inline, static] |
Definition at line 216 of file Measurement.h.
References lut2db_cfg::filename, and theMeasurementsFileName.
{ //- std::cout << " setting file name " << filename << std::endl; theMeasurementsFileName = filename; //- std::cout << " dsetting file name " << filename << std::endl; }
void Measurement::setName | ( | ) |
Definition at line 697 of file Measurement.cc.
References _OptONameList, dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, theName, and type().
Referenced by postConstruct().
{ // name already set by passing one argument with sensor type if( theName != "" ) return; if( _OptONameList.size() == 0) { std::cerr << " !!! Error in your code, you cannot ask for the name of the Measurement before the OptONameList is build " << std::endl; exit(9); } std::vector<ALIstring>::iterator vsite = (_OptONameList.end()-1); theName = type() + ":" + (*vsite); }
Definition at line 171 of file Measurement.h.
References theSigma.
Referenced by MeasurementDistancemeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), MeasurementTiltmeter::correctValueAndSigma(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{ theSigma[coor] = val; //- std::cout << coor << " setting sigma " << theSigma[coor] << std::endl; }
void Measurement::setType | ( | ALIstring | type | ) | [inline] |
Definition at line 167 of file Measurement.h.
References theValue.
Referenced by calculateOriginalSimulatedValue(), MeasurementCOPS::correctValueAndSigma(), MeasurementDistancemeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), MeasurementSensor2D::correctValueAndSigma(), and MeasurementTiltmeter::correctValueAndSigma().
{ theValue[coor] = val; }
Definition at line 196 of file Measurement.h.
References theValueSimulated, and value().
Referenced by MeasurementDiffEntry::calculateSimulatedValue(), OptODistancemeter::makeMeasurement(), OptODistancemeter3dim::makeMeasurement(), OptOTiltmeter::makeMeasurement(), OptOSensor2D::makeMeasurement(), and OptOCOPS::makeMeasurement().
{ theValueSimulated[coor] = value; }
Definition at line 192 of file Measurement.h.
References theValueSimulated_orig, and value().
Referenced by calculateOriginalSimulatedValue().
{ theValueSimulated_orig[coor] = value; }
virtual void Measurement::setXlaserLine | ( | ALIuint | ii, |
int | val | ||
) | [inline, virtual] |
Reimplemented in MeasurementCOPS.
Definition at line 209 of file Measurement.h.
Referenced by OptOCOPS::makeMeasurement().
{ };
const ALIdouble* Measurement::sigma | ( | ) | const [inline] |
Definition at line 132 of file Measurement.h.
References theSigma.
Referenced by copyMeas(), MeasurementDistancemeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), MeasurementTiltmeter::correctValueAndSigma(), CocoaToDDLMgr::measurementsAsSpecPars(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{ return theSigma; }
virtual const ALIdouble Measurement::sigmaDimensionFactor | ( | ) | const [inline, virtual] |
Definition at line 148 of file Measurement.h.
References ALIUtils::LengthSigmaDimensionFactor().
Referenced by constructFromOA(), fillData(), and MeasurementTiltmeter::setConversionFactor().
{ return ALIUtils::LengthSigmaDimensionFactor(); }
void Measurement::Substitute2p | ( | ALIstring & | ref, |
const ALIstring & | firstref, | ||
int | NtwoPoints | ||
) | [protected] |
Definition at line 423 of file Measurement.cc.
References gather_cfg::cout, ALIUtils::debug, and pickleFileParser::slash.
Referenced by buildOptOList().
{ // '/' sets hierarchy of OptOs ALIstring slash("/"); int pos1st = firstref.length(); // Go back an '/' in firstref for each '..' in ref for (int ii=0; ii < Ntwopoints; ii++) { pos1st = firstref.find_last_of( slash, pos1st-1); if ( ALIUtils::debug >=9 ) std::cout << "pos1st=" << pos1st; } if ( ALIUtils::debug >=9 ) std::cout << "before change ref: " << ref << " 1ref " << firstref << std::endl; // Substitute name ref.replace( 0, (Ntwopoints*3)-1, firstref, 0, pos1st); if ( ALIUtils::debug >=9 ) std::cout << "after change ref: " << ref << " 1ref " << firstref << std::endl; }
const ALIstring& Measurement::type | ( | ) | const [inline] |
Definition at line 86 of file Measurement.h.
References theType.
Referenced by MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), construct(), constructFromOA(), copyMeas(), Model::copyMeasurements(), CocoaToDDLMgr::measurementsAsSpecPars(), printStartCalculateSimulatedValue(), setName(), and setType().
{ return theType; }
const ALIdouble* Measurement::value | ( | ) | const [inline] |
Definition at line 125 of file Measurement.h.
References theValue.
Referenced by MeasurementDiffEntry::calculateSimulatedValue(), copyMeas(), MeasurementCOPS::correctValueAndSigma(), MeasurementDistancemeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), MeasurementSensor2D::correctValueAndSigma(), MeasurementTiltmeter::correctValueAndSigma(), OptOSensor2D::fastTraversesLightRay(), OptODistancemeter::makeMeasurement(), OptODistancemeter3dim::makeMeasurement(), OptOTiltmeter::makeMeasurement(), OptOSensor2D::makeMeasurement(), OptOCOPS::makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), setValueSimulated(), and setValueSimulated_orig().
{ return theValue; }
virtual const ALIdouble Measurement::valueDimensionFactor | ( | ) | const [inline, virtual] |
Definition at line 144 of file Measurement.h.
References ALIUtils::LengthValueDimensionFactor().
Referenced by constructFromOA(), fillData(), MeasurementTiltmeter::setConversionFactor(), MeasurementSensor2D::setConversionFactor(), and MeasurementCOPS::setConversionFactor().
{ return ALIUtils::LengthValueDimensionFactor(); }
bool Measurement::valueIsSimulated | ( | ALIint | coor | ) | [inline] |
Definition at line 205 of file Measurement.h.
References theValueIsSimulated.
Referenced by calculateOriginalSimulatedValue(), construct(), copyMeas(), and CocoaToDDLMgr::measurementsAsSpecPars().
{ return theValueIsSimulated[coor]; }
Definition at line 117 of file Measurement.h.
References theValueSimulated.
Referenced by calculateOriginalSimulatedValue(), MeasurementDiffEntry::calculateSimulatedValue(), copyMeas(), OptODistancemeter::makeMeasurement(), OptODistancemeter3dim::makeMeasurement(), OptOTiltmeter::makeMeasurement(), OptOSensor2D::makeMeasurement(), and OptOCOPS::makeMeasurement().
{ return theValueSimulated[ii]; }
Definition at line 121 of file Measurement.h.
References theValueSimulated_orig.
Referenced by copyMeas().
{ return theValueSimulated_orig[ii]; }
Definition at line 140 of file Measurement.h.
References theValueType.
Referenced by OptOSensor2D::makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().
{ return theValueType[ii]; }
virtual int Measurement::xlaserLine | ( | ALIuint | ii | ) | [inline, virtual] |
Reimplemented in MeasurementCOPS.
Definition at line 199 of file Measurement.h.
References dtNoiseDBValidation_cfg::cerr.
Referenced by OptOCOPS::makeMeasurement().
{ std::cerr << "!!!! Measurement::xlaserLine is not returning anything " << std::endl; abort(); };
std::vector<OpticalObject*> Measurement::_OptOList [private] |
Definition at line 256 of file Measurement.h.
Referenced by AddOptOListItem(), buildAffectingEntryList(), buildOptOList(), getMeasuringBehaviour(), getPreviousOptO(), and OptOList().
std::vector<ALIstring> Measurement::_OptONameList [private] |
Definition at line 254 of file Measurement.h.
Referenced by AddOptONameListItem(), buildOptOList(), buildOptONamesList(), constructFromOA(), getMeasuringBehaviour(), OptONameList(), and setName().
ALIdouble Measurement::cameraScaleFactor = 1. [static] |
Definition at line 209 of file Measurement.h.
Referenced by Fit::FillMatricesWithMeasurements().
ALIbool Measurement::only1 = 0 [static] |
Definition at line 267 of file Measurement.h.
Referenced by Fit::fitNextEvent(), Model::readMeasurementsFromFile(), and Model::readSystemDescription().
ALIstring Measurement::only1Date = "" [static] |
Definition at line 268 of file Measurement.h.
Referenced by Model::readMeasurementsFromFile(), and Model::readSystemDescription().
ALIstring Measurement::only1Time = "" [static] |
Definition at line 269 of file Measurement.h.
Referenced by Model::readMeasurementsFromFile(), and Model::readSystemDescription().
std::vector<Entry*> Measurement::theAffectingEntryList [private] |
Definition at line 258 of file Measurement.h.
Referenced by addAffectingEntriesFromOptO(), and affectingEntryList().
ALIstring Measurement::theCurrentDate = "99/99/99" [static, private] |
Definition at line 264 of file Measurement.h.
Referenced by getCurrentDate(), and setCurrentDate().
ALIstring Measurement::theCurrentTime = "99:99" [static, private] |
Definition at line 265 of file Measurement.h.
Referenced by getCurrentTime(), and setCurrentDate().
ALIuint Measurement::theDim [private] |
Definition at line 235 of file Measurement.h.
Referenced by copyMeas(), DerivativeRespectEntry(), dim(), fillData(), Measurement(), and SetDimension().
CLHEP::Hep3Vector Measurement::theLightRayDirection [private] |
Definition at line 261 of file Measurement.h.
Referenced by getLightRayDirection(), and setLightRayDirection().
CLHEP::Hep3Vector Measurement::theLightRayPosition [private] |
Definition at line 260 of file Measurement.h.
Referenced by getLightRayPosition(), and setLightRayPosition().
ALIstring Measurement::theMeasurementsFileName = "" [static, private] |
Definition at line 262 of file Measurement.h.
Referenced by measurementsFileName(), and setMeasurementsFileName().
ALIstring Measurement::theName [private] |
Definition at line 239 of file Measurement.h.
Referenced by copyMeas(), name(), sensorName(), and setName().
ALIdouble* Measurement::theSigma [private] |
Definition at line 238 of file Measurement.h.
Referenced by copyMeas(), fillData(), Measurement(), setSigma(), sigma(), and ~Measurement().
ALIstring Measurement::theType [private] |
Definition at line 236 of file Measurement.h.
Referenced by copyMeas(), setType(), and type().
ALIdouble* Measurement::theValue [private] |
Definition at line 237 of file Measurement.h.
Referenced by copyMeas(), fillData(), Measurement(), setValue(), value(), and ~Measurement().
ALIbool* Measurement::theValueIsSimulated [private] |
Definition at line 251 of file Measurement.h.
Referenced by copyMeas(), fillData(), Measurement(), and valueIsSimulated().
ALIdouble* Measurement::theValueSimulated [private] |
Definition at line 243 of file Measurement.h.
Referenced by copyMeas(), DerivativeRespectEntry(), Measurement(), setValueSimulated(), and valueSimulated().
ALIdouble* Measurement::theValueSimulated_orig [private] |
Definition at line 245 of file Measurement.h.
Referenced by copyMeas(), DerivativeRespectEntry(), Measurement(), setValueSimulated_orig(), and valueSimulated_orig().
ALIstring* Measurement::theValueType [private] |
Definition at line 240 of file Measurement.h.
Referenced by fillData(), Measurement(), and valueType().