CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
Model Class Reference

#include <Model.h>

Public Member Functions

void BuildMeasurementsFromOA (OpticalAlignMeasurements &measList)
 
void BuildSystemDescriptionFromOA (OpticalAlignments &optAlig)
 
void CMSLinkFit (ALIint cmslink)
 *************** FOR CMS LINK SYSTEM (to fit it part by part) More...
 
OpticalAlignInfo FindOptAlignInfoByType (const ALIstring &type)
 
 Model ()
 
 ~Model ()
 

Static Public Member Functions

static void addEntryToList (Entry *entry)
 ***************** SET DATA MEMBERS More...
 
static void addMeasurementToList (Measurement *measadd)
 
static ALIbool createCopyComponentList (const ALIstring &optoname)
 **************** FOR COPYING AN OPTO More...
 
static std::vector< Entry * > & EntryList ()
 
static cocoaStatus getCocoaStatus ()
 
static ALIbool getComponentOptOs (const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
 --— Get from theOptOList the list of pointers to component OptOs More...
 
static ALIbool getComponentOptOTypes (const ALIstring &opto_type, std::vector< ALIstring > &vcomponents)
 --— Get from theOptODictionary the list of component OptO types More...
 
static EntrygetEntryByName (const ALIstring &opto_entry_name)
 
static EntrygetEntryByName (const ALIstring &opto_name, const ALIstring &entry_name)
 --— Search an Entry name in the Entry* list and return a pointer to it More...
 
static FittedEntriesReadergetFittedEntriesReader ()
 
static ModelgetInstance ()
 -------— Gets the only instance of this class More...
 
static MeasurementgetMeasurementByName (const ALIstring &name, ALIbool exists=true)
 
static std::vector< OpticalAlignInfogetOpticalAlignments ()
 
static OpticalObjectgetOptOByName (const ALIstring &opto_name)
 --— Find an OptO name in theOptOList and return a pointer to it More...
 
static OpticalObjectgetOptOByType (const ALIstring &type)
 --— Find the first OptO of type 'opto_type' in theOptOList and return a pointer to it More...
 
static int getParameterValue (const ALIstring &sstr, ALIdouble &val)
 ************ ACCESS INFO FROM STATIC DATA More...
 
static ALIdouble getParamFittedSigmaVectorItem (const ALIuint position)
 
static ALIstringMatricesFName ()
 the name of the File for storing the matrices More...
 
static ALIstringMeasFName ()
 the name of the Measurements File More...
 
static std::vector< Measurement * > & MeasurementList ()
 
static struct tm & MeasurementsTime ()
 
static OpticalObjectnextOptOToCopy ()
 
static std::vector< std::vector< ALIstring > > & OptODictionary ()
 ACCESS STATIC DATA MEMBERS. More...
 
static std::vector< OpticalObject * > & OptOList ()
 
static std::string printCocoaStatus (const cocoaStatus cs)
 
static ALIbool readMeasurementsFromFile (ALIstring only1Date=ALIstring(""), ALIstring only1Time=ALIstring(""))
 
static void readSystemDescription ()
 -------— Read the different sections of the SDF and act accordingly More...
 
static ALIstringReportFName ()
 the name of the report File More...
 
static ALIstringSDFName ()
 the name of the System Description File More...
 
static void setCocoaStatus (const cocoaStatus cs)
 
static void setMatricesFName (const ALIstring &name)
 
static void setMeasurementsTime (struct tm &tim)
 
static void setReportFName (const ALIstring &name)
 
static void setSDFName (const ALIstring &name)
 

Static Public Attributes

static std::vector< ALIdoubleCMSLinkRangeDetValue
 
static ALIint Ncmslinkrange = 0
 *************** FOR RANGE STUDIES More...
 

Private Member Functions

void CMSLinkCleanModel ()
 

Static Private Member Functions

static void buildMeasurementsLinksToOptOs ()
 Read Measurements (to be implemented for reading from an external file the DATA of the measurements) More...
 
static void cleanParamFittedSigmaVector ()
 
static void cleanParamFittedValueDisplacementMap ()
 
static void CMSLinkDeleteOptOs ()
 
static void CMSLinkRecoverParamFittedSigma (ALIint cmslink)
 
static void CMSLinkRecoverParamFittedValueDisplacement (ALIint cmslink)
 
static void CMSLinkSaveParamFittedSigma (ALIint cmslink)
 
static void CMSLinkSaveParamFittedValueDisplacement (ALIint cmslink)
 
static void copyMeasurements (const std::vector< ALIstring > &wl)
 
static void deleteOptO (const ALIstring &opto_name)
 
static void deleteOptO (OpticalObject *opto)
 
static ALIbool fillCopyComponentList (const OpticalObject *opto)
 
static void recoverParamFittedSigma (const ALIstring &opto_name, const ALIstring &entry_name, const ALIuint position)
 
static void reorderOptODictionary (const ALIstring &ssearch, std::vector< std::vector< ALIstring > > &OptODictionary2)
 ********** private METHODS More...
 
static void saveParamFittedCorrelation (const ALIstring &opto_name1, const ALIstring &entry_name1, const ALIstring &opto_name2, const ALIstring &entry_name2)
 
static void saveParamFittedSigma (const ALIstring &opto_name, const ALIstring &entry_name)
 
static void SetValueDisplacementsFromReportOut ()
 

Static Private Attributes

static ALIint CMSLinkIteration = 0
 
static cocoaStatus theCocoaStatus = COCOA_Init
 
static std::vector< Entry * > theEntryVector
 std::vector of all Entries More...
 
static FittedEntriesReadertheFittedEntriesReader = nullptr
 
static ModeltheInstance = nullptr
 
static ALIstring theMatricesFName = "matrices.out"
 the name of the File for storing the matrices More...
 
static ALIstring theMeasFName = "Measurements.txt"
 the name of the Measurements File More...
 
static struct tm theMeasurementsTime
 
static std::vector< Measurement * > theMeasurementVector
 std::vector of all Measurements More...
 
static std::vector< OpticalAlignInfotheOpticalAlignments
 
static std::vector< std::vector< ALIstring > > theOptODictionary
 parameters More...
 
static std::vector< OpticalObject * > theOptOList
 map of OptO*‍/type of parent OptO, for navigation down the tree structure More...
 
static std::vector< OpticalObject * > theOptOsToCopyList
 
static std::vector< OpticalObject * >::const_iterator theOptOsToCopyListIterator
 
static std::vector< ALIdoubletheParamFittedSigmaVector
 
static std::map< ALIstring, ALIdouble, std::less< ALIstring > > theParamFittedValueDisplacementMap
 
static ALIstring theReportFName = "report.out"
 the name of the report File More...
 
static ALIstring theSDFName = "SystemDescription.txt"
 the name of the System Description File More...
 

Detailed Description

Definition at line 54 of file Model.h.

Constructor & Destructor Documentation

◆ Model()

Model::Model ( )

Definition at line 92 of file Model.cc.

92  {
93  // theMeasurementsTime = clock();
94 }

◆ ~Model()

Model::~Model ( )
inline

Definition at line 58 of file Model.h.

58 {};

Member Function Documentation

◆ addEntryToList()

static void Model::addEntryToList ( Entry entry)
inlinestatic

***************** SET DATA MEMBERS

Definition at line 140 of file Model.h.

140  {
141  theEntryVector.push_back(entry);
142  //- std::cout << entry << entry->OptOCurrent()->name() << "ADDENTRY " << entry->name() << " " << EntryList().size() << std::endl;
143  }

References mps_splice::entry, and theEntryVector.

Referenced by OpticalObject::fillCoordinateEntry(), OpticalObject::fillExtraEntry(), and OpticalObject::setAnglesNull().

◆ addMeasurementToList()

static void Model::addMeasurementToList ( Measurement measadd)
inlinestatic

Definition at line 145 of file Model.h.

145  {
146  theMeasurementVector.push_back(measadd);
147  // std::cout << "ADD MEASUREMENT" << theMeasurementVector.size() << std::endl ;
148  }

References theMeasurementVector.

Referenced by Measurement::postConstruct().

◆ BuildMeasurementsFromOA()

void Model::BuildMeasurementsFromOA ( OpticalAlignMeasurements measList)

Definition at line 1577 of file Model.cc.

1577  {
1578  std::vector<OpticalAlignMeasurementInfo>::iterator mite;
1579 
1580  if (ALIUtils::debug >= 5)
1581  std::cout << " BuildMeasurementsFromOA " << std::endl;
1582  std::vector<OpticalAlignMeasurementInfo> measInfos = measList.oaMeasurements_;
1583  for (mite = measInfos.begin(); mite != measInfos.end(); ++mite) {
1584  std::string measType = (*mite).type_;
1585  std::string measName = (*mite).name_;
1586  if (ALIUtils::debug >= 4)
1587  std::cout << " BuildMeasurementsFromOA measType " << measType << " measName " << measName << std::endl;
1588  //---------- Create Measurement with appropiate dimension
1589  Measurement* meastemp = nullptr;
1590  if (measType == ALIstring("SENSOR2D")) {
1591  meastemp = new MeasurementSensor2D(2, measType, measName);
1592  } else if (measType == ALIstring("DISTANCEMETER3DIM")) {
1593  meastemp = new MeasurementDistancemeter3dim(1, measType, measName);
1594  } else if (measType == ALIstring("DISTANCEMETER") || measType == ALIstring("DISTANCEMETER1DIM")) {
1595  meastemp = new MeasurementDistancemeter(1, measType, measName);
1596  } else if (measType == ALIstring("TILTMETER")) {
1597  meastemp = new MeasurementTiltmeter(1, measType, measName);
1598  } else if (measType == ALIstring("COPS")) {
1599  meastemp = new MeasurementCOPS(4, measType, measName);
1600  // } else if ( measType == ALIstring("DIFFCENTRE") ) {
1601  // meastemp = new MeasurementDiffCentre( 1, measType, measName );
1602  // } else if ( measType == ALIstring("DIFFANGLE") ) {
1603  // meastemp = new MeasurementDiffAngle( 2, measType, measName );
1604  } else if (measType == ALIstring("DIFFENTRY")) {
1605  meastemp = new MeasurementDiffEntry(1, measType, measName);
1606  } else {
1607  std::cerr << " !!! Model::BuildMeasurementsFromOA : measType not found " << measType << std::endl;
1608  throw std::exception();
1609  }
1610  meastemp->constructFromOA(*mite);
1611  }
1612 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, Measurement::constructFromOA(), gather_cfg::cout, ALIUtils::debug, cppFunctionSkipper::exception, OpticalAlignMeasurements::oaMeasurements_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ buildMeasurementsLinksToOptOs()

void Model::buildMeasurementsLinksToOptOs ( )
staticprivate

Read Measurements (to be implemented for reading from an external file the DATA of the measurements)

Build for each measuremnt its link to the OptO that take part in it

Definition at line 545 of file Model.cc.

545  {
546  //---------- Loop Measurements
547  std::vector<Measurement*>::const_iterator vmcite;
548  for (vmcite = MeasurementList().begin(); vmcite != MeasurementList().end(); ++vmcite) {
549  //---------- Transform for each Measurement the Measured OptO names to Measured OptO pointers
550  // (*vmcite)->buildOptOList();
551 
552  //---------- Build list of Entries that affect a Measurement
553  // (*vmcite)->buildAffectingEntryList();
554  }
555 }

Referenced by readSystemDescription().

◆ BuildSystemDescriptionFromOA()

void Model::BuildSystemDescriptionFromOA ( OpticalAlignments optAlig)

Definition at line 1536 of file Model.cc.

1536  {
1538 
1539  OpticalAlignInfo oai_system = FindOptAlignInfoByType("system");
1540 
1541  OpticalObject* OptOsystem = new OpticalObject(nullptr, "system", oai_system.name_, false);
1542 
1543  OptOsystem->constructFromOptAligInfo(oai_system);
1544 
1545  //- Model::_OptOtree.insert( std::multimap< ALIstring, OpticalObject*, std::less<ALIstring> >::value_type(OptOsystem->type(), OptOsystem) );
1546  // theOptOlist[OptOsystem->name()] = OptOsystem;
1547  theOptOList.push_back(OptOsystem);
1548 }

References OpticalObject::constructFromOptAligInfo(), OpticalAlignInfo::name_, and OpticalAlignments::opticalAlignments().

◆ cleanParamFittedSigmaVector()

static void Model::cleanParamFittedSigmaVector ( )
inlinestaticprivate

Definition at line 257 of file Model.h.

257  {
258  ALIuint pfsv_size = theParamFittedSigmaVector.size();
259  for (ALIuint ii = 0; ii < pfsv_size; ii++) {
260  theParamFittedSigmaVector.pop_back();
261  }
262  }

References cuy::ii, and theParamFittedSigmaVector.

◆ cleanParamFittedValueDisplacementMap()

static void Model::cleanParamFittedValueDisplacementMap ( )
inlinestaticprivate

Definition at line 264 of file Model.h.

References theParamFittedValueDisplacementMap.

◆ CMSLinkCleanModel()

void Model::CMSLinkCleanModel ( )
private

Definition at line 864 of file Model.cc.

864  {
865  deleteOptO("s");
866  //---------- Clean OptOdicitionary (in case this is not first reading)
867  ALIuint odsize = theOptODictionary.size();
868  for (ALIuint ii = 0; ii < odsize; ii++) {
869  theOptODictionary.pop_back();
870  }
871 }

References cuy::ii.

◆ CMSLinkDeleteOptOs()

void Model::CMSLinkDeleteOptOs ( )
staticprivate

Definition at line 876 of file Model.cc.

876  {
877  ALIint cmslink_iter = Model::CMSLinkIteration;
878  ALIdouble cmslink_method;
879 
881  assert(gomgr->getGlobalOptionValue("cms_link_method", cmslink_method));
882  ALIdouble cmslink_halfplanes;
883  assert(gomgr->getGlobalOptionValue("cms_link_halfplanes", cmslink_halfplanes));
884  if (ALIUtils::debug >= 2)
885  std::cout << "CMSLinkDeleteOptOs: cms_link_halfplanes " << cmslink_halfplanes << cmslink_iter << std::endl;
886 
887  if (cmslink_iter == 1) {
888  //---------- First fit: delete everything but laser1 and det_tkU
889  // deleteOptO("s/laserboxL/laser2");
890  //- std::cout << "delete mabs" << std::endl;
891  deleteOptO("s/mabsL");
892  //------- Method 1: detectors at tracker down
893  if (cmslink_method == 1) {
894  deleteOptO("s/tracker/det_trkDL");
895  deleteOptO("s/tracker/det_trkDR");
896  }
897 
898  if (cmslink_halfplanes == 2) {
899  // deleteOptO("s/laserboxR/laser2");
900  deleteOptO("s/mabsR");
901  }
902 
903  } else if (cmslink_iter == 2) {
904  //---------- Second fit (method 1): delete everything but laser1 and det3
905  // deleteOptO("s/laserboxL/laser2");
906  deleteOptO("s/mabsL");
907  deleteOptO("s/tracker/CST/wheel_trkL/peri/mirror"); //??
908  deleteOptO("s/tracker/CST/wheel_trkL/det_trkU");
909  //------- Method 1: detectors on CST, Method 2: detectors on tracker
910  //not necessary deleteOptO("s/tracker/CST/det6");
911 
912  if (cmslink_halfplanes <= 1) {
913  deleteOptO("s/tracker/CST/wheel_trkR");
914  } else if (cmslink_halfplanes == 2) {
915  // deleteOptO("s/laserboxR/laser2");
916  deleteOptO("s/mabsR");
917  deleteOptO("s/tracker/CST/wheel_trkR/peri/mirror"); //??
918  deleteOptO("s/tracker/CST/wheel_trkR/det_trkU");
919  }
920 
921  } else if (cmslink_iter == 3) {
922  //---------- Third fit: delete everything but laser2 and mabs
923  // deleteOptO("s/laserboxL/laser1");
924  deleteOptO("s/tracker");
925 
926  if (cmslink_halfplanes == 2) {
927  // deleteOptO("s/laserboxR/laser1");
928  }
929  //---------- Do nothing
930  } else {
931  }
932 }

References cms::cuda::assert(), CMSLinkIteration, gather_cfg::cout, ALIUtils::debug, GlobalOptionMgr::getGlobalOptionValue(), and GlobalOptionMgr::getInstance().

◆ CMSLinkFit()

void Model::CMSLinkFit ( ALIint  cmslink)

*************** FOR CMS LINK SYSTEM (to fit it part by part)

Definition at line 808 of file Model.cc.

808  {
809  /*
810  //---------- Get number of fits
811  ALIint cmslinkNoFits = 0;
812  if( cmslink == 1) {
813  cmslinkNoFits = 3;
814  } else if( cmslink == 2) {
815  cmslinkNoFits = 2;
816  }
817  if(ALIUtils::debug >= 4) std::cout << " Start CMS link fit with method " << cmslink << " (number of fits = " << cmslinkNoFits << ")" << std::endl;
818 
819  //----------- Loop number of cms_link fits
820  for(ALIint ilink = ALIint(Model::GlobalOptions()["cms_link"]); ilink <= cmslinkNoFits; ilink++) {
821 
822  //----- Iteration 2 of method 2 resembles iteration 3 of method 1
823  ALIdouble cmslink_method;
824  assert(Model::getGlobalOptionValue("cms_link_method", cmslink_method));
825  if( cmslink_method == 2 && ilink == 2) ilink = 3;
826 
827 //---- Set variable CMSLinkIteration, Checked in Fit.C and other //- std::cout << "ilink" << ilink << std::endl;
828  Model::setGlobalOption("cms_link", ilink);
829  Model::CMSLinkIteration = ilink;
830 
831  if(ilink > 1)Model::readSystemDescription(); //already read once to fill value Model::GlobalOptions()["cms_link"]
832 
833  //---------- Delete the OptO not fitted in this iteration
834  // Model::CMSLinkDeleteOptOs();
835  // cannot be here because you may recover a parameter saved in previous iteration that now it is deleted (!!MODIFY THIS)
836 
837  //---------- Recover parameters fitted in previous iteration
838  Model::CMSLinkRecoverParamFittedSigma( ilink );
839 
840  Model::CMSLinkRecoverParamFittedValueDisplacement( ilink );
841 
842  //---------- Delete the OptO not fitted in this iteration
843  Model::CMSLinkDeleteOptOs();
844 
845  //---------- Start fit
846  Fit::startFit();
847 
848  //---------- Save parameters fitted in this iteration (to be used in next one)
849  Model::CMSLinkSaveParamFittedSigma( ilink );
850 
851  Model::CMSLinkSaveParamFittedValueDisplacement( ilink );
852 
853  //---------- Delete whole system to start anew in next iteration
854  Model::CMSLinkCleanModel();
855 
856  }
857  */
858 }

◆ CMSLinkRecoverParamFittedSigma()

void Model::CMSLinkRecoverParamFittedSigma ( ALIint  cmslink)
staticprivate

Definition at line 1025 of file Model.cc.

1025  {
1026  /*
1027  ALIdouble cms_link_halfplanes = (GlobalOptions()["cms_link_halfplanes"]);
1028 
1029  if( cms_link == 2) {
1030  //---------- Second fit: recover laserbox angles
1031  recoverParamFittedSigma("s/laserboxL","Angles X",0);
1032  recoverParamFittedSigma("s/laserboxL","Angles Y",1);
1033 
1034  if( cms_link_halfplanes == 2) {
1035  recoverParamFittedSigma("s/laserboxR","Angles X",0);
1036  recoverParamFittedSigma("s/laserboxR","Angles Y",1);
1037  }
1038 
1039  } else if( cms_link == 3) {
1040  //---------- Third fit: recover laserbox angles and position and rotate angles to mabs
1041  recoverParamFittedSigma("s/laserboxL","Centre X",0);
1042  recoverParamFittedSigma("s/laserboxL","Centre Y",1);
1043  recoverParamFittedSigma("s/laserboxL","Centre Z",2);
1044  recoverParamFittedSigma("s/laserboxL","Angles X",3);
1045 
1046  //----- Angle around Y is converted to angle around Z when turning 90 deg
1047  Entry* slaZ = getEntryByName("s/laserboxL","Angles Z");
1048  //--- prec_level_laser
1049  Entry* smaZ = getEntryByName("s/mabsL","Angles Z");
1050  slaZ->setQuality(0);
1051  slaZ->setValue( smaZ->value() );
1052  // smaZ->setQuality(0); //!!???!!?
1053 
1054  Entry* slaY = getEntryByName("s/laserboxL","Angles Y");
1055  slaY->setQuality(0);
1056 
1057  if( cms_link_halfplanes == 2) {
1058  recoverParamFittedSigma("s/laserboxR","Centre X",0);
1059  recoverParamFittedSigma("s/laserboxR","Centre Y",1);
1060  recoverParamFittedSigma("s/laserboxR","Centre Z",2);
1061  recoverParamFittedSigma("s/laserboxR","Angles X",3);
1062 
1063  //----- Angle around Y is converted to angle around Z when turning 90 deg
1064  Entry* slaZ = getEntryByName("s/laserboxR","Angles Z");
1065  //--- prec_level_laser
1066  Entry* smaZ = getEntryByName("s/mabsR","Angles Z");
1067  slaZ->setQuality(0);
1068  slaZ->setValue( smaZ->value() );
1069  // smaZ->setQuality(0); //!!???!!?
1070 
1071  Entry* slaY = getEntryByName("s/laserboxR","Angles Y");
1072  slaY->setQuality(0);
1073  }
1074  } else {
1075  //---------- Do nothing
1076 
1077  }
1078  */
1079 }

◆ CMSLinkRecoverParamFittedValueDisplacement()

void Model::CMSLinkRecoverParamFittedValueDisplacement ( ALIint  cmslink)
staticprivate

Definition at line 1084 of file Model.cc.

1084  {
1085  /*
1086  //---------- Second fit: recover laserbox angles
1087  if( cms_link == 2 || cms_link == 3 ) {
1088 
1089  std::map<ALIstring, ALIdouble, std::less<ALIstring> >::const_iterator vsdmite;
1090  if ( ALIUtils::debug >= 99) std::cout << "theParamFittedValueDisplacementMap.size " << theParamFittedValueDisplacementMap.size() << std::endl;
1091  for( vsdmite = theParamFittedValueDisplacementMap.begin(); vsdmite != theParamFittedValueDisplacementMap.end(); vsdmite++) {
1092  std::cout << "reoverValueDisp" << (*vsdmite).first << " " << (*vsdmite).second << std::endl;
1093  Entry* this_entry = getEntryByName( (*vsdmite).first);
1094  this_entry->displaceOriginal( (*vsdmite).second );
1095  this_entry->OptOCurrent()->resetGlobalCoordinates();
1096  this_entry->setValueDisplacementByFitting( (*vsdmite).second );
1097 
1098  }
1099 
1100  //---------- Do nothing
1101  } else {
1102 
1103  }
1104  */
1105 }

◆ CMSLinkSaveParamFittedSigma()

void Model::CMSLinkSaveParamFittedSigma ( ALIint  cmslink)
staticprivate

Definition at line 937 of file Model.cc.

937  {
938  /*
939  ALIdouble cms_link_halfplanes = (GlobalOptions()["cms_link_halfplanes"]);
940 
941  cleanParamFittedSigmaVector();
942 
943  //---------- First fit: Save laserbox angles fitted at tracker
944  if( cms_link == 1) {
945  //? if (GlobalOptions()["cms_link_method"] < 10){
946  saveParamFittedSigma("s/laserboxL","Angles X");
947  saveParamFittedSigma("s/laserboxL","Angles Y");
948 
949  saveParamFittedCorrelation("s/laserboxL","Angles X",
950  "s/tracker/CST","Centre Y");
951  saveParamFittedCorrelation("s/laserboxL","Angles Y",
952  "s/tracker/CST","Centre X");
953  if( cms_link_halfplanes == 2) {
954  saveParamFittedSigma("s/laserboxR","Angles X");
955  saveParamFittedSigma("s/laserboxR","Angles Y");
956 
957  saveParamFittedCorrelation("s/laserboxR","Angles X",
958  "s/tracker/CST","Centre Y");
959  saveParamFittedCorrelation("s/laserboxR","Angles Y",
960  "s/tracker/CST","Centre X");
961  }
962 
963  } else if( cms_link == 2) {
964  //---------- Second fit: Save laserbox angles and position
965  saveParamFittedSigma("s/laserboxL","Centre X");
966  saveParamFittedSigma("s/laserboxL","Centre Y");
967  // Make quality unk to cal
968  saveParamFittedSigma("s/laserboxL","Centre Z");
969  saveParamFittedSigma("s/laserboxL","Angles X");
970  saveParamFittedSigma("s/laserboxL","Angles Y");
971 
972  saveParamFittedCorrelation("s/laserboxL","Centre X",
973  "s/laserboxL","Angles Y");
974  saveParamFittedCorrelation("s/laserboxL","Centre Y",
975  "s/laserboxL","Angles X");
976 
977  if( cms_link_halfplanes == 2) {
978  saveParamFittedSigma("s/laserboxR","Centre X");
979  saveParamFittedSigma("s/laserboxR","Centre Y");
980  // Make quality unk to cal
981  saveParamFittedSigma("s/laserboxR","Centre Z");
982  saveParamFittedSigma("s/laserboxR","Angles X");
983  saveParamFittedSigma("s/laserboxR","Angles Y");
984 
985  saveParamFittedCorrelation("s/laserboxR","Centre X",
986  "s/laserboxR","Angles Y");
987  saveParamFittedCorrelation("s/laserboxR","Centre Y",
988  "s/laserboxR","Angles X");
989  }
990  } else {
991  //---------- Do nothing
992 
993  }
994  */
995 }

◆ CMSLinkSaveParamFittedValueDisplacement()

void Model::CMSLinkSaveParamFittedValueDisplacement ( ALIint  cmslink)
staticprivate

Definition at line 1000 of file Model.cc.

1000  {
1001  /*
1002  cleanParamFittedValueDisplacementMap();
1003 
1004  //----------
1005  if( cms_link == 1 || cms_link == 2 ) {
1006  std::vector<Entry*>::const_iterator vecite;
1007  for( vecite = EntryList().begin(); vecite != EntryList().end(); vecite++) {
1008  if( (*vecite)->valueDisplacementByFitting() != 0 ) {
1009  ALIstring names = (*vecite)->OptOCurrent()->name() + "/" + (*vecite)->name();
1010  std::cout << "saeParamFittedValueDisplacementMap" << names << (*vecite)->valueDisplacementByFitting() << std::endl;
1011  theParamFittedValueDisplacementMap[ names ] = (*vecite)->valueDisplacementByFitting();
1012  }
1013  }
1014 
1015  //---------- Do nothing
1016  } else {
1017 
1018  }
1019  */
1020 }

◆ copyMeasurements()

void Model::copyMeasurements ( const std::vector< ALIstring > &  wl)
staticprivate

Definition at line 1419 of file Model.cc.

1419  {
1420  //----- Check format, e.g. @copy_measurements _1/_2/*_1
1421 
1422  //----- get list of Measurement's that satisfy the query in their name
1423  //t std::string querystr = wl[1].substr( wl[1].find("/")+1, wl[1].length() );
1424  std::string subsstr1 = wl[1].substr(0, wl[1].find('/'));
1425  std::string subsstr2 = wl[1].substr(wl[1].find('/') + 1, wl[1].rfind('/') - wl[1].find('/') - 1);
1426  std::string querystr = wl[1].substr(wl[1].rfind('/') + 1, wl[1].length());
1427 
1428  std::cout << " Model::copyMeasurements "
1429  << " subsstr1 " << subsstr1 << " subsstr2 " << subsstr2 << " querystr " << querystr << std::endl;
1430 
1431  std::vector<Measurement*> measToCopy;
1432  std::vector<Measurement*>::iterator mite;
1433  for (mite = theMeasurementVector.begin(); mite != theMeasurementVector.end(); ++mite) {
1434  Measurement* meas = (*mite);
1435  //improve this
1436  if (meas->name().find(querystr) != std::string::npos) {
1437  measToCopy.push_back(meas);
1438  }
1439  }
1440 
1441  //---- Build new measurements
1442  Measurement* meastemp = nullptr;
1443  for (mite = measToCopy.begin(); mite != measToCopy.end(); ++mite) {
1444  Measurement* meas = (*mite);
1445  std::vector<ALIstring> wlt;
1446  wlt.push_back(meas->type());
1447 
1448  //---- create new name
1449  std::string newName = ALIUtils::changeName(meas->name(), subsstr1, subsstr2);
1450  std::cout << " newName " << newName << std::endl;
1451  wlt.push_back(newName);
1452 
1453  ALIstring measType = wlt[0];
1454  ALIstring measName;
1455  if (wlt.size() == 2) {
1456  measName = wlt[1];
1457  } else {
1458  measName = "";
1459  }
1460  if (meas->type() == ALIstring("SENSOR2D")) {
1461  meastemp = new MeasurementSensor2D(2, measType, measName);
1462  // } else if ( meas->type() == ALIstring("DISTANCEMETER3DIM") ) {
1463  // meastemp = new MeasurementDistancemeter3dim( 1, measType, measName );
1464  } else if (meas->type() == ALIstring("DISTANCEMETER") || meas->type() == ALIstring("DISTANCEMETER1DIM")) {
1465  meastemp = new MeasurementDistancemeter(1, measType, measName);
1466  } else if (meas->type() == ALIstring("TILTMETER")) {
1467  meastemp = new MeasurementTiltmeter(1, measType, measName);
1468  // } else if ( meas->type() == ALIstring("DIFFCENTRE") ) {
1469  // meastemp = new MeasurementDiffCentre( 1, measType, measName );
1470  // } else if ( meas->type() == ALIstring("DIFFANGLE") ) {
1471  // meastemp = new MeasurementDiffAngle( 1, measType, measName );
1472  } else if (meas->type() == ALIstring("DIFFENTRY")) {
1473  meastemp = new MeasurementDiffEntry(1, measType, measName);
1474  } else if (meas->type() == ALIstring("COPS")) {
1475  meastemp = new MeasurementCOPS(4, measType, measName);
1476  } else {
1477  throw cms::Exception("LogicError") << "@SUB=Model::copyMeasurements\n"
1478  << "unknown measurement type: " << meas->type();
1479  }
1480 
1481  //later meastemp->copyConversionFactor( wordlist );
1482  meastemp->copyMeas(meas, subsstr1, subsstr2);
1483 
1484  break;
1485  }
1486 }

References ALIUtils::changeName(), Measurement::copyMeas(), gather_cfg::cout, Exception, spr::find(), Measurement::name(), mps_merge::newName, AlCaHLTBitMon_QueryRunRegistry::string, Measurement::type(), and LaserClient_cfi::wl.

◆ createCopyComponentList()

ALIbool Model::createCopyComponentList ( const ALIstring optoname)
static

**************** FOR COPYING AN OPTO

Definition at line 750 of file Model.cc.

750  {
751  //---------- Find an OptO with the same type (YOU HAVE TO BE SURE THAT ALL EXISTING OPTOs OF THIS TYPE HAVE SAME COMPONENTS, IF NOT COPYING MAY GIVE YOU UNPREDICTABLE RESULTS)
752  if (ALIUtils::debug >= 3)
753  std::cout << "createCopyComponentList " << typ << std::endl;
754  OpticalObject* start_opto = getOptOByType(typ);
755 
756  //---------- clean list of OptOs to copy
758 
759  //---------- Fill list of OptOs to copy
760  fillCopyComponentList(start_opto);
761  //- if(ALIUtils::debug >= 9) std::cout << "createCopyComponentList " << typ << theOptOsToCopyList.size() << std::endl;
762 
764  return true;
765 }

References gather_cfg::cout, and ALIUtils::debug.

Referenced by OpticalObject::createComponentOptOs().

◆ deleteOptO() [1/2]

void Model::deleteOptO ( const ALIstring opto_name)
staticprivate

Definition at line 1110 of file Model.cc.

1110  {
1111  OpticalObject* opto = getOptOByName(opto_name);
1112  deleteOptO(opto);
1113 }

◆ deleteOptO() [2/2]

void Model::deleteOptO ( OpticalObject opto)
staticprivate

Definition at line 1118 of file Model.cc.

1118  {
1119  if (ALIUtils::debug >= 5)
1120  std::cout << "DELETING OptO" << opto->name() << std::endl;
1121 
1122  //---------- Delete Coordinate Entries of this OptO
1123  std::vector<Entry*>::const_iterator vecite;
1124  std::vector<Entry*>::iterator veite2;
1125  if (ALIUtils::debug >= 9)
1126  std::cout << "SIZE" << theEntryVector.size() << std::endl;
1127  for (vecite = opto->CoordinateEntryList().begin(); vecite != opto->CoordinateEntryList().end(); ++vecite) {
1128  // ALIuint pos = FindItemInVector( (*veite), opto->CoordinateEntryList() );
1129  veite2 = find(theEntryVector.begin(), theEntryVector.end(), (*vecite));
1130  //- if ( ALIUtils::debug >= 9) std::cout << (*veite2) << "DELETE ENTRY " << (*vecite) <<(*veite2)->OptOCurrent()->name() << (*veite2)->name() << std::endl;
1131  delete ((*veite2));
1132  theEntryVector.erase(veite2);
1133  }
1134 
1135  for (vecite = opto->ExtraEntryList().begin(); vecite != opto->ExtraEntryList().end(); ++vecite) {
1136  // ALIuint pos = FindItemInVector( (*veite), opto->CoordinateEntryList() );
1137  veite2 = find(theEntryVector.begin(), theEntryVector.end(), (*vecite));
1138  //- if(ALIUtils::debug >= 9) std::cout << (*veite2) << "DELETE ENTRY " << (*veite2)->OptOCurrent()->name() << (*veite2)->name() << std::endl;
1139  delete ((*veite2));
1140  theEntryVector.erase(veite2);
1141  }
1142 
1143  for (vecite = theEntryVector.begin(); vecite != theEntryVector.end(); ++vecite) {
1144  // std::cout << (*vecite) << "ENTReY " << (*vecite)->OptOCurrent()->name() << (*vecite)->name() << std::endl;
1145  }
1146 
1147  //---------- Delete all Measurement in which opto takes part
1148  std::vector<Measurement*> MeasToBeDeleted;
1149  std::vector<Measurement*>::const_iterator vmite;
1150  std::vector<OpticalObject*>::const_iterator vocite;
1151  for (vmite = MeasurementList().begin(); vmite != MeasurementList().end(); ++vmite) {
1152  if (ALIUtils::debug >= 5)
1153  std::cout << "Deleting Measurement" << (*vmite)->name() << std::endl;
1154  //----- If any of the OptO Measured is opto, delete this Measurement
1155  for (vocite = (*vmite)->OptOList().begin(); vocite != (*vmite)->OptOList().end(); ++vocite) {
1156  if ((*vocite) == opto) {
1157  //- std::cout << "MEASTBD" << (*vmite) << std::endl;
1158  MeasToBeDeleted.push_back(*vmite);
1159  //? delete (*vmite);
1160  break;
1161  }
1162  }
1163  }
1164 
1165  //---------- Delete Measurements from list
1166  std::vector<Measurement*>::const_iterator vmcite;
1167  std::vector<Measurement*>::iterator vmite2;
1168  if (ALIUtils::debug >= 9)
1169  std::cout << "SIZEMEAS" << MeasToBeDeleted.size() << std::endl;
1170  for (vmcite = MeasToBeDeleted.begin(); vmcite != MeasToBeDeleted.end(); ++vmcite) {
1171  vmite2 = find(theMeasurementVector.begin(), theMeasurementVector.end(), (*vmcite));
1172  // std::cout << (*vmite2) << "DELETE MSEASU " << (*vmcite) << (*vmite2)->name()[0] << std::endl;
1173  delete ((*vmite2));
1174  theMeasurementVector.erase(vmite2);
1175  }
1176 
1177  //---------- Delete components
1178  // std::vector<OpticalObject*>::iterator voite;
1179  std::vector<OpticalObject*> vopto;
1180  // ALIbool opto_found = getComponentOptOs( opto->name(), vopto );
1181  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1182  deleteOptO(*vocite);
1183  }
1184 
1185  //---------- Delete this OptO
1186  //---------- Delete OptO (only from list, to delete it really first delete components)
1187  /* map< ALIstring, OpticalObject*, std::less<ALIstring> >::iterator msoite =
1188 find( theOptOList.begin(), theOptOList.end(),
1189 map< ALIstring, OpticalObject*, std::less<ALIstring> >::value_type( opto->name(), opto) );*/
1190  std::vector<OpticalObject*>::iterator dvoite =
1192  //- std::cout << (*dvoite) << "DELETE OPTO " << opto <<"WW" << (*dvoite)->name() << std::endl;
1193  theOptOList.erase(dvoite);
1194  delete opto;
1195 }

References OpticalObject::CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, OpticalObject::ExtraEntryList(), spr::find(), and OpticalObject::name().

◆ EntryList()

static std::vector<Entry*>& Model::EntryList ( )
inlinestatic

◆ fillCopyComponentList()

ALIbool Model::fillCopyComponentList ( const OpticalObject opto)
staticprivate

Definition at line 770 of file Model.cc.

770  {
771  if (ALIUtils::debug >= 3)
772  std::cout << "entering fillCopyComponentList(): OptO" << opto->name() << std::endl;
773  //---------- Get list of components of 'opto'
774  std::vector<OpticalObject*> vopto;
775  ALIbool opto_found = getComponentOptOs(opto->name(), vopto);
776  if (!opto_found) {
777  if (ALIUtils::debug >= 5)
778  std::cout << "fillCopyComponentList: NO COMPONENTS TO COPY IN THIS OptO" << opto->name() << std::endl;
779  }
780 
781  //---------- Loop list of components of 'opto'
782  std::vector<OpticalObject*>::const_iterator vocite;
783  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
784  theOptOsToCopyList.push_back(*vocite);
785  if (ALIUtils::debug >= 5)
786  std::cout << "fillCopyOptOList " << (*vocite)->type() << " " << (*vocite)->name() << std::endl;
787  //---------- Add components of this component
788  fillCopyComponentList(*vocite);
789  }
790  return opto_found;
791 }

References gather_cfg::cout, ALIUtils::debug, and OpticalObject::name().

◆ FindOptAlignInfoByType()

OpticalAlignInfo Model::FindOptAlignInfoByType ( const ALIstring type)

Definition at line 1551 of file Model.cc.

1551  {
1552  OpticalAlignInfo oai;
1553 
1554  ALIbool bFound = false;
1555  std::vector<OpticalAlignInfo>::iterator ite;
1556  for (ite = theOpticalAlignments.begin(); ite != theOpticalAlignments.end(); ++ite) {
1557  // std::cout << " Model::FindOptAlignInfoByType " << (*ite).type_ << " =? " << type << std::endl;
1558  if ((*ite).type_ == type) {
1559  if (!bFound) {
1560  oai = *ite;
1561  bFound = true;
1562  } else {
1563  std::cerr << "!! WARNING: Model::FindOptAlignInfoByType more than one objects of type " << type << std::endl;
1564  std::cerr << " returning object " << oai.name_ << std::endl << " skipping object " << (*ite).name_ << std::endl;
1565  }
1566  }
1567  }
1568  if (!bFound) {
1569  std::cerr << "!! ERROR: Model::FindOptAlignInfoByType object not found, of type " << type << std::endl;
1570  std::exception();
1571  }
1572 
1573  return oai;
1574 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cppFunctionSkipper::exception, and OpticalAlignInfo::name_.

◆ getCocoaStatus()

static cocoaStatus Model::getCocoaStatus ( )
inlinestatic

Definition at line 63 of file Model.h.

63 { return theCocoaStatus; }

References theCocoaStatus.

Referenced by Fit::fitParameters().

◆ getComponentOptOs()

ALIbool Model::getComponentOptOs ( const ALIstring opto_name,
std::vector< OpticalObject * > &  vcomponents 
)
static

--— Get from theOptOList the list of pointers to component OptOs

Definition at line 705 of file Model.cc.

705  {
706  //---------- clean std::vector in which you are going to store opto pointers
707  std::vector<OpticalObject*>::iterator voite;
708  for (voite = vcomponents.begin(); voite != vcomponents.end(); ++voite) {
709  vcomponents.pop_back();
710  }
711 
712  //---------- Get OptO corresponding to name 'opto_name'
713  OpticalObject* opto = getOptOByName(opto_name);
714 
715  if (ALIUtils::debug >= 99)
716  std::cout << opto_name << "getComponentOptOs: opto " << opto << opto->name() << std::endl;
717  std::vector<OpticalObject*>::const_iterator vocite;
718 
719  if (ALIUtils::debug >= 99)
720  std::cout << "optolist size " << OptOList().size() << std::endl;
721  ALIbool opto_found = false;
722  for (vocite = OptOList().begin(); vocite != OptOList().end(); ++vocite) {
723  if ((*vocite)->parent() != nullptr) {
724  // std::cout << "looping OptOlist" << (*vocite)->name() << " parent " <<(*vocite)->parent()->name() << std::endl;
725  if ((*vocite)->parent()->name() == opto_name) {
726  opto_found = true;
727  vcomponents.push_back((*vocite));
728  }
729  }
730  }
731 
732  /* std::pair<multimap< ALIstring, OpticalObject*, std::less<ALIstring> >::iterator,
733  std::multimap< ALIstring, OpticalObject*, std::less<ALIstring> >::iterator>
734  pmmao = _OptOtree.equal_range(opto_name);
735 
736  if( pmmao.first != _OptOtree.end()) {
737  std::multimap< ALIstring, OpticalObject*, std::less<ALIstring> >::const_iterator socite;
738  for (socite = pmmao.first; socite != (pmmao.second); socite++) {
739  vcomponents.push_back( (*socite).second );
740  }
741  }
742  */
743  return opto_found;
744 }

References gather_cfg::cout, ALIUtils::debug, and OpticalObject::name().

Referenced by OpticalObject::displaceCentreGlob(), OpticalObject::displaceCentreGlobOriginal(), OpticalObject::displaceCentreGlobOriginalOriginal(), OpticalObject::displaceRmGlobAroundGlobal(), OpticalObject::displaceRmGlobAroundLocal(), OpticalObject::displaceRmGlobOriginal(), OpticalObject::displaceRmGlobOriginalOriginal(), OpticalObject::propagateGlobalRMOriginalOriginalChangeToChildren(), OpticalObject::resetGlobalCoordinates(), OpticalObject::resetOriginalOriginalCoordinates(), OpticalObject::setGlobalCoordinatesOfComponents(), and OpticalObject::setGlobalRMOriginalOriginal().

◆ getComponentOptOTypes()

ALIbool Model::getComponentOptOTypes ( const ALIstring opto_type,
std::vector< ALIstring > &  vcomponents 
)
static

--— Get from theOptODictionary the list of component OptO types

Definition at line 674 of file Model.cc.

674  {
675  //---------- clean std::vector in which you are going to store opto types
676  std::vector<ALIstring>::iterator vsite;
677  for (vsite = vcomponents.begin(); vsite != vcomponents.end(); ++vsite) {
678  vcomponents.pop_back();
679  }
680 
681  //---------- Looks the theOptODictionary item that has 'opto_type' as the first ALIstring,
682  ALIint ALIstring_found = 0;
683  std::vector<std::vector<ALIstring> >::iterator vvsite;
684  for (vvsite = OptODictionary().begin(); vvsite != OptODictionary().end(); ++vvsite) {
685  if (*((*vvsite).begin()) == opto_type) {
686  ALIstring_found = 1;
687  //tt copies this item to 'vcomponents', substracting the first ALIstring, that is the opto_type itself,
688  vcomponents = *vvsite;
689  vcomponents.erase(vcomponents.begin());
690  break;
691  }
692  }
693 
694  if (ALIstring_found) {
695  return true;
696  } else {
697  return false;
698  }
699 }

Referenced by OpticalObject::createComponentOptOs().

◆ getEntryByName() [1/2]

static Entry* Model::getEntryByName ( const ALIstring opto_entry_name)
inlinestatic

--— Search an Entry from the full entry path (first substract the name of the OptO and then look in the Entry* list)

Definition at line 120 of file Model.h.

120  {
121  ALIint slash_pos = opto_entry_name.rfind('/');
122  ALIint length = opto_entry_name.length();
123  ALIstring opto_name = opto_entry_name.substr(0, slash_pos);
124  ALIstring entry_name = opto_entry_name.substr(slash_pos + 1, length);
125  Entry* entry = getEntryByName(opto_name, entry_name);
126  return entry;
127  }

References mps_splice::entry, and getEntryByName().

◆ getEntryByName() [2/2]

Entry * Model::getEntryByName ( const ALIstring opto_name,
const ALIstring entry_name 
)
static

--— Search an Entry name in the Entry* list and return a pointer to it

Definition at line 623 of file Model.cc.

623  {
624  //---------- Look for Entry name type in EntryList
625  std::vector<Entry*>::const_iterator vecite;
626  for (vecite = EntryList().begin(); vecite != EntryList().end(); ++vecite) {
627  if (ALIUtils::debug >= 4)
628  std::cout << "getEntryByName: " << (*vecite)->OptOCurrent()->name() << " E " << (*vecite)->name()
629  << " Searching: " << opto_name << " E " << entry_name << std::endl;
630  //- std::cout << " optoName " << (*vecite)->OptOCurrent()->name()<< " " << (*vecite)->name() << std::endl;
631  if ((*vecite)->OptOCurrent()->name() == opto_name && (*vecite)->name() == entry_name) {
632  return *vecite;
633  }
634  }
635  //---------- Entry not found!
636  std::cerr << "!!!EXITING at getEntryByName: Entry name not found:" << opto_name << " " << entry_name << std::endl;
637  exit(1);
638 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, and beamvalidation::exit().

Referenced by MeasurementDiffEntry::calculateSimulatedValue(), FittedEntry::FittedEntry(), getEntryByName(), FittedEntriesReader::readFittedEntriesFromFile(), Fit::setCorrelationFromParamFitted(), and FittedEntriesSet::SetOptOEntries().

◆ getFittedEntriesReader()

static FittedEntriesReader* Model::getFittedEntriesReader ( )
inlinestatic

Definition at line 254 of file Model.h.

254 { return theFittedEntriesReader; }

References theFittedEntriesReader.

Referenced by Fit::fitNextEvent().

◆ getInstance()

Model & Model::getInstance ( )
static

-------— Gets the only instance of this class

Definition at line 82 of file Model.cc.

82  {
83  if (!theInstance) {
84  theInstance = new Model;
85  }
86  return *theInstance;
87 }

Referenced by CocoaAnalyzer::runCocoa().

◆ getMeasurementByName()

Measurement * Model::getMeasurementByName ( const ALIstring name,
ALIbool  exists = true 
)
static

Definition at line 641 of file Model.cc.

641  {
642  //---------- Look for Optical Object name in OptOList
643  std::vector<Measurement*>::const_iterator vmcite;
644  for (vmcite = theMeasurementVector.begin(); vmcite != theMeasurementVector.end(); ++vmcite) {
645  if ((*vmcite)->name() == meas_name)
646  break;
647  }
648 
649  if (vmcite != theMeasurementVector.end()) {
650  //---------- If opto_name found, return pointer to it
651  return (*vmcite);
652  } else {
653  if (exists) {
654  //---------- If opto_name not found, exit
655  std::cerr << " LIST OF Measurements " << std::endl;
656  for (vmcite = theMeasurementVector.begin(); vmcite != theMeasurementVector.end(); ++vmcite) {
657  std::cerr << (*vmcite)->name() << std::endl;
658  }
659  std::cerr << "!!EXITING at getMeasurementByName: Measurement " << meas_name << " doesn't exist!!" << std::endl;
660  abort();
661  // return (OpticalObject*)0;
662  } else {
663  return nullptr;
664  }
665  }
666 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

◆ getOpticalAlignments()

static std::vector<OpticalAlignInfo> Model::getOpticalAlignments ( )
inlinestatic

Definition at line 137 of file Model.h.

137 { return theOpticalAlignments; }

References theOpticalAlignments.

Referenced by OpticalObject::createComponentOptOsFromOptAlignInfo().

◆ getOptOByName()

OpticalObject * Model::getOptOByName ( const ALIstring opto_name)
static

--— Find an OptO name in theOptOList and return a pointer to it

Definition at line 570 of file Model.cc.

570  {
571  //---------- Look for Optical Object name in OptOList
572  std::vector<OpticalObject*>::const_iterator vocite;
573  for (vocite = OptOList().begin(); vocite != OptOList().end(); ++vocite) {
574  if ((*vocite)->name() == opto_name)
575  break;
576  }
577 
578  if (vocite == OptOList().end()) {
579  //---------- If opto_name not found, exit
580  std::cerr << " LIST OF OpticalObjects " << std::endl;
581  for (vocite = OptOList().begin(); vocite != OptOList().end(); ++vocite) {
582  std::cerr << (*vocite)->name() << std::endl;
583  }
584  std::cerr << "!!EXITING at getOptOByName: Optical Object " << opto_name << " doesn't exist!!" << std::endl;
585  exit(4);
586  // return (OpticalObject*)0;
587  } else {
588  //---------- If opto_name found, return pointer to it
589  if (ALIUtils::debug > 999) {
590  std::cout << opto_name.c_str() << "SSOptOitem" << (*vocite) << (*vocite)->name() << "len" << OptOList().size()
591  << std::endl;
592  }
593  return (*vocite);
594  }
595 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, and beamvalidation::exit().

Referenced by Measurement::buildOptOList(), Fit::findEntryFitPosition(), and FittedEntriesSet::SetOptOEntries().

◆ getOptOByType()

OpticalObject * Model::getOptOByType ( const ALIstring type)
static

--— Find the first OptO of type 'opto_type' in theOptOList and return a pointer to it

Definition at line 601 of file Model.cc.

601  {
602  //---------- Look for Optical Object type in OptOList
603  std::vector<OpticalObject*>::const_iterator vocite;
604  for (vocite = OptOList().begin(); vocite != OptOList().end(); ++vocite) {
605  // std::cout << "OPTOList" << (*msocite).first << std::endl;
606  if ((*vocite)->type() == opto_type)
607  break;
608  }
609 
610  if (vocite == OptOList().end()) {
611  //---------- If opto_type not found, exit
612  std::cerr << "!!EXITING at getOptOByType: Optical Object " << opto_type << " doesn't exist!!" << std::endl;
613  exit(4);
614  } else {
615  //---------- If opto_type found, return pointer to it
616  return (*vocite);
617  }
618 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and beamvalidation::exit().

◆ getParameterValue()

ALIint Model::getParameterValue ( const ALIstring sstr,
ALIdouble val 
)
static

************ ACCESS INFO FROM STATIC DATA

--— Search a string in theParameters and return 1 if found

Definition at line 560 of file Model.cc.

560  {
562  ALIint iret = parmgr->getParameterValue(sstr, val);
563 
564  return iret;
565 }

References ParameterMgr::getInstance(), ParameterMgr::getParameterValue(), and heppy_batch::val.

◆ getParamFittedSigmaVectorItem()

ALIdouble Model::getParamFittedSigmaVectorItem ( const ALIuint  position)
static

Definition at line 1275 of file Model.cc.

1275  {
1276  if (position >= theParamFittedSigmaVector.size()) {
1277  std::cerr << "!!EXITING at getParamFittedSigma: position" << position
1278  << " bigger than dimension of theParamFittedSigmaVector " << theParamFittedSigmaVector.size()
1279  << std::endl;
1280  exit(3);
1281  }
1282  std::vector<ALIdouble>::const_iterator vdcite = theParamFittedSigmaVector.begin() + position;
1283  return (*vdcite);
1284 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, beamvalidation::exit(), and position.

◆ MatricesFName()

static ALIstring& Model::MatricesFName ( )
inlinestatic

the name of the File for storing the matrices

Definition at line 102 of file Model.h.

102 { return theMatricesFName; }

References theMatricesFName.

Referenced by Fit::dumpMatrices().

◆ MeasFName()

static ALIstring& Model::MeasFName ( )
inlinestatic

the name of the Measurements File

Definition at line 96 of file Model.h.

96 { return theMeasFName; }

References theMeasFName.

◆ MeasurementList()

static std::vector<Measurement*>& Model::MeasurementList ( )
inlinestatic

◆ MeasurementsTime()

static struct tm& Model::MeasurementsTime ( )
inlinestatic

Definition at line 135 of file Model.h.

135 { return theMeasurementsTime; }

References theMeasurementsTime.

◆ nextOptOToCopy()

OpticalObject * Model::nextOptOToCopy ( )
static

Definition at line 796 of file Model.cc.

796  {
797  if (ALIUtils::debug >= 5)
798  std::cout << "entering nextOptOToCopy() " << std::endl;
800  // if(ALIUtils::debug >= 5) std::cout <<" nextOptOToCopy " << (*(theOptOsToCopyListIterator-1))->name() << std::endl;
801  return *(theOptOsToCopyListIterator - 1);
802 }

References gather_cfg::cout, and ALIUtils::debug.

Referenced by OpticalObject::copyData().

◆ OptODictionary()

static std::vector<std::vector<ALIstring> >& Model::OptODictionary ( )
inlinestatic

ACCESS STATIC DATA MEMBERS.

Definition at line 82 of file Model.h.

82 { return theOptODictionary; }

References theOptODictionary.

Referenced by readSystemDescription().

◆ OptOList()

static std::vector<OpticalObject*>& Model::OptOList ( )
inlinestatic

◆ printCocoaStatus()

std::string Model::printCocoaStatus ( const cocoaStatus  cs)
static

Definition at line 1511 of file Model.cc.

1511  {
1512  std::string str = "";
1513 
1514  if (cs == COCOA_Init) {
1515  str = "COCOA_Init ";
1516  } else if (cs == COCOA_ReadingModel) {
1517  str = "COCOA_ReadingModel";
1518  } else if (cs == COCOA_InitFit) {
1519  str = "COCOA_InitFit";
1520  } else if (cs == COCOA_FitOK) {
1521  str = "COCOA_FitOK";
1522  } else if (cs == COCOA_FitImproving) {
1523  str = "COCOA_FitImproving";
1524  } else if (cs == COCOA_FitCannotImprove) {
1525  str = "COCOA_FitCannotImprove";
1526  } else if (cs == COCOA_FitChi2Worsened) {
1527  str = "COCOA_FitChi2Worsened";
1528  } else if (cs == COCOA_FitMatrixNonInversable) {
1529  str = "COCOA_FitMatrixNonInversable";
1530  }
1531 
1532  return str;
1533 }

References COCOA_FitCannotImprove, COCOA_FitChi2Worsened, COCOA_FitImproving, COCOA_FitMatrixNonInversable, COCOA_FitOK, COCOA_Init, COCOA_InitFit, COCOA_ReadingModel, fwrapper::cs, str, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ readMeasurementsFromFile()

ALIbool Model::readMeasurementsFromFile ( ALIstring  only1Date = ALIstring(""),
ALIstring  only1Time = ALIstring("") 
)
static

Definition at line 1289 of file Model.cc.

1289  {
1290  if (ALIUtils::debug >= 5)
1291  std::cout << " readMeasurementsFromFile " << Measurement::measurementsFileName() << std::endl;
1293  return true;
1294 
1296  std::vector<ALIstring> wordlist;
1297  //---------- read date
1298  // ALIint retfil = filein.getWordsInLine(wordlist);
1299  // std::cout << "@@@@@@@@@@@@@@@ RETFIL " << retfil << std::endl;
1300  //if( retfil == 0 ) {
1301  if (filein.getWordsInLine(wordlist) == 0) {
1302  if (ALIUtils::debug >= 4)
1303  std::cout << "@@@@ No more measurements left" << std::endl;
1304  return false;
1305  }
1306 
1308  // struct tm tim;
1309  //t Model::setMeasurementsTime( tim );
1310 
1311  //if you are looking for only one measurement with a given date and time, loop all measurements until you find it
1312  if (Measurement::only1) {
1313  for (;;) {
1314  if (wordlist[0] == "DATE:" && wordlist[1] == Measurement::only1Date && wordlist[2] == Measurement::only1Time)
1315  break;
1316  filein.getWordsInLine(wordlist);
1317  if (filein.eof()) {
1318  std::cerr << "!! EXITING date not found in measurements file" << Measurement::only1Date << " "
1319  << Measurement::only1Time << std::endl;
1320  exit(1);
1321  }
1322  }
1323  }
1324 
1325  //set date and time of current measurement
1326  if (wordlist[0] == "DATE:") {
1327  Measurement::setCurrentDate(wordlist);
1328  }
1329 
1330  //---------- loop measurements
1331  ALIint nMeas = Model::MeasurementList().size();
1332  if (ALIUtils::debug >= 4) {
1333  std::cout << " Reading " << nMeas << " measurements from file " << Measurement::measurementsFileName()
1334  << " DATE: " << wordlist[1] << " " << wordlist[1] << std::endl;
1335  }
1336  ALIint ii;
1337  for (ii = 0; ii < nMeas; ii++) {
1338  filein.getWordsInLine(wordlist);
1339  if (wordlist[0] == ALIstring("SENSOR2D") || wordlist[0] == ALIstring("TILTMETER") ||
1340  wordlist[0] == ALIstring("DISTANCEMETER") || wordlist[0] == ALIstring("DISTANCEMETER1DIM") ||
1341  wordlist[0] == ALIstring("COPS")) {
1342  if (wordlist.size() != 2) {
1343  std::cerr << "!!!EXITING Model::readMeasurementsFromFile. number of words should be 2 instead of "
1344  << wordlist.size() << std::endl;
1345  ALIUtils::dumpVS(wordlist, " ");
1346  exit(1);
1347  }
1348  std::vector<Measurement*>::const_iterator vmcite;
1349  for (vmcite = MeasurementList().begin(); vmcite != MeasurementList().end(); ++vmcite) {
1350  //-------- Measurement found, fill data
1351  /* ALIint last_slash = (*vmcite)->name().rfind('/');
1352  ALIstring oname = (*vmcite)->name();
1353  if( last_slash != -1 ) {
1354  oname = oname.substr(last_slash+1, (*vmcite)->name().size()-1);
1355  }
1356  */
1357  ALIint fcolon = (*vmcite)->name().find(':');
1358  ALIstring oname = (*vmcite)->name();
1359  oname = oname.substr(fcolon + 1, oname.length());
1360  //- std::cout << " measurement name " << (*vmcite)->name() << " short " << oname << std::endl;
1361  if (oname == wordlist[1]) {
1362  //- std::cout << " measurement name found " << oname << std::endl;
1363  if ((*vmcite)->type() != wordlist[0]) {
1364  std::cerr << "!!! Reading measurement from file: type in file is " << wordlist[0] << " and should be "
1365  << (*vmcite)->type() << std::endl;
1366  exit(1);
1367  }
1368  Measurement* meastemp = *vmcite;
1369 
1371  ALIbool sigmaFF = gomgr->GlobalOptions()["measurementErrorFromFile"];
1372  //---------- Read the data
1373  for (ALIuint ii = 0; ii < meastemp->dim(); ii++) {
1374  filein.getWordsInLine(wordlist);
1375  ALIdouble sigma = 0.;
1376  if (!sigmaFF) {
1377  // keep the sigma, do not read it from file
1378  const ALIdouble* sigmav = meastemp->sigma();
1379  sigma = sigmav[ii];
1380  }
1381  //---- Check measurement value type is OK
1382  if (meastemp->valueType(ii) != wordlist[0]) {
1383  filein.ErrorInLine();
1384  std::cerr << "!!!FATAL ERROR: Measurement value type is " << wordlist[0]
1385  << " while in setup definition was " << meastemp->valueType(ii) << std::endl;
1386  exit(1);
1387  }
1388  meastemp->fillData(ii, wordlist);
1389  if (!sigmaFF) {
1390  meastemp->setSigma(ii, sigma);
1391  }
1392  }
1393  meastemp->correctValueAndSigma();
1394  break;
1395  }
1396  }
1397  if (vmcite == MeasurementList().end()) {
1398  for (vmcite = MeasurementList().begin(); vmcite != MeasurementList().end(); ++vmcite) {
1399  std::cerr << "MEAS: " << (*vmcite)->name() << " " << (*vmcite)->type() << std::endl;
1400  }
1401  std::cerr << "!!! Reading measurement from file: measurement not found in list: type in file is " << wordlist[1]
1402  << std::endl;
1403  exit(1);
1404  }
1405  } else {
1406  std::cerr << " wrong type of measurement: " << wordlist[0] << std::endl
1407  << " Available types are SENSOR2D, TILTMETER, DISTANCEMETER, DISTANCEMETER1DIM, COPS" << std::endl;
1408  exit(1);
1409  }
1410  }
1411  //- std::cout << " returning readmeasff" << std::endl;
1412 
1413  return true;
1414 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, Measurement::correctValueAndSigma(), gather_cfg::cout, ALIUtils::debug, Measurement::dim(), ALIUtils::dumpVS(), relativeConstraints::empty, mps_fire::end, ALIFileIn::eof(), ALIFileIn::ErrorInLine(), beamvalidation::exit(), Measurement::fillData(), GlobalOptionMgr::getInstance(), ALIFileIn::getInstance(), ALIFileIn::getWordsInLine(), GlobalOptionMgr::GlobalOptions(), cuy::ii, MeasurementList(), Measurement::measurementsFileName(), heppy_report::oname, Measurement::only1, Measurement::only1Date, Measurement::only1Time, Measurement::setCurrentDate(), Measurement::setSigma(), Measurement::sigma(), and Measurement::valueType().

◆ readSystemDescription()

void Model::readSystemDescription ( )
static

-------— Read the different sections of the SDF and act accordingly

Definition at line 99 of file Model.cc.

99  {
101 
102  ALIint data_reading = 0; // variable to identify the first line of section SYSTEM_TREE_DATA
103 
104  //---------- Open the system description file
106 
107  //----------- Set section titles
108  std::vector<ALIstring> SectionTitle;
109  SectionTitle.push_back(ALIstring("GLOBAL_OPTIONS"));
110  SectionTitle.push_back(ALIstring("PARAMETERS"));
111  SectionTitle.push_back(ALIstring("SYSTEM_TREE_DESCRIPTION"));
112  SectionTitle.push_back(ALIstring("SYSTEM_TREE_DATA"));
113  SectionTitle.push_back(ALIstring("MEASUREMENTS"));
114  SectionTitle.push_back(ALIstring("REPORT.OUT"));
115  std::vector<ALIstring>::iterator SectionTitleIterator;
116 
117  //---------------------------------------- Loops lines in SDF file
118  std::vector<ALIstring> wordlist;
119  ALIint InSectionNo = -1;
120  ALIint currentSectionNo = -1;
121  while (!filein.eof()) {
122  if (!filein.getWordsInLine(wordlist))
123  break; //----- Read line
124  assert(!wordlist.empty());
125 
126  //----- checking
127  if (ALIUtils::debug > 99) {
128  ALIUtils::dumpVS(wordlist, " ", std::cout);
129  }
130 
131  //---------- Get in which section the current line is and act accordingly
132  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
133  //@@@ ---------- Check if word is start of section
134  SectionTitleIterator = find(SectionTitle.begin(), SectionTitle.end(), *wordlist.begin());
135  if (SectionTitleIterator != SectionTitle.end()) {
136  //---------- Check that previous sections are correct
137  currentSectionNo = SectionTitleIterator - SectionTitle.begin();
138  if (currentSectionNo != InSectionNo + 1) {
139  if (currentSectionNo != sectReportOut) {
141  std::cerr << "BAD ORDER OF SECTIONS, reading section " << *SectionTitleIterator << std::endl
142  << " currentSectionNo = " << currentSectionNo << " InSectionNo = " << InSectionNo << std::endl
143  << " --------- Please see documentation ---------- " << std::endl;
144  exit(1);
145  }
146  } else {
147  if (currentSectionNo != sectReportOut) {
148  InSectionNo++;
149  }
150  }
151  if (currentSectionNo == sectMeasurements) {
153  }
154 
155  if (ALIUtils::debug >= 4)
156  std::cout << std::endl << "START OF SECTION: " << currentSectionNo << " " << *SectionTitleIterator << std::endl;
157 
158  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
159  //@@@ ---------- Reading GLOBAL_OPTIONS section
160  } else if (currentSectionNo == sectGlobalOptions) {
161  //- std::cout << "utilsdebug " << ALIUtils::debug << std::endl;
162  //-------- Check format of line read
163  //----- Two words
164  if (wordlist.size() == 2) {
165  //----- Second word is number
166  int isnumber = ALIUtils::IsNumber(wordlist[1]);
167  if (!isnumber && wordlist[0] != ALIstring("external_meas")) {
169  std::cerr << ": EXPECTING A NUMBER, FOUND: " << wordlist[1] << std::endl;
170  exit(2);
171  }
172 
174  gomgr->setGlobalOption(wordlist[0], ALIUtils::getFloat(wordlist[1]), ALIFileIn::getInstance(Model::SDFName()));
175 
176  //-or GlobalOptions.insert(std::pair<const ALIstring, ALIdouble>(wordlist[0] , atof(wordlist[1].c_str()) ) );
177 
178  if (ALIUtils::debug >= 1) {
179  ALIUtils::dumpVS(wordlist, "GLOBAL_OPTION: ", std::cout);
180  }
181 
182  } else {
183  std::cout << "error < 1" << std::endl;
185  std::cerr << ": IN GLOBAL_OPTIONS section TWO-WORD LINES ARE EXPECTED " << std::endl;
186  exit(2);
187  }
188 
189  //------- Set dimension factors for lengths and angles
194 
195  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
196  //@@@ ---------- Reading PARAMETERS section
197  } else if (currentSectionNo == sectParameters ||
198  currentSectionNo ==
199  -1) { // Allow parameters in first lines (for easy study of different parameter values)
200 
201  //---------- Check format of line read
202  //----- Two words
203  if (wordlist.size() == 2) {
204  /* now checked in ParameterMgr
205  //----- Second is number
206  int isnumber = ALIUtils::IsNumber( wordlist[1] );
207  if( !isnumber ) {
208  ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
209  std::cerr << ": EXPECTING A NUMBER, FOUND: " << wordlist[1] << std::endl;
210  exit(2);
211  } */
212 
213  //old---------- Create parameter with value read (or overwrite existing value)
214  //---------- Create parameter with value read if parameter does not exist yet
216  parmgr->addParameter(wordlist[0], wordlist[1]);
217 
218  } else if (wordlist.size() == 3) {
219  if (wordlist[1] != "seed") {
221  std::cerr << ": For a three-word parameter line, second has to be 'seed', it is " << wordlist[1]
222  << std::endl;
223  exit(1);
224  }
225 
226  if (wordlist[0] == "gauss" || wordlist[0] == "flat") {
228  } else {
230  std::cerr << ": For a three-word parameter line, first has to be 'gauss' or 'flat', it is " << wordlist[0]
231  << std::endl;
232  exit(1);
233  }
234  } else if (wordlist.size() == 4) {
235  if (wordlist[0] == "gauss") {
236  ParameterMgr::getInstance()->addRandomGaussParameter(wordlist[1], wordlist[2], wordlist[3]);
237  } else if (wordlist[0] == "flat") {
238  ParameterMgr::getInstance()->addRandomFlatParameter(wordlist[1], wordlist[2], wordlist[3]);
239  } else {
241  std::cerr << ": For a four-word parameter line, first has to be 'gauss' or 'flat', it is " << wordlist[0]
242  << std::endl;
243  exit(1);
244  }
245  } else {
247  std::cerr << ": IN PARAMETERS section TWO-WORD-LINES ARE EXPECTED " << std::endl;
248  ALIUtils::dumpVS(wordlist, " ");
249  exit(2);
250  }
251 
252  //print it out
253  if (ALIUtils::debug >= 1) {
254  ALIUtils::dumpVS(wordlist, "PARAMETERS: ", std::cout);
255  }
256 
257  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
258  //@@@ ---------- Reading SYSTEM_TREE_DESCRIPTION section
259  } else if (currentSectionNo == sectSystemTreeDescription) {
260  //---------- Convert the numbers found in list of components (e.g. 2 laser -> laser laser )
261  //----- Backup wordlist and erase it
262  std::vector<ALIstring> wordlist2 = wordlist;
263  std::vector<ALIstring>::iterator vsite;
264  ALIint wsiz = wordlist.size();
265  for (ALIint ii = 0; ii < wsiz; ii++) {
266  wordlist.pop_back();
267  }
268  //----- Loop objects looking for numbers to convert
269  for (vsite = wordlist2.begin(); vsite != wordlist2.end(); ++vsite) {
270  if (ALIUtils::IsNumber(*vsite)) {
271  int nOpticalObjects = atoi((*vsite).c_str());
272  //----- If number is 1 it is not necessary
273  if (nOpticalObjects == 1) {
274  if (ALIUtils::debug >= 0)
275  std::cerr << "WARNING: in line " << ALIFileIn::getInstance(Model::SDFName()).nline()
276  << " number of repeated OpticalObjects = 1. Please avoid the numbering " << std::endl;
277  //- wordlist.erase( wordlist.begin() + (vsite-wordlist2.begin()) );
278  } else {
279  //----- The number cannot be the last in the list and you cannot put two numbers together
280  if (vsite + 1 == wordlist.end() || ALIUtils::IsNumber(*(vsite + 1))) {
282  std::cerr << "NUMBER SHOULD BE FOLLOWED BY an OpticalObject type" << std::endl;
283  exit(2);
284  }
285  //----- Right format: convert
286  //--- Substitute the number by the object type in wordlist
287  //- *( wordlist.begin() + (vsite-wordlist2.begin()) ) = *(vsite+1);
288  //--- Add n-1 object types to wordlist (the nth object will be added as the object taht goes after the number)
289  for (ALIint ii = 0; ii < nOpticalObjects - 1; ii++) {
290  //-std::cout << ii << "inserting in wordlist " << *(vsite+1) << std::endl;
291  wordlist.push_back(*(vsite + 1));
292  }
293  }
294  } else {
295  //----- Not number, add it to wordlist
296  wordlist.push_back(*vsite);
297  }
298  }
299 
300  //---------- Dump system structure
301  if (ALIUtils::debug >= 1) {
302  ALIUtils::dumpVS(wordlist, "SYSTEM TREE DESCRIPTION: before ordering, OBJECT: ", std::cout);
303  }
304 
305  //---------- Fill the list of Optical Object with components (theOptODictionary)
306  //----- First word is 'object': new OptO
307  if (wordlist[0] == ALIstring("object")) {
308  //----- Check out repeated objects
309  std::vector<std::vector<ALIstring> >::iterator vvsite;
310  for (vvsite = theOptODictionary.begin(); vvsite != theOptODictionary.end(); ++vvsite) {
311  //- std::cout << " system" << vvsite << std::endl;
312 
313  if (*((*vvsite).begin()) == wordlist[1]) {
315  std::cerr << "SYSTEM_TREE_DESCRIPTION: REPEATED object " << *((*vvsite).begin())
316  << " ( NOT ALLOWED NEITHER WITH EQUAL NOR WITH DIFFERENT COMPONENTS)" << std::endl;
317  exit(1);
318  }
319  }
320  //------- Add an item to theOptODictionary
321  std::vector<ALIstring> vstemp;
322  copy(wordlist.begin() + 1, wordlist.end(), back_inserter(vstemp));
323  Model::OptODictionary().push_back(vstemp);
324  } else {
325  //----- First word is not 'object': add to previous OptO
326  if (OptODictionary().empty()) {
328  std::cerr << "SYSTEM_TREE_DESCRIPTION section: FIRST LINE SHOULD START WITH 'object'" << std::endl;
329  exit(2);
330  }
331  copy(wordlist.begin(), wordlist.end(), back_inserter(*(OptODictionary().end() - 1)));
332  }
333 
334  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
335  //---------------------------------- Reading SYSTEM_TREE_DATA section
336  } else if (currentSectionNo == sectSystemTreeData) {
337  //---------- First line of data:
338  if (!data_reading) {
339  // ALIint dictsize = theOptODictionary.size();
340  //------- Reorder theOptODictionary
341  std::vector<std::vector<ALIstring> > OptODictionary2;
342  reorderOptODictionary("system", OptODictionary2);
343  if (OptODictionary2.empty()) {
344  std::cerr << "SYSTEM_TREE_DESCRIPTION section: no object 'system' found " << std::endl;
345  exit(9);
346  }
347  //------- We start reordering with 'system', therefore if 'system' is not the top most object, the objects not hanging from it would not be considered
348  //---- Check if all the objects are here
349  std::vector<std::vector<ALIstring> >::const_iterator vvscite, vvscite2;
350  // ALIint dictsizen = 0;
351  for (vvscite = theOptODictionary.begin(); vvscite != theOptODictionary.end(); ++vvscite) {
352  ALIbool ofound = false;
353  for (vvscite2 = OptODictionary2.begin(); vvscite2 != OptODictionary2.end(); ++vvscite2) {
354  if (*((*vvscite).begin()) == *((*vvscite2).begin())) {
355  ofound = true;
356  break;
357  }
358  }
359  if (!ofound) {
360  std::cerr << "!!!SYSTEM_TREE_DESCRIPTION section: object " << *((*vvscite).begin())
361  << " is not hanging from object 'system' " << std::endl;
362  for (vvscite = OptODictionary().begin(); vvscite != OptODictionary().end(); ++vvscite) {
363  std::vector<ALIstring> ptemp = *vvscite;
364  ALIUtils::dumpVS(ptemp, "OBJECT ", std::cerr);
365  }
366  exit(9);
367  }
368  }
369  theOptODictionary = OptODictionary2;
370 
371  data_reading = 1;
372 
373  //------- Dump ordered OptOs
374  if (ALIUtils::debug >= 3) {
375  std::vector<std::vector<ALIstring> >::iterator itevs;
376  for (itevs = OptODictionary().begin(); itevs != OptODictionary().end(); ++itevs) {
377  std::vector<ALIstring> ptemp = *itevs;
378  ALIUtils::dumpVS(ptemp, " SYSTEM TREE DESCRIPTION: after ordering: OBJECT ", std::cout);
379  }
380  }
381 
382  //---------- Create OpticalObject 'system' (first OpticalObject object):
383  //---------- it will create its components and recursively all the System Tree of Optical Objects
384  if (wordlist[0] != "system") {
385  std::cerr << "SYSTEM_TREE_DATA section: object 'system' is not the first one " << std::endl;
386  exit(9);
387  }
388 
389  OpticalObject* OptOsystem = new OpticalObject(nullptr, "system", wordlist[1], false);
390  OptOsystem->construct();
391  //- Model::_OptOtree.insert( std::multimap< ALIstring, OpticalObject*, std::less<ALIstring> >::value_type(OptOsystem->type(), OptOsystem) );
392  // theOptOlist[OptOsystem->name()] = OptOsystem;
393  theOptOList.push_back(OptOsystem);
394 
395  } else {
396  //----------- All system is read by the Optical Objects, it should not reach here
398  std::cerr << " STILL SOME LINES AFTER ALL SYSTEM TREE IS READ!!!" << std::endl;
399  exit(9);
400  }
401 
402  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
403  //----------------------------------- Reading MEASUREMENTS section
404  } else if (currentSectionNo == sectMeasurements) {
405  //---------- Create Measurement with appropiate dimension
406  Measurement* meastemp = nullptr;
407  ALIstring measType = wordlist[0];
408  ALIstring measName;
409  if (wordlist.size() == 2) {
410  measName = wordlist[1];
411  wordlist.pop_back();
412  } else {
413  measName = "";
414  }
415  if (measType == ALIstring("SENSOR2D")) {
416  meastemp = new MeasurementSensor2D(2, measType, measName);
417  meastemp->setConversionFactor(wordlist);
418  meastemp->construct();
419  } else if (measType == ALIstring("DISTANCEMETER3DIM")) {
420  meastemp = new MeasurementDistancemeter3dim(1, measType, measName);
421  meastemp->setConversionFactor(wordlist);
422  meastemp->construct();
423  } else if (measType == ALIstring("DISTANCEMETER") || measType == ALIstring("DISTANCEMETER1DIM")) {
424  meastemp = new MeasurementDistancemeter(1, measType, measName);
425  meastemp->setConversionFactor(wordlist);
426  meastemp->construct();
427  } else if (measType == ALIstring("TILTMETER")) {
428  meastemp = new MeasurementTiltmeter(1, measType, measName);
429  meastemp->setConversionFactor(wordlist);
430  meastemp->construct();
431  } else if (measType == ALIstring("COPS")) {
432  meastemp = new MeasurementCOPS(4, measType, measName);
433  meastemp->setConversionFactor(wordlist);
434  meastemp->construct();
435  } else if (measType == ALIstring("DIFFCENTRE")) {
436  //t meastemp = new MeasurementDiffCentre( 1, measType, measName );
437  meastemp->construct();
438  } else if (measType == ALIstring("DIFFANGLE")) {
439  //t meastemp = new MeasurementDiffAngle( 2, measType, measName );
440  meastemp->construct();
441  } else if (measType == ALIstring("DIFFENTRY")) {
442  meastemp = new MeasurementDiffEntry(1, measType, measName);
443  meastemp->construct();
444  } else if (measType == ALIstring("measurements_from_file") || measType == ALIstring("@measurements_from_file")) {
445  new CocoaDaqReaderText(wordlist[1]);
446  //m Measurement::setMeasurementsFileName( wordlist[1] );
447  //m if ( ALIUtils::debug >= 2) std::cout << " setting measurements_from_file " << measType << " == " << Measurement::measurementsFileName() << std::endl;
448  if (wordlist.size() == 4) {
449  Measurement::only1 = true;
450  Measurement::only1Date = wordlist[2];
451  Measurement::only1Time = wordlist[3];
452  //- std::cout << " setting Measurement::only1" << Measurement::only1 << std::endl;
453  }
454  } else if (measType == ALIstring("measurements_from_file_ROOT") ||
455  measType == ALIstring("@measurements_from_file")) {
456  new CocoaDaqReaderRoot(wordlist[1]);
457  } else if (wordlist[0] == ALIstring("correlations_from_file") ||
458  wordlist[0] == ALIstring("@correlations_from_file")) {
460  } else if (wordlist[0] == ALIstring("copy_measurements") || wordlist[0] == ALIstring("@copy_measurements")) {
461  copyMeasurements(wordlist);
462  // } else if( wordlist[0] == "scan" || wordlist[0] == "@scan" ) {
463  // ScanMgr::getInstance()->addOptOEntry( wordlist );
464  } else if (wordlist[0] == ALIstring("fittedEntries_from_file")) {
465  theFittedEntriesReader = new FittedEntriesReader(wordlist[1]);
466  if (ALIUtils::debug >= 2)
467  std::cout << " setting fittedEntries_from_file " << wordlist[0] << " == " << wordlist[1] << std::endl;
468  } else {
469  std::cerr << "Measurement:" << std::endl;
471  std::cerr << "!!! type of measurement not allowed: " << wordlist[0] << std::endl;
472  std::cerr << " Allowed types: SENSOR2D, DISTANCEMETER, DISTANCEMETER1DIM, TILTMETER, COPS, DIFFENTRY "
473  << std::endl;
474  exit(2);
475  }
476  //- meastemp->setGlobalName( wordlist[0] );
477  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
478  //@@@ ---------- Reading REPORT OUT section
479  } else if (currentSectionNo == sectReportOut) {
480  //----- It must be after global options section
481  if (InSectionNo + 1 != sectParameters) {
483  std::cerr << "BAD ORDER OF SECTIONS, reading section " << *SectionTitleIterator << std::endl
484  << " currentSectionNo = " << currentSectionNo << " InSectionNo = " << InSectionNo << std::endl
485  << " --------- Please see documentation ---------- " << std::endl;
486  exit(1);
487  }
488 
490  }
491  }
492 
493  //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
494  //@@@ All system read
495  //---------- make Measurements links to their OptOs
496  if (ALIUtils::debug >= 2)
497  std::cout << std::endl << "@@@@ Building Measurements links to OptOs" << std::endl;
499 
500  if (ALIUtils::debug >= 1) {
501  std::cout << "---------- SYSTEM SUCCESFULLY READ ----------" << std::endl << std::endl;
502  }
503  filein.close();
504 
505  return;
506 }

References ParameterMgr::addParameter(), ParameterMgr::addRandomFlatParameter(), ParameterMgr::addRandomGaussParameter(), cms::cuda::assert(), buildMeasurementsLinksToOptOs(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, ALIFileIn::close(), COCOA_Init, Measurement::construct(), OpticalObject::construct(), filterCSVwithJSON::copy, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), relativeConstraints::empty, mps_fire::end, ALIFileIn::eof(), ALIFileIn::ErrorInLine(), beamvalidation::exit(), spr::find(), ALIUtils::getFloat(), EntryMgr::getInstance(), ParameterMgr::getInstance(), ErrorCorrelationMgr::getInstance(), GlobalOptionMgr::getInstance(), ALIFileIn::getInstance(), ALIUtils::getInt(), ALIFileIn::getWordsInLine(), cuy::ii, ALIUtils::IsNumber(), ALIFileIn::nline(), Measurement::only1, Measurement::only1Date, Measurement::only1Time, OptODictionary(), EntryMgr::readEntryFromReportOut(), ErrorCorrelationMgr::readFromReportFile(), SDFName(), sectGlobalOptions, sectMeasurements, sectParameters, sectReportOut, sectSystemTreeData, sectSystemTreeDescription, ALIUtils::SetAngleDimensionFactors(), setCocoaStatus(), Measurement::setConversionFactor(), GlobalOptionMgr::setGlobalOption(), ALIUtils::SetLengthDimensionFactors(), ALIUtils::SetOutputAngleDimensionFactors(), ALIUtils::SetOutputLengthDimensionFactors(), and ParameterMgr::setRandomSeed().

◆ recoverParamFittedSigma()

void Model::recoverParamFittedSigma ( const ALIstring opto_name,
const ALIstring entry_name,
const ALIuint  position 
)
staticprivate

Definition at line 1256 of file Model.cc.

1256  {
1257  /*
1258  if( position >= theParamFittedSigmaVector.size() ) {
1259  std::cerr << "!!EXITING at recoverParamFittedSigma: position" << position <<
1260  " bigger than dimension of theParamFittedSigmaVector " << theParamFittedSigmaVector.size() << std::endl;
1261  exit(3);
1262  }
1263  ALIdouble sigma = getParamFittedSigmaVectorItem( position );
1264 
1265  Entry* entry = getEntryByName(opto_name, entry_name);
1266  entry->setSigma( sigma );
1267  entry->setQuality( 1 );
1268  std::cout << "recover " << opto_name << entry_name << entry->sigma() <<std::endl;
1269  */
1270 }

◆ reorderOptODictionary()

void Model::reorderOptODictionary ( const ALIstring ssearch,
std::vector< std::vector< ALIstring > > &  OptODictionary2 
)
staticprivate

********** private METHODS

Reorder the list of OptOs in a hierarchical structure (tree-like)

Definition at line 512 of file Model.cc.

512  {
513  // int ALIstring_found = 0;
514  std::vector<std::vector<ALIstring> >::iterator vvsite;
515  std::vector<ALIstring>::iterator vsite;
516 
517  //---------------------------------------- Look for 'ssearch' as the first ALIstring of an OptODictionary item
518  for (vvsite = OptODictionary().begin(); vvsite != OptODictionary().end(); ++vvsite) {
519  if (*((*vvsite).begin()) == ssearch) {
520  // ALIstring_found = 1;
521  OptODictionary2.push_back(*vvsite);
522 
523  //- std::cout << "VVSITE";
524  //- ostream_iterator<ALIstring> outs(std::cout,"&");
525  //- copy( (*vvsite).begin(), (*vvsite).end(), outs);
526 
527  //---------------------------------- look for components of this _OptODictionary item
528  for (vsite = (*vvsite).begin() + 1; vsite != (*vvsite).end(); ++vsite) {
529  reorderOptODictionary(*vsite, OptODictionary2);
530  }
531  break;
532  }
533  }
534 
535  /* //------- object 'system' should exist
536  if(!ALIstring_found && ssearch == "system") {
537  std::cerr << "SYSTEM_TREE_DATA section: no 'object system' found " << std::endl;
538  exit(9);
539  } */
540 }

◆ ReportFName()

static ALIstring& Model::ReportFName ( )
inlinestatic

the name of the report File

Definition at line 99 of file Model.h.

99 { return theReportFName; }

References theReportFName.

Referenced by Fit::fitNextEvent(), Fit::getFitQuality(), Fit::PrintChi2(), and CocoaAnalyzer::runCocoa().

◆ saveParamFittedCorrelation()

void Model::saveParamFittedCorrelation ( const ALIstring opto_name1,
const ALIstring entry_name1,
const ALIstring opto_name2,
const ALIstring entry_name2 
)
staticprivate

Definition at line 1219 of file Model.cc.

1222  {
1223  /*
1224 //---------- Get sigma of param Optical
1225  Entry* entry1 = getEntryByName(opto_name1, entry_name1);
1226  Entry* entry2 = getEntryByName(opto_name2, entry_name2);
1227  ALIuint fit_pos1 = entry1->fitPos();
1228  ALIuint fit_pos2 = entry2->fitPos();
1229 
1230  //---------- Get correlation if entry has been fitted
1231  ALIuint pmsize = Fit::propagationMatrix().NoLines();
1232  if( fit_pos1 >= 0 && fit_pos1 < pmsize && fit_pos2 >= 0 && fit_pos2 < pmsize ) {
1233  ALIdouble error1 = sqrt( Fit::propagationMatrix()( fit_pos1, fit_pos1) );
1234  ALIdouble error2 = sqrt( Fit::propagationMatrix()( fit_pos2, fit_pos2) );
1235  ALIdouble correl = Fit::propagationMatrix()( fit_pos1, fit_pos2) / error1 / error2;
1236  theParamFittedSigmaVector.push_back( correl );
1237  if(ALIUtils::debug>=9) {
1238  std::cout << "saveParamFittedCorre" << opto_name1 << entry_name1 << fit_pos1 <<
1239  opto_name2 << entry_name2 << fit_pos2 << "MM " << correl << std::endl;
1240  }
1241  } else {
1242  if(ALIUtils::debug>=9) {
1243  std::cout << "NOsaveParamFittedCorre" << opto_name1 << entry_name1 << fit_pos1 <<
1244  opto_name2 << entry_name2 << fit_pos2 << "MM " << std::endl;
1245  theParamFittedSigmaVector.push_back( 0. );
1246  }
1247 
1248  }
1249  //- Fit::propagationMatrix().Dump(" the 2PropagationMatrix");
1250  */
1251 }

◆ saveParamFittedSigma()

void Model::saveParamFittedSigma ( const ALIstring opto_name,
const ALIstring entry_name 
)
staticprivate

Definition at line 1200 of file Model.cc.

1200  {
1201  /*
1202 //---------- Get sigma of param Optical
1203  Entry* entry = getEntryByName(opto_name, entry_name);
1204  ALIuint fit_pos = entry->fitPos();
1205  if( fit_pos < 0 || fit_pos >= Fit::propagationMatrix().NoLines()) {
1206  std::cerr << "!!EXITING at saveParamFittedSigma: fit position incorrect " <<
1207  fit_pos << "propagationMatrix size =" << Fit::propagationMatrix().NoLines() << opto_name << std::endl;
1208  exit(3);
1209  }
1210  std::cout << entry_name << "saveParamFittedSigma" << fit_pos << sqrt(Fit::propagationMatrix()( fit_pos, fit_pos)) << std::endl;
1211  theParamFittedSigmaVector.push_back( sqrt(Fit::propagationMatrix()( fit_pos, fit_pos)) );
1212  //- Fit::propagationMatrix().Dump(" the 2PropagationMatrix");
1213  */
1214 }

◆ SDFName()

static ALIstring& Model::SDFName ( )
inlinestatic

◆ setCocoaStatus()

static void Model::setCocoaStatus ( const cocoaStatus  cs)
inlinestatic

Definition at line 64 of file Model.h.

64 { theCocoaStatus = cs; }

References fwrapper::cs, and theCocoaStatus.

Referenced by Fit::fitNextEvent(), and readSystemDescription().

◆ setMatricesFName()

static void Model::setMatricesFName ( const ALIstring name)
inlinestatic

Definition at line 155 of file Model.h.

155 { theMatricesFName = name; }

References Skims_PA_cff::name, and theMatricesFName.

◆ setMeasurementsTime()

static void Model::setMeasurementsTime ( struct tm &  tim)
inlinestatic

Definition at line 157 of file Model.h.

157 { theMeasurementsTime = tim; }

References theMeasurementsTime.

◆ setReportFName()

static void Model::setReportFName ( const ALIstring name)
inlinestatic

Definition at line 153 of file Model.h.

153 { theReportFName = name; }

References Skims_PA_cff::name, and theReportFName.

◆ setSDFName()

static void Model::setSDFName ( const ALIstring name)
inlinestatic

Definition at line 151 of file Model.h.

151 { theSDFName = name; }

References Skims_PA_cff::name, and theSDFName.

◆ SetValueDisplacementsFromReportOut()

void Model::SetValueDisplacementsFromReportOut ( )
staticprivate

Definition at line 1489 of file Model.cc.

1489  {
1490  if (ALIUtils::debug >= 3)
1491  std::cout << " Model::SetValueDisplacementsFromReportOut() " << std::endl;
1492 
1493  EntryMgr* entryMgr = EntryMgr::getInstance();
1494 
1495  if (entryMgr->numberOfEntries() != 0) {
1496  EntryData* entryData;
1497 
1498  std::vector<Entry*>::const_iterator vecite;
1499  for (vecite = Model::EntryList().begin(); vecite != Model::EntryList().end(); ++vecite) {
1500  //----- Find the EntryData corresponding to this entry
1501  entryData = entryMgr->findEntryByLongName((*vecite)->OptOCurrent()->longName(), (*vecite)->name());
1502  if (ALIUtils::debug >= 3)
1503  std::cout << "SetValueDisplacementsFromReportOut " << (*vecite)->OptOCurrent()->longName() << " "
1504  << (*vecite)->name() << " " << entryData->valueDisplacement() << std::endl;
1505  (*vecite)->addFittedDisplacementToValue(entryData->valueDisplacement());
1506  }
1507  }
1508 }

References gather_cfg::cout, ALIUtils::debug, EntryList(), EntryMgr::findEntryByLongName(), EntryMgr::getInstance(), EntryMgr::numberOfEntries(), and EntryData::valueDisplacement().

Member Data Documentation

◆ CMSLinkIteration

ALIint Model::CMSLinkIteration = 0
staticprivate

Definition at line 237 of file Model.h.

Referenced by CMSLinkDeleteOptOs().

◆ CMSLinkRangeDetValue

std::vector< ALIdouble > Model::CMSLinkRangeDetValue
static

Definition at line 223 of file Model.h.

◆ Ncmslinkrange

ALIint Model::Ncmslinkrange = 0
static

*************** FOR RANGE STUDIES

Definition at line 222 of file Model.h.

◆ theCocoaStatus

cocoaStatus Model::theCocoaStatus = COCOA_Init
staticprivate

Definition at line 272 of file Model.h.

Referenced by getCocoaStatus(), and setCocoaStatus().

◆ theEntryVector

std::vector< Entry * > Model::theEntryVector
staticprivate

std::vector of all Entries

Definition at line 191 of file Model.h.

Referenced by addEntryToList(), and EntryList().

◆ theFittedEntriesReader

FittedEntriesReader * Model::theFittedEntriesReader = nullptr
staticprivate

Definition at line 280 of file Model.h.

Referenced by getFittedEntriesReader().

◆ theInstance

Model * Model::theInstance = nullptr
staticprivate

Definition at line 176 of file Model.h.

◆ theMatricesFName

ALIstring Model::theMatricesFName = "matrices.out"
staticprivate

the name of the File for storing the matrices

Definition at line 203 of file Model.h.

Referenced by MatricesFName(), and setMatricesFName().

◆ theMeasFName

ALIstring Model::theMeasFName = "Measurements.txt"
staticprivate

the name of the Measurements File

Definition at line 199 of file Model.h.

Referenced by MeasFName().

◆ theMeasurementsTime

struct tm Model::theMeasurementsTime
staticprivate

Definition at line 278 of file Model.h.

Referenced by MeasurementsTime(), and setMeasurementsTime().

◆ theMeasurementVector

std::vector< Measurement * > Model::theMeasurementVector
staticprivate

std::vector of all Measurements

Definition at line 194 of file Model.h.

Referenced by addMeasurementToList(), and MeasurementList().

◆ theOpticalAlignments

std::vector< OpticalAlignInfo > Model::theOpticalAlignments
staticprivate

Definition at line 282 of file Model.h.

Referenced by getOpticalAlignments().

◆ theOptODictionary

std::vector< std::vector< ALIstring > > Model::theOptODictionary
staticprivate

parameters

std::vector of OptOs with components (in tree structure)

Definition at line 182 of file Model.h.

Referenced by OptODictionary().

◆ theOptOList

std::vector< OpticalObject * > Model::theOptOList
staticprivate

map of OptO*‍/type of parent OptO, for navigation down the tree structure

map of OptO*‍/name of OptO for quick search based on name

Definition at line 188 of file Model.h.

Referenced by OptOList().

◆ theOptOsToCopyList

std::vector< OpticalObject * > Model::theOptOsToCopyList
staticprivate

Definition at line 216 of file Model.h.

◆ theOptOsToCopyListIterator

std::vector< OpticalObject * >::const_iterator Model::theOptOsToCopyListIterator
staticprivate

Definition at line 218 of file Model.h.

◆ theParamFittedSigmaVector

std::vector< ALIdouble > Model::theParamFittedSigmaVector
staticprivate

Definition at line 274 of file Model.h.

Referenced by cleanParamFittedSigmaVector().

◆ theParamFittedValueDisplacementMap

std::map< ALIstring, ALIdouble, std::less< ALIstring > > Model::theParamFittedValueDisplacementMap
staticprivate

Definition at line 276 of file Model.h.

Referenced by cleanParamFittedValueDisplacementMap().

◆ theReportFName

ALIstring Model::theReportFName = "report.out"
staticprivate

the name of the report File

Definition at line 201 of file Model.h.

Referenced by ReportFName(), and setReportFName().

◆ theSDFName

ALIstring Model::theSDFName = "SystemDescription.txt"
staticprivate

the name of the System Description File

Definition at line 197 of file Model.h.

Referenced by SDFName(), and setSDFName().

ALIUtils::getFloat
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:373
Measurement::only1Time
static ALIstring only1Time
Definition: Measurement.h:214
Model::theOptODictionary
static std::vector< std::vector< ALIstring > > theOptODictionary
parameters
Definition: Model.h:182
ALIbool
bool ALIbool
Definition: CocoaGlobals.h:19
CocoaDaqReaderRoot
Definition: CocoaDaqReaderRoot.h:13
Model::buildMeasurementsLinksToOptOs
static void buildMeasurementsLinksToOptOs()
Read Measurements (to be implemented for reading from an external file the DATA of the measurements)
Definition: Model.cc:545
ParameterMgr::addParameter
void addParameter(const ALIstring &name, const ALIstring &valstr)
Definition: ParameterMgr.cc:63
ParameterMgr::getInstance
static ParameterMgr * getInstance()
Definition: ParameterMgr.cc:18
Model::EntryList
static std::vector< Entry * > & EntryList()
Definition: Model.h:86
OpticalAlignInfo::name_
std::string name_
Definition: OpticalAlignInfo.h:92
Measurement::copyMeas
void copyMeas(Measurement *meas, const std::string &subsstr1, const std::string &subsstr2)
Definition: Measurement.cc:621
MeasurementDiffEntry
Definition: MeasurementDiffEntry.h:18
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EntryMgr
Definition: EntryMgr.h:15
ALIUtils::getInt
static int getInt(const ALIstring &str)
Convert a string to an integer, checking that it is really an integer.
Definition: ALIUtils.cc:384
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
Model::copyMeasurements
static void copyMeasurements(const std::vector< ALIstring > &wl)
Definition: Model.cc:1419
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
Measurement::fillData
void fillData(ALIuint coor, const std::vector< ALIstring > &wl)
Definition: Measurement.cc:192
Model::theInstance
static Model * theInstance
Definition: Model.h:176
CocoaDaqReaderText
Definition: CocoaDaqReaderText.h:10
GlobalOptionMgr::GlobalOptions
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
Definition: GlobalOptionMgr.h:31
mps_splice.entry
entry
Definition: mps_splice.py:68
Model::MeasurementList
static std::vector< Measurement * > & MeasurementList()
Definition: Model.h:88
GlobalOptionMgr
Definition: GlobalOptionMgr.h:18
Model::theMatricesFName
static ALIstring theMatricesFName
the name of the File for storing the matrices
Definition: Model.h:203
sectMeasurements
Definition: Model.h:37
OpticalObject::name
const ALIstring & name() const
Definition: OpticalObject.h:58
ALIUtils::SetLengthDimensionFactors
static void SetLengthDimensionFactors()
Definition: ALIUtils.cc:81
GlobalOptionMgr::getInstance
static GlobalOptionMgr * getInstance()
Definition: GlobalOptionMgr.cc:18
Measurement::constructFromOA
void constructFromOA(OpticalAlignMeasurementInfo &measInfo)
Definition: Measurement.cc:89
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Model::getEntryByName
static Entry * getEntryByName(const ALIstring &opto_name, const ALIstring &entry_name)
--— Search an Entry name in the Entry* list and return a pointer to it
Definition: Model.cc:623
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
MeasurementCOPS
Definition: MeasurementCOPS.h:18
ALIFileIn::nline
const ALIint nline()
Definition: ALIFileIn.h:41
ParameterMgr::addRandomGaussParameter
void addRandomGaussParameter(const ALIstring &name, const ALIstring &valMean, const ALIstring &valStdDev)
Definition: ParameterMgr.cc:75
ParameterMgr::setRandomSeed
void setRandomSeed(const long seed)
Definition: ParameterMgr.cc:72
OpticalAlignInfo
Definition: OpticalAlignInfo.h:71
cms::cuda::assert
assert(be >=bs)
GlobalOptionMgr::getGlobalOptionValue
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
Definition: GlobalOptionMgr.cc:115
EntryMgr::findEntryByLongName
EntryData * findEntryByLongName(const ALIstring &optoName, const ALIstring &entryName="")
Definition: EntryMgr.cc:82
Model::theOptOsToCopyList
static std::vector< OpticalObject * > theOptOsToCopyList
Definition: Model.h:216
ParameterMgr::getParameterValue
ALIint getParameterValue(const ALIstring &name, ALIdouble &val)
Definition: ParameterMgr.cc:114
COCOA_ReadingModel
Definition: Model.h:43
Model::theOpticalAlignments
static std::vector< OpticalAlignInfo > theOpticalAlignments
Definition: Model.h:282
OpticalObject
Definition: OpticalObject.h:35
ALIUtils::IsNumber
static int IsNumber(const ALIstring &str)
Definition: ALIUtils.cc:33
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Model::getComponentOptOs
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:705
Model::getOptOByType
static OpticalObject * getOptOByType(const ALIstring &type)
--— Find the first OptO of type 'opto_type' in theOptOList and return a pointer to it
Definition: Model.cc:601
Model::setCocoaStatus
static void setCocoaStatus(const cocoaStatus cs)
Definition: Model.h:64
sectSystemTreeDescription
Definition: Model.h:35
Model::theMeasurementVector
static std::vector< Measurement * > theMeasurementVector
std::vector of all Measurements
Definition: Model.h:194
ErrorCorrelationMgr::getInstance
static ErrorCorrelationMgr * getInstance()
Definition: ErrorCorrelationMgr.cc:15
Model::Model
Model()
Definition: Model.cc:92
Measurement::dim
const ALIuint dim() const
Definition: Measurement.h:82
EntryData::valueDisplacement
ALIdouble valueDisplacement() const
Definition: EntryData.h:31
OpticalAlignments::opticalAlignments
std::vector< OpticalAlignInfo > opticalAlignments() const
Definition: OpticalAlignments.h:27
sectParameters
Definition: Model.h:34
Model::getOptOByName
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:570
Model::SDFName
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:93
COCOA_FitCannotImprove
Definition: Model.h:49
Measurement::measurementsFileName
static ALIstring & measurementsFileName()
Definition: Measurement.h:162
mps_fire.end
end
Definition: mps_fire.py:242
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
str
#define str(s)
Definition: TestProcessor.cc:51
MeasurementTiltmeter
Definition: MeasurementTiltmeter.h:18
Model::OptOList
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:84
Measurement
Definition: Measurement.h:27
Model::theSDFName
static ALIstring theSDFName
the name of the System Description File
Definition: Model.h:197
MeasurementDistancemeter
Definition: MeasurementDistancemeter.h:18
Model::theFittedEntriesReader
static FittedEntriesReader * theFittedEntriesReader
Definition: Model.h:280
COCOA_FitOK
Definition: Model.h:47
ALIFileIn::getInstance
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:22
ParameterMgr::addRandomFlatParameter
void addRandomFlatParameter(const ALIstring &name, const ALIstring &valMean, const ALIstring &valInterval)
Definition: ParameterMgr.cc:93
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
Model::theReportFName
static ALIstring theReportFName
the name of the report File
Definition: Model.h:201
OpticalObject::ExtraEntryList
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
Model::theEntryVector
static std::vector< Entry * > theEntryVector
std::vector of all Entries
Definition: Model.h:191
MeasurementSensor2D
Definition: MeasurementSensor2D.h:18
ALIFileIn::ErrorInLine
void ErrorInLine()
Definition: ALIFileIn.cc:196
OpticalObject::constructFromOptAligInfo
void constructFromOptAligInfo(const OpticalAlignInfo &oaInfo)
Definition: OpticalObject.cc:2016
ALIUtils::SetAngleDimensionFactors
static void SetAngleDimensionFactors()
Definition: ALIUtils.cc:104
Model::theCocoaStatus
static cocoaStatus theCocoaStatus
Definition: Model.h:272
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
Model::reorderOptODictionary
static void reorderOptODictionary(const ALIstring &ssearch, std::vector< std::vector< ALIstring > > &OptODictionary2)
********** private METHODS
Definition: Model.cc:512
COCOA_InitFit
Definition: Model.h:44
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
Measurement::valueType
const ALIstring valueType(ALIuint ii) const
Definition: Measurement.h:116
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
OpticalAlignMeasurements::oaMeasurements_
std::vector< OpticalAlignMeasurementInfo > oaMeasurements_
Definition: OpticalAlignMeasurements.h:27
ALIuint
unsigned int ALIuint
Definition: CocoaGlobals.h:17
Measurement::type
const ALIstring & type() const
Definition: Measurement.h:84
ALIFileIn::close
void close()
Definition: ALIFileIn.cc:218
Model::theOptOList
static std::vector< OpticalObject * > theOptOList
map of OptO*‍/type of parent OptO, for navigation down the tree structure
Definition: Model.h:188
OpticalObject::CoordinateEntryList
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
Entry
Definition: Entry.h:18
ALIFileIn::eof
ALIbool eof()
Definition: ALIFileIn.cc:201
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
ALIUtils::SetOutputAngleDimensionFactors
static void SetOutputAngleDimensionFactors()
Definition: ALIUtils.cc:153
Measurement::only1Date
static ALIstring only1Date
Definition: Measurement.h:213
COCOA_FitChi2Worsened
Definition: Model.h:50
GlobalOptionMgr::setGlobalOption
void setGlobalOption(const ALIstring go, const ALIdouble val, ALIFileIn &filein)
Definition: GlobalOptionMgr.cc:137
COCOA_FitMatrixNonInversable
Definition: Model.h:51
Model::SetValueDisplacementsFromReportOut
static void SetValueDisplacementsFromReportOut()
Definition: Model.cc:1489
Model::theOptOsToCopyListIterator
static std::vector< OpticalObject * >::const_iterator theOptOsToCopyListIterator
Definition: Model.h:218
mps_merge.newName
string newName
Definition: mps_merge.py:86
Measurement::setSigma
void setSigma(ALIint coor, ALIdouble val)
Definition: Measurement.h:131
Measurement::setCurrentDate
static void setCurrentDate(const std::vector< ALIstring > &wl)
set the date of the current measurement
Definition: Measurement.cc:605
Model::theMeasurementsTime
static struct tm theMeasurementsTime
Definition: Model.h:278
ErrorCorrelationMgr::readFromReportFile
void readFromReportFile(const ALIstring &filename)
Definition: ErrorCorrelationMgr.cc:24
Measurement::setConversionFactor
virtual void setConversionFactor(const std::vector< ALIstring > &wordlist)
Definition: Measurement.h:69
ALIUtils::dumpVS
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
Definition: ALIUtils.cc:465
Measurement::construct
void construct()
Definition: Measurement.cc:59
Measurement::only1
static ALIbool only1
Definition: Measurement.h:212
Measurement::correctValueAndSigma
virtual void correctValueAndSigma()
Definition: Measurement.h:66
heppy_batch.val
val
Definition: heppy_batch.py:351
ALIUtils::SetOutputLengthDimensionFactors
static void SetOutputLengthDimensionFactors()
Definition: ALIUtils.cc:126
Measurement::name
const ALIstring & name() const
Definition: Measurement.h:86
ParameterMgr
Definition: ParameterMgr.h:15
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:246
EntryData
Definition: EntryData.h:15
sectGlobalOptions
Definition: Model.h:33
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
OpticalObject::construct
void construct()
Definition: OpticalObject.cc:70
EntryMgr::numberOfEntries
ALIint numberOfEntries()
Definition: EntryMgr.h:36
Model::OptODictionary
static std::vector< std::vector< ALIstring > > & OptODictionary()
ACCESS STATIC DATA MEMBERS.
Definition: Model.h:82
COCOA_Init
Definition: Model.h:42
Model::fillCopyComponentList
static ALIbool fillCopyComponentList(const OpticalObject *opto)
Definition: Model.cc:770
ALIint
int ALIint
Definition: CocoaGlobals.h:15
Model::CMSLinkIteration
static ALIint CMSLinkIteration
Definition: Model.h:237
ALIFileIn::getWordsInLine
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:74
Model::theMeasFName
static ALIstring theMeasFName
the name of the Measurements File
Definition: Model.h:199
MeasurementDistancemeter3dim
Definition: MeasurementDistancemeter3dim.h:18
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EntryMgr::getInstance
static EntryMgr * getInstance()
Definition: EntryMgr.cc:16
COCOA_FitImproving
Definition: Model.h:48
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
Model::FindOptAlignInfoByType
OpticalAlignInfo FindOptAlignInfoByType(const ALIstring &type)
Definition: Model.cc:1551
sectReportOut
Definition: Model.h:38
ALIUtils::changeName
static std::string changeName(const std::string &oldName, const std::string &subsstr1, const std::string &subsstr2)
Definition: ALIUtils.cc:535
Model::theParamFittedSigmaVector
static std::vector< ALIdouble > theParamFittedSigmaVector
Definition: Model.h:274
sectSystemTreeData
Definition: Model.h:36
Model::deleteOptO
static void deleteOptO(const ALIstring &opto_name)
Definition: Model.cc:1110
cuy.ii
ii
Definition: cuy.py:590
heppy_report.oname
oname
Definition: heppy_report.py:58
Model::theParamFittedValueDisplacementMap
static std::map< ALIstring, ALIdouble, std::less< ALIstring > > theParamFittedValueDisplacementMap
Definition: Model.h:276
FittedEntriesReader
Definition: FittedEntriesReader.h:14
ALIFileIn
Definition: ALIFileIn.h:20
Measurement::sigma
const ALIdouble * sigma() const
Definition: Measurement.h:112
EntryMgr::readEntryFromReportOut
ALIbool readEntryFromReportOut(const std::vector< ALIstring > &wl)
Definition: EntryMgr.cc:29