CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
OpticalObject Class Reference

#include <OpticalObject.h>

Inheritance diagram for OpticalObject:
OptOCameraDetector OptOCOPS OptOCubeSplitter OptODistancemeter OptODistancemeter3dim OptOLaser OptOLens OptOMirror OptOModifiedRhomboidPrism OptOOpticalSquare OptOPinhole OptOPlateSplitter OptORisleyPrism OptOScreen OptOSensor2D OptOSource OptOTiltmeter OptOUserDefined OptOXLaser

Public Member Functions

void addCoordinateEntryToList (Entry *entry)
 
void addExtraEntryToList (Entry *entry)
 
void addExtraEntryValueOriginalOriginalToList (ALIdouble entry_value)
 
void addExtraEntryValueOriginalToList (ALIdouble entry_value)
 
void addExtraEntryValueToList (ALIdouble entry_value)
 
double addPii (double val)
 
double approxTo0 (double val)
 
CLHEP::HepRotation buildRmFromEntryValuesOriginalOriginal ()
 
const CLHEP::Hep3Vector & centreGlob () const
 
const CLHEP::Hep3Vector & centreGlobal () const
 
const CLHEP::Hep3Vector & centreGlobOriginal () const
 
const CLHEP::Hep3Vector & centreGlobOriginalOriginal () const
 
const CLHEP::Hep3Vector centreLocal () const
 
int checkMatrixEquations (double angleX, double angleY, double angleZ, CLHEP::HepRotation *rot=nullptr)
 
void construct ()
 
void constructFromOptAligInfo (const OpticalAlignInfo &oaInfo)
 
virtual void constructMaterial ()
 
virtual void constructSolidShape ()
 
const std::vector< Entry * > & CoordinateEntryList () const
 
void createComponentOptOsFromOptAlignInfo ()
 
virtual void defaultBehaviour (LightRay &lightray, Measurement &meas)
 
virtual void detailedDeviatesLightRay (LightRay &lightray)
 
virtual void detailedTraversesLightRay (LightRay &lightray)
 
double diff2pi (double ang1, double ang2)
 
void displaceCentreGlob (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlob (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginalOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginalOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceExtraEntry (const ALIuint entryNo, const ALIdouble disp)
 
void displaceExtraEntryOriginal (const ALIuint entryNo, const ALIdouble disp)
 
void displaceExtraEntryOriginalOriginal (const ALIuint entryNo, const ALIdouble disp)
 
void displaceRmGlobAroundGlobal (OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobAroundLocal (OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobOriginal (const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobOriginalOriginal (const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
bool eq2ang (double ang1, double ang2)
 
const std::vector< Entry * > & ExtraEntryList () const
 
const ALIint extraEntryNo (const ALIstring &entry_name) const
 
std::vector< ALIdouble > & ExtraEntryValueList ()
 
const std::vector< ALIdouble > & ExtraEntryValueOriginalList ()
 
const std::vector< ALIdouble > & ExtraEntryValueOriginalOriginalList ()
 
virtual void fastDeviatesLightRay (LightRay &lightray)
 
virtual void fastTraversesLightRay (LightRay &lightray)
 
virtual void fillIguana ()
 
virtual void fillVRML ()
 
const ALIdouble findExtraEntryValue (const ALIstring &eename) const
 
const ALIbool findExtraEntryValueIfExists (const ALIstring &eename, ALIdouble &value) const
 
const ALIdouble findExtraEntryValueMustExist (const ALIstring &eename) const
 
const ALIuint getCmsswID () const
 
std::vector< ALIstringgetCoordinateFromOptAlignParam (const OpticalAlignParam &oaParam)
 
CLHEP::Hep3Vector getDisplacementInLocalCoordinates (const XYZcoor coor, const ALIdouble disp)
 
const double getEntryCentre (const ALIstring &coor) const
 
const double getEntryCentre (const XYZcoor coor) const
 
const double getEntryRMangle (const ALIstring &coor) const
 
const double getEntryRMangle (const XYZcoor coor) const
 
std::vector< double > getLocalRotationAngles (const std::vector< Entry * > &entries) const
 
CocoaMaterialElementarygetMaterial () const
 
ALIPlane getPlate (const ALIbool forwardPlate, const ALIbool applyWedge)
 
std::vector< double > getRotationAnglesFromMatrix (CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
 
std::vector< double > getRotationAnglesInOptOFrame (const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
 
CocoaSolidShapegetSolidShape () const
 
CLHEP::Hep3Vector getZAxis ()
 
const ALIuint ID () const
 
const ALIstring longName () const
 
virtual void makeMeasurement (LightRay &lightray, Measurement &meas)
 
Measurementmeas ()
 
const ALIstringname () const
 
 OpticalObject ()
 
 OpticalObject (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
const OpticalObjectparent () const
 
virtual void participateInMeasurement (LightRay &lightray, Measurement &meas, const ALIstring &behav)
 
void propagateGlobalRMOriginalOriginalChangeToChildren (const CLHEP::HepRotation &rmorioriold, const CLHEP::HepRotation &rmoriorinew)
 
void resetGlobalCoordinates ()
 
void resetOriginalOriginalCoordinates ()
 
const CLHEP::HepRotation & rmGlob () const
 
const CLHEP::HepRotation & rmGlobOriginal () const
 
const CLHEP::HepRotation & rmGlobOriginalOriginal () const
 
const CLHEP::HepRotation rmLocal () const
 
void setCmsswID (ALIuint id)
 
void setExtraEntryValue (const ALIuint entryNo, const ALIdouble disp)
 
void setGlobalCoordinates ()
 
void setGlobalRMOriginalOriginal (const CLHEP::HepRotation &rmoriori)
 
void setID (ALIuint id)
 
void setMeas (Measurement *meas)
 set current measurement More...
 
void setOriginalEntryValues ()
 
void setRmGlobal (const CLHEP::HepRotation &rm)
 
void setRmGlobalOriginal (const CLHEP::HepRotation &rm)
 
void setType (const ALIstring &type)
 
const ALIstring shortName () const
 
const ALIstringtype () const
 
virtual void userDefinedBehaviour (LightRay &lightray, Measurement &meas, const ALIstring &behav)
 
virtual ~OpticalObject ()
 

Protected Member Functions

virtual void fillExtraEntry (std::vector< ALIstring > &wordlist)
 

Protected Attributes

CocoaMaterialElementarytheMaterial
 
CocoaSolidShapetheSolidShape
 
ALIint verbose
 

Private Member Functions

void buildWordList (const Entry *entry, std::vector< ALIstring > &wordlist)
 
void calculateLocalRotationAxisInGlobal ()
 
void copyData ()
 
void createComponentOptOs (ALIFileIn &filein)
 
OpticalObjectcreateNewOptO (OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
 
void fillCoordinateEntry (const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
 
CLHEP::Hep3Vector getDispVec (const XYZcoor coor, const ALIdouble disp)
 
void readCoordinates (const ALIstring &coor_type_read, const ALIstring &coor_type_expected, ALIFileIn &filein)
 
void readData (ALIFileIn &filein)
 
void readExtraEntries (ALIFileIn &filein)
 
template<class T >
void rotateItAroundGlobal (T &object, const XYZcoor coor, const double disp)
 
void SetAnglesIsGlobal (ALIbool isG)
 
void setAnglesNull ()
 
void SetCentreGlobFromCentreLocal ()
 
void SetCentreIsGlobal (ALIbool isG)
 
void SetCentreLocalFromEntryValues ()
 
void setGlobalCentre ()
 
void setGlobalCoordinatesOfComponents ()
 
void setGlobalRM ()
 
void SetRMGlobFromRMLocal ()
 
void SetRMGlobFromRMLocalOriginalOriginal (const CLHEP::HepRotation &rmoriori)
 
void SetRMLocalFromEntryValues ()
 
void transformCylindrical2Cartesian ()
 
void transformGlobal2Local ()
 
void transformSpherical2Cartesian ()
 

Private Attributes

ALIbool anglesIsGlobal
 
CLHEP::Hep3Vector axisXLocalInGlobal
 
CLHEP::Hep3Vector axisYLocalInGlobal
 
CLHEP::Hep3Vector axisZLocalInGlobal
 
ALIbool centreIsGlobal
 
ALIbool fcopyData
 
CLHEP::Hep3Vector theCentreGlob
 
CLHEP::Hep3Vector theCentreGlobOriginal
 
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
 
ALIuint theCmsswID
 
std::vector< Entry * > theCoordinateEntryVector
 
MeasurementtheCurrentMeas
 
std::vector< ALIdoubletheExtraEntryValueOriginalOriginalVector
 
std::vector< ALIdoubletheExtraEntryValueOriginalVector
 
std::vector< ALIdoubletheExtraEntryValueVector
 
std::vector< Entry * > theExtraEntryVector
 
ALIstring theName
 
OpticalObjecttheParent
 
CLHEP::HepRotation theRmGlob
 
CLHEP::HepRotation theRmGlobOriginal
 
CLHEP::HepRotation theRmGlobOriginalOriginal
 
ALIstring theType
 

Friends

std::ostream & operator<< (std::ostream &os, const OpticalObject &c)
 

Detailed Description

Definition at line 35 of file OpticalObject.h.

Constructor & Destructor Documentation

◆ OpticalObject() [1/2]

OpticalObject::OpticalObject ( )
inline

Definition at line 40 of file OpticalObject.h.

40 {};

◆ OpticalObject() [2/2]

OpticalObject::OpticalObject ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)

Definition at line 53 of file OpticalObject.cc.

57  : theParent(parent), theType(type), theName(name), fcopyData(copy_data) {
58  if (ALIUtils::debug >= 4) {
59  std::cout << std::endl
60  << "@@@@ Creating OpticalObject: NAME= " << theName << " TYPE= " << theType << " fcopyData " << fcopyData
61  << std::endl;
62  }
63 
65 }

References gather_cfg::cout, ALIUtils::debug, fcopyData, OpticalObjectMgr::getInstance(), OpticalObjectMgr::registerMe(), theName, and theType.

◆ ~OpticalObject()

OpticalObject::~OpticalObject ( )
virtual

Definition at line 1644 of file OpticalObject.cc.

1644 {}

Member Function Documentation

◆ addCoordinateEntryToList()

void OpticalObject::addCoordinateEntryToList ( Entry entry)
inline

Definition at line 111 of file OpticalObject.h.

111 { theCoordinateEntryVector.push_back(entry); }

References mps_splice::entry, and theCoordinateEntryVector.

Referenced by fillCoordinateEntry(), and setAnglesNull().

◆ addExtraEntryToList()

void OpticalObject::addExtraEntryToList ( Entry entry)
inline

Definition at line 112 of file OpticalObject.h.

112 { theExtraEntryVector.push_back(entry); }

References mps_splice::entry, and theExtraEntryVector.

Referenced by fillExtraEntry().

◆ addExtraEntryValueOriginalOriginalToList()

void OpticalObject::addExtraEntryValueOriginalOriginalToList ( ALIdouble  entry_value)
inline

Definition at line 117 of file OpticalObject.h.

117  {
118  theExtraEntryValueOriginalOriginalVector.push_back(entry_value);
119  }

References theExtraEntryValueOriginalOriginalVector.

Referenced by setOriginalEntryValues().

◆ addExtraEntryValueOriginalToList()

void OpticalObject::addExtraEntryValueOriginalToList ( ALIdouble  entry_value)
inline

Definition at line 114 of file OpticalObject.h.

114  {
115  theExtraEntryValueOriginalVector.push_back(entry_value);
116  }

References theExtraEntryValueOriginalVector.

Referenced by setOriginalEntryValues().

◆ addExtraEntryValueToList()

void OpticalObject::addExtraEntryValueToList ( ALIdouble  entry_value)
inline

Definition at line 113 of file OpticalObject.h.

113 { theExtraEntryValueVector.push_back(entry_value); }

References theExtraEntryValueVector.

Referenced by fillExtraEntry().

◆ addPii()

double OpticalObject::addPii ( double  val)

Definition at line 1830 of file OpticalObject.cc.

1830  {
1831  if (val < M_PI) {
1832  val += M_PI;
1833  } else {
1834  val -= M_PI;
1835  }
1836 
1837  return val;
1838 }

References M_PI, and heppy_batch::val.

◆ approxTo0()

double OpticalObject::approxTo0 ( double  val)

Definition at line 1822 of file OpticalObject.cc.

1822  {
1823  double precision = 1.e-9;
1824  if (fabs(val) < precision)
1825  val = 0;
1826  return val;
1827 }

References common_cff::precision, and heppy_batch::val.

◆ buildRmFromEntryValuesOriginalOriginal()

CLHEP::HepRotation OpticalObject::buildRmFromEntryValuesOriginalOriginal ( )

Definition at line 675 of file OpticalObject.cc.

675  {
676  CLHEP::HepRotation rm;
677  const OpticalObject* opto_par = this;
678  // if(Model::GlobalOptions()["rotateAroundLocal"] == 0) {
679  if (ALIUtils::debug >= 55)
680  std::cout << "rotate with parent: before X " << opto_par->parent()->name() << " "
681  << parent()->getEntryRMangle(XCoor) << std::endl;
682  const std::vector<Entry*>& cel = CoordinateEntryList();
683  rm.rotateX(cel[3]->valueOriginalOriginal());
684  if (ALIUtils::debug >= 55)
685  std::cout << "rotate with parent: before Y " << opto_par->parent()->name() << " "
686  << parent()->getEntryRMangle(YCoor) << std::endl;
687  rm.rotateY(cel[4]->valueOriginalOriginal());
688  if (ALIUtils::debug >= 55)
689  std::cout << "rotate with parent: before Z " << opto_par->parent()->name() << " "
690  << parent()->getEntryRMangle(ZCoor) << std::endl;
691  rm.rotateZ(cel[5]->valueOriginalOriginal());
692  //- rm.rotateZ( getEntryRMangle(ZCoor) );
693  if (ALIUtils::debug >= 54)
694  ALIUtils::dumprm(theRmGlob, "SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName());
695 
696  return rm;
697 }

References CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), getEntryRMangle(), longName(), name(), parent(), submit::rm, theRmGlob, XCoor, YCoor, and ZCoor.

◆ buildWordList()

void OpticalObject::buildWordList ( const Entry entry,
std::vector< ALIstring > &  wordlist 
)
private

Definition at line 418 of file OpticalObject.cc.

418  {
419  //---------- 1st add name
420  wordlist.push_back(entry->name());
421 
422  //---------- 1st add value
423  char chartmp[20];
424  gcvt(entry->value() / entry->ValueDimensionFactor(), 10, chartmp);
425  wordlist.push_back(chartmp);
426 
427  //---------- 1st add sigma
428  gcvt(entry->sigma() / entry->SigmaDimensionFactor(), 10, chartmp);
429  wordlist.push_back(chartmp);
430 
431  //---------- 1st add quality
432  ALIstring strtmp;
433  ALIint inttmp = entry->quality();
434  switch (inttmp) {
435  case 0:
436  strtmp = "fix";
437  break;
438  case 1:
439  strtmp = "cal";
440  break;
441  case 2:
442  strtmp = "unk";
443  break;
444  default:
445  std::cerr << "buildWordList: entry " << entry->OptOCurrent()->name() << entry->name() << " quality not found "
446  << inttmp << std::endl;
447  break;
448  }
449  wordlist.push_back(strtmp);
450 
451  if (ALIUtils::debug >= 9) {
452  ALIUtils::dumpVS(wordlist, "buildWordList: ", std::cout);
453  }
454 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), and mps_splice::entry.

Referenced by copyData().

◆ calculateLocalRotationAxisInGlobal()

void OpticalObject::calculateLocalRotationAxisInGlobal ( )
private

Definition at line 1723 of file OpticalObject.cc.

1723  {
1724  axisXLocalInGlobal = CLHEP::Hep3Vector(1., 0., 0.);
1726  axisYLocalInGlobal = CLHEP::Hep3Vector(0., 1., 0.);
1728  axisZLocalInGlobal = CLHEP::Hep3Vector(0., 0., 1.);
1730  if (ALIUtils::debug >= 4) {
1731  std::cout << name() << " axis X local in global " << axisXLocalInGlobal << std::endl;
1732  std::cout << name() << " axis Y local in global " << axisYLocalInGlobal << std::endl;
1733  std::cout << name() << " axis Z local in global " << axisZLocalInGlobal << std::endl;
1734  }
1735 }

References axisXLocalInGlobal, axisYLocalInGlobal, axisZLocalInGlobal, gather_cfg::cout, ALIUtils::debug, name(), and theRmGlob.

Referenced by displaceRmGlobAroundLocal(), resetGlobalCoordinates(), resetOriginalOriginalCoordinates(), and setGlobalRM().

◆ centreGlob()

const CLHEP::Hep3Vector& OpticalObject::centreGlob ( ) const
inline

◆ centreGlobal()

const CLHEP::Hep3Vector& OpticalObject::centreGlobal ( ) const
inline

Definition at line 77 of file OpticalObject.h.

77 { return centreGlob(); }

References centreGlob().

◆ centreGlobOriginal()

const CLHEP::Hep3Vector& OpticalObject::centreGlobOriginal ( ) const
inline

◆ centreGlobOriginalOriginal()

const CLHEP::Hep3Vector& OpticalObject::centreGlobOriginalOriginal ( ) const
inline

Definition at line 82 of file OpticalObject.h.

References theCentreGlobOriginalOriginal.

Referenced by displaceRmGlobOriginalOriginal().

◆ centreLocal()

const CLHEP::Hep3Vector OpticalObject::centreLocal ( ) const

Definition at line 1938 of file OpticalObject.cc.

1938  {
1939  CLHEP::Hep3Vector cLocal = theCentreGlob - parent()->centreGlob();
1940  CLHEP::HepRotation rmParentInv = inverseOf(parent()->rmGlob());
1941  cLocal = rmParentInv * cLocal;
1942 
1943  return cLocal;
1944  /*-
1945 
1946  if( theCoordinateEntryVector.size() >= 3 ) {
1947  return CLHEP::Hep3Vector( theCoordinateEntryVector[0]->value(), theCoordinateEntryVector[1]->value(), theCoordinateEntryVector[2]->value() );
1948  } else {
1949  return CLHEP::Hep3Vector(0.,0.,0.);
1950  }
1951  */
1952 }

References centreGlob(), parent(), rmGlob(), and theCentreGlob.

Referenced by CocoaToDDLMgr::pv().

◆ checkMatrixEquations()

int OpticalObject::checkMatrixEquations ( double  angleX,
double  angleY,
double  angleZ,
CLHEP::HepRotation *  rot = nullptr 
)

Definition at line 1841 of file OpticalObject.cc.

1841  {
1842  //- std::cout << " cme " << angleX << " " << angleY << " " << angleZ << std::endl;
1843  if (rot == nullptr) {
1844  rot = new CLHEP::HepRotation();
1845  rot->rotateX(angleX);
1846  rot->rotateY(angleY);
1847  rot->rotateZ(angleZ);
1848  }
1849  double sx = sin(angleX);
1850  double cx = cos(angleX);
1851  double sy = sin(angleY);
1852  double cy = cos(angleY);
1853  double sz = sin(angleZ);
1854  double cz = cos(angleZ);
1855 
1856  double rotxx = cy * cz;
1857  double rotxy = sx * sy * cz - cx * sz;
1858  double rotxz = cx * sy * cz + sx * sz;
1859  double rotyx = cy * sz;
1860  double rotyy = sx * sy * sz + cx * cz;
1861  double rotyz = cx * sy * sz - sx * cz;
1862  double rotzx = -sy;
1863  double rotzy = sx * cy;
1864  double rotzz = cx * cy;
1865 
1866  int matrixElemBad = 0;
1867  if (!eq2ang(rot->xx(), rotxx)) {
1868  std::cerr << " EQUATION for xx() IS BAD " << rot->xx() << " <> " << rotxx << std::endl;
1869  matrixElemBad++;
1870  }
1871  if (!eq2ang(rot->xy(), rotxy)) {
1872  std::cerr << " EQUATION for xy() IS BAD " << rot->xy() << " <> " << rotxy << std::endl;
1873  matrixElemBad++;
1874  }
1875  if (!eq2ang(rot->xz(), rotxz)) {
1876  std::cerr << " EQUATION for xz() IS BAD " << rot->xz() << " <> " << rotxz << std::endl;
1877  matrixElemBad++;
1878  }
1879  if (!eq2ang(rot->yx(), rotyx)) {
1880  std::cerr << " EQUATION for yx() IS BAD " << rot->yx() << " <> " << rotyx << std::endl;
1881  matrixElemBad++;
1882  }
1883  if (!eq2ang(rot->yy(), rotyy)) {
1884  std::cerr << " EQUATION for yy() IS BAD " << rot->yy() << " <> " << rotyy << std::endl;
1885  matrixElemBad++;
1886  }
1887  if (!eq2ang(rot->yz(), rotyz)) {
1888  std::cerr << " EQUATION for yz() IS BAD " << rot->yz() << " <> " << rotyz << std::endl;
1889  matrixElemBad++;
1890  }
1891  if (!eq2ang(rot->zx(), rotzx)) {
1892  std::cerr << " EQUATION for zx() IS BAD " << rot->zx() << " <> " << rotzx << std::endl;
1893  matrixElemBad++;
1894  }
1895  if (!eq2ang(rot->zy(), rotzy)) {
1896  std::cerr << " EQUATION for zy() IS BAD " << rot->zy() << " <> " << rotzy << std::endl;
1897  matrixElemBad++;
1898  }
1899  if (!eq2ang(rot->zz(), rotzz)) {
1900  std::cerr << " EQUATION for zz() IS BAD " << rot->zz() << " <> " << rotzz << std::endl;
1901  matrixElemBad++;
1902  }
1903 
1904  //- std::cout << " cme: matrixElemBad " << matrixElemBad << std::endl;
1905  return matrixElemBad;
1906 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, funct::cos(), eq2ang(), makeMuonMisalignmentScenario::rot, funct::sin(), fftjetcommon_cfi::sx, and fftjetcommon_cfi::sy.

◆ construct()

void OpticalObject::construct ( )

Definition at line 70 of file OpticalObject.cc.

70  {
71  //---------- Get file handler
73  /*- if(!filein) {
74  filein.ErrorInLine();
75  std::cerr << "cannot open file SystemDescription.txt" << std::endl;
76  exit(0);
77  }*/
78 
79  if (theParent != nullptr) { //----- OptO 'system' has no parent (and no affine frame)
80  //---------- Read or copy Data
81  if (!fcopyData) {
82  if (ALIUtils::debug >= 4)
83  std::cout << "@@@@ Reading data of Optical Object " << name() << std::endl;
84  readData(filein);
85  } else {
86  if (ALIUtils::debug >= 4)
87  std::cout << "Copy data of Optical Object " << name() << std::endl;
88  copyData();
89  }
90 
91  //---------- Set global coordinates
93  //---------- Set ValueDisplacementByFitting to 0. !!done at Entry construction
94  /* std::vector<Entry*>::const_iterator vecite;
95  for ( vecite = CoordinateEntryList().begin(); vecite != CoordinateEntryList().end(); vecite++) {
96  (*vecite)->setValueDisplacementByFitting( 0. );
97  }
98  */
99 
100  //---------- Set original entry values
102  }
103 
104  //---------- Create the OptO that compose this one
105  createComponentOptOs(filein);
106 
107  //---------- Construct material
109 
110  //---------- Construct solid shape
112 }

References constructMaterial(), constructSolidShape(), copyData(), gather_cfg::cout, createComponentOptOs(), ALIUtils::debug, fcopyData, ALIFileIn::getInstance(), name(), readData(), Model::SDFName(), setGlobalCoordinates(), setOriginalEntryValues(), and theParent.

Referenced by createComponentOptOs(), and Model::readSystemDescription().

◆ constructFromOptAligInfo()

void OpticalObject::constructFromOptAligInfo ( const OpticalAlignInfo oaInfo)

Definition at line 2016 of file OpticalObject.cc.

2016  {
2017  if (theParent != nullptr) { //----- OptO 'system' has no parent (and no affine frame)
2018  //---------- Build Data
2019  //---------- See if there are extra entries and read them
2020  std::vector<OpticalAlignParam> exEnt = oaInfo.extraEntries_;
2021  std::vector<OpticalAlignParam>::iterator ite;
2022  std::vector<ALIstring> wordlist;
2023  for (ite = exEnt.begin(); ite != exEnt.end(); ++ite) {
2024  wordlist = getCoordinateFromOptAlignParam(*ite);
2025  wordlist.insert(wordlist.begin(), (*ite).dimType());
2026  fillExtraEntry(wordlist);
2027  }
2028 
2029  //--------- set centre and angles not global (default behaviour)
2030  centreIsGlobal = false;
2031  anglesIsGlobal = false;
2032 
2033  setCmsswID(oaInfo.ID_);
2034  //--------- build Coordinates
2041 
2042  //---------- Set global coordinates
2044 
2045  //---------- Set original entry values
2047  }
2048 
2049  //---------- Construct material
2051 
2052  //---------- Construct solid shape
2054 
2055  if (ALIUtils::debug >= 5) {
2056  std::cout << "constructFromOptAligInfo constructed: " << *this << std::endl;
2057  }
2058 
2059  //---------- Create the OptO that compose this one
2061 }

References anglesIsGlobal, OpticalAlignInfo::angx_, OpticalAlignInfo::angy_, OpticalAlignInfo::angz_, centreIsGlobal, constructMaterial(), constructSolidShape(), gather_cfg::cout, createComponentOptOsFromOptAlignInfo(), ALIUtils::debug, OpticalAlignInfo::extraEntries_, fillCoordinateEntry(), fillExtraEntry(), getCoordinateFromOptAlignParam(), OpticalAlignInfo::ID_, setCmsswID(), setGlobalCoordinates(), setOriginalEntryValues(), theParent, OpticalAlignInfo::x_, OpticalAlignInfo::y_, and OpticalAlignInfo::z_.

Referenced by Model::BuildSystemDescriptionFromOA(), and createComponentOptOsFromOptAlignInfo().

◆ constructMaterial()

void OpticalObject::constructMaterial ( )
virtual

Definition at line 2001 of file OpticalObject.cc.

2001  {
2002  theMaterial = new CocoaMaterialElementary("Hydrogen", 70.8 * mg / cm3, "H", 1.00794f, 1);
2003 }

References f, and theMaterial.

Referenced by construct(), and constructFromOptAligInfo().

◆ constructSolidShape()

void OpticalObject::constructSolidShape ( )
virtual

◆ CoordinateEntryList()

const std::vector<Entry*>& OpticalObject::CoordinateEntryList ( ) const
inline

◆ copyData()

void OpticalObject::copyData ( )
private

Definition at line 371 of file OpticalObject.cc.

371  {
372  centreIsGlobal = false;
373  anglesIsGlobal = false;
374  if (ALIUtils::debug >= 5)
375  std::cout << "entering copyData()" << std::endl;
376 
377  //---------- Get copied OptO
379 
380  //---------- build name: for a copied OptO, now name is parent name, add the last part of the copied OptO
381  ALIint copy_name_last_slash = opto->name().rfind('/');
382  ALIint copy_name_size = opto->name().length();
383  //- if(ALIUtils::debug >= 9) std::cout << "BUILD UP NAME0 " << theName << std::endl;
384  theName.append(opto->name(), copy_name_last_slash, copy_name_size);
385  if (ALIUtils::debug >= 5)
386  std::cout << "copying OptO: " << opto->name() << " to OptO " << theName << std::endl;
387 
388  //---------- Copy Extra Entries from copied OptO
389  std::vector<Entry*>::const_iterator vecite;
390  for (vecite = opto->ExtraEntryList().begin(); vecite != opto->ExtraEntryList().end(); ++vecite) {
391  std::vector<ALIstring> wordlist;
392  wordlist.push_back((*vecite)->type());
393  buildWordList((*vecite), wordlist);
394  if (ALIUtils::debug >= 9) {
395  ALIUtils::dumpVS(wordlist, "copyData: ", std::cout);
396  }
397  fillExtraEntry(wordlist);
398  }
399 
400  //---------- Copy Coordinate Entries from copied OptO
401  for (vecite = opto->CoordinateEntryList().begin(); vecite != opto->CoordinateEntryList().end(); ++vecite) {
402  std::vector<ALIstring> wordlist;
403  buildWordList((*vecite), wordlist);
404  //----- first three coordinates centre, second three coordinates angles!!PROTECT AGAINST OTHER POSSIBILITIES!!
405  ALIstring coor_name;
406  if (vecite - opto->CoordinateEntryList().begin() < 3) {
407  coor_name = "centre";
408  } else {
409  coor_name = "angles";
410  }
411  fillCoordinateEntry(coor_name, wordlist);
412  }
413 }

References anglesIsGlobal, buildWordList(), centreIsGlobal, CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), ExtraEntryList(), fillCoordinateEntry(), fillExtraEntry(), name(), Model::nextOptOToCopy(), and theName.

Referenced by construct().

◆ createComponentOptOs()

void OpticalObject::createComponentOptOs ( ALIFileIn filein)
private

Definition at line 459 of file OpticalObject.cc.

459  {
460  //---------- flag to determine if components are copied or read (it is passed to the constructor of component OptOs)
461  ALIbool fcopyComponents = false;
462 
463  //---------- Get list of components of current OptO (copy it to 'vopto_types')
464  std::vector<ALIstring> vopto_types;
465  int igetood = Model::getComponentOptOTypes(type(), vopto_types);
466  if (!igetood) {
467  if (ALIUtils::debug >= 5)
468  std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl;
469  return;
470  }
471 
472  /* //---------- Dump component list
473  if(ALIUtils::debug >= 5) {
474  ALIUtils::dumpVS( wordlist, "SYSTEM: ", std::cout );
475  }*/
476 
477  //---------- Loop components (have to follow list in 'vopto_types')
478  std::vector<ALIstring>::iterator vsite;
479  std::vector<ALIstring> wordlist;
480  for (vsite = vopto_types.begin(); vsite != vopto_types.end(); ++vsite) {
481  //----- If it is not being copied, read first line describing object
482  //- std::cout << "fcopyy" << fcopyComponents << fcopyData << theName << *vsite << std::endl;
483  if (!fcopyData && !fcopyComponents)
484  filein.getWordsInLine(wordlist);
485  //t if( !fcopyData ) filein.getWordsInLine(wordlist);
486 
487  //----- Check first line describing object
488  //--- Don't check it if OptO is going to be copied (fcopyData = 1)
489  //--- If OptO is not copied, but components will be copied, check if only for the first component (for the second fcopyComponents=1)
490  if (fcopyData || fcopyComponents) {
491  fcopyComponents = true;
492  //--- If OptO not copied, but components will be copied
493  } else if (wordlist[0] == ALIstring("copy_components")) {
494  if (ALIUtils::debug >= 3)
495  std::cout << "createComponentOptOs: copy_components" << wordlist[0] << std::endl;
497  fcopyComponents = true; //--- for the second and following components
498  //----- If no copying: check that type is the expected one
499  } else if (wordlist[0] != (*vsite)) {
500  filein.ErrorInLine();
501  std::cerr << "!!! Badly placed OpticalObject: " << wordlist[0] << " should be = " << (*vsite) << std::endl;
502  exit(2);
503  }
504 
505  //---------- Make composite component name
506  ALIstring component_name = name();
507  //----- if component is not going to be copied add name of component to the parent (if OptO is not copied and components will be, wordlist = 'copy-components', there is no wordlist[1]
508  if (!fcopyComponents) {
509  component_name += '/';
510  component_name += wordlist[1];
511  }
512  // if ( ALIUtils::debug >= 6 ) std::cout << "MAKE NAME " << name() << " TO " << component_name << std::endl;
513 
514  //---------- Create OpticalObject of the corresponding type
515  OpticalObject* OptOcomponent = createNewOptO(this, *vsite, component_name, fcopyComponents);
516 
517  //----- Fill CMS software ID
518  if (wordlist.size() == 3) {
519  OptOcomponent->setID(ALIUtils::getInt(wordlist[2]));
520  } else {
521  OptOcomponent->setID(OpticalObjectMgr::getInstance()->buildCmsSwID());
522  }
523 
524  //---------- Construct it (read data and
525  OptOcomponent->construct();
526 
527  //---------- Fill OptO tree and OptO list
528  Model::OptOList().push_back(OptOcomponent);
529  }
530 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, construct(), gather_cfg::cout, Model::createCopyComponentList(), createNewOptO(), ALIUtils::debug, ALIFileIn::ErrorInLine(), beamvalidation::exit(), fcopyData, Model::getComponentOptOTypes(), OpticalObjectMgr::getInstance(), ALIUtils::getInt(), ALIFileIn::getWordsInLine(), name(), Model::OptOList(), setID(), and type().

Referenced by construct().

◆ createComponentOptOsFromOptAlignInfo()

void OpticalObject::createComponentOptOsFromOptAlignInfo ( )

Definition at line 2088 of file OpticalObject.cc.

2088  {
2089  //----- Build children list of this object
2090  std::vector<OpticalAlignInfo> children;
2091 
2092  std::vector<OpticalAlignInfo>::const_iterator ite;
2093  if (ALIUtils::debug >= 5) {
2094  std::cout << " Model::getOpticalAlignments().size " << Model::getOpticalAlignments().size() << std::endl;
2095  }
2096  // for( ite = Model::getOpticalAlignments().begin(); ite != Model::getOpticalAlignments().end(); ite++ ){
2097  int siz = Model::getOpticalAlignments().size();
2098  for (int ii = 0; ii < siz; ii++) {
2099  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo name " << (*ite).name_ << std::endl;
2100  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo " << (*ite).parentName_ << " =? " << theName << std::endl;
2101  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo name " << ii << std::endl;
2102  // if( (*ite)parentName_. == oaInfo.name() && (*ite).name() != "simple2DWithMirror:mirror1" ) {
2103  if (Model::getOpticalAlignments()[ii].parentName_ == theName) {
2104  // if( (*ite).parentName_ == theName ) {
2105 
2106  // std::cout << "createComponentOptOsFromOptAlignInfo: 1 to push_back " << std::endl;
2107  std::vector<OpticalAlignParam> exent = Model::getOpticalAlignments()[ii].extraEntries_;
2108  // std::vector<OpticalAlignParam> exent = (*ite).extraEntries_;
2109  //- std::cout << "createComponentOptOsFromOptAlignInfo: 2 to push_back " << std::endl;
2110  /* for( ALIuint ij = 0; ij < exent.size(); ij++ ){
2111  std::cout << " extra entry " << exent[ij].name_;
2112  std::cout << " extra entry " << exent[ij].dimType();
2113  std::cout << " extra entry " << exent[ij].value_;
2114  std::cout << " extra entry " << exent[ij].error_;
2115  std::cout << " extra entry " << exent[ij].quality_;
2116  } */
2117  // std::cout << "createComponentOptOsFromOptAlignInfo: 3 to push_back " << Model::getOpticalAlignments()[ii] << std::endl;
2119  // OpticalAlignInfo oaInfochild = *ite;
2120  // std::cout << "createComponentOptOsFromOptAlignInfo: 4 to push_back " << std::endl;
2121  children.push_back(oaInfochild);
2122  if (ALIUtils::debug >= 5) {
2123  std::cout << theName << "createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.name_
2124  << std::endl;
2125  }
2126  }
2127  // std::cout << "createComponentOptOsFromOptAlignInfo: 6 push_backed " << std::endl;
2128  }
2129  // std::cout << "createComponentOptOsFromOptAlignInfo: 10 push_backed " << std::endl;
2130 
2131  if (ALIUtils::debug >= 5) {
2132  std::cout << "OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2133  }
2134  for (ite = children.begin(); ite != children.end(); ++ite) {
2135  //---------- Get component type
2136  ALIstring optoType = (*ite).type_;
2137  //- //---------- Get composite component name
2138  //- ALIstring optoName = name()+"/"+(*ite).name_;
2139  //---------- Get component name
2140  ALIstring optoName = (*ite).name_;
2141  ALIbool fcopyComponents = false;
2142 
2143  //---------- Create OpticalObject of the corresponding type
2144  OpticalObject* OptOcomponent = createNewOptO(this, optoType, optoName, fcopyComponents);
2145 
2146  //---------- Construct it (read data and
2147  OptOcomponent->constructFromOptAligInfo(*ite);
2148 
2149  //---------- Fill OptO tree and OptO list
2150  Model::OptOList().push_back(OptOcomponent);
2151  }
2152 }

References class-composition::children, constructFromOptAligInfo(), gather_cfg::cout, createNewOptO(), ALIUtils::debug, Model::getOpticalAlignments(), cuy::ii, OpticalAlignInfo::name_, Model::OptOList(), and theName.

Referenced by constructFromOptAligInfo().

◆ createNewOptO()

OpticalObject * OpticalObject::createNewOptO ( OpticalObject parent,
ALIstring  optoType,
ALIstring  optoName,
ALIbool  fcopyComponents 
)
private

Definition at line 533 of file OpticalObject.cc.

536  {
537  if (ALIUtils::debug >= 3)
538  std::cout << " OpticalObject::createNewOptO optoType " << optoType << " optoName " << optoName << " parent "
539  << parent->name() << std::endl;
540  OpticalObject* OptOcomponent;
541  if (optoType == "laser") {
542  OptOcomponent = new OptOLaser(this, optoType, optoName, fcopyComponents);
543  } else if (optoType == "source") {
544  OptOcomponent = new OptOSource(this, optoType, optoName, fcopyComponents);
545  } else if (optoType == "Xlaser") {
546  OptOcomponent = new OptOXLaser(this, optoType, optoName, fcopyComponents);
547  } else if (optoType == "mirror") {
548  OptOcomponent = new OptOMirror(this, optoType, optoName, fcopyComponents);
549  } else if (optoType == "plate_splitter") {
550  OptOcomponent = new OptOPlateSplitter(this, optoType, optoName, fcopyComponents);
551  } else if (optoType == "cube_splitter") {
552  OptOcomponent = new OptOCubeSplitter(this, optoType, optoName, fcopyComponents);
553  } else if (optoType == "modified_rhomboid_prism") {
554  OptOcomponent = new OptOModifiedRhomboidPrism(this, optoType, optoName, fcopyComponents);
555  } else if (optoType == "pseudo_pentaprism" || optoType == "optical_square") {
556  OptOcomponent = new OptOOpticalSquare(this, optoType, optoName, fcopyComponents);
557  } else if (optoType == "lens") {
558  OptOcomponent = new OptOLens(this, optoType, optoName, fcopyComponents);
559  } else if (optoType == "Risley_prism") {
560  OptOcomponent = new OptORisleyPrism(this, optoType, optoName, fcopyComponents);
561  } else if (optoType == "sensor2D") {
562  OptOcomponent = new OptOSensor2D(this, optoType, optoName, fcopyComponents);
563  } else if (optoType == "distancemeter" || optoType == "distancemeter1dim") {
564  OptOcomponent = new OptODistancemeter(this, optoType, optoName, fcopyComponents);
565  } else if (optoType == "distancemeter3dim") {
566  OptOcomponent = new OptODistancemeter3dim(this, optoType, optoName, fcopyComponents);
567  } else if (optoType == "distance_target") {
568  OptOcomponent = new OptOScreen(this, optoType, optoName, fcopyComponents);
569  } else if (optoType == "tiltmeter") {
570  OptOcomponent = new OptOTiltmeter(this, optoType, optoName, fcopyComponents);
571  } else if (optoType == "pinhole") {
572  OptOcomponent = new OptOPinhole(this, optoType, optoName, fcopyComponents);
573  } else if (optoType == "COPS") {
574  OptOcomponent = new OptOCOPS(this, optoType, optoName, fcopyComponents);
575  } else {
576  OptOcomponent =
577  //o new OpticalObject( this, optoType, optoName, fcopyComponents );
578  new OptOUserDefined(this, optoType, optoName, fcopyComponents);
579  }
580 
581  return OptOcomponent;
582 }

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

Referenced by createComponentOptOs(), and createComponentOptOsFromOptAlignInfo().

◆ defaultBehaviour()

void OpticalObject::defaultBehaviour ( LightRay lightray,
Measurement meas 
)
virtual

Reimplemented in OptOSource, OptOCOPS, OptOMirror, OptOSensor2D, OptODistancemeter, OptODistancemeter3dim, OptOLaser, OptOPinhole, OptOScreen, OptOTiltmeter, and OptOXLaser.

Definition at line 873 of file OpticalObject.cc.

873  {
874  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement a default behaviour"
875  << std::endl;
876  std::cerr << " You have to specify some behaviour, like :D or :T or ..." << std::endl;
877  exit(1);
878 }

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

Referenced by participateInMeasurement().

◆ detailedDeviatesLightRay()

void OpticalObject::detailedDeviatesLightRay ( LightRay lightray)
virtual

Reimplemented in OptOCubeSplitter, OptOModifiedRhomboidPrism, OptOOpticalSquare, OptOMirror, and OptOPlateSplitter.

Definition at line 903 of file OpticalObject.cc.

903  {
904  std::cerr << "!!! Optical Object " << name() << " of type " << type()
905  << " does not implement detailed deviation (:DD / :D)" << std::endl;
906  std::cerr << " Please read documentation for this object type" << std::endl;
907  exit(1);
908 }

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

Referenced by participateInMeasurement().

◆ detailedTraversesLightRay()

void OpticalObject::detailedTraversesLightRay ( LightRay lightray)
virtual

Reimplemented in OptOMirror, OptOSensor2D, OptOCubeSplitter, OptOModifiedRhomboidPrism, OptOOpticalSquare, and OptOPlateSplitter.

Definition at line 913 of file OpticalObject.cc.

913  {
914  std::cerr << "!!! Optical Object " << name() << " of type " << type()
915  << " does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
916  std::cerr << " Please read documentation for this object type" << std::endl;
917  exit(1);
918 }

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

Referenced by participateInMeasurement().

◆ diff2pi()

double OpticalObject::diff2pi ( double  ang1,
double  ang2 
)

Definition at line 1800 of file OpticalObject.cc.

1800  {
1801  double diff = fabs(ang1 - ang2);
1802  diff = diff - int(diff / 2. / M_PI) * 2 * M_PI;
1803  return diff;
1804 }

References change_name::diff, createfilelist::int, and M_PI.

Referenced by eq2ang().

◆ displaceCentreGlob() [1/2]

void OpticalObject::displaceCentreGlob ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1046 of file OpticalObject.cc.

1046  {
1047  if (ALIUtils::debug >= 5)
1048  std::cout << name() << " displaceCentreGlob: dispVec = " << dispVec << std::endl;
1049 
1051  theCentreGlob += dispVec;
1052 
1053  //----------- Displace CentreGlob() of every component
1054  std::vector<OpticalObject*> vopto;
1055  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1056  if (!igetood) {
1057  return;
1058  }
1059  std::vector<OpticalObject*>::const_iterator vocite;
1060  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1061  (*vocite)->displaceCentreGlob(dispVec);
1062  }
1063 }

References centreGlobOriginal(), gather_cfg::cout, ALIUtils::debug, Model::getComponentOptOs(), name(), and theCentreGlob.

◆ displaceCentreGlob() [2/2]

void OpticalObject::displaceCentreGlob ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1000 of file OpticalObject.cc.

1000  {
1001  if (ALIUtils::debug >= 5)
1002  std::cout << name() << " displaceCentreGlob: coor " << coor << " disp = " << disp << std::endl;
1003 
1005  CLHEP::Hep3Vector dispVec = getDispVec(coor, disp);
1006  theCentreGlob += dispVec;
1007 
1008  //----------- Displace CentreGlob() of every component
1009  std::vector<OpticalObject*> vopto;
1010  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1011  if (!igetood) {
1012  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
1013  return;
1014  }
1015  std::vector<OpticalObject*>::const_iterator vocite;
1016  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1017  (*vocite)->displaceCentreGlob(dispVec);
1018  }
1019 }

References centreGlobOriginal(), gather_cfg::cout, ALIUtils::debug, Model::getComponentOptOs(), getDispVec(), name(), and theCentreGlob.

Referenced by EntryLengthAffCentre::displace().

◆ displaceCentreGlobOriginal() [1/2]

void OpticalObject::displaceCentreGlobOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1105 of file OpticalObject.cc.

1105  {
1106  if (ALIUtils::debug >= 4)
1107  std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1108 
1109  theCentreGlobOriginal += dispVec;
1110 
1111  if (ALIUtils::debug >= 5)
1112  ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original");
1113 
1114  //----------- Displace CentreGlob() of every component
1115  std::vector<OpticalObject*> vopto;
1116  Model::getComponentOptOs(name(), vopto);
1117  std::vector<OpticalObject*>::const_iterator vocite;
1118  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1119  (*vocite)->displaceCentreGlobOriginal(dispVec);
1120  }
1121 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Model::getComponentOptOs(), name(), and theCentreGlobOriginal.

◆ displaceCentreGlobOriginal() [2/2]

void OpticalObject::displaceCentreGlobOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1082 of file OpticalObject.cc.

1082  {
1083  if (ALIUtils::debug >= 4)
1084  std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1085  if (ALIUtils::debug >= 5)
1086  ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original 0");
1087  CLHEP::Hep3Vector dispVec = getDispVec(coor, disp);
1088  theCentreGlobOriginal += dispVec;
1089 
1090  if (ALIUtils::debug >= 5)
1091  ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original displaced");
1092 
1093  //----------- Displace CentreGlob() of every component
1094  std::vector<OpticalObject*> vopto;
1095  Model::getComponentOptOs(name(), vopto);
1096  std::vector<OpticalObject*>::const_iterator vocite;
1097  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1098  (*vocite)->displaceCentreGlobOriginal(dispVec);
1099  }
1100 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Model::getComponentOptOs(), getDispVec(), name(), and theCentreGlobOriginal.

Referenced by EntryLengthAffCentre::displaceOriginal().

◆ displaceCentreGlobOriginalOriginal() [1/2]

void OpticalObject::displaceCentreGlobOriginalOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1147 of file OpticalObject.cc.

1147  {
1148  if (ALIUtils::debug >= 4)
1149  std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1150 
1151  theCentreGlobOriginalOriginal += dispVec;
1152 
1153  if (ALIUtils::debug >= 5)
1154  ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original");
1155 
1156  //----------- Displace CentreGlob() of every component
1157  std::vector<OpticalObject*> vopto;
1158  Model::getComponentOptOs(name(), vopto);
1159  std::vector<OpticalObject*>::const_iterator vocite;
1160  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1161  (*vocite)->displaceCentreGlobOriginalOriginal(dispVec);
1162  }
1163 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Model::getComponentOptOs(), name(), and theCentreGlobOriginalOriginal.

◆ displaceCentreGlobOriginalOriginal() [2/2]

void OpticalObject::displaceCentreGlobOriginalOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1124 of file OpticalObject.cc.

1124  {
1125  if (ALIUtils::debug >= 4)
1126  std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1127  if (ALIUtils::debug >= 5)
1128  ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob originalOriginal 0");
1129  CLHEP::Hep3Vector dispVec = getDispVec(coor, disp);
1130  theCentreGlobOriginalOriginal += dispVec;
1131 
1132  if (ALIUtils::debug >= 5)
1133  ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original displaced");
1134 
1135  //----------- Displace CentreGlob() of every component
1136  std::vector<OpticalObject*> vopto;
1137  Model::getComponentOptOs(name(), vopto);
1138  std::vector<OpticalObject*>::const_iterator vocite;
1139  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1140  (*vocite)->displaceCentreGlobOriginalOriginal(dispVec);
1141  }
1142 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Model::getComponentOptOs(), getDispVec(), name(), and theCentreGlobOriginalOriginal.

Referenced by EntryLengthAffCentre::displaceOriginalOriginal().

◆ displaceExtraEntry()

void OpticalObject::displaceExtraEntry ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1068 of file OpticalObject.cc.

1068  {
1069  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalVector.begin() + entryNo);
1070  ALIdouble Pentry_value = (Pentry_orig_value) + disp;
1071  LogDebug("OpticalObject::displaceExtraEntry")
1072  << " displaceExtraEntry " << Pentry_value << " <> " << Pentry_orig_value << std::endl;
1073  theExtraEntryValueVector[entryNo] = Pentry_value;
1074 }

References LogDebug, theExtraEntryValueOriginalVector, and theExtraEntryValueVector.

Referenced by Entry::displace().

◆ displaceExtraEntryOriginal()

void OpticalObject::displaceExtraEntryOriginal ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1484 of file OpticalObject.cc.

1484  {
1485  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalVector.begin() + entryNo);
1486  Pentry_orig_value += disp;
1487  // std::cout << " displaceExtraEntryOriginal " << *(theExtraEntryValueOriginalVector.begin() + entryNo) << " + " << disp << std::endl;
1488  theExtraEntryValueOriginalVector[entryNo] = Pentry_orig_value;
1489 }

References theExtraEntryValueOriginalVector.

Referenced by Entry::displaceOriginal().

◆ displaceExtraEntryOriginalOriginal()

void OpticalObject::displaceExtraEntryOriginalOriginal ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1492 of file OpticalObject.cc.

1492  {
1493  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo);
1494  Pentry_orig_value += disp;
1495  // std::cout << " displaceExtraEntryOriginalOriginal " << *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo) << " + " << disp << std::endl;
1496  theExtraEntryValueOriginalOriginalVector[entryNo] = Pentry_orig_value;
1497 }

References theExtraEntryValueOriginalOriginalVector.

Referenced by Entry::displaceOriginalOriginal().

◆ displaceRmGlobAroundGlobal()

void OpticalObject::displaceRmGlobAroundGlobal ( OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1169 of file OpticalObject.cc.

1171  {
1172  if (ALIUtils::debug >= 5)
1173  std::cout << name() << "DISPLACERMGLOBAROUNDGLOBAL" << coor << "disp" << disp << std::endl;
1174  //-------------------- Rotate rotation matrix
1177  if (ALIUtils::debug >= 5) {
1178  std::cout << this->name() << std::endl;
1179  ALIUtils::dumprm(theRmGlob, "before disp rm ");
1180  }
1181  rotateItAroundGlobal(theRmGlob, coor, disp);
1182  if (ALIUtils::debug >= 5) {
1183  ALIUtils::dumprm(theRmGlob, "after disp rm ");
1184  }
1185  //-------------------- Rotation translate the centre of component OptO
1186  if (ALIUtils::debug >= 5)
1187  ALIUtils::dump3v(centreGlob(), " centre_glob before rotation");
1188  if (ALIUtils::debug >= 5)
1189  ALIUtils::dump3v(centreGlobOriginal(), " centreGlobOriginal before rotation");
1190  if (opto1stRotated != this) { //own _centre_glob is not displaced
1191  //---------- Distance to 1st rotated OptO
1192  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1193  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1194  rotateItAroundGlobal(radius_rotated, coor, disp);
1195  theCentreGlob = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1196  if (ALIUtils::debug >= 5)
1197  ALIUtils::dump3v(centreGlob(), " centre_glob after rotation");
1198  if (ALIUtils::debug >= 5)
1199  ALIUtils::dump3v(centreGlobOriginal(), " centre_globOriginal() after rotation");
1200  }
1201 
1202  //----------- Displace every component
1203  std::vector<OpticalObject*> vopto;
1204  Model::getComponentOptOs(name(), vopto);
1205  std::vector<OpticalObject*>::const_iterator vocite;
1206  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1207  (*vocite)->displaceRmGlobAroundGlobal(opto1stRotated, coor, disp);
1208  }
1209 }

References centreGlob(), centreGlobOriginal(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), Model::getComponentOptOs(), name(), rmGlobOriginal(), rotateItAroundGlobal(), theCentreGlob, and theRmGlob.

Referenced by EntryAngleAffAngles::displace().

◆ displaceRmGlobAroundLocal()

void OpticalObject::displaceRmGlobAroundLocal ( OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1215 of file OpticalObject.cc.

1215  {
1216  if (anglesIsGlobal) {
1217  std::cerr << "!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is "
1218  "set as a Global Option "
1219  << std::endl;
1220  abort();
1221  }
1222 
1223  if (ALIUtils::debug >= 5)
1224  std::cout << name() << " DISPLACE_RMGLOB_AROUND_LOCAL " << coor << " disp " << disp << std::endl;
1225  //---------- Build the rmGlob and centreGlob again, with displacement values
1226  //----- Local rotation is build with entry values plus displacement
1227  theRmGlob = CLHEP::HepRotation();
1228  //---------- Set global rotation matrix
1229  //-------- Get rm from Entries
1230  if (coor == XCoor) {
1231  theRmGlob.rotateX(getEntryRMangle(XCoor) + disp);
1232  if (ALIUtils::debug >= 5)
1233  std::cout << " rmglob rotated around x " << getEntryRMangle(XCoor) + disp << std::endl;
1234  } else {
1235  theRmGlob.rotateX(getEntryRMangle(XCoor));
1236  }
1237  if (ALIUtils::debug >= 4) {
1238  ALIUtils::dumprm(theRmGlob, "displaceRmGlobAroundLocal: rm local after X ");
1239  }
1240 
1241  //- std::cout << name() << " " << coor << " " << XCoor << " getEntryRMangle(coor) )" << getEntryRMangle(coor) << std::endl;
1242  if (coor == YCoor) {
1243  theRmGlob.rotateY(getEntryRMangle(YCoor) + disp);
1244  if (ALIUtils::debug >= 5)
1245  std::cout << " rmglob rotated around y " << getEntryRMangle(YCoor) + disp << std::endl;
1246  } else {
1247  theRmGlob.rotateY(getEntryRMangle(YCoor));
1248  }
1249  if (ALIUtils::debug >= 4) {
1250  std::cout << " getEntryRMangle(YCoor) " << getEntryRMangle(YCoor) << std::endl;
1251  ALIUtils::dumprm(theRmGlob, "displaceRmGlobAroundLocal: rm local after Y ");
1252  }
1253 
1254  if (coor == ZCoor) {
1255  theRmGlob.rotateZ(getEntryRMangle(ZCoor) + disp);
1256  if (ALIUtils::debug >= 5)
1257  std::cout << " rmglob rotated around z " << getEntryRMangle(ZCoor) + disp << std::endl;
1258  } else {
1259  theRmGlob.rotateZ(getEntryRMangle(ZCoor));
1260  }
1261  if (ALIUtils::debug >= 4) {
1262  std::cout << " getEntryRMangle(ZCoor) " << getEntryRMangle(ZCoor) << std::endl;
1263  ALIUtils::dumprm(theRmGlob, "SetRMLocalFromEntryValues: RM ");
1264  }
1265 
1266  //- theCentreGlob = CLHEP::Hep3Vector(0.,0.,0.);
1267  if (ALIUtils::debug >= 5 && disp != 0) {
1268  std::cout << this->name() << std::endl;
1269  ALIUtils::dumprm(theRmGlob, "displaceRmGlobAroundLocal: rm local ");
1270  }
1271 
1272  if (!anglesIsGlobal) {
1274  }
1275 
1276  //----- calculate local rot axis with new rm glob
1278 
1279  //- theCentreGlob = CLHEP::Hep3Vector(0.,0.,0.);
1280  if (ALIUtils::debug >= 5 && disp != 0) {
1281  std::cout << this->name() << std::endl;
1282  ALIUtils::dumprm(theRmGlob, "displaceRmGlobAroundLocal: rm global ");
1283  }
1284 
1285  if (opto1stRotated != this) { //own _centre_glob doesn't rotate
1286  setGlobalCentre();
1287  if (ALIUtils::debug >= 5) {
1288  ALIUtils::dump3v(centreGlob(), " centre_glob after rotation");
1289  ALIUtils::dump3v(centreGlobOriginal(), " centre_globOriginal() after rotation");
1290  }
1291  }
1292 
1293  //----------- Displace every component
1294  std::vector<OpticalObject*> vopto;
1295  Model::getComponentOptOs(name(), vopto);
1296  std::vector<OpticalObject*>::const_iterator vocite;
1297  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1298  (*vocite)->displaceRmGlobAroundLocal(opto1stRotated, coor, 0.);
1299  //for aroundglobal all components are explicitly rotated disp, for aroundLocal, they will be rotated automatically if the parent is rotated, as the rmGlob is built from scratch
1300  }
1301 }

References anglesIsGlobal, calculateLocalRotationAxisInGlobal(), centreGlob(), centreGlobOriginal(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), Model::getComponentOptOs(), getEntryRMangle(), name(), setGlobalCentre(), SetRMGlobFromRMLocal(), theRmGlob, XCoor, YCoor, and ZCoor.

Referenced by EntryAngleAffAngles::displace().

◆ displaceRmGlobOriginal()

void OpticalObject::displaceRmGlobOriginal ( const OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

!temporary, theRmGlobOriginal should disappear

Definition at line 1315 of file OpticalObject.cc.

1317  {
1318  if (ALIUtils::debug >= 9)
1319  std::cout << name() << " DISPLACEORIGRMGLOB " << coor << " disp " << disp << std::endl;
1321  if (gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
1322  //-------------------- Rotate rotation matrix
1323  if (ALIUtils::debug >= 5)
1324  ALIUtils::dumprm(theRmGlobOriginal, name() + ALIstring(" theRmGlobOriginal before displaced "));
1325  switch (coor) {
1326  case 0:
1327  theRmGlobOriginal.rotateX(disp);
1328  break;
1329  case 1:
1330  theRmGlobOriginal.rotateY(disp);
1331  break;
1332  case 2:
1333  theRmGlobOriginal.rotateZ(disp);
1334  break;
1335  default:
1336  std::cerr << "!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1337  exit(2);
1338  }
1339 
1340  //-------------------- Rotation translate the centre of component OptO
1341  if (ALIUtils::debug >= 98)
1342  ALIUtils::dump3v(centreGlob(), "angles rotate centre_glob");
1343  if (ALIUtils::debug >= 98)
1344  ALIUtils::dump3v(centreGlobOriginal(), " centreGlobOriginal");
1345  if (opto1stRotated != this) { //own _centre_glob doesn't rotate
1346  //---------- Distance to 1st rotated OptO
1347  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1348  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1349  switch (coor) {
1350  case 0:
1351  radius_rotated.rotateX(disp);
1352  break;
1353  case 1:
1354  radius_rotated.rotateY(disp);
1355  break;
1356  case 2:
1357  radius_rotated.rotateZ(disp);
1358  break;
1359  default:
1360  break; // already exited in previous switch
1361  }
1362  theCentreGlobOriginal = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1363  if (ALIUtils::debug >= 98)
1364  ALIUtils::dump3v(centreGlob(), "angle rotate centre_glob");
1365  if (ALIUtils::debug >= 98)
1366  ALIUtils::dump3v(centreGlobOriginal(), " centre_globOriginal()");
1367  }
1368 
1369  if (ALIUtils::debug >= 5)
1370  ALIUtils::dumprm(theRmGlobOriginal, name() + ALIstring(" theRmGlobOriginal displaced "));
1371 
1372  //----------- Displace every OptO component
1373  std::vector<OpticalObject*> vopto;
1374  Model::getComponentOptOs(name(), vopto);
1375  std::vector<OpticalObject*>::const_iterator vocite;
1376  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1377  (*vocite)->displaceRmGlobOriginal(opto1stRotated, coor, disp);
1378  }
1379 
1380  } else {
1384  //----------- Displace every OptO component
1385  std::vector<OpticalObject*> vopto;
1386  Model::getComponentOptOs(name(), vopto);
1387  std::vector<OpticalObject*>::const_iterator vocite;
1388  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1389  (*vocite)->displaceRmGlobOriginal(opto1stRotated, coor, disp);
1390  }
1391  if (ALIUtils::debug >= 5) {
1392  ALIUtils::dump3v(theCentreGlob, " displaceRmGlobOriginal ");
1393  ALIUtils::dumprm(theRmGlob, " displaceRmGlobOriginal ");
1394  }
1395  }
1396 }

References centreGlob(), centreGlobOriginal(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), beamvalidation::exit(), Model::getComponentOptOs(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), name(), setGlobalCoordinates(), theCentreGlob, theCentreGlobOriginal, theRmGlob, and theRmGlobOriginal.

Referenced by EntryAngleAffAngles::displaceOriginal().

◆ displaceRmGlobOriginalOriginal()

void OpticalObject::displaceRmGlobOriginalOriginal ( const OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

!temporary, theRmGlobOriginalOriginal should disappear

Definition at line 1399 of file OpticalObject.cc.

1401  {
1402  if (ALIUtils::debug >= 9)
1403  std::cout << name() << " DISPLACEORIGRMGLOB " << coor << " disp " << disp << std::endl;
1405  if (gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
1406  //-------------------- Rotate rotation matrix
1407  if (ALIUtils::debug >= 5)
1408  ALIUtils::dumprm(theRmGlobOriginalOriginal, name() + ALIstring(" theRmGlobOriginalOriginal before displaced"));
1409  switch (coor) {
1410  case 0:
1411  theRmGlobOriginalOriginal.rotateX(disp);
1412  break;
1413  case 1:
1414  theRmGlobOriginalOriginal.rotateY(disp);
1415  break;
1416  case 2:
1417  theRmGlobOriginalOriginal.rotateZ(disp);
1418  break;
1419  default:
1420  std::cerr << "!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1421  exit(2);
1422  }
1423 
1424  //-------------------- Rotation translate the centre of component OptO
1425  if (ALIUtils::debug >= 98)
1426  ALIUtils::dump3v(centreGlob(), "angles rotate centre_glob");
1427  if (ALIUtils::debug >= 98)
1428  ALIUtils::dump3v(centreGlobOriginalOriginal(), " centreGlobOriginalOriginal");
1429  if (opto1stRotated != this) { //own _centre_glob doesn't rotate
1430  //---------- Distance to 1st rotated OptO
1431  CLHEP::Hep3Vector radiusOriginalOriginal =
1433  CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1434  switch (coor) {
1435  case 0:
1436  radius_rotated.rotateX(disp);
1437  break;
1438  case 1:
1439  radius_rotated.rotateY(disp);
1440  break;
1441  case 2:
1442  radius_rotated.rotateZ(disp);
1443  break;
1444  default:
1445  break; // already exited in previous switch
1446  }
1447  theCentreGlobOriginalOriginal = centreGlobOriginalOriginal() + (radius_rotated - radiusOriginalOriginal);
1448  if (ALIUtils::debug >= 98)
1449  ALIUtils::dump3v(centreGlob(), "angle rotate centre_glob");
1450  if (ALIUtils::debug >= 98)
1451  ALIUtils::dump3v(centreGlobOriginalOriginal(), " centre_globOriginalOriginal()");
1452  }
1453 
1454  if (ALIUtils::debug >= 5)
1455  ALIUtils::dumprm(theRmGlobOriginalOriginal, name() + ALIstring(" theRmGlobOriginalOriginal displaced "));
1456 
1457  //----------- Displace every OptO component
1458  std::vector<OpticalObject*> vopto;
1459  Model::getComponentOptOs(name(), vopto);
1460  std::vector<OpticalObject*>::const_iterator vocite;
1461  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1462  (*vocite)->displaceRmGlobOriginalOriginal(opto1stRotated, coor, disp);
1463  }
1464 
1465  } else {
1469  //----------- Displace every OptO component
1470  std::vector<OpticalObject*> vopto;
1471  Model::getComponentOptOs(name(), vopto);
1472  std::vector<OpticalObject*>::const_iterator vocite;
1473  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1474  (*vocite)->displaceRmGlobOriginalOriginal(opto1stRotated, coor, disp);
1475  }
1476  if (ALIUtils::debug >= 5) {
1477  ALIUtils::dump3v(theCentreGlob, " displaceRmGlobOriginalOriginal ");
1478  ALIUtils::dumprm(theRmGlob, " displaceRmGlobOriginalOriginal ");
1479  }
1480  }
1481 }

References centreGlob(), centreGlobOriginalOriginal(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), beamvalidation::exit(), Model::getComponentOptOs(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), name(), setGlobalCoordinates(), theCentreGlob, theCentreGlobOriginalOriginal, theRmGlob, and theRmGlobOriginalOriginal.

Referenced by EntryAngleAffAngles::displaceOriginalOriginal().

◆ eq2ang()

bool OpticalObject::eq2ang ( double  ang1,
double  ang2 
)

Definition at line 1807 of file OpticalObject.cc.

1807  {
1808  bool beq = true;
1809 
1810  double diff = diff2pi(ang1, ang2);
1811  if (diff > 0.00001) {
1812  if (fabs(diff - 2 * M_PI) > 0.00001) {
1813  //- std::cout << " diff " << diff << " " << ang1 << " " << ang2 << std::endl;
1814  beq = false;
1815  }
1816  }
1817 
1818  return beq;
1819 }

References change_name::diff, diff2pi(), and M_PI.

Referenced by checkMatrixEquations().

◆ ExtraEntryList()

const std::vector<Entry*>& OpticalObject::ExtraEntryList ( ) const
inline

◆ extraEntryNo()

const ALIint OpticalObject::extraEntryNo ( const ALIstring entry_name) const

Definition at line 1500 of file OpticalObject.cc.

1500  {
1501  //- std::cout << ExtraEntryList().size() << "entry name " << entry_name << std::endl;
1502 
1503  std::vector<Entry*>::const_iterator vecite;
1504  for (vecite = ExtraEntryList().begin(); vecite != ExtraEntryList().end(); ++vecite) {
1505  //- std::cout <<"in entryno" << (*vecite)->name() << entry_name << std::endl;
1506  if ((*vecite)->name() == entry_name) {
1507  return (vecite - ExtraEntryList().begin());
1508  }
1509  //- std::cout <<"DD in entryno" << (*vecite)->name() << entry_name << std::endl;
1510  }
1511  //- std::cout << "!!: extra entry name not found: " << entry_name << " in OptO " << name() << std::endl;
1512  // exit(2);
1513  return ALIint(-1);
1514 }

References ExtraEntryList().

Referenced by Entry::displace(), Entry::displaceOriginal(), Entry::displaceOriginalOriginal(), findExtraEntryValue(), findExtraEntryValueIfExists(), findExtraEntryValueMustExist(), and Entry::valueDisplaced().

◆ ExtraEntryValueList()

std::vector<ALIdouble>& OpticalObject::ExtraEntryValueList ( )
inline

◆ ExtraEntryValueOriginalList()

const std::vector<ALIdouble>& OpticalObject::ExtraEntryValueOriginalList ( )
inline

◆ ExtraEntryValueOriginalOriginalList()

const std::vector<ALIdouble>& OpticalObject::ExtraEntryValueOriginalOriginalList ( )
inline

Definition at line 70 of file OpticalObject.h.

70  {
72  }

References theExtraEntryValueOriginalOriginalVector.

◆ fastDeviatesLightRay()

void OpticalObject::fastDeviatesLightRay ( LightRay lightray)
virtual

Reimplemented in OptOMirror, OptOPlateSplitter, OptOCubeSplitter, OptOModifiedRhomboidPrism, and OptOOpticalSquare.

Definition at line 883 of file OpticalObject.cc.

883  {
884  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement deviation (:D)"
885  << std::endl;
886  std::cerr << " Please read documentation for this object type" << std::endl;
887  exit(1);
888 }

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

Referenced by participateInMeasurement().

◆ fastTraversesLightRay()

void OpticalObject::fastTraversesLightRay ( LightRay lightray)
virtual

Reimplemented in OptOMirror, OptOCOPS, OptOPlateSplitter, OptOSensor2D, OptOCubeSplitter, OptOModifiedRhomboidPrism, and OptOOpticalSquare.

Definition at line 893 of file OpticalObject.cc.

893  {
894  std::cerr << "!!! Optical Object " << name() << " of type " << type()
895  << " does not implement the light traversing (:T)" << std::endl;
896  std::cerr << " Please read documentation for this object type" << std::endl;
897  exit(1);
898 }

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

Referenced by participateInMeasurement().

◆ fillCoordinateEntry()

void OpticalObject::fillCoordinateEntry ( const ALIstring coor_name,
const std::vector< ALIstring > &  wordlist 
)
private

Definition at line 314 of file OpticalObject.cc.

314  {
315  //---------- Select which type of entry to create
316  Entry* entry = nullptr;
317  if (coor_type == ALIstring("centre")) {
318  entry = new EntryLengthAffCentre(coor_type);
319  } else if (coor_type == ALIstring("angles")) {
320  entry = new EntryAngleAffAngles(coor_type);
321  } else {
322  std::cerr << " !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type
323  << std::endl;
324  exit(1);
325  }
326 
327  //---------- Set link from entry to OptO it belongs to
328  entry->setOptOCurrent(this);
329  //----- Name is filled from here to include 'centre' or 'angles'
330  ALIstring name = coor_type + "_" + wordlist[0];
331  entry->fillName(name);
332  //---------- Fill entry with data read
333  entry->fill(wordlist);
334 
335  //---------- Add entry to lists
338 }

References addCoordinateEntryToList(), Model::addEntryToList(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mps_splice::entry, beamvalidation::exit(), and name().

Referenced by constructFromOptAligInfo(), copyData(), and readCoordinates().

◆ fillExtraEntry()

void OpticalObject::fillExtraEntry ( std::vector< ALIstring > &  wordlist)
protectedvirtual

Reimplemented in OptOSensor2D.

Definition at line 163 of file OpticalObject.cc.

163  {
164  //- if(ALIUtils::debug >= 5) std::cout << "fillExtraEntry wordlist0 " << wordlist[0].c_str() << std::endl;
165 
166  //---------- Check which type of entry to create
167  Entry* xentry;
168  if (wordlist[0] == ALIstring("length")) {
169  xentry = new EntryLength(wordlist[0]);
170  } else if (wordlist[0] == ALIstring("angle")) {
171  xentry = new EntryAngle(wordlist[0]);
172  } else if (wordlist[0] == ALIstring("nodim")) {
173  xentry = new EntryNoDim(wordlist[0]);
174  } else {
175  std::cerr << "!!ERROR: Exiting... unknown type of Extra Entry " << wordlist[0] << std::endl;
176  ALIUtils::dumpVS(wordlist, " Only 'length', 'angle' or 'nodim' are allowed ", std::cerr);
177  exit(2);
178  }
179 
180  if (ALIUtils::debug >= 99) {
181  ALIUtils::dumpVS(wordlist, "fillExtraEntry: ", std::cout);
182  }
183  //---------- Erase first word of line read (type of entry)
184  wordlist.erase(wordlist.begin());
185 
186  if (ALIUtils::debug >= 99) {
187  ALIUtils::dumpVS(wordlist, "fillExtraEntry: ", std::cout);
188  }
189 
190  //---------- Set link from entry to OptO it belongs to
191  xentry->setOptOCurrent(this);
192  //----- Name is filled from here to be consistent with fillCoordinate
193  xentry->fillName(wordlist[0]);
194  //---------- Fill entry with data in line read
195  xentry->fill(wordlist);
196 
197  //---------- Add entry to entry lists
198  Model::addEntryToList(xentry);
199  addExtraEntryToList(xentry);
200 
201  if (ALIUtils::debug >= 5)
202  std::cout << "fillExtraEntry: xentry_value" << xentry->value() << xentry->ValueDimensionFactor() << std::endl;
203 
204  //---------- Add entry value to list
205  addExtraEntryValueToList(xentry->value());
206 }

References Model::addEntryToList(), addExtraEntryToList(), addExtraEntryValueToList(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), beamvalidation::exit(), Entry::fill(), Entry::fillName(), Entry::setOptOCurrent(), Entry::value(), and Entry::ValueDimensionFactor().

Referenced by constructFromOptAligInfo(), copyData(), OptOSensor2D::fillExtraEntry(), and readExtraEntries().

◆ fillIguana()

virtual void OpticalObject::fillIguana ( )
inlinevirtual

Definition at line 55 of file OpticalObject.h.

55 {};

◆ fillVRML()

virtual void OpticalObject::fillVRML ( )
inlinevirtual

Definition at line 54 of file OpticalObject.h.

54 {};

◆ findExtraEntryValue()

const ALIdouble OpticalObject::findExtraEntryValue ( const ALIstring eename) const

Definition at line 1519 of file OpticalObject.cc.

1519  {
1520  ALIdouble retval;
1521  const ALIint entryNo = extraEntryNo(eename);
1522  if (entryNo >= 0) {
1523  const ALIdouble Pentry_value = *(theExtraEntryValueVector.begin() + entryNo);
1524  retval = (Pentry_value);
1525  } else {
1526  // if(ALIUtils::debug >= 0) std::cerr << "!!Warning: entry not found; " << eename << ", in object " << name() << " returns 0. " << std::endl;
1527  ALIdouble check;
1529  gomgr->getGlobalOptionValue("check_extra_entries", check);
1530  if (check == 1) {
1531  // if( check <= 1) {//exit temporarily
1532  std::cerr << "!!OpticalObject:ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1533  exit(1);
1534  } else {
1535  //- std::cerr << "!!temporal WARNING in OpticalObject::findExtraEntryValue: entry not found; " << eename << ", in object " << name() << std::endl;
1536  retval = 0.;
1537  }
1538  }
1539 
1540  if (ALIUtils::debug >= 5)
1541  std::cout << " OpticalObject::findExtraEntryValue: " << eename << " = " << retval << std::endl;
1542  return retval;
1543 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, RPCNoise_example::check, gather_cfg::cout, ALIUtils::debug, beamvalidation::exit(), extraEntryNo(), GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), name(), and theExtraEntryValueVector.

Referenced by OptOCubeSplitter::detailedDeviatesLightRay(), OptOCubeSplitter::detailedTraversesLightRay(), findExtraEntryValueIfExists(), findExtraEntryValueMustExist(), getPlate(), OptOCubeSplitter::getUpperPlate(), LightRay::shiftAndDeviateWhileTraversing(), and OptOUserDefined::userDefinedBehaviour().

◆ findExtraEntryValueIfExists()

const ALIbool OpticalObject::findExtraEntryValueIfExists ( const ALIstring eename,
ALIdouble value 
) const

Definition at line 1563 of file OpticalObject.cc.

1563  {
1564  value = findExtraEntryValue(eename);
1565  const ALIint entryNo = extraEntryNo(eename);
1566  //- std::cout << eename << " entryNo " << entryNo << " value " << value << std::endl;
1567  return (entryNo >= 0);
1568 }

References extraEntryNo(), and findExtraEntryValue().

Referenced by OptOCubeSplitter::getMiddlePlate(), and OptOCOPS::makeMeasurement().

◆ findExtraEntryValueMustExist()

const ALIdouble OpticalObject::findExtraEntryValueMustExist ( const ALIstring eename) const

Definition at line 1548 of file OpticalObject.cc.

1548  {
1550  const ALIint entryNo = extraEntryNo(eename);
1551  if (entryNo < 0) {
1552  std::cerr << "!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename << ", in object "
1553  << name() << std::endl;
1554  exit(1);
1555  }
1556  // if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValueMustExist: " << eename << " = " << entry << std::endl;
1557  return entry;
1558 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mps_splice::entry, beamvalidation::exit(), extraEntryNo(), findExtraEntryValue(), and name().

◆ getCmsswID()

const ALIuint OpticalObject::getCmsswID ( ) const
inline

◆ getCoordinateFromOptAlignParam()

std::vector< ALIstring > OpticalObject::getCoordinateFromOptAlignParam ( const OpticalAlignParam oaParam)

Definition at line 2064 of file OpticalObject.cc.

2064  {
2065  char chartmp[20];
2066  std::vector<ALIstring> wordlist;
2067  wordlist.push_back(oaParam.name());
2068  gcvt(oaParam.value(), 10, chartmp);
2069  wordlist.push_back(chartmp);
2070  gcvt(oaParam.sigma(), 10, chartmp);
2071  wordlist.push_back(chartmp);
2072  if (oaParam.quality() == 0) {
2073  wordlist.push_back("fix");
2074  } else if (oaParam.quality() == 1) {
2075  wordlist.push_back("cal");
2076  } else if (oaParam.quality() == 2) {
2077  wordlist.push_back("unk");
2078  }
2079 
2080  if (ALIUtils::debug >= 5) {
2081  ALIUtils::dumpVS(wordlist, " getCoordinateFromOptAlignParam " + oaParam.name());
2082  }
2083 
2084  return wordlist;
2085 }

References ALIUtils::debug, ALIUtils::dumpVS(), OpticalAlignParam::name(), OpticalAlignParam::quality(), OpticalAlignParam::sigma(), and OpticalAlignParam::value().

Referenced by constructFromOptAligInfo().

◆ getDisplacementInLocalCoordinates()

CLHEP::Hep3Vector OpticalObject::getDisplacementInLocalCoordinates ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1022 of file OpticalObject.cc.

1022  {
1023  CLHEP::Hep3Vector dispVec;
1024  switch (coor) {
1025  case 0:
1026  dispVec = CLHEP::Hep3Vector(disp, 0., 0.);
1027  break;
1028  case 1:
1029  dispVec = CLHEP::Hep3Vector(0., disp, 0.);
1030  break;
1031  case 2:
1032  dispVec = CLHEP::Hep3Vector(0., 0., disp);
1033  break;
1034  default:
1035  std::cerr << "!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1036  exit(2);
1037  }
1038 
1039  return dispVec;
1040 }

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

◆ getDispVec()

CLHEP::Hep3Vector OpticalObject::getDispVec ( const XYZcoor  coor,
const ALIdouble  disp 
)
private

Definition at line 1909 of file OpticalObject.cc.

1909  {
1910  CLHEP::Hep3Vector dispVec;
1911  switch (coor) {
1912  case 0:
1913  dispVec = CLHEP::Hep3Vector(disp, 0., 0.);
1914  break;
1915  case 1:
1916  dispVec = CLHEP::Hep3Vector(0., disp, 0.);
1917  break;
1918  case 2:
1919  dispVec = CLHEP::Hep3Vector(0., 0., disp);
1920  break;
1921  default:
1922  break; // already exited in previous switch
1923  }
1924  //- CLHEP::Hep3Vector dispVec = getDisplacementInLocalCoordinates( coor, disp);
1925  if (ALIUtils::debug >= 5) {
1926  ALIUtils::dump3v(dispVec, " dispVec in local ");
1927  CLHEP::HepRotation rmt = parent()->rmGlob();
1928  ALIUtils::dumprm(rmt, "parent rmGlob ");
1929  }
1930  dispVec = parent()->rmGlob() * dispVec;
1931  if (ALIUtils::debug >= 5)
1932  ALIUtils::dump3v(dispVec, " dispVec in global ");
1933 
1934  return dispVec;
1935 }

References ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), parent(), and rmGlob().

Referenced by displaceCentreGlob(), displaceCentreGlobOriginal(), and displaceCentreGlobOriginalOriginal().

◆ getEntryCentre() [1/2]

const double OpticalObject::getEntryCentre ( const ALIstring coor) const

Definition at line 1962 of file OpticalObject.cc.

1962  {
1963  XYZcoor coor = XCoor;
1964  if (coorstr == "X") {
1965  coor = XCoor;
1966  } else if (coorstr == "Y") {
1967  coor = YCoor;
1968  } else if (coorstr == "Z") {
1969  coor = ZCoor;
1970  }
1971  Entry* ce = theCoordinateEntryVector[coor];
1972  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
1973  return ce->value() + ce->valueDisplacementByFitting();
1974 }

References theCoordinateEntryVector, Entry::value(), Entry::valueDisplacementByFitting(), XCoor, YCoor, and ZCoor.

◆ getEntryCentre() [2/2]

const double OpticalObject::getEntryCentre ( const XYZcoor  coor) const

Definition at line 1955 of file OpticalObject.cc.

1955  {
1956  Entry* ce = theCoordinateEntryVector[coor];
1957  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
1958  return ce->value() + ce->valueDisplacementByFitting();
1959 }

References theCoordinateEntryVector, Entry::value(), and Entry::valueDisplacementByFitting().

Referenced by SetCentreLocalFromEntryValues().

◆ getEntryRMangle() [1/2]

const double OpticalObject::getEntryRMangle ( const ALIstring coor) const

Definition at line 1985 of file OpticalObject.cc.

1985  {
1986  XYZcoor coor = XCoor;
1987  if (coorstr == "X") {
1988  coor = XCoor;
1989  } else if (coorstr == "Y") {
1990  coor = YCoor;
1991  } else if (coorstr == "Z") {
1992  coor = ZCoor;
1993  }
1994  Entry* ce = theCoordinateEntryVector[coor + 3];
1995  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
1996 
1997  return ce->value() + ce->valueDisplacementByFitting();
1998 }

References theCoordinateEntryVector, Entry::value(), Entry::valueDisplacementByFitting(), XCoor, YCoor, and ZCoor.

◆ getEntryRMangle() [2/2]

const double OpticalObject::getEntryRMangle ( const XYZcoor  coor) const

Definition at line 1977 of file OpticalObject.cc.

1977  {
1978  Entry* ce = theCoordinateEntryVector[coor + 3];
1979  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
1980 
1981  return ce->value() + ce->valueDisplacementByFitting();
1982 }

References theCoordinateEntryVector, Entry::value(), and Entry::valueDisplacementByFitting().

Referenced by buildRmFromEntryValuesOriginalOriginal(), displaceRmGlobAroundLocal(), FittedEntriesReader::readFittedEntriesFromFile(), SetRMGlobFromRMLocal(), and SetRMLocalFromEntryValues().

◆ getLocalRotationAngles()

std::vector< double > OpticalObject::getLocalRotationAngles ( const std::vector< Entry * > &  entries) const

Definition at line 1679 of file OpticalObject.cc.

1679  {
1680  return getRotationAnglesInOptOFrame(theParent, entries);
1681 }

References getRotationAnglesInOptOFrame(), and theParent.

Referenced by CocoaDBMgr::GetOptAlignInfoFromOptO().

◆ getMaterial()

CocoaMaterialElementary* OpticalObject::getMaterial ( ) const
inline

Definition at line 217 of file OpticalObject.h.

217 { return theMaterial; }

References theMaterial.

Referenced by CocoaToDDLMgr::lv().

◆ getPlate()

ALIPlane OpticalObject::getPlate ( const ALIbool  forwardPlate,
const ALIbool  applyWedge 
)

Definition at line 946 of file OpticalObject.cc.

946  {
947  if (ALIUtils::debug >= 4)
948  std::cout << "% LR: GET PLATE " << name() << " forward= " << forwardPlate << std::endl;
949  //---------- Get OptO variables
950  const ALIdouble width = (findExtraEntryValue("width"));
951 
952  //---------- Get centre and normal of plate
953  //----- Get plate normal before wedge (Z axis of OptO)
954  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
955  CLHEP::HepRotation rmt = rmGlob();
956  CLHEP::Hep3Vector plate_normal = rmt * ZAxis;
957 
958  //----- plate centre = OptO centre +/- 1/2 width before wedge
959  CLHEP::Hep3Vector plate_point = centreGlob();
960  //--- Add to it half of the width following the direction of the plate normal. -1/2 if it is forward plate, +1/2 if it is backward plate
961  ALIdouble normal_sign = -forwardPlate * 2 + 1;
962  plate_point += normal_sign * width / 2. * plate_normal;
963  //- if (ALIUtils::debug >= 4) std::cout << "width = " << width <<std::endl;
964  if (ALIUtils::debug >= 3) {
965  ALIUtils::dump3v(plate_point, "plate_point");
966  ALIUtils::dump3v(plate_normal, "plate_normal before wedge");
967  ALIUtils::dumprm(rmt, "rmt before wedge");
968  }
969 
970  if (applyWedge) {
971  ALIdouble wedge;
972  wedge = findExtraEntryValue("wedge");
973  if (wedge != 0.) {
974  //---------- Rotate plate normal by 1/2 wedge angles
975  CLHEP::Hep3Vector XAxis(1., 0., 0.);
976  XAxis = rmt * XAxis;
977  plate_normal.rotate(normal_sign * wedge / 2., XAxis);
978  if (ALIUtils::debug >= 3)
979  ALIUtils::dump3v(plate_normal, "plate_normal after wedgeX ");
980  if (ALIUtils::debug >= 4)
981  ALIUtils::dump3v(XAxis, "X Axis for applying wedge ");
982  CLHEP::Hep3Vector YAxis(0., 1., 0.);
983  YAxis = rmt * YAxis;
984  plate_normal.rotate(normal_sign * wedge / 2., YAxis);
985  if (ALIUtils::debug >= 3)
986  ALIUtils::dump3v(plate_normal, "plate_normal after wedgeY ");
987  if (ALIUtils::debug >= 4)
988  ALIUtils::dump3v(YAxis, "Y Axis for applying wedge ");
989  }
990  }
991 
992  //---------- Return plate plane
993  return ALIPlane(plate_point, plate_normal);
994 }

References centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), findExtraEntryValue(), name(), rmGlob(), and ApeEstimator_cff::width.

Referenced by OptOCubeSplitter::detailedDeviatesLightRay(), OptOCubeSplitter::detailedTraversesLightRay(), OptOCubeSplitter::fastTraversesLightRay(), and OptOUserDefined::userDefinedBehaviour().

◆ getRotationAnglesFromMatrix()

std::vector< double > OpticalObject::getRotationAnglesFromMatrix ( CLHEP::HepRotation &  rmLocal,
const std::vector< Entry * > &  entries 
) const

Definition at line 1710 of file OpticalObject.cc.

1711  {
1712  std::vector<double> newang(3);
1713  double angleX = entries[3]->value() + entries[3]->valueDisplacementByFitting();
1714  double angleY = entries[4]->value() + entries[4]->valueDisplacementByFitting();
1715  double angleZ = entries[5]->value() + entries[5]->valueDisplacementByFitting();
1716  if (ALIUtils::debug >= 5) {
1717  std::cout << " angles as value entries: X= " << angleX << " Y= " << angleY << " Z " << angleZ << std::endl;
1718  }
1719  return ALIUtils::getRotationAnglesFromMatrix(rmLocal, angleX, angleY, angleZ);
1720 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::getRotationAnglesFromMatrix(), and rmLocal().

Referenced by getRotationAnglesInOptOFrame(), and EntryAngleAffAngles::valueDisplaced().

◆ getRotationAnglesInOptOFrame()

std::vector< double > OpticalObject::getRotationAnglesInOptOFrame ( const OpticalObject optoAncestor,
const std::vector< Entry * > &  entries 
) const

Definition at line 1684 of file OpticalObject.cc.

1685  {
1686  const CLHEP::HepRotation& rmParent = optoAncestor->rmGlob(); //ORIGINAL ?????????????????
1687  CLHEP::HepRotation rmLocal = rmParent.inverse() * theRmGlob;
1688 
1689  //I was using theRmGlobOriginal, assuming it has been set to theRmGlob already, check it, in case it may have other consequences
1690  if (theRmGlobOriginal != theRmGlob) {
1691  std::cerr << " !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob "
1692  << std::endl;
1693  ALIUtils::dumprm(theRmGlobOriginal, " theRmGlobOriginal ");
1694  ALIUtils::dumprm(theRmGlob, " theRmGlob ");
1695  exit(1);
1696  }
1697 
1698  if (ALIUtils::debug >= 5) {
1699  std::cout << " OpticalObject::getRotationAnglesInOptOFrame " << name() << " optoAncestor " << optoAncestor->name()
1700  << std::endl;
1701  ALIUtils::dumprm(rmParent, " rm parent ");
1702  ALIUtils::dumprm(rmLocal, " rm local ");
1703  ALIUtils::dumprm(theRmGlobOriginal, " theRmGlobOriginal ");
1704  ALIUtils::dumprm(theRmGlob, " theRmGlob ");
1705  }
1706  return getRotationAnglesFromMatrix(rmLocal, entries);
1707 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), beamvalidation::exit(), getRotationAnglesFromMatrix(), name(), rmGlob(), rmLocal(), theRmGlob, and theRmGlobOriginal.

Referenced by getLocalRotationAngles(), and Fit::printRotationAnglesInOptOFrame().

◆ getSolidShape()

CocoaSolidShape* OpticalObject::getSolidShape ( ) const
inline

Definition at line 218 of file OpticalObject.h.

218 { return theSolidShape; }

References theSolidShape.

◆ getZAxis()

CLHEP::Hep3Vector OpticalObject::getZAxis ( )
inline

Definition at line 143 of file OpticalObject.h.

143  {
144  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
145  CLHEP::HepRotation rmt = rmGlob();
146  ZAxis = rmt * ZAxis;
147  return ZAxis;
148  }

References rmGlob().

◆ ID()

const ALIuint OpticalObject::ID ( ) const
inline

Definition at line 96 of file OpticalObject.h.

96 { return theCmsswID; }

References theCmsswID.

◆ longName()

const ALIstring OpticalObject::longName ( ) const
inline

◆ makeMeasurement()

void OpticalObject::makeMeasurement ( LightRay lightray,
Measurement meas 
)
virtual

Reimplemented in OptOCOPS, OptODistancemeter, OptODistancemeter3dim, OptOSensor2D, and OptOTiltmeter.

Definition at line 923 of file OpticalObject.cc.

923  {
924  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement making measurement (:M)"
925  << std::endl;
926  std::cerr << " Please read documentation for this object type" << std::endl;
927  exit(1);
928 }

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

Referenced by participateInMeasurement().

◆ meas()

Measurement* OpticalObject::meas ( )
inline

◆ name()

const ALIstring& OpticalObject::name ( ) const
inline

Definition at line 58 of file OpticalObject.h.

58 { return theName; };

References theName.

Referenced by config.CFG::__str__(), Measurement::addAffectingEntriesFromOptO(), Entry::addFittedDisplacementToValue(), Measurement::buildOptOList(), buildRmFromEntryValuesOriginalOriginal(), calculateLocalRotationAxisInGlobal(), construct(), copyData(), createComponentOptOs(), createNewOptO(), OptOPinhole::defaultBehaviour(), defaultBehaviour(), Model::deleteOptO(), OptOCubeSplitter::detailedDeviatesLightRay(), detailedDeviatesLightRay(), OptOCubeSplitter::detailedTraversesLightRay(), detailedTraversesLightRay(), validation.Sample::digest(), displaceCentreGlob(), displaceCentreGlobOriginal(), displaceCentreGlobOriginalOriginal(), displaceRmGlobAroundGlobal(), displaceRmGlobAroundLocal(), displaceRmGlobOriginal(), displaceRmGlobOriginalOriginal(), OptOCubeSplitter::fastDeviatesLightRay(), fastDeviatesLightRay(), OptOCubeSplitter::fastTraversesLightRay(), fastTraversesLightRay(), fillCoordinateEntry(), Model::fillCopyComponentList(), Entry::fillFromInputFileQuality(), Entry::fillFromReportOutFileValue(), findExtraEntryValue(), findExtraEntryValueMustExist(), CocoaDBMgr::GetAlignInfoErrorFromOptO(), CocoaDBMgr::GetAlignInfoFromOptO(), Model::getComponentOptOs(), OptOCubeSplitter::getMiddlePlate(), CocoaDBMgr::GetOptAlignInfoFromOptO(), getPlate(), Measurement::getPreviousOptO(), getRotationAnglesInOptOFrame(), OptOCubeSplitter::getUpperPlate(), VIDSelectorBase.VIDSelectorBase::initialize(), LightRay::LightRay(), Entry::longName(), longName(), CocoaToDDLMgr::lv(), OptODistancemeter3dim::makeMeasurement(), OptODistancemeter::makeMeasurement(), makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), Fit::printCentreInOptOFrame(), propagateGlobalRMOriginalOriginalChangeToChildren(), CocoaToDDLMgr::pv(), resetGlobalCoordinates(), resetOriginalOriginalCoordinates(), setAnglesNull(), SetCentreGlobFromCentreLocal(), setGlobalCoordinatesOfComponents(), setGlobalRMOriginalOriginal(), FittedEntriesSet::SetOptOEntries(), SetRMGlobFromRMLocal(), shortName(), CocoaToDDLMgr::specPar(), LightRay::startLightRay(), transformCylindrical2Cartesian(), OptOUserDefined::userDefinedBehaviour(), userDefinedBehaviour(), EntryAngleAffAngles::valueDisplaced(), EntryLengthAffCentre::valueDisplaced(), and Entry::valueDisplaced().

◆ parent()

const OpticalObject* OpticalObject::parent ( ) const
inline

◆ participateInMeasurement()

void OpticalObject::participateInMeasurement ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
virtual

Reimplemented in OptOCameraDetector, OptOLens, and OptORisleyPrism.

Definition at line 850 of file OpticalObject.cc.

850  {
851  //---------- see if light traverses or reflects
852  setMeas(&meas);
853  if (behav == " ") {
854  defaultBehaviour(lightray, meas);
855  } else if (behav == "D" || behav == "DD") {
856  detailedDeviatesLightRay(lightray);
857  } else if (behav == "T" || behav == "DT") {
858  detailedTraversesLightRay(lightray);
859  } else if (behav == "FD") {
860  fastDeviatesLightRay(lightray);
861  } else if (behav == "FT") {
862  fastTraversesLightRay(lightray);
863  } else if (behav == "M") {
864  makeMeasurement(lightray, meas);
865  } else {
866  userDefinedBehaviour(lightray, meas, behav);
867  }
868 }

References defaultBehaviour(), detailedDeviatesLightRay(), detailedTraversesLightRay(), fastDeviatesLightRay(), fastTraversesLightRay(), makeMeasurement(), meas(), setMeas(), and userDefinedBehaviour().

◆ propagateGlobalRMOriginalOriginalChangeToChildren()

void OpticalObject::propagateGlobalRMOriginalOriginalChangeToChildren ( const CLHEP::HepRotation &  rmorioriold,
const CLHEP::HepRotation &  rmoriorinew 
)

Definition at line 652 of file OpticalObject.cc.

653  {
654  std::cout << " propagateGlobalRMOriginalOriginalChangeToChildren OptO " << name() << std::endl;
655  ALIUtils::dumprm(rmGlobOriginalOriginal(), " setGlobalRMOriginalOriginal old ");
656  theRmGlobOriginalOriginal = rmoriorinew.inverse() * theRmGlobOriginalOriginal;
658  ALIUtils::dumprm(rmGlobOriginalOriginal(), " setGlobalRMOriginalOriginal new ");
659 
660  //----------- Reset RMGlobOriginalOriginal() of every component
661  std::vector<OpticalObject*> vopto;
662  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
663  if (!igetood) {
664  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
665  return;
666  }
667  std::vector<OpticalObject*>::const_iterator vocite;
668  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
669  // CLHEP::HepRotation rmoriorid = buildRmFromEntryValues();
670  (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren(rmorioriold, rmoriorinew);
671  }
672 }

References gather_cfg::cout, ALIUtils::dumprm(), Model::getComponentOptOs(), name(), rmGlobOriginalOriginal(), and theRmGlobOriginalOriginal.

◆ readCoordinates()

void OpticalObject::readCoordinates ( const ALIstring coor_type_read,
const ALIstring coor_type_expected,
ALIFileIn filein 
)
private

Definition at line 212 of file OpticalObject.cc.

214  {
215  ALIstring coor_type_reads = coor_type_read.substr(0, 6);
216  if (coor_type_reads == "center")
217  coor_type_reads = "centre";
218  //---------- if after the first six letters ther is a 'G', it means they are global coordinates
219  //----- If data is read from a 'report.out', it is always local and this is not needed
220 
221  //TODO: check that if only one entry of the three is read from 'report.out', the input file does not give global coordinates (it would cause havoc)
222  if (EntryMgr::getInstance()->findEntryByLongName(longName(), "") == nullptr) {
223  if (coor_type_read.size() == 7) {
224  if (coor_type_read[6] == 'G') {
225  if (ALIUtils::debug >= 5)
226  std::cout << " coordinate global " << coor_type_read << std::endl;
227  if (coor_type_expected == "centre") {
228  centreIsGlobal = true;
229  } else if (coor_type_expected == "angles") {
230  anglesIsGlobal = true;
231  }
232  }
233  }
234  }
235 
236  std::vector<ALIstring> wordlist;
237  //---------- Read 4 lines: first is entry type, rest are three coordinates (each one will be an individual entry)
238  ALIstring coor_names[3]; // to check if using cartesian, cylindrical or spherical coordinates
239 
240  for (int ii = 0; ii < 4; ii++) {
241  if (ii == 0) {
242  //---------- Check that first line is of expected type
243  if (coor_type_reads != coor_type_expected) {
244  filein.ErrorInLine();
245  std::cerr << "readCoordinates: " << coor_type_expected << " should be read here, instead of " << coor_type_reads
246  << std::endl;
247  exit(1);
248  }
249  } else {
250  //----------- Fill entry Data
251  filein.getWordsInLine(wordlist);
252  coor_names[ii - 1] = wordlist[0];
253  fillCoordinateEntry(coor_type_expected, wordlist);
254  }
255  }
256 
257  //---- Transform coordinate system if cylindrical or spherical
258  if (coor_names[0] == ALIstring("X") && coor_names[1] == ALIstring("Y") && coor_names[2] == ALIstring("Z")) {
259  //do nothing
260  } else if (coor_names[0] == ALIstring("R") && coor_names[1] == ALIstring("PHI") && coor_names[2] == ALIstring("Z")) {
262  } else if (coor_names[0] == ALIstring("R") && coor_names[1] == ALIstring("THE") &&
263  coor_names[2] == ALIstring("PHI")) {
265  } else {
266  std::cerr << "!!!EXITING: coordinates have to be cartesian (X ,Y ,Z), or cylindrical (R, PHI, Z) or spherical (R, "
267  "THE, PHI) "
268  << std::endl
269  << " they are " << coor_names[0] << ", " << coor_names[1] << ", " << coor_names[2] << "." << std::endl;
270  exit(1);
271  }
272 }

References anglesIsGlobal, centreIsGlobal, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIFileIn::ErrorInLine(), beamvalidation::exit(), fillCoordinateEntry(), EntryMgr::getInstance(), ALIFileIn::getWordsInLine(), cuy::ii, longName(), transformCylindrical2Cartesian(), and transformSpherical2Cartesian().

Referenced by readData().

◆ readData()

void OpticalObject::readData ( ALIFileIn filein)
private

Definition at line 118 of file OpticalObject.cc.

118  {
119  //---------- See if there are extra entries and read them
120  std::vector<ALIstring> wordlist;
121  filein.getWordsInLine(wordlist);
122  if (wordlist[0] == ALIstring("ENTRY")) {
123  //---------- Read extra entries from file
124  readExtraEntries(filein);
125  filein.getWordsInLine(wordlist);
126  }
127 
128  //--------- set centre and angles not global (default behaviour)
129  centreIsGlobal = false;
130  anglesIsGlobal = false;
131 
132  //--------- readCoordinates
133  if (type() == ALIstring("source") || type() == ALIstring("pinhole")) {
134  readCoordinates(wordlist[0], "centre", filein);
135  setAnglesNull();
136  } else {
137  //---------- Read centre and angles
138  readCoordinates(wordlist[0], "centre", filein);
139  filein.getWordsInLine(wordlist);
140  readCoordinates(wordlist[0], "angles", filein);
141  }
142 }

References anglesIsGlobal, centreIsGlobal, ALIFileIn::getWordsInLine(), readCoordinates(), readExtraEntries(), setAnglesNull(), and type().

Referenced by construct().

◆ readExtraEntries()

void OpticalObject::readExtraEntries ( ALIFileIn filein)
private

Definition at line 147 of file OpticalObject.cc.

147  {
148  //---------- Loop extra entries until a '}'-line is found
149  std::vector<ALIstring> wordlist;
150  for (;;) {
151  filein.getWordsInLine(wordlist);
152  if (wordlist[0] != ALIstring("}")) {
153  fillExtraEntry(wordlist);
154  } else {
155  break;
156  }
157  }
158 }

References fillExtraEntry(), and ALIFileIn::getWordsInLine().

Referenced by readData().

◆ resetGlobalCoordinates()

void OpticalObject::resetGlobalCoordinates ( )

Definition at line 1573 of file OpticalObject.cc.

1573  {
1574  //---------- Reset centre and rm
1577 
1578  //---------- Reset extra entries
1579  //---------- Set extra entry values list
1580  std::vector<ALIdouble>::iterator vdite;
1581  std::vector<ALIdouble>::const_iterator vdcite_o = ExtraEntryValueOriginalList().begin();
1582  for (vdite = ExtraEntryValueList().begin(); vdite != ExtraEntryValueList().end(); ++vdite, ++vdcite_o) {
1583  (*vdite) = (*vdcite_o);
1584  }
1585 
1586  //----------- Reset entries of every component
1587  std::vector<OpticalObject*> vopto;
1588  Model::getComponentOptOs(name(), vopto);
1589  std::vector<OpticalObject*>::const_iterator vocite;
1590  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1591  (*vocite)->resetGlobalCoordinates();
1592  }
1593 
1595 }

References calculateLocalRotationAxisInGlobal(), centreGlobOriginal(), ExtraEntryValueList(), ExtraEntryValueOriginalList(), Model::getComponentOptOs(), name(), rmGlobOriginal(), theCentreGlob, and theRmGlob.

Referenced by Entry::addFittedDisplacementToValue().

◆ resetOriginalOriginalCoordinates()

void OpticalObject::resetOriginalOriginalCoordinates ( )

Definition at line 1600 of file OpticalObject.cc.

1600  {
1601  // std::cout << " !!! CALLING resetOriginalOriginalCoordinates(). STOP " << std::endl;
1602 
1603  //---------- Reset centre and rm
1608 
1609  //---------- Reset extra entry values list
1610  std::vector<ALIdouble>::iterator vdite;
1611  std::vector<ALIdouble>::iterator vdite_o = theExtraEntryValueOriginalVector.begin();
1612  std::vector<ALIdouble>::const_iterator vdcite_oo = theExtraEntryValueOriginalOriginalVector.begin();
1613  std::vector<Entry*>::const_iterator vdciteE = ExtraEntryList().begin();
1614  for (vdite = ExtraEntryValueList().begin(); vdite != ExtraEntryValueList().end();
1615  ++vdite, ++vdite_o, ++vdcite_oo, ++vdciteE) {
1616  (*vdite) = (*vdcite_oo);
1617  (*vdite_o) = (*vdcite_oo);
1618  (*vdciteE)->addFittedDisplacementToValue(-(*vdciteE)->valueDisplacementByFitting());
1619  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdcite_oo) << std::endl;
1620  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdciteE)->value() << std::endl;
1621  // std::cout << " check extra entry " << (*vdciteE)->value() << " =? " << (*vdite) << std::endl;
1622  }
1623 
1624  /* std::vector< Entry* >::iterator eite;
1625  for( eite = theCoordinateEntryVector.begin(); eite != theCoordinateEntryVector.end(); eite++ ){
1626  (*eite)->addFittedDisplacementToValue( - (*eite)->valueDisplacementByFitting() );
1627  }
1628  */
1629 
1631 
1632  //----------- Reset entries of every component
1633  std::vector<OpticalObject*> vopto;
1634  Model::getComponentOptOs(name(), vopto);
1635  std::vector<OpticalObject*>::const_iterator vocite;
1636  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1637  (*vocite)->resetOriginalOriginalCoordinates();
1638  }
1639 }

References calculateLocalRotationAxisInGlobal(), ExtraEntryList(), ExtraEntryValueList(), Model::getComponentOptOs(), name(), theCentreGlob, theCentreGlobOriginal, theCentreGlobOriginalOriginal, theExtraEntryValueOriginalOriginalVector, theExtraEntryValueOriginalVector, theRmGlob, theRmGlobOriginal, and theRmGlobOriginalOriginal.

◆ rmGlob()

const CLHEP::HepRotation& OpticalObject::rmGlob ( ) const
inline

◆ rmGlobOriginal()

const CLHEP::HepRotation& OpticalObject::rmGlobOriginal ( ) const
inline

◆ rmGlobOriginalOriginal()

const CLHEP::HepRotation& OpticalObject::rmGlobOriginalOriginal ( ) const
inline

◆ rmLocal()

const CLHEP::HepRotation OpticalObject::rmLocal ( ) const

Definition at line 1669 of file OpticalObject.cc.

1669  {
1670  CLHEP::HepRotation rm;
1671  rm.rotateX(theCoordinateEntryVector[3]->value());
1672  rm.rotateY(theCoordinateEntryVector[4]->value());
1673  rm.rotateZ(theCoordinateEntryVector[5]->value());
1674 
1675  return rm;
1676 }

References submit::rm, theCoordinateEntryVector, and relativeConstraints::value.

Referenced by CocoaToDDLMgr::buildRotationNumber(), getRotationAnglesFromMatrix(), and getRotationAnglesInOptOFrame().

◆ rotateItAroundGlobal()

template<class T >
void OpticalObject::rotateItAroundGlobal ( T object,
const XYZcoor  coor,
const double  disp 
)
private

Definition at line 1739 of file OpticalObject.cc.

1739  {
1740  switch (coor) {
1741  case 0:
1742  object.rotateX(disp);
1743  break;
1744  case 1:
1745  object.rotateY(disp);
1746  break;
1747  case 2:
1748  object.rotateZ(disp);
1749  break;
1750  }
1751  // CLHEP::Hep3Vector axisToRotate = GetAxisForDisplacement( coor );
1752  // object.rotate(disp, axisToRotate);
1753  if (ALIUtils::debug >= 5)
1754  std::cout << " rotateItAroundGlobal coor " << coor << " disp " << disp << std::endl;
1755 }

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

Referenced by displaceRmGlobAroundGlobal().

◆ SetAnglesIsGlobal()

void OpticalObject::SetAnglesIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 273 of file OpticalObject.h.

273 { anglesIsGlobal = isG; }

References anglesIsGlobal.

◆ setAnglesNull()

void OpticalObject::setAnglesNull ( )
private

Definition at line 343 of file OpticalObject.cc.

343  {
345  //---------- three names will be X, Y and Z
346  ALIstring coor("XYZ");
347 
348  //---------- Fill the three entries
349  for (int ii = 0; ii < 3; ii++) {
350  entry = new EntryAngleAffAngles("angles");
351 
352  //---------- Set link from entry to OptO it belongs to
353  entry->setOptOCurrent(this);
354  //----- Name is filled from here to be consistent with fillCoordinate
355  ALIstring name = "angles_" + coor.substr(ii, 1);
356  entry->fillName(name);
357  //---------- Set entry data to zero
358  entry->fillNull();
359 
360  // entry.fillNull( tt );
361 
362  //---------- Add entry to lists
365  }
366 }

References addCoordinateEntryToList(), Model::addEntryToList(), mps_splice::entry, cuy::ii, and name().

Referenced by readData().

◆ SetCentreGlobFromCentreLocal()

void OpticalObject::SetCentreGlobFromCentreLocal ( )
private

Definition at line 749 of file OpticalObject.cc.

749  {
750  //----------- Get global centre: parent centre plus local centre traslated to parent coordinate system
751  CLHEP::Hep3Vector cLocal = theCentreGlob;
753 
754  if (ALIUtils::debug >= 5)
755  ALIUtils::dump3v(theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE in parent local frame ");
757 
758  if (ALIUtils::debug >= 5)
759  ALIUtils::dump3v(theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE GLOBAL ");
760  if (ALIUtils::debug >= 5) {
761  ALIUtils::dump3v(parent()->centreGlob(), " parent centreGlob" + parent()->name());
762  ALIUtils::dumprm(parent()->rmGlob(), " parent rmGlob ");
763  }
764 
765  /* CLHEP::Hep3Vector cLocal2 = theCentreGlob - parent()->centreGlob();
766  CLHEP::HepRotation rmParentInv = inverseOf( parent()->rmGlob() );
767  cLocal2 = rmParentInv * cLocal2;
768  if( (cLocal2 - cLocal).mag() > 1.E-9 ) {
769  std::cerr << "!!!! CALCULATE LOCAL WRONG. Diff= " << (cLocal2 - cLocal).mag() << " " << cLocal2 << " " << cLocal << std::endl;
770  if( (cLocal2 - cLocal).mag() > 1.E-4 ) {
771  std::exception();
772  }
773  }*/
774 }

References centreGlob(), ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), name(), parent(), rmGlob(), and theCentreGlob.

Referenced by setGlobalCentre().

◆ SetCentreIsGlobal()

void OpticalObject::SetCentreIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 272 of file OpticalObject.h.

272 { centreIsGlobal = isG; }

References centreIsGlobal.

◆ SetCentreLocalFromEntryValues()

void OpticalObject::SetCentreLocalFromEntryValues ( )
private

Definition at line 700 of file OpticalObject.cc.

700  {
701  // std::vector<Entry*>::const_iterator vecite = CoordinateEntryList().begin();
702  //- std::cout << "PARENTSYSTEM" << name() << parent() <<"ZZ"<<vecite<< std::endl;
703  // std::cout << " OpticalObject::setGlobalCoordinates " << this->name() << std::endl;
704  //- std::cout << veite << "WW" << *vecite << std::endl;
705  //---------------------------------------- Set global centre
706  //----------------------------------- Get local centre from Entries
710  if (ALIUtils::debug >= 4)
711  ALIUtils::dump3v(centreGlob(), "SetCentreLocalFromEntryValues: CENTRE LOCAL ");
712 }

References centreGlob(), ALIUtils::debug, ALIUtils::dump3v(), getEntryCentre(), theCentreGlob, XCoor, YCoor, and ZCoor.

Referenced by setGlobalCentre().

◆ setCmsswID()

void OpticalObject::setCmsswID ( ALIuint  id)
inline

Definition at line 98 of file OpticalObject.h.

98 { theCmsswID = id; }

References triggerObjects_cff::id, and theCmsswID.

Referenced by constructFromOptAligInfo().

◆ setExtraEntryValue()

void OpticalObject::setExtraEntryValue ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1077 of file OpticalObject.cc.

1077  {
1078  theExtraEntryValueVector[entryNo] = val;
1079 }

References theExtraEntryValueVector, and heppy_batch::val.

◆ setGlobalCentre()

void OpticalObject::setGlobalCentre ( )
private

Definition at line 593 of file OpticalObject.cc.

593  {
595  if (type() != ALIstring("system") && !centreIsGlobal) {
597  }
598  if (anglesIsGlobal) {
599  std::cerr << "!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
600  abort();
601  }
602 }

References anglesIsGlobal, centreIsGlobal, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, SetCentreGlobFromCentreLocal(), SetCentreLocalFromEntryValues(), and type().

Referenced by displaceRmGlobAroundLocal(), and setGlobalCoordinates().

◆ setGlobalCoordinates()

void OpticalObject::setGlobalCoordinates ( )

◆ setGlobalCoordinatesOfComponents()

void OpticalObject::setGlobalCoordinatesOfComponents ( )
private

Definition at line 1304 of file OpticalObject.cc.

1304  {
1305  // Calculate the displaced centreGlob and rmGlob of components
1306  std::vector<OpticalObject*> vopto;
1307  Model::getComponentOptOs(name(), vopto);
1308  std::vector<OpticalObject*>::const_iterator vocite;
1309  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1310  (*vocite)->setGlobalCoordinates();
1311  }
1312 }

References Model::getComponentOptOs(), and name().

◆ setGlobalRM()

void OpticalObject::setGlobalRM ( )
private

Definition at line 605 of file OpticalObject.cc.

605  {
607  if (!anglesIsGlobal) {
609  }
610 
611  // Calculate local rot axis with new rm glob
613 }

References anglesIsGlobal, calculateLocalRotationAxisInGlobal(), SetRMGlobFromRMLocal(), and SetRMLocalFromEntryValues().

Referenced by setGlobalCoordinates().

◆ setGlobalRMOriginalOriginal()

void OpticalObject::setGlobalRMOriginalOriginal ( const CLHEP::HepRotation &  rmoriori)

Definition at line 616 of file OpticalObject.cc.

616  {
617  CLHEP::HepRotation rmorioriold = rmGlobOriginalOriginal();
618  if (ALIUtils::debug >= 5) {
619  std::cout << " setGlobalRMOriginalOriginal OptO " << name() << std::endl;
620  ALIUtils::dumprm(rmorioriLocal, " setGlobalRMOriginalOriginal new local");
621  ALIUtils::dumprm(rmGlobOriginalOriginal(), " setGlobalRMOriginalOriginal old ");
622  }
623 
625 
626  /* //---- multiplyt it by parent rmGlobOriginalOriginal
627  if( parent()->type() != ALIstring("system") ) {
628  theRmGlobOriginalOriginal = parent()->rmGlobOriginalOriginal() * theRmGlobOriginalOriginal;
629  }*/
630 
631  if (ALIUtils::debug >= 5) {
632  ALIUtils::dumprm(parent()->rmGlobOriginalOriginal(), " parent rmoriori glob ");
633  ALIUtils::dumprm(rmGlobOriginalOriginal(), " setGlobalRMOriginalOriginal new ");
634  }
635 
636  //----------- Reset RMGlobOriginalOriginal() of every component
637  std::vector<OpticalObject*> vopto;
638  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
639  if (!igetood) {
640  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
641  return;
642  }
643  std::vector<OpticalObject*>::const_iterator vocite;
644  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
645  CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
646  (*vocite)->setGlobalRMOriginalOriginal(rmorioriLocalChild);
647  // (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmGlobOriginalOriginal() );
648  }
649 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), Model::getComponentOptOs(), name(), parent(), rmGlobOriginalOriginal(), and SetRMGlobFromRMLocalOriginalOriginal().

Referenced by FittedEntriesReader::readFittedEntriesFromFile().

◆ setID()

void OpticalObject::setID ( ALIuint  id)
inline

Definition at line 99 of file OpticalObject.h.

99 { theCmsswID = id; }

References triggerObjects_cff::id, and theCmsswID.

Referenced by createComponentOptOs().

◆ setMeas()

void OpticalObject::setMeas ( Measurement meas)
inline

set current measurement

Definition at line 199 of file OpticalObject.h.

199 { theCurrentMeas = meas; }

References meas(), and theCurrentMeas.

Referenced by participateInMeasurement().

◆ setOriginalEntryValues()

void OpticalObject::setOriginalEntryValues ( )

Definition at line 823 of file OpticalObject.cc.

823  {
824  //---------- Set orig coordinates
827 
830 
831  /* if ( ALIUtils::debug >= 5 ) {
832  ALIUtils::dump3v( centreGlob(), "OPTO: CENTRE GLOB ");
833  ALIUtils::dumprm( rmGlob(), "OPTO: RM GLOB ");
834  }*/
835 
836  //---------- Set extra entry values
837  std::vector<ALIdouble>::const_iterator vdcite;
838  for (vdcite = ExtraEntryValueList().begin(); vdcite != ExtraEntryValueList().end(); ++vdcite) {
841  }
842  //- test();
843  if (ALIUtils::debug >= 6)
844  std::cout << " setOriginalEntryValues " << std::endl;
845 }

References addExtraEntryValueOriginalOriginalToList(), addExtraEntryValueOriginalToList(), centreGlob(), gather_cfg::cout, ALIUtils::debug, ExtraEntryValueList(), rmGlob(), theCentreGlobOriginal, theCentreGlobOriginalOriginal, theRmGlobOriginal, and theRmGlobOriginalOriginal.

Referenced by construct(), constructFromOptAligInfo(), and FittedEntriesSet::SetOptOEntries().

◆ setRmGlobal()

void OpticalObject::setRmGlobal ( const CLHEP::HepRotation &  rm)
inline

Definition at line 108 of file OpticalObject.h.

108 { theRmGlob = rm; }

References submit::rm, and theRmGlob.

Referenced by OptOLens::OptOLens(), and OptOSource::OptOSource().

◆ setRmGlobalOriginal()

void OpticalObject::setRmGlobalOriginal ( const CLHEP::HepRotation &  rm)
inline

Definition at line 102 of file OpticalObject.h.

102 { theRmGlobOriginal = rm; }

References submit::rm, and theRmGlobOriginal.

Referenced by OptOLens::OptOLens(), and OptOSource::OptOSource().

◆ SetRMGlobFromRMLocal()

void OpticalObject::SetRMGlobFromRMLocal ( )
private

Definition at line 777 of file OpticalObject.cc.

777  {
778  const OpticalObject* opto_par = this;
780  if (gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
781  while (opto_par->parent()->type() != ALIstring("system")) {
782  //t vecite = opto_par->parent()->GetCoordinateEntry( CEanglesX );
783  if (ALIUtils::debug >= 5)
784  std::cout << "rotate with parent: before X " << opto_par->parent()->name() << " "
785  << parent()->getEntryRMangle(XCoor) << std::endl;
786  theRmGlob.rotateX(parent()->getEntryRMangle(XCoor));
787  if (ALIUtils::debug >= 5)
788  std::cout << "rotate with parent: before Y " << opto_par->parent()->name() << " "
789  << parent()->getEntryRMangle(YCoor) << std::endl;
790  theRmGlob.rotateY(parent()->getEntryRMangle(YCoor));
791  if (ALIUtils::debug >= 5)
792  std::cout << "rotate with parent: before Z " << opto_par->parent()->name() << " "
793  << parent()->getEntryRMangle(ZCoor) << std::endl;
794  theRmGlob.rotateZ(parent()->getEntryRMangle(ZCoor));
795  if (ALIUtils::debug >= 4)
796  ALIUtils::dumprm(theRmGlob, "SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName());
797  opto_par = opto_par->parent();
798  }
799  } else {
800  if (ALIUtils::debug >= 4) {
801  std::cout << " Composing rmGlob with parent " << parent()->name() << std::endl;
802  // ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: RM GLOB ");
803  }
804  theRmGlob = parent()->rmGlob() * theRmGlob;
805  }
806 
807  // std::cout << "rotate with parent (parent)" << opto_par->name() <<parent()->name() << (*vecite)->name() << (*vecite)->value() <<std::endl;
808  if (ALIUtils::debug >= 4) {
809  ALIUtils::dumprm(theRmGlob, "SetRMGlobFromRMLocal: final RM GLOB ");
810  ALIUtils::dumprm(parent()->rmGlob(), "parent rm glob ");
811  }
812 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), getEntryRMangle(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), longName(), name(), parent(), rmGlob(), theRmGlob, type(), XCoor, YCoor, and ZCoor.

Referenced by displaceRmGlobAroundLocal(), and setGlobalRM().

◆ SetRMGlobFromRMLocalOriginalOriginal()

void OpticalObject::SetRMGlobFromRMLocalOriginalOriginal ( const CLHEP::HepRotation &  rmoriori)
private

◆ SetRMLocalFromEntryValues()

void OpticalObject::SetRMLocalFromEntryValues ( )
private

Definition at line 715 of file OpticalObject.cc.

715  {
716  //---------- Set global rotation matrix
717  //-------- Get rm from Entries
718  theRmGlob = CLHEP::HepRotation();
719  theRmGlob.rotateX(getEntryRMangle(XCoor));
720  if (ALIUtils::debug >= 4) {
721  std::cout << " getEntryRMangle(XCoor) )" << getEntryRMangle(XCoor) << std::endl;
722  ALIUtils::dumprm(theRmGlob, "SetRMLocalFromEntryValues: RM after X");
723  }
724  theRmGlob.rotateY(getEntryRMangle(YCoor));
725  if (ALIUtils::debug >= 4) {
726  std::cout << " getEntryRMangle(YCoor) )" << getEntryRMangle(YCoor) << std::endl;
727  ALIUtils::dumprm(theRmGlob, "SetRMLocalFromEntryValues: RM after Y");
728  }
729  theRmGlob.rotateZ(getEntryRMangle(ZCoor));
730  if (ALIUtils::debug >= 4) {
731  std::cout << " getEntryRMangle(ZCoor) )" << getEntryRMangle(ZCoor) << std::endl;
732  ALIUtils::dumprm(theRmGlob, "SetRMLocalFromEntryValues: RM FINAL");
733  }
734 
735  //----- angles are relative to parent, so rotate parent angles first
736  // RmGlob() = 0;
737  //- if(ALIUtils::debug >= 4) ALIUtils::dumprm( parent()->rmGlob(), "OPTO0: RM LOCAL ");
738  // if ( type() != ALIstring("system") ) theRmGlob.transform( parent()->rmGlob() );
739  //----- if anglesIsGlobal, RM is already in global coordinates, else multiply by ancestors
740 
741  /* /////////////
742  CLHEP::Hep3Vector ztest(0.,0.,1.);
743  ztest = theRmGlob * ztest;
744  if( ALIUtils::debug >= 5 ) ALIUtils::dump3v( ztest, "z rotated by theRmGlob ");
745  */
746 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), getEntryRMangle(), theRmGlob, XCoor, YCoor, and ZCoor.

Referenced by setGlobalRM().

◆ setType()

void OpticalObject::setType ( const ALIstring type)
inline

Definition at line 110 of file OpticalObject.h.

110 { theType = type; }

References theType, and type().

◆ shortName()

const ALIstring OpticalObject::shortName ( ) const

Definition at line 1649 of file OpticalObject.cc.

1649  {
1650  ALIint last_slash = name().rfind('/');
1651  ALIstring sname = name().substr(last_slash + 1, name().size() - 1);
1652  if (last_slash == -1) { //object of type "system"
1653  sname = name();
1654  } else {
1655  sname = name().substr(last_slash + 1, name().size() - 1);
1656  }
1657  return sname;
1658 }

References name(), and findQualityFiles::size.

Referenced by CocoaToDDLMgr::lv(), and CocoaToDDLMgr::pv().

◆ transformCylindrical2Cartesian()

void OpticalObject::transformCylindrical2Cartesian ( )
private

Definition at line 275 of file OpticalObject.cc.

275  {
276  ALIuint ii;
277  ALIuint siz = theCoordinateEntryVector.size();
278  ALIdouble R = theCoordinateEntryVector[0]->value();
281  if (siz != 3) {
282  throw cms::Exception("LogicError") << "@SUB=OpticalObject::transformCylindrical2Cartesian\n"
283  << "Transformation from cylindrical to cartesian coordinates requires the"
284  << " coordinate entry vector to have a size of three.";
285  }
286  ALIdouble newcoor[3] = {
287  R * cos(phi),
288  R * sin(phi),
289  theCoordinateEntryVector[2]->value() // Z
290  };
291  //- std::cout << " phi " << phi << std::endl;
292  //----- Name is filled from here to include 'centre' or 'angles'
293 
294  for (ii = 0; ii < siz; ii++) {
295  if (ALIUtils::debug >= 5)
296  std::cout << " OpticalObject::transformCylindrical2Cartesian " << ii << " " << newcoor[ii] << std::endl;
297  theCoordinateEntryVector[ii]->setValue(newcoor[ii]);
298  }
299  // change the names
300  ALIstring name = "centre_X";
301  theCoordinateEntryVector[0]->fillName(name);
302  name = "centre_Y";
303  theCoordinateEntryVector[1]->fillName(name);
304  name = "centre_Z";
305  theCoordinateEntryVector[2]->fillName(name);
306 }

References ALIUtils::AngleValueDimensionFactor(), funct::cos(), gather_cfg::cout, ALIUtils::debug, Exception, cuy::ii, ALIUtils::LengthValueDimensionFactor(), name(), phi, dttmaxenums::R, funct::sin(), and theCoordinateEntryVector.

Referenced by readCoordinates().

◆ transformGlobal2Local()

void OpticalObject::transformGlobal2Local ( )
private

◆ transformSpherical2Cartesian()

void OpticalObject::transformSpherical2Cartesian ( )
private

Definition at line 309 of file OpticalObject.cc.

309 {}

Referenced by readCoordinates().

◆ type()

const ALIstring& OpticalObject::type ( ) const
inline

◆ userDefinedBehaviour()

void OpticalObject::userDefinedBehaviour ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
virtual

Reimplemented in OptOUserDefined.

Definition at line 930 of file OpticalObject.cc.

930  {
931  std::cerr << "!!! Optical Object " << name() << " of type " << type()
932  << " does not implement user defined behaviour = " << behav << std::endl;
933  std::cerr << " Please read documentation for this object type" << std::endl;
934  exit(1);
935 }

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

Referenced by participateInMeasurement().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const OpticalObject c 
)
friend

Definition at line 1661 of file OpticalObject.cc.

1661  {
1662  os << "OPTICALOBJECT: " << c.theName << " of type: " << c.theType << " " << c.theCentreGlob << c.theRmGlob
1663  << std::endl;
1664 
1665  return os;
1666 }

Member Data Documentation

◆ anglesIsGlobal

ALIbool OpticalObject::anglesIsGlobal
private

◆ axisXLocalInGlobal

CLHEP::Hep3Vector OpticalObject::axisXLocalInGlobal
private

Definition at line 307 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

◆ axisYLocalInGlobal

CLHEP::Hep3Vector OpticalObject::axisYLocalInGlobal
private

Definition at line 308 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

◆ axisZLocalInGlobal

CLHEP::Hep3Vector OpticalObject::axisZLocalInGlobal
private

Definition at line 309 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

◆ centreIsGlobal

ALIbool OpticalObject::centreIsGlobal
private

◆ fcopyData

ALIbool OpticalObject::fcopyData
private

Definition at line 281 of file OpticalObject.h.

Referenced by construct(), createComponentOptOs(), and OpticalObject().

◆ theCentreGlob

CLHEP::Hep3Vector OpticalObject::theCentreGlob
private

◆ theCentreGlobOriginal

CLHEP::Hep3Vector OpticalObject::theCentreGlobOriginal
private

◆ theCentreGlobOriginalOriginal

CLHEP::Hep3Vector OpticalObject::theCentreGlobOriginalOriginal
private

◆ theCmsswID

ALIuint OpticalObject::theCmsswID
private

Definition at line 311 of file OpticalObject.h.

Referenced by getCmsswID(), ID(), setCmsswID(), and setID().

◆ theCoordinateEntryVector

std::vector<Entry*> OpticalObject::theCoordinateEntryVector
private

◆ theCurrentMeas

Measurement* OpticalObject::theCurrentMeas
private

Definition at line 305 of file OpticalObject.h.

Referenced by meas(), and setMeas().

◆ theExtraEntryValueOriginalOriginalVector

std::vector<ALIdouble> OpticalObject::theExtraEntryValueOriginalOriginalVector
private

◆ theExtraEntryValueOriginalVector

std::vector<ALIdouble> OpticalObject::theExtraEntryValueOriginalVector
private

◆ theExtraEntryValueVector

std::vector<ALIdouble> OpticalObject::theExtraEntryValueVector
private

◆ theExtraEntryVector

std::vector<Entry*> OpticalObject::theExtraEntryVector
private

Definition at line 294 of file OpticalObject.h.

Referenced by addExtraEntryToList(), and ExtraEntryList().

◆ theMaterial

CocoaMaterialElementary* OpticalObject::theMaterial
protected

Definition at line 314 of file OpticalObject.h.

Referenced by constructMaterial(), and getMaterial().

◆ theName

ALIstring OpticalObject::theName
private

◆ theParent

OpticalObject* OpticalObject::theParent
private

◆ theRmGlob

CLHEP::HepRotation OpticalObject::theRmGlob
private

◆ theRmGlobOriginal

CLHEP::HepRotation OpticalObject::theRmGlobOriginal
private

◆ theRmGlobOriginalOriginal

CLHEP::HepRotation OpticalObject::theRmGlobOriginalOriginal
private

◆ theSolidShape

CocoaSolidShape* OpticalObject::theSolidShape
protected

◆ theType

ALIstring OpticalObject::theType
private

Definition at line 278 of file OpticalObject.h.

Referenced by OpticalObject(), setType(), and type().

◆ verbose

ALIint OpticalObject::verbose
protected
OpticalObject::diff2pi
double diff2pi(double ang1, double ang2)
Definition: OpticalObject.cc:1800
OpticalObject::fastDeviatesLightRay
virtual void fastDeviatesLightRay(LightRay &lightray)
Definition: OpticalObject.cc:883
change_name.diff
diff
Definition: change_name.py:13
OpticalObject::SetCentreLocalFromEntryValues
void SetCentreLocalFromEntryValues()
Definition: OpticalObject.cc:700
OpticalObject::readCoordinates
void readCoordinates(const ALIstring &coor_type_read, const ALIstring &coor_type_expected, ALIFileIn &filein)
Definition: OpticalObject.cc:212
OpticalObject::constructSolidShape
virtual void constructSolidShape()
Definition: OpticalObject.cc:2006
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
OpticalObject::constructMaterial
virtual void constructMaterial()
Definition: OpticalObject.cc:2001
OpticalObject::meas
Measurement * meas()
Definition: OpticalObject.h:200
ALIbool
bool ALIbool
Definition: CocoaGlobals.h:19
OpticalObject::rmGlobOriginalOriginal
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
Definition: OpticalObject.h:88
OpticalObject::buildWordList
void buildWordList(const Entry *entry, std::vector< ALIstring > &wordlist)
Definition: OpticalObject.cc:418
OpticalObject::addExtraEntryToList
void addExtraEntryToList(Entry *entry)
Definition: OpticalObject.h:112
OpticalObject::setGlobalCoordinates
void setGlobalCoordinates()
Definition: OpticalObject.cc:587
OpticalObject::extraEntryNo
const ALIint extraEntryNo(const ALIstring &entry_name) const
Definition: OpticalObject.cc:1500
OpticalAlignInfo::name_
std::string name_
Definition: OpticalAlignInfo.h:92
OpticalObject::theExtraEntryValueOriginalVector
std::vector< ALIdouble > theExtraEntryValueOriginalVector
Definition: OpticalObject.h:298
OpticalObject::longName
const ALIstring longName() const
Definition: OpticalObject.h:196
OpticalObject::fcopyData
ALIbool fcopyData
Definition: OpticalObject.h:281
OpticalObject::findExtraEntryValue
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
Definition: OpticalObject.cc:1519
Model::nextOptOToCopy
static OpticalObject * nextOptOToCopy()
Definition: Model.cc:796
OptOTiltmeter
Definition: OptOTiltmeter.h:18
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
OpticalObject::setCmsswID
void setCmsswID(ALIuint id)
Definition: OpticalObject.h:98
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
Entry::ValueDimensionFactor
virtual ALIdouble ValueDimensionFactor() const
Definition: Entry.h:35
OpticalObject::readExtraEntries
void readExtraEntries(ALIFileIn &filein)
Definition: OpticalObject.cc:147
OpticalObject::getEntryRMangle
const double getEntryRMangle(const XYZcoor coor) const
Definition: OpticalObject.cc:1977
OpticalObject::axisZLocalInGlobal
CLHEP::Hep3Vector axisZLocalInGlobal
Definition: OpticalObject.h:309
GlobalOptionMgr::GlobalOptions
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
Definition: GlobalOptionMgr.h:31
class-composition.children
children
Definition: class-composition.py:88
mps_splice.entry
entry
Definition: mps_splice.py:68
OpticalObject::theExtraEntryVector
std::vector< Entry * > theExtraEntryVector
Definition: OpticalObject.h:294
GlobalOptionMgr
Definition: GlobalOptionMgr.h:18
OpticalObject::calculateLocalRotationAxisInGlobal
void calculateLocalRotationAxisInGlobal()
Definition: OpticalObject.cc:1723
EntryLengthAffCentre
Definition: EntryLengthAffCentre.h:15
OpticalObject::name
const ALIstring & name() const
Definition: OpticalObject.h:58
GlobalOptionMgr::getInstance
static GlobalOptionMgr * getInstance()
Definition: GlobalOptionMgr.cc:18
YCoor
Definition: OpticalObject.h:33
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Entry::setOptOCurrent
void setOptOCurrent(OpticalObject *opto)
Definition: Entry.h:82
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
OptOMirror
Definition: OptOMirror.h:18
OpticalAlignParam::name
std::string name() const
Definition: OpticalAlignInfo.h:39
OpticalObject::getRotationAnglesInOptOFrame
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
Definition: OpticalObject.cc:1684
OpticalObject::theType
ALIstring theType
Definition: OpticalObject.h:278
OpticalAlignInfo
Definition: OpticalAlignInfo.h:71
GlobalOptionMgr::getGlobalOptionValue
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
Definition: GlobalOptionMgr.cc:115
OpticalObject::theSolidShape
CocoaSolidShape * theSolidShape
Definition: OpticalObject.h:315
Model::getOpticalAlignments
static std::vector< OpticalAlignInfo > getOpticalAlignments()
Definition: Model.h:137
OpticalObject::setAnglesNull
void setAnglesNull()
Definition: OpticalObject.cc:343
OpticalObject
Definition: OpticalObject.h:35
OpticalObject::theCmsswID
ALIuint theCmsswID
Definition: OpticalObject.h:311
OpticalObject::ExtraEntryValueOriginalList
const std::vector< ALIdouble > & ExtraEntryValueOriginalList()
Definition: OpticalObject.h:69
CocoaSolidShapeBox
Definition: CocoaSolidShapeBox.h:13
XCoor
Definition: OpticalObject.h:33
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
OpticalObject::readData
void readData(ALIFileIn &filein)
Definition: OpticalObject.cc:118
OpticalObject::eq2ang
bool eq2ang(double ang1, double ang2)
Definition: OpticalObject.cc:1807
Entry::value
ALIdouble value() const
Definition: Entry.h:53
OpticalObject::centreGlob
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
OpticalObject::addExtraEntryValueOriginalToList
void addExtraEntryValueOriginalToList(ALIdouble entry_value)
Definition: OpticalObject.h:114
OpticalObject::type
const ALIstring & type() const
Definition: OpticalObject.h:59
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
OpticalObjectMgr::registerMe
void registerMe(OpticalObject *opto)
Definition: OpticalObjectMgr.h:28
OpticalObject::ExtraEntryValueList
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:67
OpticalObject::axisYLocalInGlobal
CLHEP::Hep3Vector axisYLocalInGlobal
Definition: OpticalObject.h:308
OpticalObject::rmGlob
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
OptODistancemeter
Definition: OptODistancemeter.h:18
OpticalObject::theName
ALIstring theName
Definition: OpticalObject.h:279
OptOCOPS
Definition: OptOCOPS.h:20
EntryLength
Definition: EntryLength.h:16
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
OpticalObject::getEntryCentre
const double getEntryCentre(const XYZcoor coor) const
Definition: OpticalObject.cc:1955
OpticalObject::defaultBehaviour
virtual void defaultBehaviour(LightRay &lightray, Measurement &meas)
Definition: OpticalObject.cc:873
OptOScreen
Definition: OptOScreen.h:18
OpticalObject::rmLocal
const CLHEP::HepRotation rmLocal() const
Definition: OpticalObject.cc:1669
Model::SDFName
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:93
XYZcoor
XYZcoor
Definition: OpticalObject.h:33
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
OpticalObject::theCoordinateEntryVector
std::vector< Entry * > theCoordinateEntryVector
Definition: OpticalObject.h:293
OpticalObject::SetCentreGlobFromCentreLocal
void SetCentreGlobFromCentreLocal()
Definition: OpticalObject.cc:749
OpticalObject::setGlobalCentre
void setGlobalCentre()
Definition: OpticalObject.cc:593
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
OpticalObject::theCentreGlobOriginalOriginal
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
Definition: OpticalObject.h:289
OpticalAlignInfo::angx_
OpticalAlignParam angx_
Definition: OpticalAlignInfo.h:89
OpticalObject::centreIsGlobal
ALIbool centreIsGlobal
Definition: OpticalObject.h:302
Model::OptOList
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:84
OpticalObject::addExtraEntryValueOriginalOriginalToList
void addExtraEntryValueOriginalOriginalToList(ALIdouble entry_value)
Definition: OpticalObject.h:117
OpticalObject::theRmGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
Definition: OpticalObject.h:288
OpticalObject::setID
void setID(ALIuint id)
Definition: OpticalObject.h:99
submit.rm
rm
Definition: submit.py:77
OpticalObject::fastTraversesLightRay
virtual void fastTraversesLightRay(LightRay &lightray)
Definition: OpticalObject.cc:893
OpticalObject::getDispVec
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
Definition: OpticalObject.cc:1909
Entry::fill
void fill(const std::vector< ALIstring > &wordlist)
Definition: Entry.cc:31
OpticalObject::makeMeasurement
virtual void makeMeasurement(LightRay &lightray, Measurement &meas)
Definition: OpticalObject.cc:923
OpticalObject::SetRMLocalFromEntryValues
void SetRMLocalFromEntryValues()
Definition: OpticalObject.cc:715
ALIFileIn::getInstance
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:22
OpticalObject::theExtraEntryValueOriginalOriginalVector
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
Definition: OpticalObject.h:299
OpticalAlignInfo::angz_
OpticalAlignParam angz_
Definition: OpticalAlignInfo.h:89
OpticalAlignInfo::y_
OpticalAlignParam y_
Definition: OpticalAlignInfo.h:89
OpticalObject::getCoordinateFromOptAlignParam
std::vector< ALIstring > getCoordinateFromOptAlignParam(const OpticalAlignParam &oaParam)
Definition: OpticalObject.cc:2064
OpticalObject::theCentreGlobOriginal
CLHEP::Hep3Vector theCentreGlobOriginal
Definition: OpticalObject.h:287
OpticalObject::ExtraEntryList
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
OpticalObject::theCurrentMeas
Measurement * theCurrentMeas
Definition: OpticalObject.h:305
common_cff.precision
precision
Definition: common_cff.py:44
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
OpticalObject::centreGlobOriginalOriginal
const CLHEP::Hep3Vector & centreGlobOriginalOriginal() const
Definition: OpticalObject.h:82
OpticalObject::createComponentOptOsFromOptAlignInfo
void createComponentOptOsFromOptAlignInfo()
Definition: OpticalObject.cc:2088
ALIUtils::dumprm
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
OpticalAlignInfo::extraEntries_
std::vector< OpticalAlignParam > extraEntries_
Definition: OpticalAlignInfo.h:90
ALIFileIn::ErrorInLine
void ErrorInLine()
Definition: ALIFileIn.cc:196
OpticalObject::theExtraEntryValueVector
std::vector< ALIdouble > theExtraEntryValueVector
Definition: OpticalObject.h:297
OpticalObject::constructFromOptAligInfo
void constructFromOptAligInfo(const OpticalAlignInfo &oaInfo)
Definition: OpticalObject.cc:2016
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
OpticalObject::parent
const OpticalObject * parent() const
Definition: OpticalObject.h:60
OpticalObjectMgr::getInstance
static OpticalObjectMgr * getInstance()
Get the only instance.
Definition: OpticalObjectMgr.cc:9
OptOModifiedRhomboidPrism
Definition: OptOModifiedRhomboidPrism.h:18
EntryAngleAffAngles
Definition: EntryAngleAffAngles.h:15
OpticalObject::copyData
void copyData()
Definition: OpticalObject.cc:371
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
OptOLaser
Definition: OptOLaser.h:18
OpticalObject::SetRMGlobFromRMLocal
void SetRMGlobFromRMLocal()
Definition: OpticalObject.cc:777
OptOXLaser
Definition: OptOXLaser.h:18
OpticalObject::theRmGlob
CLHEP::HepRotation theRmGlob
Definition: OpticalObject.h:285
OpticalAlignInfo::angy_
OpticalAlignParam angy_
Definition: OpticalAlignInfo.h:89
OpticalObject::rotateItAroundGlobal
void rotateItAroundGlobal(T &object, const XYZcoor coor, const double disp)
Definition: OpticalObject.cc:1739
createfilelist.int
int
Definition: createfilelist.py:10
ALIuint
unsigned int ALIuint
Definition: CocoaGlobals.h:17
ZCoor
Definition: OpticalObject.h:33
value
Definition: value.py:1
fftjetcommon_cfi.sy
sy
Definition: fftjetcommon_cfi.py:203
OptOUserDefined
Definition: OptOUserDefined.h:18
OpticalAlignInfo::x_
OpticalAlignParam x_
Definition: OpticalAlignInfo.h:89
OpticalObject::setOriginalEntryValues
void setOriginalEntryValues()
Definition: OpticalObject.cc:823
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
ALIPlane
Definition: ALIPlane.h:15
OpticalObject::CoordinateEntryList
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
Entry
Definition: Entry.h:18
OpticalAlignParam::value
double value() const
Definition: OpticalAlignInfo.h:40
OpticalObject::transformCylindrical2Cartesian
void transformCylindrical2Cartesian()
Definition: OpticalObject.cc:275
OptOPinhole
Definition: OptOPinhole.h:18
OpticalObject::transformSpherical2Cartesian
void transformSpherical2Cartesian()
Definition: OpticalObject.cc:309
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
OpticalObject::fillExtraEntry
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
Definition: OpticalObject.cc:163
OpticalObject::detailedTraversesLightRay
virtual void detailedTraversesLightRay(LightRay &lightray)
Definition: OpticalObject.cc:913
DDAxes::phi
OpticalObject::setGlobalRM
void setGlobalRM()
Definition: OpticalObject.cc:605
Entry::valueDisplacementByFitting
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
Entry::fillName
virtual void fillName(const ALIstring &name)
Definition: Entry.cc:230
OptOSensor2D
Definition: OptOSensor2D.h:19
OpticalObject::fillCoordinateEntry
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
Definition: OpticalObject.cc:314
heppy_batch.val
val
Definition: heppy_batch.py:351
ALIUtils::dump3v
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
Model::createCopyComponentList
static ALIbool createCopyComponentList(const ALIstring &optoname)
**************** FOR COPYING AN OPTO
Definition: Model.cc:750
OpticalObject::theMaterial
CocoaMaterialElementary * theMaterial
Definition: OpticalObject.h:314
OpticalObject::userDefinedBehaviour
virtual void userDefinedBehaviour(LightRay &lightray, Measurement &meas, const ALIstring &behav)
Definition: OpticalObject.cc:930
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.value
value
Definition: relativeConstraints.py:53
OpticalObject::theParent
OpticalObject * theParent
Definition: OpticalObject.h:277
ALIUtils::AngleValueDimensionFactor
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:64
Exception
Definition: hltDiff.cc:245
OpticalObject::SetRMGlobFromRMLocalOriginalOriginal
void SetRMGlobFromRMLocalOriginalOriginal(const CLHEP::HepRotation &rmoriori)
Definition: OpticalObject.cc:815
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
OptODistancemeter3dim
Definition: OptODistancemeter3dim.h:18
OpticalAlignParam::sigma
double sigma() const
Definition: OpticalAlignInfo.h:41
OpticalObject::addCoordinateEntryToList
void addCoordinateEntryToList(Entry *entry)
Definition: OpticalObject.h:111
OpticalObject::rmGlobOriginal
const CLHEP::HepRotation & rmGlobOriginal() const
Definition: OpticalObject.h:87
OpticalObject::getRotationAnglesFromMatrix
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
Definition: OpticalObject.cc:1710
Model::getComponentOptOTypes
static ALIbool getComponentOptOTypes(const ALIstring &opto_type, std::vector< ALIstring > &vcomponents)
--— Get from theOptODictionary the list of component OptO types
Definition: Model.cc:674
OptOPlateSplitter
Definition: OptOPlateSplitter.h:18
OpticalObject::construct
void construct()
Definition: OpticalObject.cc:70
OptOSource
Definition: OptOSource.h:18
Model::addEntryToList
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:140
OpticalObject::centreGlobOriginal
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
ALIint
int ALIint
Definition: CocoaGlobals.h:15
OpticalObject::theCentreGlob
CLHEP::Hep3Vector theCentreGlob
Definition: OpticalObject.h:284
OpticalObject::detailedDeviatesLightRay
virtual void detailedDeviatesLightRay(LightRay &lightray)
Definition: OpticalObject.cc:903
ALIFileIn::getWordsInLine
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:74
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EntryMgr::getInstance
static EntryMgr * getInstance()
Definition: EntryMgr.cc:16
ALIUtils::LengthValueDimensionFactor
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:62
OptOLens
Definition: OptOLens.h:18
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
EntryAngle
Definition: EntryAngle.h:16
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
EntryNoDim
Definition: EntryNoDim.h:15
OpticalAlignInfo::ID_
unsigned int ID_
Definition: OpticalAlignInfo.h:94
OpticalObject::axisXLocalInGlobal
CLHEP::Hep3Vector axisXLocalInGlobal
Definition: OpticalObject.h:307
dttmaxenums::R
Definition: DTTMax.h:29
cuy.ii
ii
Definition: cuy.py:590
OpticalAlignInfo::z_
OpticalAlignParam z_
Definition: OpticalAlignInfo.h:89
OpticalObject::createComponentOptOs
void createComponentOptOs(ALIFileIn &filein)
Definition: OpticalObject.cc:459
OptORisleyPrism
Definition: OptORisleyPrism.h:18
OpticalObject::anglesIsGlobal
ALIbool anglesIsGlobal
Definition: OpticalObject.h:303
OpticalObject::setMeas
void setMeas(Measurement *meas)
set current measurement
Definition: OpticalObject.h:199
OpticalObject::addExtraEntryValueToList
void addExtraEntryValueToList(ALIdouble entry_value)
Definition: OpticalObject.h:113
OptOCubeSplitter
Definition: OptOCubeSplitter.h:18
OpticalAlignParam::quality
int quality() const
Definition: OpticalAlignInfo.h:42
CocoaMaterialElementary
Definition: CocoaMaterialElementary.h:16
ALIUtils::getRotationAnglesFromMatrix
static std::vector< double > getRotationAnglesFromMatrix(const CLHEP::HepRotation &rmLocal, double origAngleX, double origAngleY, double origAngleZ)
Definition: ALIUtils.cc:549
OptOOpticalSquare
Definition: OptOOpticalSquare.h:18
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
ALIFileIn
Definition: ALIFileIn.h:20
OpticalObject::theRmGlobOriginalOriginal
CLHEP::HepRotation theRmGlobOriginalOriginal
Definition: OpticalObject.h:290
OpticalObject::createNewOptO
OpticalObject * createNewOptO(OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
Definition: OpticalObject.cc:533
fftjetcommon_cfi.sx
sx
Definition: fftjetcommon_cfi.py:202