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 XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlob (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginalOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginalOriginal (const CLHEP::Hep3Vector &dispVec)
 
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 XYZcoor coor) const
 
const double getEntryCentre (const ALIstring &coor) const
 
const double getEntryRMangle (const XYZcoor coor) const
 
const double getEntryRMangle (const ALIstring &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.

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

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 }
ALIstring theName
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static OpticalObjectMgr * getInstance()
Get the only instance.
void registerMe(OpticalObject *opto)
ALIstring theType
OpticalObject * theParent
ALIbool fcopyData
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ ~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.

References mps_splice::entry, and theCoordinateEntryVector.

Referenced by fillCoordinateEntry(), and setAnglesNull().

111 { theCoordinateEntryVector.push_back(entry); }
std::vector< Entry * > theCoordinateEntryVector

◆ addExtraEntryToList()

void OpticalObject::addExtraEntryToList ( Entry entry)
inline

Definition at line 112 of file OpticalObject.h.

References mps_splice::entry, and theExtraEntryVector.

Referenced by fillExtraEntry().

112 { theExtraEntryVector.push_back(entry); }
std::vector< Entry * > theExtraEntryVector

◆ addExtraEntryValueOriginalOriginalToList()

void OpticalObject::addExtraEntryValueOriginalOriginalToList ( ALIdouble  entry_value)
inline

Definition at line 117 of file OpticalObject.h.

References theExtraEntryValueOriginalOriginalVector.

Referenced by setOriginalEntryValues().

117  {
118  theExtraEntryValueOriginalOriginalVector.push_back(entry_value);
119  }
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector

◆ addExtraEntryValueOriginalToList()

void OpticalObject::addExtraEntryValueOriginalToList ( ALIdouble  entry_value)
inline

Definition at line 114 of file OpticalObject.h.

References theExtraEntryValueOriginalVector.

Referenced by setOriginalEntryValues().

114  {
115  theExtraEntryValueOriginalVector.push_back(entry_value);
116  }
std::vector< ALIdouble > theExtraEntryValueOriginalVector

◆ addExtraEntryValueToList()

void OpticalObject::addExtraEntryValueToList ( ALIdouble  entry_value)
inline

Definition at line 113 of file OpticalObject.h.

References theExtraEntryValueVector.

Referenced by fillExtraEntry().

113 { theExtraEntryValueVector.push_back(entry_value); }
std::vector< ALIdouble > theExtraEntryValueVector

◆ addPii()

double OpticalObject::addPii ( double  val)

Definition at line 1830 of file OpticalObject.cc.

References M_PI, and heppy_batch::val.

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

◆ approxTo0()

double OpticalObject::approxTo0 ( double  val)

Definition at line 1822 of file OpticalObject.cc.

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

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

◆ buildRmFromEntryValuesOriginalOriginal()

CLHEP::HepRotation OpticalObject::buildRmFromEntryValuesOriginalOriginal ( )

Definition at line 675 of file OpticalObject.cc.

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

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 }
def rm(path, rec=False)
Definition: eostools.py:363
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring longName() const
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
const OpticalObject * parent() const
Definition: OpticalObject.h:60
const double getEntryRMangle(const XYZcoor coor) const

◆ buildWordList()

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

Definition at line 418 of file OpticalObject.cc.

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

Referenced by copyData().

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 }
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:34
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
std::string ALIstring
Definition: CocoaGlobals.h:9

◆ calculateLocalRotationAxisInGlobal()

void OpticalObject::calculateLocalRotationAxisInGlobal ( )
private

Definition at line 1723 of file OpticalObject.cc.

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

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

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 }
CLHEP::HepRotation theRmGlob
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::Hep3Vector axisYLocalInGlobal
CLHEP::Hep3Vector axisXLocalInGlobal
CLHEP::Hep3Vector axisZLocalInGlobal

◆ centreGlob()

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

◆ centreGlobal()

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

Definition at line 77 of file OpticalObject.h.

References centreGlob().

77 { return centreGlob(); }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75

◆ 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().

CLHEP::Hep3Vector theCentreGlobOriginalOriginal

◆ centreLocal()

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

Definition at line 1938 of file OpticalObject.cc.

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

Referenced by CocoaToDDLMgr::pv().

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
const OpticalObject * parent() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob

◆ checkMatrixEquations()

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

Definition at line 1841 of file OpticalObject.cc.

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

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool eq2ang(double ang1, double ang2)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

◆ construct()

void OpticalObject::construct ( )

Definition at line 70 of file OpticalObject.cc.

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

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

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;
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
106 
107  //---------- Construct material
109 
110  //---------- Construct solid shape
112 }
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:21
static ALIint debug
Definition: ALIUtils.h:34
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:93
const ALIstring & name() const
Definition: OpticalObject.h:58
void setOriginalEntryValues()
void readData(ALIFileIn &filein)
virtual void constructSolidShape()
OpticalObject * theParent
ALIbool fcopyData
void createComponentOptOs(ALIFileIn &filein)
virtual void constructMaterial()
void setGlobalCoordinates()

◆ constructFromOptAligInfo()

void OpticalObject::constructFromOptAligInfo ( const OpticalAlignInfo oaInfo)

Definition at line 2018 of file OpticalObject.cc.

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().

2018  {
2019  if (theParent != nullptr) { //----- OptO 'system' has no parent (and no affine frame)
2020  //---------- Build Data
2021  //---------- See if there are extra entries and read them
2022  std::vector<OpticalAlignParam> exEnt = oaInfo.extraEntries_;
2023  std::vector<OpticalAlignParam>::iterator ite;
2024  std::vector<ALIstring> wordlist;
2025  for (ite = exEnt.begin(); ite != exEnt.end(); ++ite) {
2026  wordlist = getCoordinateFromOptAlignParam(*ite);
2027  wordlist.insert(wordlist.begin(), (*ite).dimType());
2028  fillExtraEntry(wordlist);
2029  }
2030 
2031  //--------- set centre and angles not global (default behaviour)
2032  centreIsGlobal = false;
2033  anglesIsGlobal = false;
2034 
2035  setCmsswID(oaInfo.ID_);
2036  //--------- build Coordinates
2043 
2044  //---------- Set global coordinates
2046 
2047  //---------- Set original entry values
2049  }
2050 
2051  //---------- Construct material
2053 
2054  //---------- Construct solid shape
2056 
2057  if (ALIUtils::debug >= 5) {
2058  std::cout << "constructFromOptAligInfo constructed: " << *this << std::endl;
2059  }
2060 
2061  //---------- Create the OptO that compose this one
2063 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
OpticalAlignParam x_
static ALIint debug
Definition: ALIUtils.h:34
void setOriginalEntryValues()
OpticalAlignParam angx_
OpticalAlignParam y_
virtual void constructSolidShape()
OpticalAlignParam angz_
std::vector< ALIstring > getCoordinateFromOptAlignParam(const OpticalAlignParam &oaParam)
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
void setCmsswID(ALIuint id)
Definition: OpticalObject.h:98
OpticalAlignParam z_
OpticalObject * theParent
std::vector< OpticalAlignParam > extraEntries_
OpticalAlignParam angy_
ALIbool centreIsGlobal
void createComponentOptOsFromOptAlignInfo()
virtual void constructMaterial()
void setGlobalCoordinates()
unsigned int ID_

◆ constructMaterial()

void OpticalObject::constructMaterial ( )
virtual

Definition at line 2001 of file OpticalObject.cc.

References f, and theMaterial.

Referenced by construct(), and constructFromOptAligInfo().

2001  {
2002  theMaterial = new CocoaMaterialElementary("Hydrogen", 70.8 * CLHEP::mg / CLHEP::cm3, "H", 1.00794f, 1);
2003 }
double f[11][100]
CocoaMaterialElementary * theMaterial

◆ constructSolidShape()

void OpticalObject::constructSolidShape ( )
virtual

Reimplemented in OptOSensor2D, OptOCOPS, OptOCubeSplitter, OptOMirror, OptOModifiedRhomboidPrism, OptOOpticalSquare, OptOPlateSplitter, OptODistancemeter, OptODistancemeter3dim, OptOTiltmeter, OptOLaser, OptOSource, OptOLens, OptOPinhole, OptOScreen, OptOCameraDetector, OptORisleyPrism, and OptOXLaser.

Definition at line 2006 of file OpticalObject.cc.

References GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), visualization-live-secondInstance_cfg::m, and theSolidShape.

Referenced by construct(), and constructFromOptAligInfo().

2006  {
2007  ALIdouble go;
2009  gomgr->getGlobalOptionValue("VisScale", go);
2010 
2011  theSolidShape = new CocoaSolidShapeBox("Box",
2012  go * 5. * CLHEP::cm / CLHEP::m,
2013  go * 5. * CLHEP::cm / CLHEP::m,
2014  go * 5. * CLHEP::cm / CLHEP::m); //COCOA internal units are meters
2015 }
long double ALIdouble
Definition: CocoaGlobals.h:11
CocoaSolidShape * theSolidShape
static GlobalOptionMgr * getInstance()
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found

◆ CoordinateEntryList()

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

◆ copyData()

void OpticalObject::copyData ( )
private

Definition at line 371 of file OpticalObject.cc.

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

Referenced by construct().

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 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
ALIstring theName
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:34
static OpticalObject * nextOptOToCopy()
Definition: Model.cc:788
const ALIstring & name() const
Definition: OpticalObject.h:58
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:63
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
void buildWordList(const Entry *entry, std::vector< ALIstring > &wordlist)
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
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9

◆ createComponentOptOs()

void OpticalObject::createComponentOptOs ( ALIFileIn filein)
private

Definition at line 459 of file OpticalObject.cc.

References DMR_cfg::cerr, construct(), gather_cfg::cout, Model::createCopyComponentList(), createNewOptO(), ALIUtils::debug, beamvalidation::exit(), fcopyData, ConfigBuilder::filein, Model::getComponentOptOTypes(), OpticalObjectMgr::getInstance(), ALIUtils::getInt(), name(), Model::OptOList(), setID(), and type().

Referenced by construct().

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 }
void setID(ALIuint id)
Definition: OpticalObject.h:99
OpticalObject * createNewOptO(OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:84
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static OpticalObjectMgr * getInstance()
Get the only instance.
bool ALIbool
Definition: CocoaGlobals.h:19
static ALIbool createCopyComponentList(const ALIstring &optoname)
**************** FOR COPYING AN OPTO
Definition: Model.cc:742
static ALIbool getComponentOptOTypes(const ALIstring &opto_type, std::vector< ALIstring > &vcomponents)
--— Get from theOptODictionary the list of component OptO types
Definition: Model.cc:666
ALIbool fcopyData
std::string ALIstring
Definition: CocoaGlobals.h:9
static int getInt(const ALIstring &str)
Convert a string to an integer, checking that it is really an integer.
Definition: ALIUtils.cc:384
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ createComponentOptOsFromOptAlignInfo()

void OpticalObject::createComponentOptOsFromOptAlignInfo ( )

Definition at line 2090 of file OpticalObject.cc.

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

Referenced by constructFromOptAligInfo().

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

◆ createNewOptO()

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

Definition at line 533 of file OpticalObject.cc.

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

Referenced by createComponentOptOs(), and createComponentOptOsFromOptAlignInfo().

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 }
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ 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.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ detailedDeviatesLightRay()

void OpticalObject::detailedDeviatesLightRay ( LightRay lightray)
virtual

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

Definition at line 903 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ detailedTraversesLightRay()

void OpticalObject::detailedTraversesLightRay ( LightRay lightray)
virtual

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

Definition at line 913 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ diff2pi()

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

Definition at line 1800 of file OpticalObject.cc.

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

Referenced by eq2ang().

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

◆ displaceCentreGlob() [1/2]

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

Definition at line 1000 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displace().

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 }
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
bool ALIbool
Definition: CocoaGlobals.h:19
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
CLHEP::Hep3Vector theCentreGlob

◆ displaceCentreGlob() [2/2]

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

Definition at line 1046 of file OpticalObject.cc.

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

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 }
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
bool ALIbool
Definition: CocoaGlobals.h:19
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
CLHEP::Hep3Vector theCentreGlob

◆ displaceCentreGlobOriginal() [1/2]

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

Definition at line 1082 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginal().

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 }
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::Hep3Vector theCentreGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ displaceCentreGlobOriginal() [2/2]

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

Definition at line 1105 of file OpticalObject.cc.

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

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 }
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::Hep3Vector theCentreGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ displaceCentreGlobOriginalOriginal() [1/2]

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

Definition at line 1124 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginalOriginal().

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 }
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ displaceCentreGlobOriginalOriginal() [2/2]

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

Definition at line 1147 of file OpticalObject.cc.

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

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 }
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ displaceExtraEntry()

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

Definition at line 1068 of file OpticalObject.cc.

References LogDebug, theExtraEntryValueOriginalVector, and theExtraEntryValueVector.

Referenced by Entry::displace().

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 }
std::vector< ALIdouble > theExtraEntryValueVector
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueOriginalVector
#define LogDebug(id)

◆ displaceExtraEntryOriginal()

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

Definition at line 1484 of file OpticalObject.cc.

References theExtraEntryValueOriginalVector.

Referenced by Entry::displaceOriginal().

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 }
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueOriginalVector

◆ displaceExtraEntryOriginalOriginal()

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

Definition at line 1492 of file OpticalObject.cc.

References theExtraEntryValueOriginalOriginalVector.

Referenced by Entry::displaceOriginalOriginal().

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 }
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector

◆ displaceRmGlobAroundGlobal()

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

Definition at line 1169 of file OpticalObject.cc.

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

Referenced by EntryAngleAffAngles::displace().

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
void rotateItAroundGlobal(T &object, const XYZcoor coor, const double disp)
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
const CLHEP::HepRotation & rmGlobOriginal() const
Definition: OpticalObject.h:87
CLHEP::Hep3Vector theCentreGlob

◆ displaceRmGlobAroundLocal()

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

Definition at line 1215 of file OpticalObject.cc.

References anglesIsGlobal, calculateLocalRotationAxisInGlobal(), centreGlob(), centreGlobOriginal(), DMR_cfg::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().

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 }
ALIbool anglesIsGlobal
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
void calculateLocalRotationAxisInGlobal()
void SetRMGlobFromRMLocal()
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
void setGlobalCentre()
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
const double getEntryRMangle(const XYZcoor coor) const

◆ 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.

References centreGlob(), centreGlobOriginal(), DMR_cfg::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().

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static GlobalOptionMgr * getInstance()
CLHEP::Hep3Vector theCentreGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
std::string ALIstring
Definition: CocoaGlobals.h:9
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
CLHEP::Hep3Vector theCentreGlob
void setGlobalCoordinates()
def exit(msg="")

◆ 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.

References centreGlob(), centreGlobOriginalOriginal(), DMR_cfg::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().

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
CLHEP::HepRotation theRmGlobOriginalOriginal
const ALIstring & name() const
Definition: OpticalObject.h:58
const CLHEP::Hep3Vector & centreGlobOriginalOriginal() const
Definition: OpticalObject.h:82
static GlobalOptionMgr * getInstance()
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
std::string ALIstring
Definition: CocoaGlobals.h:9
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
CLHEP::Hep3Vector theCentreGlob
void setGlobalCoordinates()
def exit(msg="")

◆ eq2ang()

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

Definition at line 1807 of file OpticalObject.cc.

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

Referenced by checkMatrixEquations().

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 }
#define M_PI
double diff2pi(double ang1, double ang2)

◆ 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.

References SplitLinear::begin, and ExtraEntryList().

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

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 }
int ALIint
Definition: CocoaGlobals.h:15
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65

◆ ExtraEntryValueList()

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

◆ ExtraEntryValueOriginalList()

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

Definition at line 69 of file OpticalObject.h.

References theExtraEntryValueOriginalVector.

Referenced by resetGlobalCoordinates(), and Entry::valueDisplaced().

std::vector< ALIdouble > theExtraEntryValueOriginalVector

◆ ExtraEntryValueOriginalOriginalList()

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

Definition at line 70 of file OpticalObject.h.

References theExtraEntryValueOriginalOriginalVector.

70  {
72  }
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector

◆ fastDeviatesLightRay()

void OpticalObject::fastDeviatesLightRay ( LightRay lightray)
virtual

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

Definition at line 883 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ 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.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ fillCoordinateEntry()

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

Definition at line 314 of file OpticalObject.cc.

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

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

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 }
Definition: Entry.h:18
const ALIstring & name() const
Definition: OpticalObject.h:58
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:140
std::string ALIstring
Definition: CocoaGlobals.h:9
void addCoordinateEntryToList(Entry *entry)
def exit(msg="")

◆ fillExtraEntry()

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

Reimplemented in OptOSensor2D.

Definition at line 163 of file OpticalObject.cc.

References Model::addEntryToList(), addExtraEntryToList(), addExtraEntryValueToList(), DMR_cfg::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().

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 }
virtual ALIdouble ValueDimensionFactor() const
Definition: Entry.h:35
void setOptOCurrent(OpticalObject *opto)
Definition: Entry.h:82
void addExtraEntryToList(Entry *entry)
Definition: Entry.h:18
static ALIint debug
Definition: ALIUtils.h:34
void addExtraEntryValueToList(ALIdouble entry_value)
ALIdouble value() const
Definition: Entry.h:53
void fill(const std::vector< ALIstring > &wordlist)
Definition: Entry.cc:31
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:140
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
std::string ALIstring
Definition: CocoaGlobals.h:9
virtual void fillName(const ALIstring &name)
Definition: Entry.cc:230
def exit(msg="")

◆ 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.

References DMR_cfg::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().

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 }
std::vector< ALIdouble > theExtraEntryValueVector
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static GlobalOptionMgr * getInstance()
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
const ALIint extraEntryNo(const ALIstring &entry_name) const
def exit(msg="")

◆ findExtraEntryValueIfExists()

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

Definition at line 1563 of file OpticalObject.cc.

References extraEntryNo(), and findExtraEntryValue().

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

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 }
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
int ALIint
Definition: CocoaGlobals.h:15
const ALIint extraEntryNo(const ALIstring &entry_name) const
Definition: value.py:1

◆ findExtraEntryValueMustExist()

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

Definition at line 1548 of file OpticalObject.cc.

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

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 }
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIint extraEntryNo(const ALIstring &entry_name) const
def exit(msg="")

◆ getCmsswID()

const ALIuint OpticalObject::getCmsswID ( ) const
inline

◆ getCoordinateFromOptAlignParam()

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

Definition at line 2066 of file OpticalObject.cc.

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

Referenced by constructFromOptAligInfo().

2066  {
2067  char chartmp[20];
2068  std::vector<ALIstring> wordlist;
2069  wordlist.push_back(oaParam.name());
2070  gcvt(oaParam.value(), 10, chartmp);
2071  wordlist.push_back(chartmp);
2072  gcvt(oaParam.sigma(), 10, chartmp);
2073  wordlist.push_back(chartmp);
2074  if (oaParam.quality() == 0) {
2075  wordlist.push_back("fix");
2076  } else if (oaParam.quality() == 1) {
2077  wordlist.push_back("cal");
2078  } else if (oaParam.quality() == 2) {
2079  wordlist.push_back("unk");
2080  }
2081 
2082  if (ALIUtils::debug >= 5) {
2083  ALIUtils::dumpVS(wordlist, " getCoordinateFromOptAlignParam " + oaParam.name());
2084  }
2085 
2086  return wordlist;
2087 }
double value() const
static ALIint debug
Definition: ALIUtils.h:34
std::string name() const
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
double sigma() const

◆ getDisplacementInLocalCoordinates()

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

Definition at line 1022 of file OpticalObject.cc.

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

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 }
def exit(msg="")

◆ getDispVec()

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

Definition at line 1909 of file OpticalObject.cc.

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

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

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 }
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ getEntryCentre() [1/2]

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

Definition at line 1955 of file OpticalObject.cc.

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

Referenced by SetCentreLocalFromEntryValues().

1955  {
1956  Entry* ce = theCoordinateEntryVector[coor];
1957  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
1958  return ce->value() + ce->valueDisplacementByFitting();
1959 }
Definition: Entry.h:18
ALIdouble value() const
Definition: Entry.h:53
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
std::vector< Entry * > theCoordinateEntryVector

◆ getEntryCentre() [2/2]

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

Definition at line 1962 of file OpticalObject.cc.

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

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 }
Definition: Entry.h:18
ALIdouble value() const
Definition: Entry.h:53
XYZcoor
Definition: OpticalObject.h:33
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
std::vector< Entry * > theCoordinateEntryVector

◆ getEntryRMangle() [1/2]

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

Definition at line 1977 of file OpticalObject.cc.

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

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

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 }
Definition: Entry.h:18
ALIdouble value() const
Definition: Entry.h:53
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
std::vector< Entry * > theCoordinateEntryVector

◆ getEntryRMangle() [2/2]

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

Definition at line 1985 of file OpticalObject.cc.

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

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 }
Definition: Entry.h:18
ALIdouble value() const
Definition: Entry.h:53
XYZcoor
Definition: OpticalObject.h:33
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
std::vector< Entry * > theCoordinateEntryVector

◆ getLocalRotationAngles()

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

Definition at line 1679 of file OpticalObject.cc.

References getRotationAnglesInOptOFrame(), and theParent.

Referenced by CocoaDBMgr::GetOptAlignInfoFromOptO().

1679  {
1680  return getRotationAnglesInOptOFrame(theParent, entries);
1681 }
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry *> &entries) const
OpticalObject * theParent

◆ getMaterial()

CocoaMaterialElementary* OpticalObject::getMaterial ( ) const
inline

Definition at line 217 of file OpticalObject.h.

References theMaterial.

Referenced by CocoaToDDLMgr::lv().

217 { return theMaterial; }
CocoaMaterialElementary * theMaterial

◆ getPlate()

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

Definition at line 946 of file OpticalObject.cc.

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().

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 }
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
long double ALIdouble
Definition: CocoaGlobals.h:11
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58

◆ getRotationAnglesFromMatrix()

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

Definition at line 1710 of file OpticalObject.cc.

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

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

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 }
static std::vector< double > getRotationAnglesFromMatrix(const CLHEP::HepRotation &rmLocal, double origAngleX, double origAngleY, double origAngleZ)
Definition: ALIUtils.cc:549
static ALIint debug
Definition: ALIUtils.h:34
const CLHEP::HepRotation rmLocal() const

◆ getRotationAnglesInOptOFrame()

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

Definition at line 1684 of file OpticalObject.cc.

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

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

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 }
CLHEP::HepRotation theRmGlob
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry *> &entries) const
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const CLHEP::HepRotation rmLocal() const
CLHEP::HepRotation theRmGlobOriginal
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
def exit(msg="")

◆ getSolidShape()

CocoaSolidShape* OpticalObject::getSolidShape ( ) const
inline

Definition at line 218 of file OpticalObject.h.

References theSolidShape.

218 { return theSolidShape; }
CocoaSolidShape * theSolidShape

◆ getZAxis()

CLHEP::Hep3Vector OpticalObject::getZAxis ( )
inline

Definition at line 143 of file OpticalObject.h.

References rmGlob().

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

◆ ID()

const ALIuint OpticalObject::ID ( ) const
inline

Definition at line 96 of file OpticalObject.h.

References theCmsswID.

96 { return theCmsswID; }
ALIuint 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.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

◆ meas()

Measurement* OpticalObject::meas ( )
inline

◆ name()

const ALIstring& OpticalObject::name ( ) const
inline

Definition at line 58 of file OpticalObject.h.

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().

58 { return theName; };
ALIstring theName

◆ 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.

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

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 }
void setMeas(Measurement *meas)
set current measurement
virtual void defaultBehaviour(LightRay &lightray, Measurement &meas)
virtual void fastDeviatesLightRay(LightRay &lightray)
virtual void userDefinedBehaviour(LightRay &lightray, Measurement &meas, const ALIstring &behav)
virtual void makeMeasurement(LightRay &lightray, Measurement &meas)
virtual void fastTraversesLightRay(LightRay &lightray)
Measurement * meas()
virtual void detailedDeviatesLightRay(LightRay &lightray)
virtual void detailedTraversesLightRay(LightRay &lightray)

◆ propagateGlobalRMOriginalOriginalChangeToChildren()

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

Definition at line 652 of file OpticalObject.cc.

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

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 }
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
CLHEP::HepRotation theRmGlobOriginalOriginal
const ALIstring & name() const
Definition: OpticalObject.h:58
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
Definition: OpticalObject.h:88
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ 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.

References anglesIsGlobal, centreIsGlobal, DMR_cfg::cerr, gather_cfg::cout, ALIUtils::debug, beamvalidation::exit(), ConfigBuilder::filein, fillCoordinateEntry(), EntryMgr::getInstance(), cuy::ii, longName(), transformCylindrical2Cartesian(), and transformSpherical2Cartesian().

Referenced by readData().

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 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
void transformCylindrical2Cartesian()
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring longName() const
ii
Definition: cuy.py:589
static EntryMgr * getInstance()
Definition: EntryMgr.cc:16
ALIbool centreIsGlobal
void transformSpherical2Cartesian()
std::string ALIstring
Definition: CocoaGlobals.h:9
def exit(msg="")

◆ readData()

void OpticalObject::readData ( ALIFileIn filein)
private

Definition at line 118 of file OpticalObject.cc.

References anglesIsGlobal, centreIsGlobal, ConfigBuilder::filein, readCoordinates(), readExtraEntries(), setAnglesNull(), and type().

Referenced by construct().

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
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 }
ALIbool anglesIsGlobal
void setAnglesNull()
void readCoordinates(const ALIstring &coor_type_read, const ALIstring &coor_type_expected, ALIFileIn &filein)
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9
void readExtraEntries(ALIFileIn &filein)
const ALIstring & type() const
Definition: OpticalObject.h:59

◆ readExtraEntries()

void OpticalObject::readExtraEntries ( ALIFileIn filein)
private

Definition at line 147 of file OpticalObject.cc.

References ConfigBuilder::filein, and fillExtraEntry().

Referenced by readData().

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 }
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
std::string ALIstring
Definition: CocoaGlobals.h:9

◆ resetGlobalCoordinates()

void OpticalObject::resetGlobalCoordinates ( )

Definition at line 1573 of file OpticalObject.cc.

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

Referenced by Entry::addFittedDisplacementToValue().

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 }
CLHEP::HepRotation theRmGlob
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:81
const ALIstring & name() const
Definition: OpticalObject.h:58
const std::vector< ALIdouble > & ExtraEntryValueOriginalList()
Definition: OpticalObject.h:69
void calculateLocalRotationAxisInGlobal()
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:67
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
const CLHEP::HepRotation & rmGlobOriginal() const
Definition: OpticalObject.h:87
CLHEP::Hep3Vector theCentreGlob

◆ resetOriginalOriginalCoordinates()

void OpticalObject::resetOriginalOriginalCoordinates ( )

Definition at line 1600 of file OpticalObject.cc.

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

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 }
CLHEP::HepRotation theRmGlob
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
CLHEP::HepRotation theRmGlobOriginalOriginal
const ALIstring & name() const
Definition: OpticalObject.h:58
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
void calculateLocalRotationAxisInGlobal()
CLHEP::Hep3Vector theCentreGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
std::vector< ALIdouble > theExtraEntryValueOriginalVector
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:67
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
CLHEP::Hep3Vector theCentreGlob

◆ rmGlob()

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

◆ rmGlobOriginal()

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

Definition at line 87 of file OpticalObject.h.

References theRmGlobOriginal.

Referenced by displaceRmGlobAroundGlobal(), resetGlobalCoordinates(), and EntryAngleAffAngles::valueDisplaced().

87 { return theRmGlobOriginal; }
CLHEP::HepRotation theRmGlobOriginal

◆ rmGlobOriginalOriginal()

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

◆ rmLocal()

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

Definition at line 1669 of file OpticalObject.cc.

References eostools::rm(), theCoordinateEntryVector, and relativeConstraints::value.

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

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 }
def rm(path, rec=False)
Definition: eostools.py:363
std::vector< Entry * > theCoordinateEntryVector

◆ rotateItAroundGlobal()

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

Definition at line 1739 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundGlobal().

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 }
static ALIint debug
Definition: ALIUtils.h:34

◆ SetAnglesIsGlobal()

void OpticalObject::SetAnglesIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 273 of file OpticalObject.h.

References anglesIsGlobal.

273 { anglesIsGlobal = isG; }
ALIbool anglesIsGlobal

◆ setAnglesNull()

void OpticalObject::setAnglesNull ( )
private

Definition at line 343 of file OpticalObject.cc.

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

Referenced by readData().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
ii
Definition: cuy.py:589
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:140
std::string ALIstring
Definition: CocoaGlobals.h:9
void addCoordinateEntryToList(Entry *entry)

◆ SetCentreGlobFromCentreLocal()

void OpticalObject::SetCentreGlobFromCentreLocal ( )
private

Definition at line 749 of file OpticalObject.cc.

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

Referenced by setGlobalCentre().

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
const OpticalObject * parent() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob

◆ SetCentreIsGlobal()

void OpticalObject::SetCentreIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 272 of file OpticalObject.h.

References centreIsGlobal.

272 { centreIsGlobal = isG; }
ALIbool centreIsGlobal

◆ SetCentreLocalFromEntryValues()

void OpticalObject::SetCentreLocalFromEntryValues ( )
private

Definition at line 700 of file OpticalObject.cc.

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

Referenced by setGlobalCentre().

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 }
const double getEntryCentre(const XYZcoor coor) const
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
static ALIint debug
Definition: ALIUtils.h:34
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
CLHEP::Hep3Vector theCentreGlob

◆ setCmsswID()

void OpticalObject::setCmsswID ( ALIuint  id)
inline

◆ setExtraEntryValue()

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

Definition at line 1077 of file OpticalObject.cc.

References theExtraEntryValueVector, and heppy_batch::val.

1077  {
1078  theExtraEntryValueVector[entryNo] = val;
1079 }
std::vector< ALIdouble > theExtraEntryValueVector

◆ setGlobalCentre()

void OpticalObject::setGlobalCentre ( )
private

Definition at line 593 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundLocal(), and setGlobalCoordinates().

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 }
ALIbool anglesIsGlobal
void SetCentreLocalFromEntryValues()
void SetCentreGlobFromCentreLocal()
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & type() const
Definition: OpticalObject.h:59

◆ setGlobalCoordinates()

void OpticalObject::setGlobalCoordinates ( )

◆ setGlobalCoordinatesOfComponents()

void OpticalObject::setGlobalCoordinatesOfComponents ( )
private

Definition at line 1304 of file OpticalObject.cc.

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

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697

◆ setGlobalRM()

void OpticalObject::setGlobalRM ( )
private

Definition at line 605 of file OpticalObject.cc.

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

Referenced by setGlobalCoordinates().

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

◆ setGlobalRMOriginalOriginal()

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

Definition at line 616 of file OpticalObject.cc.

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

Referenced by FittedEntriesReader::readFittedEntriesFromFile().

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 }
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
Definition: OpticalObject.h:88
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject *> &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:697
const OpticalObject * parent() const
Definition: OpticalObject.h:60
void SetRMGlobFromRMLocalOriginalOriginal(const CLHEP::HepRotation &rmoriori)

◆ setID()

void OpticalObject::setID ( ALIuint  id)
inline

◆ setMeas()

void OpticalObject::setMeas ( Measurement meas)
inline

set current measurement

Definition at line 199 of file OpticalObject.h.

References meas(), and theCurrentMeas.

Referenced by participateInMeasurement().

199 { theCurrentMeas = meas; }
Measurement * theCurrentMeas
Measurement * meas()

◆ setOriginalEntryValues()

void OpticalObject::setOriginalEntryValues ( )

Definition at line 823 of file OpticalObject.cc.

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

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

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 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
static ALIint debug
Definition: ALIUtils.h:34
CLHEP::HepRotation theRmGlobOriginalOriginal
void addExtraEntryValueOriginalToList(ALIdouble entry_value)
CLHEP::Hep3Vector theCentreGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
void addExtraEntryValueOriginalOriginalToList(ALIdouble entry_value)
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:67

◆ setRmGlobal()

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

Definition at line 108 of file OpticalObject.h.

References eostools::rm(), and theRmGlob.

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

108 { theRmGlob = rm; }
def rm(path, rec=False)
Definition: eostools.py:363
CLHEP::HepRotation theRmGlob

◆ setRmGlobalOriginal()

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

Definition at line 102 of file OpticalObject.h.

References eostools::rm(), and theRmGlobOriginal.

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

102 { theRmGlobOriginal = rm; }
def rm(path, rec=False)
Definition: eostools.py:363
CLHEP::HepRotation theRmGlobOriginal

◆ SetRMGlobFromRMLocal()

void OpticalObject::SetRMGlobFromRMLocal ( )
private

Definition at line 777 of file OpticalObject.cc.

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().

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 }
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static GlobalOptionMgr * getInstance()
const ALIstring longName() const
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
std::string ALIstring
Definition: CocoaGlobals.h:9
const OpticalObject * parent() const
Definition: OpticalObject.h:60
const double getEntryRMangle(const XYZcoor coor) const
const ALIstring & type() const
Definition: OpticalObject.h:59

◆ SetRMGlobFromRMLocalOriginalOriginal()

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

Definition at line 815 of file OpticalObject.cc.

References parent(), rmGlobOriginalOriginal(), and theRmGlobOriginalOriginal.

Referenced by setGlobalRMOriginalOriginal().

815  {
816  theRmGlobOriginalOriginal = rmoriori;
818 }
CLHEP::HepRotation theRmGlobOriginalOriginal
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
Definition: OpticalObject.h:88
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ SetRMLocalFromEntryValues()

void OpticalObject::SetRMLocalFromEntryValues ( )
private

Definition at line 715 of file OpticalObject.cc.

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

Referenced by setGlobalRM().

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 }
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const double getEntryRMangle(const XYZcoor coor) const

◆ setType()

void OpticalObject::setType ( const ALIstring type)
inline

Definition at line 110 of file OpticalObject.h.

References theType, and type().

110 { theType = type; }
ALIstring theType
const ALIstring & type() const
Definition: OpticalObject.h:59

◆ shortName()

const ALIstring OpticalObject::shortName ( ) const

Definition at line 1649 of file OpticalObject.cc.

References name(), and findQualityFiles::size.

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

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 }
size
Write out results.
int ALIint
Definition: CocoaGlobals.h:15
const ALIstring & name() const
Definition: OpticalObject.h:58
std::string ALIstring
Definition: CocoaGlobals.h:9

◆ transformCylindrical2Cartesian()

void OpticalObject::transformCylindrical2Cartesian ( )
private

Definition at line 275 of file OpticalObject.cc.

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().

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 }
long double ALIdouble
Definition: CocoaGlobals.h:11
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
ii
Definition: cuy.py:589
std::vector< Entry * > theCoordinateEntryVector
std::string ALIstring
Definition: CocoaGlobals.h:9
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:64
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:62
unsigned int ALIuint
Definition: CocoaGlobals.h:17

◆ transformGlobal2Local()

void OpticalObject::transformGlobal2Local ( )
private

◆ transformSpherical2Cartesian()

void OpticalObject::transformSpherical2Cartesian ( )
private

Definition at line 309 of file OpticalObject.cc.

Referenced by readCoordinates().

309 {}

◆ 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.

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

Referenced by participateInMeasurement().

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 }
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIstring & type() const
Definition: OpticalObject.h:59
def exit(msg="")

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