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::OpticalObject ( )
inline
OpticalObject::OpticalObject ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)

Definition at line 54 of file OpticalObject.cc.

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

54  :theParent(parent), theType(type), theName(name), fcopyData( copy_data)
55 {
56  if ( ALIUtils::debug >= 4 ) {
57  std::cout << std::endl << "@@@@ Creating OpticalObject: NAME= " << theName << " TYPE= " <<theType << " fcopyData " <<fcopyData <<std::endl;
58  }
59 
61 }
type
Definition: HCALResponse.h:21
ALIstring theName
static ALIint debug
Definition: ALIUtils.h:36
static OpticalObjectMgr * getInstance()
Get the only instance.
void registerMe(OpticalObject *opto)
ALIstring theType
OpticalObject * theParent
ALIbool fcopyData
const ALIstring & name() const
Definition: OpticalObject.h:60
OpticalObject::~OpticalObject ( )
virtual

Definition at line 1707 of file OpticalObject.cc.

Referenced by OpticalObject().

1708 {
1709 }

Member Function Documentation

void OpticalObject::addCoordinateEntryToList ( Entry entry)
inline

Definition at line 141 of file OpticalObject.h.

References theCoordinateEntryVector.

Referenced by fillCoordinateEntry(), and setAnglesNull().

141  {
142  theCoordinateEntryVector.push_back( entry );
143  }
std::vector< Entry * > theCoordinateEntryVector
void OpticalObject::addExtraEntryToList ( Entry entry)
inline

Definition at line 144 of file OpticalObject.h.

References theExtraEntryVector.

Referenced by fillExtraEntry().

144  {
145  theExtraEntryVector.push_back( entry );
146  }
std::vector< Entry * > theExtraEntryVector
void OpticalObject::addExtraEntryValueOriginalOriginalToList ( ALIdouble  entry_value)
inline
void OpticalObject::addExtraEntryValueOriginalToList ( ALIdouble  entry_value)
inline

Definition at line 150 of file OpticalObject.h.

References theExtraEntryValueOriginalVector.

Referenced by setOriginalEntryValues().

150  {
151  theExtraEntryValueOriginalVector.push_back( entry_value );
152  }
std::vector< ALIdouble > theExtraEntryValueOriginalVector
void OpticalObject::addExtraEntryValueToList ( ALIdouble  entry_value)
inline

Definition at line 147 of file OpticalObject.h.

References theExtraEntryValueVector.

Referenced by fillExtraEntry().

147  {
148  theExtraEntryValueVector.push_back( entry_value );
149  }
std::vector< ALIdouble > theExtraEntryValueVector
double OpticalObject::addPii ( double  val)

Definition at line 1912 of file OpticalObject.cc.

References M_PI, and heppy_batch::val.

Referenced by meas().

1913 {
1914  if( val < M_PI ) {
1915  val += M_PI;
1916  } else {
1917  val -= M_PI;
1918  }
1919 
1920  return val;
1921 }
#define M_PI
double OpticalObject::approxTo0 ( double  val)

Definition at line 1903 of file OpticalObject.cc.

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

Referenced by meas().

1904 {
1905  double precision = 1.e-9;
1906  if( fabs(val) < precision ) val = 0;
1907  return val;
1908 }
CLHEP::HepRotation OpticalObject::buildRmFromEntryValuesOriginalOriginal ( )

Definition at line 716 of file OpticalObject.cc.

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

Referenced by setRmGlobalOriginal().

717 {
718  CLHEP::HepRotation rm;
719  const OpticalObject* opto_par = this;
720  // if(Model::GlobalOptions()["rotateAroundLocal"] == 0) {
721  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before X " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(XCoor) <<std::endl;
722  const std::vector< Entry* >& cel = CoordinateEntryList();
723  rm.rotateX( cel[3]->valueOriginalOriginal() );
724  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before Y " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(YCoor) <<std::endl;
725  rm.rotateY( cel[4]->valueOriginalOriginal() );
726  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before Z " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(ZCoor) <<std::endl;
727  rm.rotateZ( cel[5]->valueOriginalOriginal() );
728  //- rm.rotateZ( getEntryRMangle(ZCoor) );
729  if(ALIUtils::debug >= 54) ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName() );
730 
731  return rm;
732 }
const double getEntryRMangle(const XYZcoor coor) const
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:65
static ALIint debug
Definition: ALIUtils.h:36
const OpticalObject * parent() const
Definition: OpticalObject.h:62
const ALIstring longName() const
const ALIstring & name() const
Definition: OpticalObject.h:60
rm
Definition: submit.py:76
void OpticalObject::buildWordList ( const Entry entry,
std::vector< ALIstring > &  wordlist 
)
private

Definition at line 433 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), Entry::name(), name(), Entry::OptOCurrent(), Entry::quality(), Entry::sigma(), Entry::SigmaDimensionFactor(), Entry::value(), and Entry::ValueDimensionFactor().

Referenced by copyData(), and getSolidShape().

434 {
435  //---------- 1st add name
436  wordlist.push_back( entry->name() );
437 
438  //---------- 1st add value
439  char chartmp[20];
440  gcvt(entry->value()/entry->ValueDimensionFactor(),10, chartmp);
441  wordlist.push_back( chartmp );
442 
443  //---------- 1st add sigma
444  gcvt(entry->sigma()/entry->SigmaDimensionFactor(),10, chartmp);
445  wordlist.push_back( chartmp );
446 
447  //---------- 1st add quality
448  ALIstring strtmp;
449  ALIint inttmp = entry->quality();
450  switch ( inttmp ) {
451  case 0:
452  strtmp = "fix";
453  break;
454  case 1:
455  strtmp = "cal";
456  break;
457  case 2:
458  strtmp = "unk";
459  break;
460  default:
461  std::cerr << "buildWordList: entry " << entry->OptOCurrent()->name() << entry->name() << " quality not found " << inttmp << std::endl;
462  break;
463  }
464  wordlist.push_back( strtmp );
465 
466  if( ALIUtils::debug>=9) {
467  ALIUtils::dumpVS( wordlist, "buildWordList: ", std::cout );
468  }
469 
470 }
ALIdouble value() const
Definition: Entry.h:55
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:36
virtual ALIdouble SigmaDimensionFactor() const
Definition: Entry.h:38
const ALIstring & name() const
Definition: Entry.h:52
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:501
ALIint quality() const
Definition: Entry.h:59
virtual ALIdouble ValueDimensionFactor() const
Definition: Entry.h:37
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
ALIdouble sigma() const
Definition: Entry.h:57
void OpticalObject::calculateLocalRotationAxisInGlobal ( )
private

Definition at line 1796 of file OpticalObject.cc.

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

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

1797 {
1798  axisXLocalInGlobal = CLHEP::Hep3Vector(1.,0.,0.);
1800  axisYLocalInGlobal = CLHEP::Hep3Vector(0.,1.,0.);
1802  axisZLocalInGlobal = CLHEP::Hep3Vector(0.,0.,1.);
1804  if( ALIUtils::debug >= 4 ){
1805  std::cout << name() << " axis X local in global " << axisXLocalInGlobal << std::endl;
1806  std::cout << name() << " axis Y local in global " << axisYLocalInGlobal << std::endl;
1807  std::cout << name() << " axis Z local in global " << axisZLocalInGlobal << std::endl;
1808  }
1809 
1810 }
CLHEP::HepRotation theRmGlob
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::Hep3Vector axisYLocalInGlobal
CLHEP::Hep3Vector axisXLocalInGlobal
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector axisZLocalInGlobal
const CLHEP::Hep3Vector& OpticalObject::centreGlob ( ) const
inline
const CLHEP::Hep3Vector& OpticalObject::centreGlobal ( ) const
inline

Definition at line 89 of file OpticalObject.h.

References centreGlob(), and centreLocal().

89  {
90  return centreGlob();
91  }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const CLHEP::Hep3Vector& OpticalObject::centreGlobOriginal ( ) const
inline
const CLHEP::Hep3Vector& OpticalObject::centreGlobOriginalOriginal ( ) const
inline

Definition at line 98 of file OpticalObject.h.

References theCentreGlobOriginalOriginal.

Referenced by displaceRmGlobOriginalOriginal().

98  {
100  }
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
const CLHEP::Hep3Vector OpticalObject::centreLocal ( ) const

Definition at line 2025 of file OpticalObject.cc.

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

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

2026 {
2027 
2028  CLHEP::Hep3Vector cLocal = theCentreGlob - parent()->centreGlob();
2029  CLHEP::HepRotation rmParentInv = inverseOf( parent()->rmGlob() );
2030  cLocal = rmParentInv * cLocal;
2031 
2032  return cLocal;
2033  /*-
2034 
2035  if( theCoordinateEntryVector.size() >= 3 ) {
2036  return CLHEP::Hep3Vector( theCoordinateEntryVector[0]->value(), theCoordinateEntryVector[1]->value(), theCoordinateEntryVector[2]->value() );
2037  } else {
2038  return CLHEP::Hep3Vector(0.,0.,0.);
2039  }
2040  */
2041 }
const CLHEP::HepRotation & rmGlob() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
CLHEP::Hep3Vector theCentreGlob
int OpticalObject::checkMatrixEquations ( double  angleX,
double  angleY,
double  angleZ,
CLHEP::HepRotation *  rot = nullptr 
)

Definition at line 1924 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, funct::cos(), eq2ang(), funct::sin(), fftjetcommon_cfi::sx, and fftjetcommon_cfi::sy.

Referenced by meas().

1925 {
1926  //- std::cout << " cme " << angleX << " " << angleY << " " << angleZ << std::endl;
1927  if( rot == nullptr ) {
1928  rot = new CLHEP::HepRotation();
1929  rot->rotateX( angleX );
1930  rot->rotateY( angleY );
1931  rot->rotateZ( angleZ );
1932  }
1933  double sx = sin(angleX);
1934  double cx = cos(angleX);
1935  double sy = sin(angleY);
1936  double cy = cos(angleY);
1937  double sz = sin(angleZ);
1938  double cz = cos(angleZ);
1939 
1940  double rotxx = cy*cz;
1941  double rotxy = sx*sy*cz-cx*sz;
1942  double rotxz = cx*sy*cz+sx*sz;
1943  double rotyx = cy*sz;
1944  double rotyy = sx*sy*sz+cx*cz;
1945  double rotyz = cx*sy*sz-sx*cz;
1946  double rotzx = -sy;
1947  double rotzy = sx*cy;
1948  double rotzz = cx*cy;
1949 
1950  int matrixElemBad = 0;
1951  if( !eq2ang( rot->xx(), rotxx ) ) {
1952  std::cerr << " EQUATION for xx() IS BAD " << rot->xx() << " <> " << rotxx << std::endl;
1953  matrixElemBad++;
1954  }
1955  if( !eq2ang( rot->xy(), rotxy ) ) {
1956  std::cerr << " EQUATION for xy() IS BAD " << rot->xy() << " <> " << rotxy << std::endl;
1957  matrixElemBad++;
1958  }
1959  if( !eq2ang( rot->xz(), rotxz ) ) {
1960  std::cerr << " EQUATION for xz() IS BAD " << rot->xz() << " <> " << rotxz << std::endl;
1961  matrixElemBad++;
1962  }
1963  if( !eq2ang( rot->yx(), rotyx ) ) {
1964  std::cerr << " EQUATION for yx() IS BAD " << rot->yx() << " <> " << rotyx << std::endl;
1965  matrixElemBad++;
1966  }
1967  if( !eq2ang( rot->yy(), rotyy ) ) {
1968  std::cerr << " EQUATION for yy() IS BAD " << rot->yy() << " <> " << rotyy << std::endl;
1969  matrixElemBad++;
1970  }
1971  if( !eq2ang( rot->yz(), rotyz ) ) {
1972  std::cerr << " EQUATION for yz() IS BAD " << rot->yz() << " <> " << rotyz << std::endl;
1973  matrixElemBad++;
1974  }
1975  if( !eq2ang( rot->zx(), rotzx ) ) {
1976  std::cerr << " EQUATION for zx() IS BAD " << rot->zx() << " <> " << rotzx << std::endl;
1977  matrixElemBad++;
1978  }
1979  if( !eq2ang( rot->zy(), rotzy ) ) {
1980  std::cerr << " EQUATION for zy() IS BAD " << rot->zy() << " <> " << rotzy << std::endl;
1981  matrixElemBad++;
1982  }
1983  if( !eq2ang( rot->zz(), rotzz ) ) {
1984  std::cerr << " EQUATION for zz() IS BAD " << rot->zz() << " <> " << rotzz << std::endl;
1985  matrixElemBad++;
1986  }
1987 
1988  //- std::cout << " cme: matrixElemBad " << matrixElemBad << std::endl;
1989  return matrixElemBad;
1990 }
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
void OpticalObject::construct ( )

Definition at line 67 of file OpticalObject.cc.

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

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

68 {
69  //---------- Get file handler
71  /*- if(!filein) {
72  filein.ErrorInLine();
73  std::cerr << "cannot open file SystemDescription.txt" << std::endl;
74  exit(0);
75  }*/
76 
77  if( theParent != nullptr ) { //----- OptO 'system' has no parent (and no affine frame)
78  //---------- Read or copy Data
79  if(!fcopyData) {
80  if(ALIUtils::debug >=4) std::cout << "@@@@ Reading data of Optical Object " << name() << std::endl;
81  readData( filein );
82  } else {
83  if(ALIUtils::debug >=4) std::cout << "Copy data of Optical Object " << name() << std::endl;
84  copyData();
85  }
86 
87  //---------- Set global coordinates
89  //---------- Set ValueDisplacementByFitting to 0. !!done at Entry construction
90  /* std::vector<Entry*>::const_iterator vecite;
91  for ( vecite = CoordinateEntryList().begin(); vecite != CoordinateEntryList().end(); vecite++) {
92  (*vecite)->setValueDisplacementByFitting( 0. );
93  }
94  */
95 
96  //---------- Set original entry values
98  }
99 
100  //---------- Create the OptO that compose this one
101  createComponentOptOs( filein );
102 
103  //---------- Construct material
105 
106  //---------- Construct solid shape
108 
109 }
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:23
static ALIint debug
Definition: ALIUtils.h:36
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:86
void setOriginalEntryValues()
void readData(ALIFileIn &filein)
virtual void constructSolidShape()
OpticalObject * theParent
ALIbool fcopyData
const ALIstring & name() const
Definition: OpticalObject.h:60
void createComponentOptOs(ALIFileIn &filein)
virtual void constructMaterial()
void setGlobalCoordinates()
void OpticalObject::constructFromOptAligInfo ( const OpticalAlignInfo oaInfo)

Definition at line 2112 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(), createComponentOptOsFromOptAlignInfo(), and OpticalObject().

2113 {
2114  if( theParent != nullptr ) { //----- OptO 'system' has no parent (and no affine frame)
2115  //---------- Build Data
2116  //---------- See if there are extra entries and read them
2117  std::vector<OpticalAlignParam> exEnt = oaInfo.extraEntries_;
2118  std::vector<OpticalAlignParam>::iterator ite;
2119  std::vector<ALIstring> wordlist;
2120  for( ite = exEnt.begin(); ite != exEnt.end(); ++ite ){
2121  wordlist = getCoordinateFromOptAlignParam( *ite );
2122  wordlist.insert(wordlist.begin(), (*ite).dimType() );
2123  fillExtraEntry( wordlist );
2124  }
2125 
2126  //--------- set centre and angles not global (default behaviour)
2127  centreIsGlobal = false;
2128  anglesIsGlobal = false;
2129 
2130  setCmsswID( oaInfo.ID_);
2131  //--------- build Coordinates
2132  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.x_ ) );
2133  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.y_ ) );
2134  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.z_ ) );
2138 
2139  //---------- Set global coordinates
2141 
2142  //---------- Set original entry values
2144  }
2145 
2146  //---------- Construct material
2148 
2149  //---------- Construct solid shape
2151 
2152  if ( ALIUtils::debug >= 5 ) {
2153  std::cout << "constructFromOptAligInfo constructed: " << *this << std::endl;
2154  }
2155 
2156  //---------- Create the OptO that compose this one
2158 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
OpticalAlignParam x_
static ALIint debug
Definition: ALIUtils.h:36
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)
OpticalAlignParam z_
OpticalObject * theParent
std::vector< OpticalAlignParam > extraEntries_
OpticalAlignParam angy_
ALIbool centreIsGlobal
void createComponentOptOsFromOptAlignInfo()
virtual void constructMaterial()
void setGlobalCoordinates()
unsigned int ID_
void OpticalObject::constructMaterial ( )
virtual

Definition at line 2095 of file OpticalObject.cc.

References f, and theMaterial.

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

2096 {
2097  theMaterial = new CocoaMaterialElementary( "Hydrogen", 70.8*mg/cm3, "H", 1.00794f, 1 );
2098 }
double f[11][100]
CocoaMaterialElementary * theMaterial
void OpticalObject::constructSolidShape ( )
virtual

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

Definition at line 2101 of file OpticalObject.cc.

References GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), funct::m, and theSolidShape.

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

2102 {
2103  ALIdouble go;
2105  gomgr->getGlobalOptionValue("VisScale", go );
2106 
2107  theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
2108 }
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
const std::vector< Entry* >& OpticalObject::CoordinateEntryList ( ) const
inline
void OpticalObject::copyData ( )
private

Definition at line 385 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(), and getSolidShape().

386 {
387  centreIsGlobal = false;
388  anglesIsGlobal = false;
389  if(ALIUtils::debug >= 5) std::cout << "entering copyData()" << std::endl;
390 
391  //---------- Get copied OptO
393 
394  //---------- build name: for a copied OptO, now name is parent name, add the last part of the copied OptO
395  ALIint copy_name_last_slash = opto->name().rfind('/');
396  ALIint copy_name_size = opto->name().length();
397  //- if(ALIUtils::debug >= 9) std::cout << "BUILD UP NAME0 " << theName << std::endl;
398  theName.append( opto->name(), copy_name_last_slash, copy_name_size);
399  if(ALIUtils::debug >= 5) std::cout << "copying OptO: " << opto->name() << " to OptO " << theName << std::endl;
400 
401  //---------- Copy Extra Entries from copied OptO
402  std::vector<Entry*>::const_iterator vecite;
403  for( vecite = opto->ExtraEntryList().begin(); vecite != opto->ExtraEntryList().end(); ++vecite ) {
404  std::vector<ALIstring> wordlist;
405  wordlist.push_back( (*vecite)->type() );
406  buildWordList( (*vecite), wordlist );
407  if( ALIUtils::debug>=9) {
408  ALIUtils::dumpVS( wordlist, "copyData: ", std::cout );
409  }
410  fillExtraEntry( wordlist );
411  }
412 
413  //---------- Copy Coordinate Entries from copied OptO
414  for( vecite = opto->CoordinateEntryList().begin(); vecite != opto->CoordinateEntryList().end(); ++vecite ) {
415  std::vector<ALIstring> wordlist;
416  buildWordList( (*vecite), wordlist );
417  //----- first three coordinates centre, second three coordinates angles!!PROTECT AGAINST OTHER POSSIBILITIES!!
418  ALIstring coor_name;
419  if( vecite - opto->CoordinateEntryList().begin() < 3 ) {
420  coor_name = "centre";
421  } else {
422  coor_name = "angles";
423  }
424  fillCoordinateEntry( coor_name, wordlist );
425  }
426 
427 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
ALIstring theName
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:65
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:36
static OpticalObject * nextOptOToCopy()
Definition: Model.cc:818
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:501
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::createComponentOptOs ( ALIFileIn filein)
private

Definition at line 476 of file OpticalObject.cc.

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

Referenced by construct(), and getSolidShape().

477 {
478  //---------- flag to determine if components are copied or read (it is passed to the constructor of component OptOs)
479  ALIbool fcopyComponents = false;
480 
481  //---------- Get list of components of current OptO (copy it to 'vopto_types')
482  std::vector<ALIstring> vopto_types;
483  int igetood = Model::getComponentOptOTypes( type(), vopto_types );
484  if( !igetood ) {
485  if(ALIUtils::debug >= 5) std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
486  return;
487  }
488 
489  /* //---------- Dump component list
490  if(ALIUtils::debug >= 5) {
491  ALIUtils::dumpVS( wordlist, "SYSTEM: ", std::cout );
492  }*/
493 
494  //---------- Loop components (have to follow list in 'vopto_types')
495  std::vector<ALIstring>::iterator vsite;
496  std::vector<ALIstring> wordlist;
497  for( vsite=vopto_types.begin(); vsite!=vopto_types.end(); ++vsite ) {
498  //----- If it is not being copied, read first line describing object
499  //- std::cout << "fcopyy" << fcopyComponents << fcopyData << theName << *vsite << std::endl;
500  if( !fcopyData && !fcopyComponents ) filein.getWordsInLine(wordlist);
501  //t if( !fcopyData ) filein.getWordsInLine(wordlist);
502 
503  //----- Check first line describing object
504  //--- Don't check it if OptO is going to be copied (fcopyData = 1)
505  //--- If OptO is not copied, but components will be copied, check if only for the first component (for the second fcopyComponents=1)
506  if( fcopyData || fcopyComponents ) {
507  fcopyComponents = true;
508  //--- If OptO not copied, but components will be copied
509  }else if( wordlist[0] == ALIstring("copy_components") ) {
510  if(ALIUtils::debug>=3)std::cout << "createComponentOptOs: copy_components" << wordlist[0] << std::endl;
512  fcopyComponents = true; //--- for the second and following components
513  //----- If no copying: check that type is the expected one
514  } else if ( wordlist[0] != (*vsite) ) {
515  filein.ErrorInLine();
516  std::cerr << "!!! Badly placed OpticalObject: " << wordlist[0] << " should be = " << (*vsite) << std::endl;
517  exit(2);
518  }
519 
520  //---------- Make composite component name
521  ALIstring component_name = name();
522  //----- 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]
523  if( !fcopyComponents ) {
524  component_name += '/';
525  component_name += wordlist[1];
526  }
527  // if ( ALIUtils::debug >= 6 ) std::cout << "MAKE NAME " << name() << " TO " << component_name << std::endl;
528 
529  //---------- Create OpticalObject of the corresponding type
530  OpticalObject* OptOcomponent = createNewOptO( this, *vsite, component_name, fcopyComponents );
531 
532  //----- Fill CMS software ID
533  if( wordlist.size() == 3 ) {
534  OptOcomponent->setID( ALIUtils::getInt( wordlist[2] ) );
535  } else {
536  OptOcomponent->setID( OpticalObjectMgr::getInstance()->buildCmsSwID() );
537  }
538 
539  //---------- Construct it (read data and
540  OptOcomponent->construct();
541 
542  //---------- Fill OptO tree and OptO list
543  Model::OptOList().push_back( OptOcomponent );
544  }
545 
546 }
void setID(ALIuint id)
OpticalObject * createNewOptO(OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
static ALIint debug
Definition: ALIUtils.h:36
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:771
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:83
static ALIbool getComponentOptOTypes(const ALIstring &opto_type, std::vector< ALIstring > &vcomponents)
--— Get from theOptODictionary the list of component OptO types
Definition: Model.cc:692
void ErrorInLine()
Definition: ALIFileIn.cc:204
ALIbool fcopyData
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
static int getInt(const ALIstring &str)
Convert a string to an integer, checking that it is really an integer.
Definition: ALIUtils.cc:417
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::createComponentOptOsFromOptAlignInfo ( )

Definition at line 2189 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(), and OpticalObject().

2190 {
2191  //----- Build children list of this object
2192  std::vector<OpticalAlignInfo> children;
2193 
2194  std::vector<OpticalAlignInfo>::const_iterator ite;
2195  if ( ALIUtils::debug >= 5 ) {
2196  std::cout << " Model::getOpticalAlignments().size " << Model::getOpticalAlignments().size() << std::endl;
2197  }
2198  // for( ite = Model::getOpticalAlignments().begin(); ite != Model::getOpticalAlignments().end(); ite++ ){
2199  int siz= Model::getOpticalAlignments().size();
2200  for(int ii = 0; ii < siz; ii++ ){
2201  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo name " << (*ite).name_ << std::endl;
2202  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo " << (*ite).parentName_ << " =? " << theName << std::endl;
2203  // std::cout << " OpticalObject::getComponentOptOsFromOptAlignInfo name " << ii << std::endl;
2204  // if( (*ite)parentName_. == oaInfo.name() && (*ite).name() != "simple2DWithMirror:mirror1" ) {
2205  if( Model::getOpticalAlignments()[ii].parentName_ == theName ) {
2206  // if( (*ite).parentName_ == theName ) {
2207 
2208  // std::cout << "createComponentOptOsFromOptAlignInfo: 1 to push_back " << std::endl;
2209  std::vector<OpticalAlignParam> exent = Model::getOpticalAlignments()[ii].extraEntries_;
2210  // std::vector<OpticalAlignParam> exent = (*ite).extraEntries_;
2211  //- std::cout << "createComponentOptOsFromOptAlignInfo: 2 to push_back " << std::endl;
2212  /* for( ALIuint ij = 0; ij < exent.size(); ij++ ){
2213  std::cout << " extra entry " << exent[ij].name_;
2214  std::cout << " extra entry " << exent[ij].dimType();
2215  std::cout << " extra entry " << exent[ij].value_;
2216  std::cout << " extra entry " << exent[ij].error_;
2217  std::cout << " extra entry " << exent[ij].quality_;
2218  } */
2219  // std::cout << "createComponentOptOsFromOptAlignInfo: 3 to push_back " << Model::getOpticalAlignments()[ii] << std::endl;
2221  // OpticalAlignInfo oaInfochild = *ite;
2222  // std::cout << "createComponentOptOsFromOptAlignInfo: 4 to push_back " << std::endl;
2223  children.push_back(oaInfochild);
2224  if ( ALIUtils::debug >= 5 ) {
2225  std::cout << theName << "createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.name_ << std::endl;
2226  }
2227  }
2228  // std::cout << "createComponentOptOsFromOptAlignInfo: 6 push_backed " << std::endl;
2229 
2230  }
2231  // std::cout << "createComponentOptOsFromOptAlignInfo: 10 push_backed " << std::endl;
2232 
2233 
2234  if ( ALIUtils::debug >= 5 ) {
2235  std::cout << "OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2236  }
2237  for( ite = children.begin(); ite != children.end(); ++ite ){
2238 
2239  //---------- Get component type
2240  ALIstring optoType = (*ite).type_;
2241  //- //---------- Get composite component name
2242  //- ALIstring optoName = name()+"/"+(*ite).name_;
2243  //---------- Get component name
2244  ALIstring optoName = (*ite).name_;
2245  ALIbool fcopyComponents = false;
2246 
2247  //---------- Create OpticalObject of the corresponding type
2248  OpticalObject* OptOcomponent = createNewOptO( this, optoType, optoName, fcopyComponents );
2249 
2250  //---------- Construct it (read data and
2251  OptOcomponent->constructFromOptAligInfo( *ite );
2252 
2253  //---------- Fill OptO tree and OptO list
2254  Model::OptOList().push_back( OptOcomponent );
2255  }
2256 
2257 }
ALIstring theName
OpticalObject * createNewOptO(OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
static ALIint debug
Definition: ALIUtils.h:36
static std::vector< OpticalAlignInfo > getOpticalAlignments()
Definition: Model.h:141
bool ALIbool
Definition: CocoaGlobals.h:19
ii
Definition: cuy.py:588
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
std::string ALIstring
Definition: CocoaGlobals.h:9
void constructFromOptAligInfo(const OpticalAlignInfo &oaInfo)
OpticalObject * OpticalObject::createNewOptO ( OpticalObject parent,
ALIstring  optoType,
ALIstring  optoName,
ALIbool  fcopyComponents 
)
private

Definition at line 549 of file OpticalObject.cc.

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

Referenced by createComponentOptOs(), createComponentOptOsFromOptAlignInfo(), and getSolidShape().

550 {
551  if ( ALIUtils::debug >= 3 ) std::cout << " OpticalObject::createNewOptO optoType " << optoType << " optoName " << optoName << " parent " << parent->name() << std::endl;
552  OpticalObject* OptOcomponent;
553  if( optoType == "laser" ) {
554  OptOcomponent =
555  new OptOLaser( this, optoType, optoName, fcopyComponents );
556  } else if( optoType == "source" ) {
557  OptOcomponent =
558  new OptOSource( this, optoType, optoName, fcopyComponents );
559  } else if( optoType == "Xlaser" ) {
560  OptOcomponent =
561  new OptOXLaser( this, optoType, optoName, fcopyComponents );
562  } else if( optoType == "mirror" ){
563  OptOcomponent =
564  new OptOMirror( this, optoType, optoName, fcopyComponents );
565  } else if( optoType == "plate_splitter" ) {
566  OptOcomponent =
567  new OptOPlateSplitter( this, optoType, optoName, fcopyComponents );
568  } else if( optoType == "cube_splitter" ) {
569  OptOcomponent =
570  new OptOCubeSplitter( this, optoType, optoName, fcopyComponents );
571  } else if( optoType == "modified_rhomboid_prism" ) {
572  OptOcomponent =
573  new OptOModifiedRhomboidPrism( this, optoType, optoName, fcopyComponents );
574  } else if( optoType == "pseudo_pentaprism" || optoType == "optical_square" ) {
575  OptOcomponent =
576  new OptOOpticalSquare( this, optoType, optoName, fcopyComponents );
577  } else if( optoType == "lens" ) {
578  OptOcomponent =
579  new OptOLens( this, optoType, optoName, fcopyComponents );
580  } else if( optoType == "Risley_prism" ) {
581  OptOcomponent =
582  new OptORisleyPrism( this, optoType, optoName, fcopyComponents );
583  } else if( optoType == "sensor2D" ) {
584  OptOcomponent =
585  new OptOSensor2D( this, optoType, optoName, fcopyComponents );
586  } else if( optoType == "distancemeter" || optoType == "distancemeter1dim" ) {
587  OptOcomponent =
588  new OptODistancemeter( this, optoType, optoName, fcopyComponents );
589  } else if( optoType == "distancemeter3dim" ) {
590  OptOcomponent =
591  new OptODistancemeter3dim( this, optoType, optoName, fcopyComponents );
592  } else if( optoType == "distance_target" ) {
593  OptOcomponent =
594  new OptOScreen( this, optoType, optoName, fcopyComponents );
595  } else if( optoType == "tiltmeter" ) {
596  OptOcomponent =
597  new OptOTiltmeter( this, optoType, optoName, fcopyComponents );
598  } else if( optoType == "pinhole" ) {
599  OptOcomponent =
600  new OptOPinhole( this, optoType, optoName, fcopyComponents );
601  } else if( optoType == "COPS" ) {
602  OptOcomponent =
603  new OptOCOPS( this, optoType, optoName, fcopyComponents );
604  } else {
605  OptOcomponent =
606  //o new OpticalObject( this, optoType, optoName, fcopyComponents );
607  new OptOUserDefined( this, optoType, optoName, fcopyComponents );
608  }
609 
610  return OptOcomponent;
611 }
static ALIint debug
Definition: ALIUtils.h:36
const ALIstring & name() const
Definition: OpticalObject.h:60
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 914 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

915 {
916  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement a default behaviour" << std::endl;
917  std::cerr << " You have to specify some behaviour, like :D or :T or ..." << std::endl;
918  exit(1);
919 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::detailedDeviatesLightRay ( LightRay lightray)
virtual

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

Definition at line 947 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

948 {
949  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement detailed deviation (:DD / :D)" << std::endl;
950  std::cerr << " Please read documentation for this object type" << std::endl;
951  exit(1);
952 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::detailedTraversesLightRay ( LightRay lightray)
virtual

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

Definition at line 958 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

959 {
960  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
961  std::cerr << " Please read documentation for this object type" << std::endl;
962  exit(1);
963 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
double OpticalObject::diff2pi ( double  ang1,
double  ang2 
)

Definition at line 1877 of file OpticalObject.cc.

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

Referenced by eq2ang(), and meas().

1878 {
1879  double diff = fabs( ang1 - ang2 );
1880  diff = diff - int(diff/2./M_PI) * 2 *M_PI;
1881  return diff;
1882 }
#define M_PI
void OpticalObject::displaceCentreGlob ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1045 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displace(), and getZAxis().

1046 {
1047  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: coor " << coor << " disp = " << disp << std::endl;
1048 
1050  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
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  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
1058  return;
1059  }
1060  std::vector<OpticalObject*>::const_iterator vocite;
1061  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1062  (*vocite)->displaceCentreGlob( dispVec );
1063  }
1064 
1065 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::displaceCentreGlob ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1094 of file OpticalObject.cc.

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

1095 {
1096  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: dispVec = " << dispVec << std::endl;
1097 
1099  theCentreGlob += dispVec;
1100 
1101  //----------- Displace CentreGlob() of every component
1102  std::vector<OpticalObject*> vopto;
1103  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1104  if( !igetood ) {
1105  return;
1106  }
1107  std::vector<OpticalObject*>::const_iterator vocite;
1108  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1109  (*vocite)->displaceCentreGlob( dispVec );
1110  }
1111 
1112 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::displaceCentreGlobOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1135 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginal(), and getZAxis().

1136 {
1137  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1138  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original 0");
1139  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1140  theCentreGlobOriginal += dispVec;
1141 
1142  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original displaced");
1143 
1144  //----------- Displace CentreGlob() of every component
1145  std::vector<OpticalObject*> vopto;
1146  Model::getComponentOptOs(name(), vopto);
1147  std::vector<OpticalObject*>::const_iterator vocite;
1148  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1149  (*vocite)->displaceCentreGlobOriginal( dispVec );
1150  }
1151 
1152 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::Hep3Vector theCentreGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1158 of file OpticalObject.cc.

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

1159 {
1160  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1161 
1162  theCentreGlobOriginal += dispVec;
1163 
1164  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original");
1165 
1166  //----------- Displace CentreGlob() of every component
1167  std::vector<OpticalObject*> vopto;
1168  Model::getComponentOptOs(name(), vopto);
1169  std::vector<OpticalObject*>::const_iterator vocite;
1170  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1171  (*vocite)->displaceCentreGlobOriginal( dispVec );
1172  }
1173 
1174 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::Hep3Vector theCentreGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginalOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1178 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginalOriginal(), and getZAxis().

1179 {
1180  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1181  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob originalOriginal 0");
1182  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1183  theCentreGlobOriginalOriginal += dispVec;
1184 
1185  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original displaced");
1186 
1187  //----------- Displace CentreGlob() of every component
1188  std::vector<OpticalObject*> vopto;
1189  Model::getComponentOptOs(name(), vopto);
1190  std::vector<OpticalObject*>::const_iterator vocite;
1191  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1192  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1193  }
1194 
1195 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginalOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1201 of file OpticalObject.cc.

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

1202 {
1203  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1204 
1205  theCentreGlobOriginalOriginal += dispVec;
1206 
1207  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original");
1208 
1209  //----------- Displace CentreGlob() of every component
1210  std::vector<OpticalObject*> vopto;
1211  Model::getComponentOptOs(name(), vopto);
1212  std::vector<OpticalObject*>::const_iterator vocite;
1213  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1214  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1215  }
1216 
1217 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceExtraEntry ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1118 of file OpticalObject.cc.

References LogDebug, theExtraEntryValueOriginalVector, and theExtraEntryValueVector.

Referenced by Entry::displace(), and getZAxis().

1119 {
1120  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalVector.begin() + entryNo);
1121  ALIdouble Pentry_value = (Pentry_orig_value) + disp;
1122  LogDebug("OpticalObject::displaceExtraEntry")
1123  << " displaceExtraEntry " << Pentry_value << " <> " << Pentry_orig_value
1124  << std::endl;
1125  theExtraEntryValueVector[entryNo] = Pentry_value;
1126 }
#define LogDebug(id)
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueVector
std::vector< ALIdouble > theExtraEntryValueOriginalVector
void OpticalObject::displaceExtraEntryOriginal ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1525 of file OpticalObject.cc.

References theExtraEntryValueOriginalVector.

Referenced by Entry::displaceOriginal(), and getZAxis().

1526 {
1527  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalVector.begin() + entryNo);
1528  Pentry_orig_value += disp;
1529  // std::cout << " displaceExtraEntryOriginal " << *(theExtraEntryValueOriginalVector.begin() + entryNo) << " + " << disp << std::endl;
1530  theExtraEntryValueOriginalVector[entryNo] = Pentry_orig_value;
1531 
1532 }
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueOriginalVector
void OpticalObject::displaceExtraEntryOriginalOriginal ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1536 of file OpticalObject.cc.

References theExtraEntryValueOriginalOriginalVector.

Referenced by Entry::displaceOriginalOriginal(), and getZAxis().

1537 {
1538  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo);
1539  Pentry_orig_value += disp;
1540  // std::cout << " displaceExtraEntryOriginalOriginal " << *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo) << " + " << disp << std::endl;
1541  theExtraEntryValueOriginalOriginalVector[entryNo] = Pentry_orig_value;
1542 
1543 }
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
void OpticalObject::displaceRmGlobAroundGlobal ( OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1224 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(), and getZAxis().

1225 {
1226  if(ALIUtils::debug>=5) std::cout << name() << "DISPLACERMGLOBAROUNDGLOBAL" << coor << "disp" << disp << std::endl;
1227  //-------------------- Rotate rotation matrix
1230  if(ALIUtils::debug >= 5 ) {
1231  std::cout << this->name() << std::endl;
1232  ALIUtils::dumprm( theRmGlob, "before disp rm " );
1233  }
1234  rotateItAroundGlobal( theRmGlob, coor, disp );
1235  if(ALIUtils::debug >= 5 ) {
1236  ALIUtils::dumprm( theRmGlob, "after disp rm " );
1237  }
1238  //-------------------- Rotation translate the centre of component OptO
1239  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob before rotation" );
1240  if(ALIUtils::debug >= 5 ) ALIUtils::dump3v( centreGlobOriginal(), " centreGlobOriginal before rotation" );
1241  if(opto1stRotated != this ) { //own _centre_glob is not displaced
1242  //---------- Distance to 1st rotated OptO
1243  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1244  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1245  rotateItAroundGlobal( radius_rotated, coor, disp );
1246  theCentreGlob = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1247  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob after rotation" );
1248  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlobOriginal(), " centre_globOriginal() after rotation" );
1249  }
1250 
1251  //----------- Displace every component
1252  std::vector<OpticalObject*> vopto;
1253  Model::getComponentOptOs(name(), vopto);
1254  std::vector<OpticalObject*>::const_iterator vocite;
1255  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1256  (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1257  }
1258 
1259 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
void rotateItAroundGlobal(T &object, const XYZcoor coor, const double disp)
const CLHEP::HepRotation & rmGlobOriginal() const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::displaceRmGlobAroundLocal ( OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1266 of file OpticalObject.cc.

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

1267 {
1268  if( anglesIsGlobal ) {
1269  std::cerr << "!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is set as a Global Option " << std::endl;
1270  abort();
1271  }
1272 
1273  if(ALIUtils::debug>=5) std::cout << name() << " DISPLACE_RMGLOB_AROUND_LOCAL " << coor << " disp " << disp << std::endl;
1274  //---------- Build the rmGlob and centreGlob again, with displacement values
1275  //----- Local rotation is build with entry values plus displacement
1276  theRmGlob = CLHEP::HepRotation();
1277  //---------- Set global rotation matrix
1278  //-------- Get rm from Entries
1279  if( coor == XCoor ) {
1280  theRmGlob.rotateX( getEntryRMangle(XCoor) + disp );
1281  if(ALIUtils::debug>=5) std::cout << " rmglob rotated around x " << getEntryRMangle(XCoor) + disp << std::endl;
1282  }else {
1283  theRmGlob.rotateX( getEntryRMangle(XCoor) );
1284  }
1285  if(ALIUtils::debug >= 4) {
1286  ALIUtils::dumprm( theRmGlob, "displaceRmGlobAroundLocal: rm local after X " );
1287  }
1288 
1289 //- std::cout << name() << " " << coor << " " << XCoor << " getEntryRMangle(coor) )" << getEntryRMangle(coor) << std::endl;
1290  if( coor == YCoor ) {
1291  theRmGlob.rotateY( getEntryRMangle(YCoor) + disp );
1292  if(ALIUtils::debug>=5) std::cout << " rmglob rotated around y " << getEntryRMangle(YCoor) + disp << std::endl;
1293  }else {
1294  theRmGlob.rotateY( getEntryRMangle(YCoor) );
1295  }
1296  if(ALIUtils::debug >= 4) {
1297  std::cout << " getEntryRMangle(YCoor) " << getEntryRMangle(YCoor) << std::endl;
1298  ALIUtils::dumprm( theRmGlob, "displaceRmGlobAroundLocal: rm local after Y " );
1299  }
1300 
1301  if( coor == ZCoor ) {
1302  theRmGlob.rotateZ( getEntryRMangle(ZCoor) + disp );
1303  if(ALIUtils::debug>=5) std::cout << " rmglob rotated around z " << getEntryRMangle(ZCoor) + disp << std::endl;
1304  }else {
1305  theRmGlob.rotateZ( getEntryRMangle(ZCoor) );
1306  }
1307  if(ALIUtils::debug >= 4) {
1308  std::cout << " getEntryRMangle(ZCoor) " << getEntryRMangle(ZCoor) << std::endl;
1309  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM ");
1310  }
1311 
1312  //- theCentreGlob = CLHEP::Hep3Vector(0.,0.,0.);
1313  if(ALIUtils::debug >= 5 && disp != 0) {
1314  std::cout << this->name() << std::endl;
1315  ALIUtils::dumprm( theRmGlob, "displaceRmGlobAroundLocal: rm local " );
1316  }
1317 
1318 
1319  if( !anglesIsGlobal ) {
1321  }
1322 
1323  //----- calculate local rot axis with new rm glob
1325 
1326  //- theCentreGlob = CLHEP::Hep3Vector(0.,0.,0.);
1327  if(ALIUtils::debug >= 5 && disp != 0) {
1328  std::cout << this->name() << std::endl;
1329  ALIUtils::dumprm( theRmGlob, "displaceRmGlobAroundLocal: rm global " );
1330  }
1331 
1332  if(opto1stRotated != this ) { //own _centre_glob doesn't rotate
1333  setGlobalCentre();
1334  if(ALIUtils::debug >= 5) {
1335  ALIUtils::dump3v( centreGlob(), " centre_glob after rotation" );
1336  ALIUtils::dump3v( centreGlobOriginal(), " centre_globOriginal() after rotation" );
1337  }
1338  }
1339 
1340  //----------- Displace every component
1341  std::vector<OpticalObject*> vopto;
1342  Model::getComponentOptOs(name(), vopto);
1343  std::vector<OpticalObject*>::const_iterator vocite;
1344  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1345  (*vocite)->displaceRmGlobAroundLocal( opto1stRotated, coor, 0.);
1346  //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
1347  }
1348 
1349 }
const double getEntryRMangle(const XYZcoor coor) const
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
ALIbool anglesIsGlobal
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
void calculateLocalRotationAxisInGlobal()
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
void SetRMGlobFromRMLocal()
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
void setGlobalCentre()
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceRmGlobOriginal ( const OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

!temporary, theRmGlobOriginal should disappear

Definition at line 1368 of file OpticalObject.cc.

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

Referenced by EntryAngleAffAngles::displaceOriginal(), and getZAxis().

1369 {
1370  if(ALIUtils::debug>=9) std::cout << name() << " DISPLACEORIGRMGLOB " << coor << " disp " << disp << std::endl;
1372  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
1373  //-------------------- Rotate rotation matrix
1374  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginal, name() + ALIstring(" theRmGlobOriginal before displaced ") );
1375  switch( coor ) {
1376  case 0:
1377  theRmGlobOriginal.rotateX( disp );
1378  break;
1379  case 1:
1380  theRmGlobOriginal.rotateY( disp );
1381  break;
1382  case 2:
1383  theRmGlobOriginal.rotateZ( disp );
1384  break;
1385  default:
1386  std::cerr << "!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1387  exit(2);
1388  }
1389 
1390 
1391  //-------------------- Rotation translate the centre of component OptO
1392  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angles rotate centre_glob" );
1393  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginal(), " centreGlobOriginal" );
1394  if(opto1stRotated != this ) { //own _centre_glob doesn't rotate
1395  //---------- Distance to 1st rotated OptO
1396  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1397  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1398  switch (coor) {
1399  case 0:
1400  radius_rotated.rotateX(disp);
1401  break;
1402  case 1:
1403  radius_rotated.rotateY(disp);
1404  break;
1405  case 2:
1406  radius_rotated.rotateZ(disp);
1407  break;
1408  default:
1409  break; // already exited in previous switch
1410  }
1411  theCentreGlobOriginal = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1412  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angle rotate centre_glob" );
1413  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginal(), " centre_globOriginal()" );
1414  }
1415 
1416  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginal, name() + ALIstring(" theRmGlobOriginal displaced ") );
1417 
1418  //----------- Displace every OptO component
1419  std::vector<OpticalObject*> vopto;
1420  Model::getComponentOptOs(name(), vopto);
1421  std::vector<OpticalObject*>::const_iterator vocite;
1422  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1423  (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1424  }
1425 
1426  } else {
1430  //----------- Displace every OptO component
1431  std::vector<OpticalObject*> vopto;
1432  Model::getComponentOptOs(name(), vopto);
1433  std::vector<OpticalObject*>::const_iterator vocite;
1434  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1435  (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1436  }
1437  if( ALIUtils::debug >= 5 ) {
1438  ALIUtils::dump3v( theCentreGlob, " displaceRmGlobOriginal " );
1439  ALIUtils::dumprm( theRmGlob, " displaceRmGlobOriginal " );
1440  }
1441  }
1442 
1443 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
static GlobalOptionMgr * getInstance()
CLHEP::Hep3Vector theCentreGlobOriginal
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
CLHEP::HepRotation theRmGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
CLHEP::Hep3Vector theCentreGlob
void setGlobalCoordinates()
void OpticalObject::displaceRmGlobOriginalOriginal ( const OpticalObject opto1stRotated,
const XYZcoor  coor,
const ALIdouble  disp 
)

!temporary, theRmGlobOriginalOriginal should disappear

Definition at line 1446 of file OpticalObject.cc.

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

Referenced by EntryAngleAffAngles::displaceOriginalOriginal(), and getZAxis().

1447 {
1448  if(ALIUtils::debug>=9) std::cout << name() << " DISPLACEORIGRMGLOB " << coor << " disp " << disp << std::endl;
1450  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
1451  //-------------------- Rotate rotation matrix
1452  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginalOriginal, name() + ALIstring(" theRmGlobOriginalOriginal before displaced") );
1453  switch( coor ) {
1454  case 0:
1455  theRmGlobOriginalOriginal.rotateX( disp );
1456  break;
1457  case 1:
1458  theRmGlobOriginalOriginal.rotateY( disp );
1459  break;
1460  case 2:
1461  theRmGlobOriginalOriginal.rotateZ( disp );
1462  break;
1463  default:
1464  std::cerr << "!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1465  exit(2);
1466  }
1467 
1468 
1469  //-------------------- Rotation translate the centre of component OptO
1470  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angles rotate centre_glob" );
1471  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginalOriginal(), " centreGlobOriginalOriginal" );
1472  if(opto1stRotated != this ) { //own _centre_glob doesn't rotate
1473  //---------- Distance to 1st rotated OptO
1474  CLHEP::Hep3Vector radiusOriginalOriginal = centreGlobOriginalOriginal() - opto1stRotated->centreGlobOriginalOriginal();
1475  CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1476  switch (coor) {
1477  case 0:
1478  radius_rotated.rotateX(disp);
1479  break;
1480  case 1:
1481  radius_rotated.rotateY(disp);
1482  break;
1483  case 2:
1484  radius_rotated.rotateZ(disp);
1485  break;
1486  default:
1487  break; // already exited in previous switch
1488  }
1489  theCentreGlobOriginalOriginal = centreGlobOriginalOriginal() + (radius_rotated - radiusOriginalOriginal);
1490  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angle rotate centre_glob" );
1491  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginalOriginal(), " centre_globOriginalOriginal()" );
1492  }
1493 
1494  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginalOriginal, name() + ALIstring(" theRmGlobOriginalOriginal displaced ") );
1495 
1496  //----------- Displace every OptO component
1497  std::vector<OpticalObject*> vopto;
1498  Model::getComponentOptOs(name(), vopto);
1499  std::vector<OpticalObject*>::const_iterator vocite;
1500  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1501  (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1502  }
1503 
1504  } else {
1508  //----------- Displace every OptO component
1509  std::vector<OpticalObject*> vopto;
1510  Model::getComponentOptOs(name(), vopto);
1511  std::vector<OpticalObject*>::const_iterator vocite;
1512  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1513  (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1514  }
1515  if( ALIUtils::debug >= 5 ) {
1516  ALIUtils::dump3v( theCentreGlob, " displaceRmGlobOriginalOriginal " );
1517  ALIUtils::dumprm( theRmGlob, " displaceRmGlobOriginalOriginal " );
1518  }
1519  }
1520 
1521 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::HepRotation theRmGlobOriginalOriginal
static GlobalOptionMgr * getInstance()
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlobOriginalOriginal() const
Definition: OpticalObject.h:98
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
CLHEP::Hep3Vector theCentreGlob
void setGlobalCoordinates()
bool OpticalObject::eq2ang ( double  ang1,
double  ang2 
)

Definition at line 1886 of file OpticalObject.cc.

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

Referenced by checkMatrixEquations(), and meas().

1887 {
1888  bool beq = true;
1889 
1890  double diff = diff2pi( ang1, ang2 );
1891  if( diff > 0.00001 ) {
1892  if( fabs( diff - 2*M_PI ) > 0.00001 ) {
1893  //- std::cout << " diff " << diff << " " << ang1 << " " << ang2 << std::endl;
1894  beq = false;
1895  }
1896  }
1897 
1898  return beq;
1899 }
#define M_PI
double diff2pi(double ang1, double ang2)
const std::vector< Entry* >& OpticalObject::ExtraEntryList ( ) const
inline
const ALIint OpticalObject::extraEntryNo ( const ALIstring entry_name) const

Definition at line 1547 of file OpticalObject.cc.

References begin, and ExtraEntryList().

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

1548 {
1549  //- std::cout << ExtraEntryList().size() << "entry name " << entry_name << std::endl;
1550 
1551  std::vector<Entry*>::const_iterator vecite;
1552  for (vecite = ExtraEntryList().begin(); vecite != ExtraEntryList().end(); ++vecite) {
1553  //- std::cout <<"in entryno" << (*vecite)->name() << entry_name << std::endl;
1554  if ((*vecite)->name() == entry_name ) {
1555  return (vecite - ExtraEntryList().begin());
1556  }
1557  //- std::cout <<"DD in entryno" << (*vecite)->name() << entry_name << std::endl;
1558  }
1559  //- std::cout << "!!: extra entry name not found: " << entry_name << " in OptO " << name() << std::endl;
1560  // exit(2);
1561  return ALIint(-1);
1562 }
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
int ALIint
Definition: CocoaGlobals.h:15
#define begin
Definition: vmac.h:32
std::vector< ALIdouble >& OpticalObject::ExtraEntryValueList ( )
inline

Definition at line 73 of file OpticalObject.h.

References theExtraEntryValueVector.

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

73  {
75  }
std::vector< ALIdouble > theExtraEntryValueVector
const std::vector< ALIdouble >& OpticalObject::ExtraEntryValueOriginalList ( )
inline

Definition at line 77 of file OpticalObject.h.

References theExtraEntryValueOriginalVector.

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

77  {
79  }
std::vector< ALIdouble > theExtraEntryValueOriginalVector
const std::vector< ALIdouble >& OpticalObject::ExtraEntryValueOriginalOriginalList ( )
inline

Definition at line 80 of file OpticalObject.h.

References theExtraEntryValueOriginalOriginalVector.

80  {
82  }
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
void OpticalObject::fastDeviatesLightRay ( LightRay lightray)
virtual

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

Definition at line 925 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

926 {
927  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement deviation (:D)" << std::endl;
928  std::cerr << " Please read documentation for this object type" << std::endl;
929  exit(1);
930 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::fastTraversesLightRay ( LightRay lightray)
virtual

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

Definition at line 936 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

937 {
938  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement the light traversing (:T)" << std::endl;
939  std::cerr << " Please read documentation for this object type" << std::endl;
940  exit(1);
941 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::fillCoordinateEntry ( const ALIstring coor_name,
const std::vector< ALIstring > &  wordlist 
)
private

Definition at line 320 of file OpticalObject.cc.

References addCoordinateEntryToList(), Model::addEntryToList(), MessageLogger_cfi::cerr, mps_splice::entry, cmsRelvalreport::exit, Entry::fill(), Entry::fillName(), name(), and Entry::setOptOCurrent().

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

321 {
322 
323  //---------- Select which type of entry to create
324  Entry* entry = nullptr;
325  if ( coor_type == ALIstring("centre") ) {
326  entry = new EntryLengthAffCentre( coor_type );
327  }else if ( coor_type == ALIstring("angles") ) {
328  entry = new EntryAngleAffAngles( coor_type );
329  } else {
330  std::cerr << " !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type << std::endl;
331  exit(1);
332  }
333 
334  //---------- Set link from entry to OptO it belongs to
335  entry->setOptOCurrent( this );
336  //----- Name is filled from here to include 'centre' or 'angles'
337  ALIstring name = coor_type + "_" + wordlist[0];
338  entry->fillName( name );
339  //---------- Fill entry with data read
340  entry->fill( wordlist );
341 
342  //---------- Add entry to lists
343  Model::addEntryToList( entry );
344  addCoordinateEntryToList( entry );
345 
346 }
void setOptOCurrent(OpticalObject *opto)
Definition: Entry.h:81
Definition: Entry.h:18
void fill(const std::vector< ALIstring > &wordlist)
Definition: Entry.cc:32
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:145
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
virtual void fillName(const ALIstring &name)
Definition: Entry.cc:243
void addCoordinateEntryToList(Entry *entry)
void OpticalObject::fillExtraEntry ( std::vector< ALIstring > &  wordlist)
protectedvirtual

Reimplemented in OptOSensor2D.

Definition at line 166 of file OpticalObject.cc.

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

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

167 {
168 
169  //- if(ALIUtils::debug >= 5) std::cout << "fillExtraEntry wordlist0 " << wordlist[0].c_str() << std::endl;
170 
171  //---------- Check which type of entry to create
172  Entry* xentry;
173  if ( wordlist[0] == ALIstring("length") ) {
174  xentry = new EntryLength( wordlist[0] );
175  } else if ( wordlist[0] == ALIstring("angle") ) {
176  xentry = new EntryAngle( wordlist[0] );
177  } else if ( wordlist[0] == ALIstring("nodim") ) {
178  xentry = new EntryNoDim( wordlist[0] );
179  } else {
180  std::cerr << "!!ERROR: Exiting... unknown type of Extra Entry " << wordlist[0] << std::endl;
181  ALIUtils::dumpVS( wordlist, " Only 'length', 'angle' or 'nodim' are allowed ", std::cerr );
182  exit(2);
183  }
184 
185  if( ALIUtils::debug>=99) {
186  ALIUtils::dumpVS( wordlist, "fillExtraEntry: ", std::cout );
187  }
188  //---------- Erase first word of line read (type of entry)
189  wordlist.erase( wordlist.begin() );
190 
191  if( ALIUtils::debug>=99) {
192  ALIUtils::dumpVS( wordlist, "fillExtraEntry: ", std::cout );
193  }
194 
195  //---------- Set link from entry to OptO it belongs to
196  xentry->setOptOCurrent( this );
197  //----- Name is filled from here to be consistent with fillCoordinate
198  xentry->fillName( wordlist[0] );
199  //---------- Fill entry with data in line read
200  xentry->fill( wordlist );
201 
202  //---------- Add entry to entry lists
203  Model::addEntryToList( xentry );
204  addExtraEntryToList( xentry );
205 
206  if(ALIUtils::debug >=5) std::cout << "fillExtraEntry: xentry_value" << xentry->value()<<xentry->ValueDimensionFactor() << std::endl;
207 
208  //---------- Add entry value to list
209  addExtraEntryValueToList( xentry->value() );
210 
211 
212 }
void setOptOCurrent(OpticalObject *opto)
Definition: Entry.h:81
void addExtraEntryToList(Entry *entry)
Definition: Entry.h:18
ALIdouble value() const
Definition: Entry.h:55
static ALIint debug
Definition: ALIUtils.h:36
void addExtraEntryValueToList(ALIdouble entry_value)
void fill(const std::vector< ALIstring > &wordlist)
Definition: Entry.cc:32
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:145
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:501
virtual ALIdouble ValueDimensionFactor() const
Definition: Entry.h:37
std::string ALIstring
Definition: CocoaGlobals.h:9
virtual void fillName(const ALIstring &name)
Definition: Entry.cc:243
virtual void OpticalObject::fillIguana ( )
inlinevirtual
virtual void OpticalObject::fillVRML ( )
inlinevirtual
const ALIdouble OpticalObject::findExtraEntryValue ( const ALIstring eename) const

Definition at line 1568 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, trackerTree::check(), gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, extraEntryNo(), GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), name(), and theExtraEntryValueVector.

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

1568  {
1569  ALIdouble retval;
1570  const ALIint entryNo = extraEntryNo( eename );
1571  if( entryNo >= 0 ) {
1572  const ALIdouble Pentry_value = *(theExtraEntryValueVector.begin() + entryNo);
1573  retval = (Pentry_value);
1574  } else {
1575  // if(ALIUtils::debug >= 0) std::cerr << "!!Warning: entry not found; " << eename << ", in object " << name() << " returns 0. " << std::endl;
1576  ALIdouble check;
1578  gomgr->getGlobalOptionValue("check_extra_entries", check );
1579  if( check == 1) {
1580  // if( check <= 1) {//exit temporarily
1581  std::cerr << "!!OpticalObject:ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1582  exit(1);
1583  } else {
1584  //- std::cerr << "!!temporal WARNING in OpticalObject::findExtraEntryValue: entry not found; " << eename << ", in object " << name() << std::endl;
1585  retval = 0.;
1586  }
1587  }
1588 
1589  if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValue: " << eename << " = " << retval << std::endl;
1590  return retval;
1591 }
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:36
static GlobalOptionMgr * getInstance()
std::vector< ALIdouble > theExtraEntryValueVector
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
const ALIstring & name() const
Definition: OpticalObject.h:60
def check(config)
Definition: trackerTree.py:14
const ALIbool OpticalObject::findExtraEntryValueIfExists ( const ALIstring eename,
ALIdouble value 
) const

Definition at line 1613 of file OpticalObject.cc.

References extraEntryNo(), and findExtraEntryValue().

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

1614 {
1615  value = findExtraEntryValue( eename );
1616  const ALIint entryNo = extraEntryNo( eename );
1617  //- std::cout << eename << " entryNo " << entryNo << " value " << value << std::endl;
1618  return( entryNo >= 0 );
1619 }
int ALIint
Definition: CocoaGlobals.h:15
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
Definition: value.py:1
const ALIint extraEntryNo(const ALIstring &entry_name) const
const ALIdouble OpticalObject::findExtraEntryValueMustExist ( const ALIstring eename) const

Definition at line 1597 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, mps_splice::entry, cmsRelvalreport::exit, extraEntryNo(), findExtraEntryValue(), and name().

Referenced by getZAxis().

1598 {
1599  ALIdouble entry = findExtraEntryValue( eename );
1600  const ALIint entryNo = extraEntryNo( eename );
1601  if( entryNo < 0) {
1602  std::cerr << "!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1603  exit(1);
1604  }
1605  // if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValueMustExist: " << eename << " = " << entry << std::endl;
1606  return entry;
1607 }
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const ALIint extraEntryNo(const ALIstring &entry_name) const
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIuint OpticalObject::getCmsswID ( ) const
inline
std::vector< ALIstring > OpticalObject::getCoordinateFromOptAlignParam ( const OpticalAlignParam oaParam)

Definition at line 2162 of file OpticalObject.cc.

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

Referenced by constructFromOptAligInfo(), and OpticalObject().

2163 {
2164  char chartmp[20];
2165  std::vector<ALIstring> wordlist;
2166  wordlist.push_back( oaParam.name() );
2167  gcvt( oaParam.value(), 10, chartmp );
2168  wordlist.push_back( chartmp );
2169  gcvt( oaParam.sigma(), 10, chartmp );
2170  wordlist.push_back( chartmp );
2171  if( oaParam.quality() == 0 ) {
2172  wordlist.push_back("fix");
2173  } else if( oaParam.quality() == 1 ) {
2174  wordlist.push_back("cal");
2175  } else if( oaParam.quality() == 2 ) {
2176  wordlist.push_back("unk");
2177  }
2178 
2179  if ( ALIUtils::debug >= 5 ) {
2180  ALIUtils::dumpVS( wordlist, " getCoordinateFromOptAlignParam " + oaParam.name() );
2181  }
2182 
2183  return wordlist;
2184 
2185 }
int quality() const
std::string name() const
static ALIint debug
Definition: ALIUtils.h:36
double sigma() const
double value() 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:501
CLHEP::Hep3Vector OpticalObject::getDisplacementInLocalCoordinates ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1069 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, and cmsRelvalreport::exit.

Referenced by getZAxis().

1070 {
1071  CLHEP::Hep3Vector dispVec;
1072  switch( coor ) {
1073  case 0:
1074  dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1075  break;
1076  case 1:
1077  dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
1078  break;
1079  case 2:
1080  dispVec = CLHEP::Hep3Vector( 0., 0., disp );
1081  break;
1082  default:
1083  std::cerr << "!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1084  exit(2);
1085  }
1086 
1087  return dispVec;
1088 }
CLHEP::Hep3Vector OpticalObject::getDispVec ( const XYZcoor  coor,
const ALIdouble  disp 
)
private

Definition at line 1994 of file OpticalObject.cc.

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

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

1995 {
1996  CLHEP::Hep3Vector dispVec;
1997  switch (coor) {
1998  case 0:
1999  dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
2000  break;
2001  case 1:
2002  dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
2003  break;
2004  case 2:
2005  dispVec = CLHEP::Hep3Vector( 0., 0., disp );
2006  break;
2007  default:
2008  break; // already exited in previous switch
2009  }
2010  //- CLHEP::Hep3Vector dispVec = getDisplacementInLocalCoordinates( coor, disp);
2011  if ( ALIUtils::debug >= 5 ) {
2012  ALIUtils::dump3v( dispVec, " dispVec in local " );
2013  CLHEP::HepRotation rmt = parent()->rmGlob();
2014  ALIUtils::dumprm( rmt, "parent rmGlob ");
2015  }
2016  dispVec = parent()->rmGlob() * dispVec;
2017  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v( dispVec, " dispVec in global " );
2018 
2019  return dispVec;
2020 }
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::HepRotation & rmGlob() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const double OpticalObject::getEntryCentre ( const XYZcoor  coor) const

Definition at line 2044 of file OpticalObject.cc.

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

Referenced by rmGlobOriginalOriginal(), and SetCentreLocalFromEntryValues().

2045 {
2046  Entry* ce = theCoordinateEntryVector[coor];
2047  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
2048  return ce->value() + ce->valueDisplacementByFitting();
2049 }
Definition: Entry.h:18
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
ALIdouble value() const
Definition: Entry.h:55
std::vector< Entry * > theCoordinateEntryVector
const double OpticalObject::getEntryCentre ( const ALIstring coor) const

Definition at line 2053 of file OpticalObject.cc.

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

2054 {
2055  XYZcoor coor = XCoor;
2056  if( coorstr == "X" ) {
2057  coor = XCoor;
2058  }else if( coorstr == "Y" ) {
2059  coor = YCoor;
2060  }else if( coorstr == "Z" ) {
2061  coor = ZCoor;
2062  }
2063  Entry* ce = theCoordinateEntryVector[coor];
2064  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
2065  return ce->value() + ce->valueDisplacementByFitting();
2066 }
Definition: Entry.h:18
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
ALIdouble value() const
Definition: Entry.h:55
std::vector< Entry * > theCoordinateEntryVector
XYZcoor
Definition: OpticalObject.h:33
const double OpticalObject::getEntryRMangle ( const XYZcoor  coor) const

Definition at line 2069 of file OpticalObject.cc.

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

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

2069  {
2070  Entry* ce = theCoordinateEntryVector[coor+3];
2071  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
2072 
2073  return ce->value() + ce->valueDisplacementByFitting();
2074 }
Definition: Entry.h:18
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
ALIdouble value() const
Definition: Entry.h:55
std::vector< Entry * > theCoordinateEntryVector
const double OpticalObject::getEntryRMangle ( const ALIstring coor) const

Definition at line 2077 of file OpticalObject.cc.

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

2078 {
2079  XYZcoor coor = XCoor;
2080  if( coorstr == "X" ) {
2081  coor = XCoor;
2082  }else if( coorstr == "Y" ) {
2083  coor = YCoor;
2084  }else if( coorstr == "Z" ) {
2085  coor = ZCoor;
2086  }
2087  Entry* ce = theCoordinateEntryVector[coor+3];
2088  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
2089 
2090  return ce->value() + ce->valueDisplacementByFitting();
2091 }
Definition: Entry.h:18
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
ALIdouble value() const
Definition: Entry.h:55
std::vector< Entry * > theCoordinateEntryVector
XYZcoor
Definition: OpticalObject.h:33
std::vector< double > OpticalObject::getLocalRotationAngles ( const std::vector< Entry * > &  entries) const

Definition at line 1751 of file OpticalObject.cc.

References getRotationAnglesInOptOFrame(), and theParent.

Referenced by CocoaDBMgr::GetOptAlignInfoFromOptO(), and meas().

1752 {
1753  return getRotationAnglesInOptOFrame( theParent, entries );
1754 }
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
OpticalObject * theParent
CocoaMaterialElementary* OpticalObject::getMaterial ( ) const
inline

Definition at line 258 of file OpticalObject.h.

References theMaterial.

Referenced by CocoaToDDLMgr::lv().

258  {
259  return theMaterial; }
CocoaMaterialElementary * theMaterial
ALIPlane OpticalObject::getPlate ( const ALIbool  forwardPlate,
const ALIbool  applyWedge 
)

Definition at line 993 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(), getZAxis(), and OptOUserDefined::userDefinedBehaviour().

994 {
995  if (ALIUtils::debug >= 4) std::cout << "% LR: GET PLATE " << name() << " forward= " << forwardPlate << std::endl;
996  //---------- Get OptO variables
997  const ALIdouble width = (findExtraEntryValue("width"));
998 
999  //---------- Get centre and normal of plate
1000  //----- Get plate normal before wedge (Z axis of OptO)
1001  CLHEP::Hep3Vector ZAxis(0.,0.,1.);
1002  CLHEP::HepRotation rmt = rmGlob();
1003  CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
1004 
1005  //----- plate centre = OptO centre +/- 1/2 width before wedge
1006  CLHEP::Hep3Vector plate_point = centreGlob();
1007  //--- 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
1008  ALIdouble normal_sign = -forwardPlate*2 + 1;
1009  plate_point += normal_sign * width/2. * plate_normal;
1010  //- if (ALIUtils::debug >= 4) std::cout << "width = " << width <<std::endl;
1011  if (ALIUtils::debug >= 3) {
1012  ALIUtils::dump3v( plate_point, "plate_point");
1013  ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
1014  ALIUtils::dumprm( rmt, "rmt before wedge" );
1015  }
1016 
1017  if(applyWedge) {
1018  ALIdouble wedge;
1019  wedge = findExtraEntryValue("wedge");
1020  if( wedge != 0. ){
1021  //---------- Rotate plate normal by 1/2 wedge angles
1022  CLHEP::Hep3Vector XAxis(1.,0.,0.);
1023  XAxis = rmt*XAxis;
1024  plate_normal.rotate( normal_sign * wedge/2., XAxis );
1025  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeX ");
1026  if (ALIUtils::debug >= 4) ALIUtils::dump3v( XAxis, "X Axis for applying wedge ");
1027  CLHEP::Hep3Vector YAxis(0.,1.,0.);
1028  YAxis = rmt*YAxis;
1029  plate_normal.rotate( normal_sign * wedge/2., YAxis );
1030  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeY ");
1031  if (ALIUtils::debug >= 4) ALIUtils::dump3v( YAxis, "Y Axis for applying wedge ");
1032  }
1033  }
1034 
1035  //---------- Return plate plane
1036  return ALIPlane(plate_point, plate_normal);
1037 
1038 }
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:77
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::HepRotation & rmGlob() const
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60
std::vector< double > OpticalObject::getRotationAnglesFromMatrix ( CLHEP::HepRotation &  rmLocal,
const std::vector< Entry * > &  entries 
) const

Definition at line 1783 of file OpticalObject.cc.

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

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

1784 {
1785  std::vector<double> newang(3);
1786  double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1787  double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1788  double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1789  if( ALIUtils::debug >= 5 ) {
1790  std::cout << " angles as value entries: X= " << angleX << " Y= " << angleY << " Z " << angleZ << std::endl;
1791  }
1792  return ALIUtils::getRotationAnglesFromMatrix( rmLocal, angleX, angleY, angleZ );
1793 }
const CLHEP::HepRotation rmLocal() const
static ALIint debug
Definition: ALIUtils.h:36
static std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, double origAngleX, double origAngleY, double origAngleZ)
Definition: ALIUtils.cc:591
std::vector< double > OpticalObject::getRotationAnglesInOptOFrame ( const OpticalObject optoAncestor,
const std::vector< Entry * > &  entries 
) const

Definition at line 1757 of file OpticalObject.cc.

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

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

1758 {
1759  const CLHEP::HepRotation& rmParent = optoAncestor->rmGlob(); //ORIGINAL ?????????????????
1760  CLHEP::HepRotation rmLocal = rmParent.inverse() * theRmGlob;
1761 
1762  //I was using theRmGlobOriginal, assuming it has been set to theRmGlob already, check it, in case it may have other consequences
1763  if( theRmGlobOriginal != theRmGlob ){
1764  std::cerr << " !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1765  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1766  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1767  exit(1);
1768  }
1769 
1770  if( ALIUtils::debug >= 5 ) {
1771  std::cout << " OpticalObject::getRotationAnglesInOptOFrame " << name() << " optoAncestor " << optoAncestor->name() << std::endl;
1772  ALIUtils::dumprm( rmParent, " rm parent ");
1773  ALIUtils::dumprm( rmLocal, " rm local ");
1774  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1775  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1776  }
1777  return getRotationAnglesFromMatrix( rmLocal, entries );
1778 
1779 }
CLHEP::HepRotation theRmGlob
const CLHEP::HepRotation rmLocal() const
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::HepRotation & rmGlob() const
CLHEP::HepRotation theRmGlobOriginal
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
const ALIstring & name() const
Definition: OpticalObject.h:60
CocoaSolidShape* OpticalObject::getSolidShape ( ) const
inline
CLHEP::Hep3Vector OpticalObject::getZAxis ( )
inline
const ALIuint OpticalObject::ID ( ) const
inline

Definition at line 121 of file OpticalObject.h.

References theCmsswID.

121 { return theCmsswID; }
ALIuint theCmsswID
const ALIstring OpticalObject::longName ( ) const
inline
void OpticalObject::makeMeasurement ( LightRay lightray,
Measurement meas 
)
virtual

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

Definition at line 969 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

970 {
971  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement making measurement (:M)" << std::endl;
972  std::cerr << " Please read documentation for this object type" << std::endl;
973  exit(1);
974 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
Measurement* OpticalObject::meas ( )
inline
const ALIstring& OpticalObject::name ( ) const
inline

Definition at line 60 of file OpticalObject.h.

References theName.

Referenced by config.CFG::__str__(), Measurement::addAffectingEntriesFromOptO(), Entry::addFittedDisplacementToValue(), Measurement::buildOptOList(), buildRmFromEntryValuesOriginalOriginal(), buildWordList(), calculateLocalRotationAxisInGlobal(), construct(), copyData(), createComponentOptOs(), createNewOptO(), OptOPinhole::defaultBehaviour(), defaultBehaviour(), Model::deleteOptO(), Measurement::DerivativeRespectEntry(), OptOCubeSplitter::detailedDeviatesLightRay(), detailedDeviatesLightRay(), OptOCubeSplitter::detailedTraversesLightRay(), detailedTraversesLightRay(), validation.Sample::digest(), displaceCentreGlob(), displaceCentreGlobOriginal(), displaceCentreGlobOriginalOriginal(), displaceRmGlobAroundGlobal(), displaceRmGlobAroundLocal(), displaceRmGlobOriginal(), displaceRmGlobOriginalOriginal(), Fit::dumpEntryAfterFit(), 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(), OpticalObject(), Fit::printCentreInOptOFrame(), propagateGlobalRMOriginalOriginalChangeToChildren(), CocoaToDDLMgr::pv(), resetGlobalCoordinates(), resetOriginalOriginalCoordinates(), setAnglesNull(), SetCentreGlobFromCentreLocal(), setGlobalCoordinatesOfComponents(), setGlobalRMOriginalOriginal(), FittedEntriesSet::SetOptOEntries(), SetRMGlobFromRMLocal(), shortName(), CocoaToDDLMgr::specPar(), LightRay::startLightRay(), transformCylindrical2Cartesian(), OptOUserDefined::userDefinedBehaviour(), userDefinedBehaviour(), Vispa.Views.PropertyView.Property::valueChanged(), EntryAngleAffAngles::valueDisplaced(), EntryLengthAffCentre::valueDisplaced(), and Entry::valueDisplaced().

60 { return theName; };
ALIstring theName
const OpticalObject* OpticalObject::parent ( ) const
inline

Definition at line 62 of file OpticalObject.h.

References theParent.

Referenced by Measurement::addAffectingEntriesFromOptO(), Vispa.Gui.ConnectableWidget.ConnectableWidget::addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer::applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer::arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer::autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner::autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer::autosizeScrollArea(), buildRmFromEntryValuesOriginalOriginal(), centreLocal(), Vispa.Gui.PortWidget.PortWidget::connectionPoint(), Vispa.Main.StartupScreen.StartupScreen::createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::dataAccessor(), Vispa.Views.LineDecayView.DecayLine::dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer::delete(), Vispa.Views.LineDecayView.DecayNode::delete(), Vispa.Views.LineDecayView.DecayLine::delete(), Vispa.Gui.VispaWidget.VispaWidget::delete(), Vispa.Gui.VispaWidget.VispaWidget::dragWidget(), Fit::dumpFittedValues(), Fit::dumpFittedValuesInAllAncestorFrames(), Vispa.Share.ImageExporter.ImageExporter::exportImageDialog(), Vispa.Views.LineDecayView.DecayLine::extendedSize(), getDispVec(), CocoaDBMgr::GetOptAlignInfoFromOptO(), Vispa.Gui.VispaWidget.VispaWidget::keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::leaveEvent(), Vispa.Gui.PortWidget.PortWidget::moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer::mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget::mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget::mousePressEvent(), Vispa.Views.LineDecayView.DecayNode::move(), Vispa.Views.LineDecayView.LineDecayContainer::noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer::operationId(), OpticalObject(), Vispa.Views.LineDecayView.DecayLine::paint(), Vispa.Gui.VispaWidget.VispaWidget::paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), CocoaToDDLMgr::pv(), Vispa.Views.LineDecayView.DecayLine::qtLineStyle(), Vispa.Views.WidgetView.WidgetView::restoreSelection(), Vispa.Views.WidgetView.WidgetView::select(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), SetCentreGlobFromCentreLocal(), setGlobalRMOriginalOriginal(), SetRMGlobFromRMLocal(), SetRMGlobFromRMLocalOriginalOriginal(), Vispa.Views.LineDecayView.LineDecayContainer::sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer::tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer::toggleCollapsed(), Vispa.Views.LineDecayView.DecayNode::unite(), Vispa.Views.PropertyView.PropertyView::valueChanged(), EntryAngleAffAngles::valueDisplaced(), Vispa.Views.BoxDecayView.BoxDecayContainer::widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::widgetDragged().

62 { return theParent;};
OpticalObject * theParent
void OpticalObject::participateInMeasurement ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
virtual

Reimplemented in OptOCameraDetector, OptOLens, and OptORisleyPrism.

Definition at line 889 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList().

890 {
891  //---------- see if light traverses or reflects
892  setMeas( &meas );
893  if ( behav == " " ) {
894  defaultBehaviour( lightray, meas );
895  } else if ( behav == "D" || behav == "DD" ) {
896  detailedDeviatesLightRay( lightray );
897  } else if ( behav == "T" || behav == "DT" ) {
898  detailedTraversesLightRay( lightray );
899  } else if ( behav == "FD" ) {
900  fastDeviatesLightRay( lightray );
901  } else if ( behav == "FT" ) {
902  fastTraversesLightRay( lightray );
903  } else if ( behav == "M" ) {
904  makeMeasurement( lightray, meas );
905  } else {
906  userDefinedBehaviour( lightray, meas, behav);
907  }
908 }
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)
virtual void detailedDeviatesLightRay(LightRay &lightray)
virtual void detailedTraversesLightRay(LightRay &lightray)
void OpticalObject::propagateGlobalRMOriginalOriginalChangeToChildren ( const CLHEP::HepRotation &  rmorioriold,
const CLHEP::HepRotation &  rmoriorinew 
)

Definition at line 692 of file OpticalObject.cc.

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

Referenced by setRmGlobalOriginal().

693 {
694  std::cout << " propagateGlobalRMOriginalOriginalChangeToChildren OptO " << name() << std::endl;
695  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
696  theRmGlobOriginalOriginal = rmoriorinew.inverse() * theRmGlobOriginalOriginal;
698  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
699 
700  //----------- Reset RMGlobOriginalOriginal() of every component
701  std::vector<OpticalObject*> vopto;
702  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
703  if( !igetood ) {
704  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
705  return;
706  }
707  std::vector<OpticalObject*>::const_iterator vocite;
708  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
709  // CLHEP::HepRotation rmoriorid = buildRmFromEntryValues();
710  (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
711  }
712 
713 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
CLHEP::HepRotation theRmGlobOriginalOriginal
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::readCoordinates ( const ALIstring coor_type_read,
const ALIstring coor_type_expected,
ALIFileIn filein 
)
private

Definition at line 219 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and readData().

220 {
221 
222  ALIstring coor_type_reads = coor_type_read.substr(0,6);
223  if( coor_type_reads == "center" ) coor_type_reads = "centre";
224  //---------- if after the first six letters ther is a 'G', it means they are global coordinates
225  //----- If data is read from a 'report.out', it is always local and this is not needed
226 
227  //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)
228  if( EntryMgr::getInstance()->findEntryByLongName( longName(), "" ) == nullptr ) {
229  if(coor_type_read.size() == 7) {
230  if(coor_type_read[6] == 'G' ) {
231  if(ALIUtils::debug >= 5) std::cout << " coordinate global " << coor_type_read << std::endl;
232  if(coor_type_expected == "centre" ) {
233  centreIsGlobal = true;
234  } else if(coor_type_expected == "angles" ) {
235  anglesIsGlobal = true;
236  }
237  }
238  }
239  }
240 
241  std::vector<ALIstring> wordlist;
242  //---------- Read 4 lines: first is entry type, rest are three coordinates (each one will be an individual entry)
243  ALIstring coor_names[3]; // to check if using cartesian, cylindrical or spherical coordinates
244 
245  for( int ii=0; ii<4; ii++ ) {
246  if ( ii == 0 ) {
247  //---------- Check that first line is of expected type
248  if ( coor_type_reads != coor_type_expected ) {
249  filein.ErrorInLine();
250  std::cerr << "readCoordinates: " << coor_type_expected << " should be read here, instead of " << coor_type_reads << std::endl;
251  exit(1);
252  }
253  } else {
254  //----------- Fill entry Data
255  filein.getWordsInLine(wordlist);
256  coor_names[ii-1] = wordlist[0];
257  fillCoordinateEntry( coor_type_expected, wordlist );
258  }
259  }
260 
261  //---- Transform coordinate system if cylindrical or spherical
262  if( coor_names[0] == ALIstring("X") && coor_names[1] == ALIstring("Y") && coor_names[2] == ALIstring("Z")) {
263  //do nothing
264  }else if( coor_names[0] == ALIstring("R") && coor_names[1] == ALIstring("PHI") && coor_names[2] == ALIstring("Z")) {
266  }else if( coor_names[0] == ALIstring("R") && coor_names[1] == ALIstring("THE") && coor_names[2] == ALIstring("PHI")) {
268  } else {
269  std::cerr << "!!!EXITING: coordinates have to be cartesian (X ,Y ,Z), or cylindrical (R, PHI, Z) or spherical (R, THE, PHI) " << std::endl
270  << " they are " << coor_names[0] << ", " << coor_names[1] << ", " << coor_names[2] << "." << std::endl;
271  exit(1);
272  }
273 }
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
ALIbool anglesIsGlobal
void transformCylindrical2Cartesian()
static ALIint debug
Definition: ALIUtils.h:36
const ALIstring longName() const
ii
Definition: cuy.py:588
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:83
void ErrorInLine()
Definition: ALIFileIn.cc:204
static EntryMgr * getInstance()
Definition: EntryMgr.cc:17
ALIbool centreIsGlobal
void transformSpherical2Cartesian()
std::string ALIstring
Definition: CocoaGlobals.h:9
void OpticalObject::readData ( ALIFileIn filein)
private

Definition at line 116 of file OpticalObject.cc.

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

Referenced by construct(), and getSolidShape().

117 {
118  //---------- See if there are extra entries and read them
119  std::vector<ALIstring> wordlist;
120  filein.getWordsInLine( wordlist );
121  if (wordlist[0] == ALIstring( "ENTRY" ) ){
122  //---------- Read extra entries from file
123  readExtraEntries( filein );
124  filein.getWordsInLine( wordlist );
125  }
126 
127  //--------- set centre and angles not global (default behaviour)
128  centreIsGlobal = false;
129  anglesIsGlobal = false;
130 
131  //--------- readCoordinates
132  if ( type() == ALIstring("source") || type() == ALIstring("pinhole") ) {
133  readCoordinates( wordlist[0], "centre", filein );
134  setAnglesNull();
135  } else {
136  //---------- Read centre and angles
137  readCoordinates( wordlist[0], "centre", filein );
138  filein.getWordsInLine( wordlist );
139  readCoordinates( wordlist[0], "angles", filein );
140  }
141 
142 }
ALIbool anglesIsGlobal
void setAnglesNull()
void readCoordinates(const ALIstring &coor_type_read, const ALIstring &coor_type_expected, ALIFileIn &filein)
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:83
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9
void readExtraEntries(ALIFileIn &filein)
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::readExtraEntries ( ALIFileIn filein)
private

Definition at line 148 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and readData().

149 {
150  //---------- Loop extra entries until a '}'-line is found
151  std::vector<ALIstring> wordlist;
152  for (;;) {
153  filein.getWordsInLine( wordlist );
154  if ( wordlist[0] != ALIstring("}") ) {
155  fillExtraEntry( wordlist );
156  } else {
157  break;
158  }
159  }
160 }
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:83
std::string ALIstring
Definition: CocoaGlobals.h:9
void OpticalObject::resetGlobalCoordinates ( )

Definition at line 1625 of file OpticalObject.cc.

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

Referenced by Entry::addFittedDisplacementToValue(), Measurement::DerivativeRespectEntry(), and getZAxis().

1626 {
1627 
1628  //---------- Reset centre and rm
1631 
1632  //---------- Reset extra entries
1633  //---------- Set extra entry values list
1634  std::vector<ALIdouble>::iterator vdite;
1635  std::vector<ALIdouble>::const_iterator vdcite_o = ExtraEntryValueOriginalList().begin() ;
1636  for (vdite = ExtraEntryValueList().begin();
1637  vdite != ExtraEntryValueList().end(); ++vdite,++vdcite_o) {
1638  (*vdite) = (*vdcite_o);
1639  }
1640 
1641  //----------- Reset entries of every component
1642  std::vector<OpticalObject*> vopto;
1643  Model::getComponentOptOs(name(), vopto);
1644  std::vector<OpticalObject*>::const_iterator vocite;
1645  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1646  (*vocite)->resetGlobalCoordinates();
1647  }
1648 
1650 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
const std::vector< ALIdouble > & ExtraEntryValueOriginalList()
Definition: OpticalObject.h:77
CLHEP::HepRotation theRmGlob
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:73
void calculateLocalRotationAxisInGlobal()
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
const CLHEP::HepRotation & rmGlobOriginal() const
#define begin
Definition: vmac.h:32
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::resetOriginalOriginalCoordinates ( )

Definition at line 1656 of file OpticalObject.cc.

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

Referenced by getZAxis().

1657 {
1658  // std::cout << " !!! CALLING resetOriginalOriginalCoordinates(). STOP " << std::endl;
1659 
1660  //---------- Reset centre and rm
1665 
1666 
1667  //---------- Reset extra entry values list
1668  std::vector<ALIdouble>::iterator vdite;
1669  std::vector<ALIdouble>::iterator vdite_o = theExtraEntryValueOriginalVector.begin() ;
1670  std::vector<ALIdouble>::const_iterator vdcite_oo = theExtraEntryValueOriginalOriginalVector.begin() ;
1671  std::vector<Entry*>::const_iterator vdciteE = ExtraEntryList().begin() ;
1672  for (vdite = ExtraEntryValueList().begin();
1673  vdite != ExtraEntryValueList().end(); ++vdite,++vdite_o,++vdcite_oo,++vdciteE) {
1674  (*vdite) = (*vdcite_oo);
1675  (*vdite_o) = (*vdcite_oo);
1676  (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1677  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdcite_oo) << std::endl;
1678  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdciteE)->value() << std::endl;
1679  // std::cout << " check extra entry " << (*vdciteE)->value() << " =? " << (*vdite) << std::endl;
1680  }
1681 
1682  /* std::vector< Entry* >::iterator eite;
1683  for( eite = theCoordinateEntryVector.begin(); eite != theCoordinateEntryVector.end(); eite++ ){
1684  (*eite)->addFittedDisplacementToValue( - (*eite)->valueDisplacementByFitting() );
1685  }
1686  */
1687 
1688 
1690 
1691  //----------- Reset entries of every component
1692  std::vector<OpticalObject*> vopto;
1693  Model::getComponentOptOs(name(), vopto);
1694  std::vector<OpticalObject*>::const_iterator vocite;
1695  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1696  (*vocite)->resetOriginalOriginalCoordinates();
1697  }
1698 
1699 
1700 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
CLHEP::HepRotation theRmGlob
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:73
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
CLHEP::HepRotation theRmGlobOriginalOriginal
void calculateLocalRotationAxisInGlobal()
CLHEP::Hep3Vector theCentreGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
std::vector< ALIdouble > theExtraEntryValueOriginalVector
#define begin
Definition: vmac.h:32
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
const CLHEP::HepRotation& OpticalObject::rmGlob ( ) const
inline
const CLHEP::HepRotation& OpticalObject::rmGlobOriginal ( ) const
inline

Definition at line 107 of file OpticalObject.h.

References theRmGlobOriginal.

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

107  {
108  return theRmGlobOriginal;
109  }
CLHEP::HepRotation theRmGlobOriginal
const CLHEP::HepRotation& OpticalObject::rmGlobOriginalOriginal ( ) const
inline
const CLHEP::HepRotation OpticalObject::rmLocal ( ) const

Definition at line 1740 of file OpticalObject.cc.

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

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

1741 {
1742  CLHEP::HepRotation rm;
1743  rm.rotateX( theCoordinateEntryVector[3]->value() );
1744  rm.rotateY( theCoordinateEntryVector[4]->value() );
1745  rm.rotateZ( theCoordinateEntryVector[5]->value() );
1746 
1747  return rm;
1748 }
std::vector< Entry * > theCoordinateEntryVector
rm
Definition: submit.py:76
template<class T >
void OpticalObject::rotateItAroundGlobal ( T object,
const XYZcoor  coor,
const double  disp 
)
private

Definition at line 1815 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundGlobal(), and getSolidShape().

1816 {
1817  switch (coor) {
1818  case 0:
1819  object.rotateX(disp);
1820  break;
1821  case 1:
1822  object.rotateY(disp);
1823  break;
1824  case 2:
1825  object.rotateZ(disp);
1826  break;
1827  }
1828  // CLHEP::Hep3Vector axisToRotate = GetAxisForDisplacement( coor );
1829  // object.rotate(disp, axisToRotate);
1830  if( ALIUtils::debug >= 5 ) std::cout << " rotateItAroundGlobal coor " << coor << " disp " << disp << std::endl;
1831 }
static ALIint debug
Definition: ALIUtils.h:36
void OpticalObject::SetAnglesIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 316 of file OpticalObject.h.

References anglesIsGlobal.

316  {
317  anglesIsGlobal = isG; }
ALIbool anglesIsGlobal
void OpticalObject::setAnglesNull ( )
private

Definition at line 352 of file OpticalObject.cc.

References addCoordinateEntryToList(), Model::addEntryToList(), mps_splice::entry, Entry::fillName(), Entry::fillNull(), cuy::ii, name(), and Entry::setOptOCurrent().

Referenced by getSolidShape(), and readData().

353 {
354 
356  //---------- three names will be X, Y and Z
357  ALIstring coor("XYZ");
358 
359  //---------- Fill the three entries
360  for (int ii=0; ii<3; ii++) {
361  entry = new EntryAngleAffAngles( "angles" );
362 
363  //---------- Set link from entry to OptO it belongs to
364  entry->setOptOCurrent( this );
365  //----- Name is filled from here to be consistent with fillCoordinate
366  ALIstring name = "angles_" + coor.substr(ii, 1);
367  entry->fillName( name );
368  //---------- Set entry data to zero
369  entry->fillNull( );
370 
371  // entry.fillNull( tt );
372 
373  //---------- Add entry to lists
374  Model::addEntryToList( entry );
375  addCoordinateEntryToList( entry );
376 
377  }
378 
379 }
void setOptOCurrent(OpticalObject *opto)
Definition: Entry.h:81
void fillNull()
Definition: Entry.cc:251
ii
Definition: cuy.py:588
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
Definition: Model.h:145
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
virtual void fillName(const ALIstring &name)
Definition: Entry.cc:243
void addCoordinateEntryToList(Entry *entry)
void OpticalObject::SetCentreGlobFromCentreLocal ( )
private

Definition at line 789 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCentre().

790 {
791  //----------- Get global centre: parent centre plus local centre traslated to parent coordinate system
792  CLHEP::Hep3Vector cLocal = theCentreGlob;
794 
795  if(ALIUtils::debug >= 5) ALIUtils::dump3v( theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE in parent local frame ");
797 
798  if(ALIUtils::debug >= 5) ALIUtils::dump3v( theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE GLOBAL ");
799  if(ALIUtils::debug >= 5) {
800  ALIUtils::dump3v( parent()->centreGlob(), " parent centreGlob" + parent()->name() );
801  ALIUtils::dumprm( parent()->rmGlob(), " parent rmGlob ");
802  }
803 
804  /* CLHEP::Hep3Vector cLocal2 = theCentreGlob - parent()->centreGlob();
805  CLHEP::HepRotation rmParentInv = inverseOf( parent()->rmGlob() );
806  cLocal2 = rmParentInv * cLocal2;
807  if( (cLocal2 - cLocal).mag() > 1.E-9 ) {
808  std::cerr << "!!!! CALCULATE LOCAL WRONG. Diff= " << (cLocal2 - cLocal).mag() << " " << cLocal2 << " " << cLocal << std::endl;
809  if( (cLocal2 - cLocal).mag() > 1.E-4 ) {
810  std::exception();
811  }
812  }*/
813 }
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::HepRotation & rmGlob() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::SetCentreIsGlobal ( ALIbool  isG)
inlineprivate

Definition at line 314 of file OpticalObject.h.

References centreIsGlobal.

314  {
315  centreIsGlobal = isG; }
ALIbool centreIsGlobal
void OpticalObject::SetCentreLocalFromEntryValues ( )
private

Definition at line 735 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCentre().

736 {
737 
738  // std::vector<Entry*>::const_iterator vecite = CoordinateEntryList().begin();
739  //- std::cout << "PARENTSYSTEM" << name() << parent() <<"ZZ"<<vecite<< std::endl;
740  // std::cout << " OpticalObject::setGlobalCoordinates " << this->name() << std::endl;
741  //- std::cout << veite << "WW" << *vecite << std::endl;
742 //---------------------------------------- Set global centre
743 //----------------------------------- Get local centre from Entries
747  if(ALIUtils::debug >=4) ALIUtils::dump3v( centreGlob(), "SetCentreLocalFromEntryValues: CENTRE LOCAL ");
748 }
static ALIint debug
Definition: ALIUtils.h:36
const double getEntryCentre(const XYZcoor coor) const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::setCmsswID ( ALIuint  id)
inline

Definition at line 123 of file OpticalObject.h.

References triggerObjects_cff::id, and theCmsswID.

Referenced by constructFromOptAligInfo().

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

Definition at line 1129 of file OpticalObject.cc.

References theExtraEntryValueVector, and heppy_batch::val.

Referenced by getZAxis().

1130 {
1131  theExtraEntryValueVector[entryNo] = val;
1132 }
std::vector< ALIdouble > theExtraEntryValueVector
void OpticalObject::setGlobalCentre ( )
private

Definition at line 624 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundLocal(), getSolidShape(), and setGlobalCoordinates().

625 {
627  if ( type() != ALIstring("system") && !centreIsGlobal ) {
629  }
630  if( anglesIsGlobal ){
631  std::cerr << "!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
632  abort();
633  }
634 }
ALIbool anglesIsGlobal
void SetCentreLocalFromEntryValues()
void SetCentreGlobFromCentreLocal()
ALIbool centreIsGlobal
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::setGlobalCoordinates ( )
void OpticalObject::setGlobalCoordinatesOfComponents ( )
private

Definition at line 1353 of file OpticalObject.cc.

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

Referenced by getSolidShape().

1354 {
1355 
1356  // Calculate the displaced centreGlob and rmGlob of components
1357  std::vector<OpticalObject*> vopto;
1358  Model::getComponentOptOs(name(), vopto);
1359  std::vector<OpticalObject*>::const_iterator vocite;
1360  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1361  (*vocite)->setGlobalCoordinates();
1362  }
1363 
1364 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::setGlobalRM ( )
private

Definition at line 638 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCoordinates().

639 {
641  if( !anglesIsGlobal ) {
643  }
644 
645  // Calculate local rot axis with new rm glob
647 
648 }
ALIbool anglesIsGlobal
void calculateLocalRotationAxisInGlobal()
void SetRMGlobFromRMLocal()
void SetRMLocalFromEntryValues()
void OpticalObject::setGlobalRMOriginalOriginal ( const CLHEP::HepRotation &  rmoriori)

Definition at line 653 of file OpticalObject.cc.

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

Referenced by FittedEntriesReader::readFittedEntriesFromFile(), and setRmGlobalOriginal().

654 {
655  CLHEP::HepRotation rmorioriold = rmGlobOriginalOriginal();
656  if ( ALIUtils::debug >= 5 ) {
657  std::cout << " setGlobalRMOriginalOriginal OptO " << name() << std::endl;
658  ALIUtils::dumprm(rmorioriLocal," setGlobalRMOriginalOriginal new local");
659  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
660  }
661 
662  SetRMGlobFromRMLocalOriginalOriginal( rmorioriLocal );
663 
664  /* //---- multiplyt it by parent rmGlobOriginalOriginal
665  if( parent()->type() != ALIstring("system") ) {
666  theRmGlobOriginalOriginal = parent()->rmGlobOriginalOriginal() * theRmGlobOriginalOriginal;
667  }*/
668 
669  if ( ALIUtils::debug >= 5 ) {
670  ALIUtils::dumprm( parent()->rmGlobOriginalOriginal()," parent rmoriori glob ");
671  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
672  }
673 
674  //----------- Reset RMGlobOriginalOriginal() of every component
675  std::vector<OpticalObject*> vopto;
676  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
677  if( !igetood ) {
678  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
679  return;
680  }
681  std::vector<OpticalObject*>::const_iterator vocite;
682  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
683  CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
684  (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
685  // (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmGlobOriginalOriginal() );
686  }
687 
688 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:725
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
const ALIstring & name() const
Definition: OpticalObject.h:60
void SetRMGlobFromRMLocalOriginalOriginal(const CLHEP::HepRotation &rmoriori)
void OpticalObject::setID ( ALIuint  id)
inline

Definition at line 124 of file OpticalObject.h.

References triggerObjects_cff::id, and theCmsswID.

Referenced by createComponentOptOs().

void OpticalObject::setMeas ( Measurement meas)
inline

set current measurement

Definition at line 238 of file OpticalObject.h.

References meas(), and theCurrentMeas.

Referenced by participateInMeasurement().

238  {
240  }
Measurement * theCurrentMeas
Measurement * meas()
void OpticalObject::setOriginalEntryValues ( )

Definition at line 860 of file OpticalObject.cc.

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

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

861 {
862  //---------- Set orig coordinates
865 
868 
869  /* if ( ALIUtils::debug >= 5 ) {
870  ALIUtils::dump3v( centreGlob(), "OPTO: CENTRE GLOB ");
871  ALIUtils::dumprm( rmGlob(), "OPTO: RM GLOB ");
872  }*/
873 
874  //---------- Set extra entry values
875  std::vector<ALIdouble>::const_iterator vdcite;
876  for (vdcite = ExtraEntryValueList().begin();
877  vdcite != ExtraEntryValueList().end(); ++vdcite) {
880  }
881  //- test();
882  if( ALIUtils::debug >= 6 ) std::cout << " setOriginalEntryValues " << std::endl;
883 }
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:73
static ALIint debug
Definition: ALIUtils.h:36
CLHEP::HepRotation theRmGlobOriginalOriginal
const CLHEP::HepRotation & rmGlob() const
void addExtraEntryValueOriginalToList(ALIdouble entry_value)
CLHEP::Hep3Vector theCentreGlobOriginal
CLHEP::HepRotation theRmGlobOriginal
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
void addExtraEntryValueOriginalOriginalToList(ALIdouble entry_value)
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
#define begin
Definition: vmac.h:32
void OpticalObject::setRmGlobal ( const CLHEP::HepRotation &  rm)
inline

Definition at line 134 of file OpticalObject.h.

References submit::rm, and theRmGlob.

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

134  {
135  theRmGlob = rm;
136  }
CLHEP::HepRotation theRmGlob
rm
Definition: submit.py:76
void OpticalObject::setRmGlobalOriginal ( const CLHEP::HepRotation &  rm)
inline
void OpticalObject::SetRMGlobFromRMLocal ( )
private

Definition at line 817 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(), getSolidShape(), and setGlobalRM().

818 {
819  const OpticalObject* opto_par = this;
821  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
822  while ( opto_par->parent()->type() != ALIstring("system") ) {
823  //t vecite = opto_par->parent()->GetCoordinateEntry( CEanglesX );
824  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before X " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(XCoor) <<std::endl;
825  theRmGlob.rotateX( parent()->getEntryRMangle(XCoor) );
826  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before Y " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(YCoor) <<std::endl;
827  theRmGlob.rotateY( parent()->getEntryRMangle(YCoor) );
828  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before Z " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(ZCoor) <<std::endl;
829  theRmGlob.rotateZ( parent()->getEntryRMangle(ZCoor) );
830  if(ALIUtils::debug >= 4) ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName() );
831  opto_par = opto_par->parent();
832  }
833  }else {
834  if(ALIUtils::debug >= 4) {
835  std::cout << " Composing rmGlob with parent " << parent()->name() << std::endl;
836  // ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: RM GLOB ");
837  }
838  theRmGlob = parent()->rmGlob() * theRmGlob;
839  }
840 
841  // std::cout << "rotate with parent (parent)" << opto_par->name() <<parent()->name() << (*vecite)->name() << (*vecite)->value() <<std::endl;
842  if(ALIUtils::debug >= 4) {
843  ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: final RM GLOB ");
844  ALIUtils::dumprm( parent()->rmGlob(), "parent rm glob ");
845  }
846 }
const double getEntryRMangle(const XYZcoor coor) const
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
static GlobalOptionMgr * getInstance()
const CLHEP::HepRotation & rmGlob() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
const ALIstring longName() const
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
const ALIstring & type() const
Definition: OpticalObject.h:61
void OpticalObject::SetRMGlobFromRMLocalOriginalOriginal ( const CLHEP::HepRotation &  rmoriori)
private

Definition at line 849 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalRMOriginalOriginal().

850 {
851 
852  theRmGlobOriginalOriginal = rmoriori;
854 }
CLHEP::HepRotation theRmGlobOriginalOriginal
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
void OpticalObject::SetRMLocalFromEntryValues ( )
private

Definition at line 752 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalRM().

753 {
754 
755  //---------- Set global rotation matrix
756  //-------- Get rm from Entries
757  theRmGlob = CLHEP::HepRotation();
758  theRmGlob.rotateX( getEntryRMangle(XCoor) );
759  if(ALIUtils::debug >= 4) {
760  std::cout << " getEntryRMangle(XCoor) )" << getEntryRMangle(XCoor) << std::endl;
761  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM after X");
762  }
763  theRmGlob.rotateY( getEntryRMangle(YCoor) );
764  if(ALIUtils::debug >= 4) {
765  std::cout << " getEntryRMangle(YCoor) )" << getEntryRMangle(YCoor) << std::endl;
766  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM after Y");
767  }
768  theRmGlob.rotateZ( getEntryRMangle(ZCoor) );
769  if(ALIUtils::debug >= 4) {
770  std::cout << " getEntryRMangle(ZCoor) )" << getEntryRMangle(ZCoor) << std::endl;
771  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM FINAL");
772  }
773 
774  //----- angles are relative to parent, so rotate parent angles first
775  // RmGlob() = 0;
776  //- if(ALIUtils::debug >= 4) ALIUtils::dumprm( parent()->rmGlob(), "OPTO0: RM LOCAL ");
777  // if ( type() != ALIstring("system") ) theRmGlob.transform( parent()->rmGlob() );
778  //----- if anglesIsGlobal, RM is already in global coordinates, else multiply by ancestors
779 
780  /* /////////////
781  CLHEP::Hep3Vector ztest(0.,0.,1.);
782  ztest = theRmGlob * ztest;
783  if( ALIUtils::debug >= 5 ) ALIUtils::dump3v( ztest, "z rotated by theRmGlob ");
784  */
785 }
const double getEntryRMangle(const XYZcoor coor) const
CLHEP::HepRotation theRmGlob
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:77
static ALIint debug
Definition: ALIUtils.h:36
void OpticalObject::setType ( const ALIstring type)
inline

Definition at line 138 of file OpticalObject.h.

References theType, and type().

138  {
139  theType = type;
140  }
ALIstring theType
const ALIstring & type() const
Definition: OpticalObject.h:61
const ALIstring OpticalObject::shortName ( ) const

Definition at line 1715 of file OpticalObject.cc.

References name(), findQualityFiles::size, and lumiContext::sname.

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

1716 {
1717  ALIint last_slash = name().rfind('/');
1718  ALIstring sname = name().substr(last_slash+1, name().size()-1);
1719  if( last_slash == -1 ) { //object of type "system"
1720  sname = name();
1721  } else {
1722  sname = name().substr(last_slash+1, name().size()-1);
1723  }
1724  return sname;
1725 }
size
Write out results.
int ALIint
Definition: CocoaGlobals.h:15
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::transformCylindrical2Cartesian ( )
private

Definition at line 277 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 getSolidShape(), and readCoordinates().

278 {
279  ALIuint ii;
280  ALIuint siz = theCoordinateEntryVector.size();
281  ALIdouble R = theCoordinateEntryVector[0]->value();
283  if (siz != 3) {
284  throw cms::Exception("LogicError")
285  << "@SUB=OpticalObject::transformCylindrical2Cartesian\n"
286  << "Transformation from cylindrical to cartesian coordinates requires the"
287  << " coordinate entry vector to have a size of three.";
288  }
289  ALIdouble newcoor[3] = { R*cos(phi),
290  R*sin(phi),
291  theCoordinateEntryVector[2]->value() // Z
292  };
293  //- std::cout << " phi " << phi << std::endl;
294  //----- Name is filled from here to include 'centre' or 'angles'
295 
296  for( ii = 0; ii < siz; ii++ ) {
297  if(ALIUtils::debug >= 5 ) std::cout << " OpticalObject::transformCylindrical2Cartesian " << ii << " " << newcoor[ii] << std::endl;
298  theCoordinateEntryVector[ii]->setValue( newcoor[ii] );
299  }
300  // change the names
301  ALIstring name = "centre_X";
302  theCoordinateEntryVector[0]->fillName( name );
303  name = "centre_Y";
304  theCoordinateEntryVector[1]->fillName( name );
305  name = "centre_Z";
306  theCoordinateEntryVector[2]->fillName( name );
307 
308 }
long double ALIdouble
Definition: CocoaGlobals.h:11
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< Entry * > theCoordinateEntryVector
static ALIint debug
Definition: ALIUtils.h:36
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
ii
Definition: cuy.py:588
std::string ALIstring
Definition: CocoaGlobals.h:9
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:76
const ALIstring & name() const
Definition: OpticalObject.h:60
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:72
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void OpticalObject::transformGlobal2Local ( )
private

Referenced by getSolidShape().

void OpticalObject::transformSpherical2Cartesian ( )
private

Definition at line 311 of file OpticalObject.cc.

Referenced by getSolidShape(), and readCoordinates().

312 {
313 
314 }
const ALIstring& OpticalObject::type ( ) const
inline
void OpticalObject::userDefinedBehaviour ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
virtual

Reimplemented in OptOUserDefined.

Definition at line 976 of file OpticalObject.cc.

References MessageLogger_cfi::cerr, cmsRelvalreport::exit, name(), and type().

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

977 {
978  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement user defined behaviour = " << behav << std::endl;
979  std::cerr << " Please read documentation for this object type" << std::endl;
980  exit(1);
981 }
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61

Friends And Related Function Documentation

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

Definition at line 1729 of file OpticalObject.cc.

1729  {
1730  os << "OPTICALOBJECT: " << c.theName << " of type: " << c.theType
1731  << " " << c.theCentreGlob
1732  << c.theRmGlob << std::endl;
1733 
1734  return os;
1735 
1736 }
CLHEP::HepRotation theRmGlob
ALIstring theName
ALIstring theType
CLHEP::Hep3Vector theCentreGlob

Member Data Documentation

ALIbool OpticalObject::anglesIsGlobal
private
CLHEP::Hep3Vector OpticalObject::axisXLocalInGlobal
private

Definition at line 351 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

CLHEP::Hep3Vector OpticalObject::axisYLocalInGlobal
private

Definition at line 352 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

CLHEP::Hep3Vector OpticalObject::axisZLocalInGlobal
private

Definition at line 353 of file OpticalObject.h.

Referenced by calculateLocalRotationAxisInGlobal().

ALIbool OpticalObject::centreIsGlobal
private
ALIbool OpticalObject::fcopyData
private

Definition at line 325 of file OpticalObject.h.

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

CLHEP::Hep3Vector OpticalObject::theCentreGlob
private
CLHEP::Hep3Vector OpticalObject::theCentreGlobOriginal
private
CLHEP::Hep3Vector OpticalObject::theCentreGlobOriginalOriginal
private
ALIuint OpticalObject::theCmsswID
private

Definition at line 355 of file OpticalObject.h.

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

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

Definition at line 349 of file OpticalObject.h.

Referenced by meas(), and setMeas().

std::vector< ALIdouble > OpticalObject::theExtraEntryValueOriginalOriginalVector
private
std::vector< ALIdouble > OpticalObject::theExtraEntryValueOriginalVector
private
std::vector< ALIdouble > OpticalObject::theExtraEntryValueVector
private
std::vector< Entry* > OpticalObject::theExtraEntryVector
private

Definition at line 338 of file OpticalObject.h.

Referenced by addExtraEntryToList(), and ExtraEntryList().

CocoaMaterialElementary* OpticalObject::theMaterial
protected

Definition at line 358 of file OpticalObject.h.

Referenced by constructMaterial(), and getMaterial().

ALIstring OpticalObject::theName
private
OpticalObject* OpticalObject::theParent
private
CLHEP::HepRotation OpticalObject::theRmGlob
private
CLHEP::HepRotation OpticalObject::theRmGlobOriginal
private
CLHEP::HepRotation OpticalObject::theRmGlobOriginalOriginal
private
CocoaSolidShape* OpticalObject::theSolidShape
protected
ALIstring OpticalObject::theType
private
ALIint OpticalObject::verbose
protected