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=0)
 
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 1704 of file OpticalObject.cc.

Referenced by OpticalObject().

1705 {
1706 }

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 1909 of file OpticalObject.cc.

References M_PI, and heppy_batch::val.

Referenced by meas().

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

Definition at line 1900 of file OpticalObject.cc.

References heppy_batch::val.

Referenced by meas().

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

Definition at line 710 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().

711 {
712  CLHEP::HepRotation rm;
713  const OpticalObject* opto_par = this;
714  // if(Model::GlobalOptions()["rotateAroundLocal"] == 0) {
715  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before X " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(XCoor) <<std::endl;
716  const std::vector< Entry* >& cel = CoordinateEntryList();
717  rm.rotateX( cel[3]->valueOriginalOriginal() );
718  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before Y " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(YCoor) <<std::endl;
719  rm.rotateY( cel[4]->valueOriginalOriginal() );
720  if(ALIUtils::debug >= 55) std::cout << "rotate with parent: before Z " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(ZCoor) <<std::endl;
721  rm.rotateZ( cel[5]->valueOriginalOriginal() );
722  //- rm.rotateZ( getEntryRMangle(ZCoor) );
723  if(ALIUtils::debug >= 54) ALIUtils::dumprm( theRmGlob, ("SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName()).c_str() );
724 
725  return rm;
726 }
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 427 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().

428 {
429  //---------- 1st add name
430  wordlist.push_back( entry->name() );
431 
432  //---------- 1st add value
433  char chartmp[20];
434  gcvt(entry->value()/entry->ValueDimensionFactor(),10, chartmp);
435  wordlist.push_back( chartmp );
436 
437  //---------- 1st add sigma
438  gcvt(entry->sigma()/entry->SigmaDimensionFactor(),10, chartmp);
439  wordlist.push_back( chartmp );
440 
441  //---------- 1st add quality
442  ALIstring strtmp;
443  ALIint inttmp = entry->quality();
444  switch ( inttmp ) {
445  case 0:
446  strtmp = "fix";
447  break;
448  case 1:
449  strtmp = "cal";
450  break;
451  case 2:
452  strtmp = "unk";
453  break;
454  default:
455  std::cerr << "buildWordList: entry " << entry->OptOCurrent()->name() << entry->name() << " quality not found " << inttmp << std::endl;
456  break;
457  }
458  wordlist.push_back( strtmp );
459 
460  if( ALIUtils::debug>=9) {
461  ALIUtils::dumpVS( wordlist, "buildWordList: ", std::cout );
462  }
463 
464 }
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 1793 of file OpticalObject.cc.

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

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

1794 {
1795  axisXLocalInGlobal = CLHEP::Hep3Vector(1.,0.,0.);
1797  axisYLocalInGlobal = CLHEP::Hep3Vector(0.,1.,0.);
1799  axisZLocalInGlobal = CLHEP::Hep3Vector(0.,0.,1.);
1801  if( ALIUtils::debug >= 4 ){
1802  std::cout << name() << " axis X local in global " << axisXLocalInGlobal << std::endl;
1803  std::cout << name() << " axis Y local in global " << axisYLocalInGlobal << std::endl;
1804  std::cout << name() << " axis Z local in global " << axisZLocalInGlobal << std::endl;
1805  }
1806 
1807 }
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 2022 of file OpticalObject.cc.

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

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

2023 {
2024 
2025  CLHEP::Hep3Vector cLocal = theCentreGlob - parent()->centreGlob();
2026  CLHEP::HepRotation rmParentInv = inverseOf( parent()->rmGlob() );
2027  cLocal = rmParentInv * cLocal;
2028 
2029  return cLocal;
2030  /*-
2031 
2032  if( theCoordinateEntryVector.size() >= 3 ) {
2033  return CLHEP::Hep3Vector( theCoordinateEntryVector[0]->value(), theCoordinateEntryVector[1]->value(), theCoordinateEntryVector[2]->value() );
2034  } else {
2035  return CLHEP::Hep3Vector(0.,0.,0.);
2036  }
2037  */
2038 }
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 = 0 
)

Definition at line 1921 of file OpticalObject.cc.

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

Referenced by meas().

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

2110 {
2111  if( theParent != 0 ) { //----- OptO 'system' has no parent (and no affine frame)
2112  //---------- Build Data
2113  //---------- See if there are extra entries and read them
2114  std::vector<OpticalAlignParam> exEnt = oaInfo.extraEntries_;
2115  std::vector<OpticalAlignParam>::iterator ite;
2116  std::vector<ALIstring> wordlist;
2117  for( ite = exEnt.begin(); ite != exEnt.end(); ++ite ){
2118  wordlist = getCoordinateFromOptAlignParam( *ite );
2119  wordlist.insert(wordlist.begin(), (*ite).dimType() );
2120  fillExtraEntry( wordlist );
2121  }
2122 
2123  //--------- set centre and angles not global (default behaviour)
2124  centreIsGlobal = 0;
2125  anglesIsGlobal = 0;
2126 
2127  setCmsswID( oaInfo.ID_);
2128  //--------- build Coordinates
2129  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.x_ ) );
2130  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.y_ ) );
2131  fillCoordinateEntry( "centre", getCoordinateFromOptAlignParam( oaInfo.z_ ) );
2135 
2136  //---------- Set global coordinates
2138 
2139  //---------- Set original entry values
2141  }
2142 
2143  //---------- Construct material
2145 
2146  //---------- Construct solid shape
2148 
2149  if ( ALIUtils::debug >= 5 ) {
2150  std::cout << "constructFromOptAligInfo constructed: " << *this << std::endl;
2151  }
2152 
2153  //---------- Create the OptO that compose this one
2155 }
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 2092 of file OpticalObject.cc.

References f, and theMaterial.

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

2093 {
2094  theMaterial = new CocoaMaterialElementary( "Hydrogen", 70.8*mg/cm3, "H", 1.00794f, 1 );
2095 }
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 2098 of file OpticalObject.cc.

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

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

2099 {
2100  ALIdouble go;
2102  gomgr->getGlobalOptionValue("VisScale", go );
2103 
2104  theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
2105 }
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 379 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().

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

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

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

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

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

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

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

909 {
910  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement a default behaviour" << std::endl;
911  std::cerr << " You have to specify some behaviour, like :D or :T or ..." << std::endl;
912  exit(1);
913 }
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 941 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

942 {
943  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement detailed deviation (:DD / :D)" << std::endl;
944  std::cerr << " Please read documentation for this object type" << std::endl;
945  exit(1);
946 }
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 952 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

953 {
954  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
955  std::cerr << " Please read documentation for this object type" << std::endl;
956  exit(1);
957 }
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 1874 of file OpticalObject.cc.

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

Referenced by eq2ang(), and meas().

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

Definition at line 1039 of file OpticalObject.cc.

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

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

1040 {
1041  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: coor " << coor << " disp = " << disp << std::endl;
1042 
1044  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1045  theCentreGlob += dispVec;
1046 
1047  //----------- Displace CentreGlob() of every component
1048  std::vector<OpticalObject*> vopto;
1049  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1050  if( !igetood ) {
1051  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
1052  return;
1053  }
1054  std::vector<OpticalObject*>::const_iterator vocite;
1055  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1056  (*vocite)->displaceCentreGlob( dispVec );
1057  }
1058 
1059 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1088 of file OpticalObject.cc.

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

1089 {
1090  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: dispVec = " << dispVec << std::endl;
1091 
1093  theCentreGlob += dispVec;
1094 
1095  //----------- Displace CentreGlob() of every component
1096  std::vector<OpticalObject*> vopto;
1097  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1098  if( !igetood ) {
1099  return;
1100  }
1101  std::vector<OpticalObject*>::const_iterator vocite;
1102  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1103  (*vocite)->displaceCentreGlob( dispVec );
1104  }
1105 
1106 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1132 of file OpticalObject.cc.

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

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

1133 {
1134  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1135  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original 0");
1136  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1137  theCentreGlobOriginal += dispVec;
1138 
1139  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original displaced");
1140 
1141  //----------- Displace CentreGlob() of every component
1142  std::vector<OpticalObject*> vopto;
1143  Model::getComponentOptOs(name(), vopto);
1144  std::vector<OpticalObject*>::const_iterator vocite;
1145  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1146  (*vocite)->displaceCentreGlobOriginal( dispVec );
1147  }
1148 
1149 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1155 of file OpticalObject.cc.

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

1156 {
1157  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1158 
1159  theCentreGlobOriginal += dispVec;
1160 
1161  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original");
1162 
1163  //----------- Displace CentreGlob() of every component
1164  std::vector<OpticalObject*> vopto;
1165  Model::getComponentOptOs(name(), vopto);
1166  std::vector<OpticalObject*>::const_iterator vocite;
1167  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1168  (*vocite)->displaceCentreGlobOriginal( dispVec );
1169  }
1170 
1171 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1175 of file OpticalObject.cc.

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

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

1176 {
1177  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1178  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob originalOriginal 0");
1179  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1180  theCentreGlobOriginalOriginal += dispVec;
1181 
1182  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original displaced");
1183 
1184  //----------- Displace CentreGlob() of every component
1185  std::vector<OpticalObject*> vopto;
1186  Model::getComponentOptOs(name(), vopto);
1187  std::vector<OpticalObject*>::const_iterator vocite;
1188  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1189  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1190  }
1191 
1192 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1198 of file OpticalObject.cc.

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

1199 {
1200  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1201 
1202  theCentreGlobOriginalOriginal += dispVec;
1203 
1204  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original");
1205 
1206  //----------- Displace CentreGlob() of every component
1207  std::vector<OpticalObject*> vopto;
1208  Model::getComponentOptOs(name(), vopto);
1209  std::vector<OpticalObject*>::const_iterator vocite;
1210  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1211  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1212  }
1213 
1214 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1112 of file OpticalObject.cc.

References LogDebug, theExtraEntryValueOriginalVector, and theExtraEntryValueVector.

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

1113 {
1114  // std::vector< ALIdouble >::iterator ite = theExtraEntryValueVector.begin();
1115  ALIdouble Pentry_value = (*(theExtraEntryValueVector.begin() + entryNo));
1116 
1117  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalVector.begin() + entryNo);
1118  Pentry_value = (Pentry_orig_value) + disp;
1119  LogDebug("OpticalObject::displaceExtraEntry")
1120  << " displaceExtraEntry " << Pentry_value << " <> " << Pentry_orig_value
1121  << std::endl;
1122  theExtraEntryValueVector[entryNo] = Pentry_value;
1123 }
#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 1522 of file OpticalObject.cc.

References theExtraEntryValueOriginalVector.

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

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

Definition at line 1533 of file OpticalObject.cc.

References theExtraEntryValueOriginalOriginalVector.

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

1534 {
1535  ALIdouble Pentry_orig_value = *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo);
1536  Pentry_orig_value += disp;
1537  // std::cout << " displaceExtraEntryOriginalOriginal " << *(theExtraEntryValueOriginalOriginalVector.begin() + entryNo) << " + " << disp << std::endl;
1538  theExtraEntryValueOriginalOriginalVector[entryNo] = Pentry_orig_value;
1539 
1540 }
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 1221 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().

1222 {
1223  if(ALIUtils::debug>=5) std::cout << name() << "DISPLACERMGLOBAROUNDGLOBAL" << coor << "disp" << disp << std::endl;
1224  //-------------------- Rotate rotation matrix
1227  if(ALIUtils::debug >= 5 ) {
1228  std::cout << this->name() << std::endl;
1229  ALIUtils::dumprm( theRmGlob, "before disp rm " );
1230  }
1231  rotateItAroundGlobal( theRmGlob, coor, disp );
1232  if(ALIUtils::debug >= 5 ) {
1233  ALIUtils::dumprm( theRmGlob, "after disp rm " );
1234  }
1235  //-------------------- Rotation translate the centre of component OptO
1236  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob before rotation" );
1237  if(ALIUtils::debug >= 5 ) ALIUtils::dump3v( centreGlobOriginal(), " centreGlobOriginal before rotation" );
1238  if(opto1stRotated != this ) { //own _centre_glob is not displaced
1239  //---------- Distance to 1st rotated OptO
1240  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1241  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1242  rotateItAroundGlobal( radius_rotated, coor, disp );
1243  theCentreGlob = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1244  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob after rotation" );
1245  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlobOriginal(), " centre_globOriginal() after rotation" );
1246  }
1247 
1248  //----------- Displace every component
1249  std::vector<OpticalObject*> vopto;
1250  Model::getComponentOptOs(name(), vopto);
1251  std::vector<OpticalObject*>::const_iterator vocite;
1252  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1253  (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1254  }
1255 
1256 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1263 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().

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

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

1444 {
1445  if(ALIUtils::debug>=9) std::cout << name() << " DISPLACEORIGRMGLOB " << coor << " disp " << disp << std::endl;
1447  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
1448  //-------------------- Rotate rotation matrix
1449  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginalOriginal, (name() + ALIstring(" theRmGlobOriginalOriginal before displaced ")).c_str() );
1450  switch( coor ) {
1451  case 0:
1452  theRmGlobOriginalOriginal.rotateX( disp );
1453  break;
1454  case 1:
1455  theRmGlobOriginalOriginal.rotateY( disp );
1456  break;
1457  case 2:
1458  theRmGlobOriginalOriginal.rotateZ( disp );
1459  break;
1460  default:
1461  std::cerr << "!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1462  exit(2);
1463  }
1464 
1465 
1466  //-------------------- Rotation translate the centre of component OptO
1467  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angles rotate centre_glob" );
1468  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginalOriginal(), " centreGlobOriginalOriginal" );
1469  if(opto1stRotated != this ) { //own _centre_glob doesn't rotate
1470  //---------- Distance to 1st rotated OptO
1471  CLHEP::Hep3Vector radiusOriginalOriginal = centreGlobOriginalOriginal() - opto1stRotated->centreGlobOriginalOriginal();
1472  CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1473  switch (coor) {
1474  case 0:
1475  radius_rotated.rotateX(disp);
1476  break;
1477  case 1:
1478  radius_rotated.rotateY(disp);
1479  break;
1480  case 2:
1481  radius_rotated.rotateZ(disp);
1482  break;
1483  default:
1484  break; // already exited in previous switch
1485  }
1486  theCentreGlobOriginalOriginal = centreGlobOriginalOriginal() + (radius_rotated - radiusOriginalOriginal);
1487  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlob(), "angle rotate centre_glob" );
1488  if(ALIUtils::debug>=98)ALIUtils::dump3v( centreGlobOriginalOriginal(), " centre_globOriginalOriginal()" );
1489  }
1490 
1491  if( ALIUtils::debug >= 5 ) ALIUtils::dumprm(theRmGlobOriginalOriginal, (name() + ALIstring(" theRmGlobOriginalOriginal displaced ")).c_str() );
1492 
1493  //----------- Displace every OptO component
1494  std::vector<OpticalObject*> vopto;
1495  Model::getComponentOptOs(name(), vopto);
1496  std::vector<OpticalObject*>::const_iterator vocite;
1497  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1498  (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1499  }
1500 
1501  } else {
1505  //----------- Displace every OptO component
1506  std::vector<OpticalObject*> vopto;
1507  Model::getComponentOptOs(name(), vopto);
1508  std::vector<OpticalObject*>::const_iterator vocite;
1509  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1510  (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1511  }
1512  if( ALIUtils::debug >= 5 ) {
1513  ALIUtils::dump3v( theCentreGlob, " displaceRmGlobOriginalOriginal " );
1514  ALIUtils::dumprm( theRmGlob, " displaceRmGlobOriginalOriginal " );
1515  }
1516  }
1517 
1518 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 1883 of file OpticalObject.cc.

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

Referenced by checkMatrixEquations(), and meas().

1884 {
1885  bool beq = true;
1886 
1887  double diff = diff2pi( ang1, ang2 );
1888  if( diff > 0.00001 ) {
1889  if( fabs( diff - 2*M_PI ) > 0.00001 ) {
1890  //- std::cout << " diff " << diff << " " << ang1 << " " << ang2 << std::endl;
1891  beq = false;
1892  }
1893  }
1894 
1895  return beq;
1896 }
#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 1544 of file OpticalObject.cc.

References begin, and ExtraEntryList().

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

1545 {
1546  //- std::cout << ExtraEntryList().size() << "entry name " << entry_name << std::endl;
1547 
1548  std::vector<Entry*>::const_iterator vecite;
1549  for (vecite = ExtraEntryList().begin(); vecite != ExtraEntryList().end(); ++vecite) {
1550  //- std::cout <<"in entryno" << (*vecite)->name() << entry_name << std::endl;
1551  if ((*vecite)->name() == entry_name ) {
1552  return (vecite - ExtraEntryList().begin());
1553  }
1554  //- std::cout <<"DD in entryno" << (*vecite)->name() << entry_name << std::endl;
1555  }
1556  //- std::cout << "!!: extra entry name not found: " << entry_name << " in OptO " << name() << std::endl;
1557  // exit(2);
1558  return ALIint(-1);
1559 }
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
int ALIint
Definition: CocoaGlobals.h:15
#define begin
Definition: vmac.h:30
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 919 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

920 {
921  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement deviation (:D)" << std::endl;
922  std::cerr << " Please read documentation for this object type" << std::endl;
923  exit(1);
924 }
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 930 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

931 {
932  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement the light traversing (:T)" << std::endl;
933  std::cerr << " Please read documentation for this object type" << std::endl;
934  exit(1);
935 }
const ALIstring & name() const
Definition: OpticalObject.h: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 314 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().

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

1565  {
1566  ALIdouble retval;
1567  const ALIint entryNo = extraEntryNo( eename );
1568  if( entryNo >= 0 ) {
1569  const ALIdouble Pentry_value = *(theExtraEntryValueVector.begin() + entryNo);
1570  retval = (Pentry_value);
1571  } else {
1572  // if(ALIUtils::debug >= 0) std::cerr << "!!Warning: entry not found; " << eename << ", in object " << name() << " returns 0. " << std::endl;
1573  ALIdouble check;
1575  gomgr->getGlobalOptionValue("check_extra_entries", check );
1576  if( check == 1) {
1577  // if( check <= 1) {//exit temporarily
1578  std::cerr << "!!OpticalObject:ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1579  exit(1);
1580  } else {
1581  //- std::cerr << "!!temporal WARNING in OpticalObject::findExtraEntryValue: entry not found; " << eename << ", in object " << name() << std::endl;
1582  retval = 0.;
1583  }
1584  }
1585 
1586  if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValue: " << eename << " = " << retval << std::endl;
1587  return retval;
1588 }
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 1610 of file OpticalObject.cc.

References extraEntryNo(), and findExtraEntryValue().

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

1611 {
1612  value = findExtraEntryValue( eename );
1613  const ALIint entryNo = extraEntryNo( eename );
1614  //- std::cout << eename << " entryNo " << entryNo << " value " << value << std::endl;
1615  return( entryNo >= 0 );
1616 }
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 1594 of file OpticalObject.cc.

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

Referenced by getZAxis().

1595 {
1596  ALIdouble entry = findExtraEntryValue( eename );
1597  const ALIint entryNo = extraEntryNo( eename );
1598  if( entryNo < 0) {
1599  std::cerr << "!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1600  exit(1);
1601  }
1602  // if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValueMustExist: " << eename << " = " << entry << std::endl;
1603  return entry;
1604 }
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 2159 of file OpticalObject.cc.

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

Referenced by constructFromOptAligInfo(), and OpticalObject().

2160 {
2161  char chartmp[20];
2162  std::vector<ALIstring> wordlist;
2163  wordlist.push_back( oaParam.name() );
2164  gcvt( oaParam.value(), 10, chartmp );
2165  wordlist.push_back( chartmp );
2166  gcvt( oaParam.sigma(), 10, chartmp );
2167  wordlist.push_back( chartmp );
2168  if( oaParam.quality() == 0 ) {
2169  wordlist.push_back("fix");
2170  } else if( oaParam.quality() == 1 ) {
2171  wordlist.push_back("cal");
2172  } else if( oaParam.quality() == 2 ) {
2173  wordlist.push_back("unk");
2174  }
2175 
2176  if ( ALIUtils::debug >= 5 ) {
2177  ALIUtils::dumpVS( wordlist, " getCoordinateFromOptAlignParam " + oaParam.name() );
2178  }
2179 
2180  return wordlist;
2181 
2182 }
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 1063 of file OpticalObject.cc.

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

Referenced by getZAxis().

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

Definition at line 1991 of file OpticalObject.cc.

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

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

1992 {
1993  CLHEP::Hep3Vector dispVec;
1994  switch (coor) {
1995  case 0:
1996  dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1997  break;
1998  case 1:
1999  dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
2000  break;
2001  case 2:
2002  dispVec = CLHEP::Hep3Vector( 0., 0., disp );
2003  break;
2004  default:
2005  break; // already exited in previous switch
2006  }
2007  //- CLHEP::Hep3Vector dispVec = getDisplacementInLocalCoordinates( coor, disp);
2008  if ( ALIUtils::debug >= 5 ) {
2009  ALIUtils::dump3v( dispVec, " dispVec in local " );
2010  CLHEP::HepRotation rmt = parent()->rmGlob();
2011  ALIUtils::dumprm( rmt, "parent rmGlob ");
2012  }
2013  dispVec = parent()->rmGlob() * dispVec;
2014  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v( dispVec, " dispVec in global " );
2015 
2016  return dispVec;
2017 }
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 2041 of file OpticalObject.cc.

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

Referenced by rmGlobOriginalOriginal(), and SetCentreLocalFromEntryValues().

2042 {
2043  Entry* ce = theCoordinateEntryVector[coor];
2044  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
2045  return ce->value() + ce->valueDisplacementByFitting();
2046 }
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 2050 of file OpticalObject.cc.

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

2051 {
2052  XYZcoor coor = XCoor;
2053  if( coorstr == "X" ) {
2054  coor = XCoor;
2055  }else if( coorstr == "Y" ) {
2056  coor = YCoor;
2057  }else if( coorstr == "Z" ) {
2058  coor = ZCoor;
2059  }
2060  Entry* ce = theCoordinateEntryVector[coor];
2061  // std::cout << coor << " getEntryCentre " << ce->value() << " + " << ce->valueDisplacementByFitting() << std::endl;
2062  return ce->value() + ce->valueDisplacementByFitting();
2063 }
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 2066 of file OpticalObject.cc.

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

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

2066  {
2067  Entry* ce = theCoordinateEntryVector[coor+3];
2068  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
2069 
2070  return ce->value() + ce->valueDisplacementByFitting();
2071 }
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 2074 of file OpticalObject.cc.

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

2075 {
2076  XYZcoor coor = XCoor;
2077  if( coorstr == "X" ) {
2078  coor = XCoor;
2079  }else if( coorstr == "Y" ) {
2080  coor = YCoor;
2081  }else if( coorstr == "Z" ) {
2082  coor = ZCoor;
2083  }
2084  Entry* ce = theCoordinateEntryVector[coor+3];
2085  // std::cout << coor << " getEntryRMangle " << ce->value() << " + " << ce->valueDisplacementByFitting() << " size = " << theCoordinateEntryVector.size() << " ce = " << ce << " entry name " << ce->name() << " opto name " << name() << std::endl;
2086 
2087  return ce->value() + ce->valueDisplacementByFitting();
2088 }
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 1748 of file OpticalObject.cc.

References getRotationAnglesInOptOFrame(), and theParent.

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

1749 {
1750  return getRotationAnglesInOptOFrame( theParent, entries );
1751 }
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 987 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().

988 {
989  if (ALIUtils::debug >= 4) std::cout << "% LR: GET PLATE " << name() << " forward= " << forwardPlate << std::endl;
990  //---------- Get OptO variables
991  const ALIdouble width = (findExtraEntryValue("width"));
992 
993  //---------- Get centre and normal of plate
994  //----- Get plate normal before wedge (Z axis of OptO)
995  CLHEP::Hep3Vector ZAxis(0.,0.,1.);
996  CLHEP::HepRotation rmt = rmGlob();
997  CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
998 
999  //----- plate centre = OptO centre +/- 1/2 width before wedge
1000  CLHEP::Hep3Vector plate_point = centreGlob();
1001  //--- 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
1002  ALIdouble normal_sign = -forwardPlate*2 + 1;
1003  plate_point += normal_sign * width/2. * plate_normal;
1004  //- if (ALIUtils::debug >= 4) std::cout << "width = " << width <<std::endl;
1005  if (ALIUtils::debug >= 3) {
1006  ALIUtils::dump3v( plate_point, "plate_point");
1007  ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
1008  ALIUtils::dumprm( rmt, "rmt before wedge" );
1009  }
1010 
1011  if(applyWedge) {
1012  ALIdouble wedge;
1013  wedge = findExtraEntryValue("wedge");
1014  if( wedge != 0. ){
1015  //---------- Rotate plate normal by 1/2 wedge angles
1016  CLHEP::Hep3Vector XAxis(1.,0.,0.);
1017  XAxis = rmt*XAxis;
1018  plate_normal.rotate( normal_sign * wedge/2., XAxis );
1019  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeX ");
1020  if (ALIUtils::debug >= 4) ALIUtils::dump3v( XAxis, "X Axis for applying wedge ");
1021  CLHEP::Hep3Vector YAxis(0.,1.,0.);
1022  YAxis = rmt*YAxis;
1023  plate_normal.rotate( normal_sign * wedge/2., YAxis );
1024  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeY ");
1025  if (ALIUtils::debug >= 4) ALIUtils::dump3v( YAxis, "Y Axis for applying wedge ");
1026  }
1027  }
1028 
1029  //---------- Return plate plane
1030  return ALIPlane(plate_point, plate_normal);
1031 
1032 }
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 1780 of file OpticalObject.cc.

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

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

1781 {
1782  std::vector<double> newang(3);
1783  double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1784  double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1785  double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1786  if( ALIUtils::debug >= 5 ) {
1787  std::cout << " angles as value entries: X= " << angleX << " Y= " << angleY << " Z " << angleZ << std::endl;
1788  }
1789  return ALIUtils::getRotationAnglesFromMatrix( rmLocal, angleX, angleY, angleZ );
1790 }
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 1754 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().

1755 {
1756  CLHEP::HepRotation rmParent = optoAncestor->rmGlob(); //ORIGINAL ?????????????????
1757  CLHEP::HepRotation rmLocal = rmParent.inverse() * theRmGlob;
1758 
1759  //I was using theRmGlobOriginal, assuming it has been set to theRmGlob already, check it, in case it may have other consequences
1760  if( theRmGlobOriginal != theRmGlob ){
1761  std::cerr << " !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1762  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1763  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1764  exit(1);
1765  }
1766 
1767  if( ALIUtils::debug >= 5 ) {
1768  std::cout << " OpticalObject::getRotationAnglesInOptOFrame " << name() << " optoAncestor " << optoAncestor->name() << std::endl;
1769  ALIUtils::dumprm( rmParent, " rm parent ");
1770  ALIUtils::dumprm( rmLocal, " rm local ");
1771  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1772  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1773  }
1774  return getRotationAnglesFromMatrix( rmLocal, entries );
1775 
1776 }
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 963 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

964 {
965  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement making measurement (:M)" << std::endl;
966  std::cerr << " Please read documentation for this object type" << std::endl;
967  exit(1);
968 }
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 883 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList().

884 {
885  //---------- see if light traverses or reflects
886  setMeas( &meas );
887  if ( behav == " " ) {
888  defaultBehaviour( lightray, meas );
889  } else if ( behav == "D" || behav == "DD" ) {
890  detailedDeviatesLightRay( lightray );
891  } else if ( behav == "T" || behav == "DT" ) {
892  detailedTraversesLightRay( lightray );
893  } else if ( behav == "FD" ) {
894  fastDeviatesLightRay( lightray );
895  } else if ( behav == "FT" ) {
896  fastTraversesLightRay( lightray );
897  } else if ( behav == "M" ) {
898  makeMeasurement( lightray, meas );
899  } else {
900  userDefinedBehaviour( lightray, meas, behav);
901  }
902 }
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 686 of file OpticalObject.cc.

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

Referenced by setRmGlobalOriginal().

687 {
688  std::cout << " propagateGlobalRMOriginalOriginalChangeToChildren OptO " << name() << std::endl;
689  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
690  theRmGlobOriginalOriginal = rmoriorinew.inverse() * theRmGlobOriginalOriginal;
692  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
693 
694  //----------- Reset RMGlobOriginalOriginal() of every component
695  std::vector<OpticalObject*> vopto;
696  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
697  if( !igetood ) {
698  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
699  return;
700  }
701  std::vector<OpticalObject*>::const_iterator vocite;
702  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
703  // CLHEP::HepRotation rmoriorid = buildRmFromEntryValues();
704  (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
705  }
706 
707 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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(), "" ) == 0 ) {
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 = 1;
234  } else if(coor_type_expected == "angles" ) {
235  anglesIsGlobal = 1;
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 = 0;
129  anglesIsGlobal = 0;
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 1622 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().

1623 {
1624 
1625  //---------- Reset centre and rm
1628 
1629  //---------- Reset extra entries
1630  //---------- Set extra entry values list
1631  std::vector<ALIdouble>::iterator vdite;
1632  std::vector<ALIdouble>::const_iterator vdcite_o = ExtraEntryValueOriginalList().begin() ;
1633  for (vdite = ExtraEntryValueList().begin();
1634  vdite != ExtraEntryValueList().end(); ++vdite,++vdcite_o) {
1635  (*vdite) = (*vdcite_o);
1636  }
1637 
1638  //----------- Reset entries of every component
1639  std::vector<OpticalObject*> vopto;
1640  Model::getComponentOptOs(name(), vopto);
1641  std::vector<OpticalObject*>::const_iterator vocite;
1642  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1643  (*vocite)->resetGlobalCoordinates();
1644  }
1645 
1647 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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:30
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::resetOriginalOriginalCoordinates ( )

Definition at line 1653 of file OpticalObject.cc.

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

Referenced by getZAxis().

1654 {
1655  // std::cout << " !!! CALLING resetOriginalOriginalCoordinates(). STOP " << std::endl;
1656 
1657  //---------- Reset centre and rm
1662 
1663 
1664  //---------- Reset extra entry values list
1665  std::vector<ALIdouble>::iterator vdite;
1666  std::vector<ALIdouble>::iterator vdite_o = theExtraEntryValueOriginalVector.begin() ;
1667  std::vector<ALIdouble>::const_iterator vdcite_oo = theExtraEntryValueOriginalOriginalVector.begin() ;
1668  std::vector<Entry*>::const_iterator vdciteE = ExtraEntryList().begin() ;
1669  for (vdite = ExtraEntryValueList().begin();
1670  vdite != ExtraEntryValueList().end(); ++vdite,++vdite_o,++vdcite_oo,++vdciteE) {
1671  (*vdite) = (*vdcite_oo);
1672  (*vdite_o) = (*vdcite_oo);
1673  (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1674  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdcite_oo) << std::endl;
1675  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdciteE)->value() << std::endl;
1676  // std::cout << " check extra entry " << (*vdciteE)->value() << " =? " << (*vdite) << std::endl;
1677  }
1678 
1679  /* std::vector< Entry* >::iterator eite;
1680  for( eite = theCoordinateEntryVector.begin(); eite != theCoordinateEntryVector.end(); eite++ ){
1681  (*eite)->addFittedDisplacementToValue( - (*eite)->valueDisplacementByFitting() );
1682  }
1683  */
1684 
1685 
1687 
1688  //----------- Reset entries of every component
1689  std::vector<OpticalObject*> vopto;
1690  Model::getComponentOptOs(name(), vopto);
1691  std::vector<OpticalObject*>::const_iterator vocite;
1692  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1693  (*vocite)->resetOriginalOriginalCoordinates();
1694  }
1695 
1696 
1697 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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:30
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 1737 of file OpticalObject.cc.

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

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

1738 {
1739  CLHEP::HepRotation rm;
1740  rm.rotateX( theCoordinateEntryVector[3]->value() );
1741  rm.rotateY( theCoordinateEntryVector[4]->value() );
1742  rm.rotateZ( theCoordinateEntryVector[5]->value() );
1743 
1744  return rm;
1745 }
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 1812 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundGlobal(), and getSolidShape().

1813 {
1814  switch (coor) {
1815  case 0:
1816  object.rotateX(disp);
1817  break;
1818  case 1:
1819  object.rotateY(disp);
1820  break;
1821  case 2:
1822  object.rotateZ(disp);
1823  break;
1824  }
1825  // CLHEP::Hep3Vector axisToRotate = GetAxisForDisplacement( coor );
1826  // object.rotate(disp, axisToRotate);
1827  if( ALIUtils::debug >= 5 ) std::cout << " rotateItAroundGlobal coor " << coor << " disp " << disp << std::endl;
1828 }
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 346 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().

347 {
348 
350  //---------- three names will be X, Y and Z
351  ALIstring coor("XYZ");
352 
353  //---------- Fill the three entries
354  for (int ii=0; ii<3; ii++) {
355  entry = new EntryAngleAffAngles( "angles" );
356 
357  //---------- Set link from entry to OptO it belongs to
358  entry->setOptOCurrent( this );
359  //----- Name is filled from here to be consistent with fillCoordinate
360  ALIstring name = "angles_" + coor.substr(ii, 1);
361  entry->fillName( name );
362  //---------- Set entry data to zero
363  entry->fillNull( );
364 
365  // entry.fillNull( tt );
366 
367  //---------- Add entry to lists
368  Model::addEntryToList( entry );
369  addCoordinateEntryToList( entry );
370 
371  }
372 
373 }
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 783 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCentre().

784 {
785  //----------- Get global centre: parent centre plus local centre traslated to parent coordinate system
786  CLHEP::Hep3Vector cLocal = theCentreGlob;
788 
789  if(ALIUtils::debug >= 5) ALIUtils::dump3v( theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE in parent local frame ");
791 
792  if(ALIUtils::debug >= 5) ALIUtils::dump3v( theCentreGlob, "SetCentreGlobFromCentreLocal: CENTRE GLOBAL ");
793  if(ALIUtils::debug >= 5) {
794  ALIUtils::dump3v( parent()->centreGlob(), ( " parent centreGlob" + parent()->name() ).c_str() );
795  ALIUtils::dumprm( parent()->rmGlob(), " parent rmGlob ");
796  }
797 
798  /* CLHEP::Hep3Vector cLocal2 = theCentreGlob - parent()->centreGlob();
799  CLHEP::HepRotation rmParentInv = inverseOf( parent()->rmGlob() );
800  cLocal2 = rmParentInv * cLocal2;
801  if( (cLocal2 - cLocal).mag() > 1.E-9 ) {
802  std::cerr << "!!!! CALCULATE LOCAL WRONG. Diff= " << (cLocal2 - cLocal).mag() << " " << cLocal2 << " " << cLocal << std::endl;
803  if( (cLocal2 - cLocal).mag() > 1.E-4 ) {
804  std::exception();
805  }
806  }*/
807 }
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 729 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCentre().

730 {
731 
732  // std::vector<Entry*>::const_iterator vecite = CoordinateEntryList().begin();
733  //- std::cout << "PARENTSYSTEM" << name() << parent() <<"ZZ"<<vecite<< std::endl;
734  // std::cout << " OpticalObject::setGlobalCoordinates " << this->name() << std::endl;
735  //- std::cout << veite << "WW" << *vecite << std::endl;
736 //---------------------------------------- Set global centre
737 //----------------------------------- Get local centre from Entries
741  if(ALIUtils::debug >=4) ALIUtils::dump3v( centreGlob(), "SetCentreLocalFromEntryValues: CENTRE LOCAL ");
742 }
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 hcalTTPDigis_cfi::id, and theCmsswID.

Referenced by constructFromOptAligInfo().

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

Definition at line 1126 of file OpticalObject.cc.

References theExtraEntryValueVector, and heppy_batch::val.

Referenced by getZAxis().

1127 {
1128  theExtraEntryValueVector[entryNo] = val;
1129 }
std::vector< ALIdouble > theExtraEntryValueVector
void OpticalObject::setGlobalCentre ( )
private

Definition at line 618 of file OpticalObject.cc.

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

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

619 {
621  if ( type() != ALIstring("system") && !centreIsGlobal ) {
623  }
624  if( anglesIsGlobal ){
625  std::cerr << "!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
626  abort();
627  }
628 }
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 1350 of file OpticalObject.cc.

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

Referenced by getSolidShape().

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

Definition at line 632 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalCoordinates().

633 {
635  if( !anglesIsGlobal ) {
637  }
638 
639  // Calculate local rot axis with new rm glob
641 
642 }
ALIbool anglesIsGlobal
void calculateLocalRotationAxisInGlobal()
void SetRMGlobFromRMLocal()
void SetRMLocalFromEntryValues()
void OpticalObject::setGlobalRMOriginalOriginal ( const CLHEP::HepRotation &  rmoriori)

Definition at line 647 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().

648 {
649  CLHEP::HepRotation rmorioriold = rmGlobOriginalOriginal();
650  if ( ALIUtils::debug >= 5 ) {
651  std::cout << " setGlobalRMOriginalOriginal OptO " << name() << std::endl;
652  ALIUtils::dumprm(rmorioriLocal," setGlobalRMOriginalOriginal new local");
653  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
654  }
655 
656  SetRMGlobFromRMLocalOriginalOriginal( rmorioriLocal );
657 
658  /* //---- multiplyt it by parent rmGlobOriginalOriginal
659  if( parent()->type() != ALIstring("system") ) {
660  theRmGlobOriginalOriginal = parent()->rmGlobOriginalOriginal() * theRmGlobOriginalOriginal;
661  }*/
662 
663  if ( ALIUtils::debug >= 5 ) {
664  ALIUtils::dumprm( parent()->rmGlobOriginalOriginal()," parent rmoriori glob ");
665  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
666  }
667 
668  //----------- Reset RMGlobOriginalOriginal() of every component
669  std::vector<OpticalObject*> vopto;
670  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
671  if( !igetood ) {
672  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
673  return;
674  }
675  std::vector<OpticalObject*>::const_iterator vocite;
676  for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
677  CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
678  (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
679  // (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmGlobOriginalOriginal() );
680  }
681 
682 }
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
Definition: Model.cc:723
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 hcalTTPDigis_cfi::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 854 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().

855 {
856  //---------- Set orig coordinates
859 
862 
863  /* if ( ALIUtils::debug >= 5 ) {
864  ALIUtils::dump3v( centreGlob(), "OPTO: CENTRE GLOB ");
865  ALIUtils::dumprm( rmGlob(), "OPTO: RM GLOB ");
866  }*/
867 
868  //---------- Set extra entry values
869  std::vector<ALIdouble>::const_iterator vdcite;
870  for (vdcite = ExtraEntryValueList().begin();
871  vdcite != ExtraEntryValueList().end(); ++vdcite) {
874  }
875  //- test();
876  if( ALIUtils::debug >= 6 ) std::cout << " setOriginalEntryValues " << std::endl;
877 }
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:30
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 811 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().

812 {
813  const OpticalObject* opto_par = this;
815  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
816  while ( opto_par->parent()->type() != ALIstring("system") ) {
817  //t vecite = opto_par->parent()->GetCoordinateEntry( CEanglesX );
818  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before X " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(XCoor) <<std::endl;
819  theRmGlob.rotateX( parent()->getEntryRMangle(XCoor) );
820  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before Y " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(YCoor) <<std::endl;
821  theRmGlob.rotateY( parent()->getEntryRMangle(YCoor) );
822  if(ALIUtils::debug >= 5) std::cout << "rotate with parent: before Z " << opto_par->parent()->name() <<" " << parent()->getEntryRMangle(ZCoor) <<std::endl;
823  theRmGlob.rotateZ( parent()->getEntryRMangle(ZCoor) );
824  if(ALIUtils::debug >= 4) ALIUtils::dumprm( theRmGlob, ("SetRMGlobFromRMLocal: RM GLOB after " + opto_par->parent()->longName()).c_str() );
825  opto_par = opto_par->parent();
826  }
827  }else {
828  if(ALIUtils::debug >= 4) {
829  std::cout << " Composing rmGlob with parent " << parent()->name() << std::endl;
830  // ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: RM GLOB ");
831  }
832  theRmGlob = parent()->rmGlob() * theRmGlob;
833  }
834 
835  // std::cout << "rotate with parent (parent)" << opto_par->name() <<parent()->name() << (*vecite)->name() << (*vecite)->value() <<std::endl;
836  if(ALIUtils::debug >= 4) {
837  ALIUtils::dumprm( theRmGlob, "SetRMGlobFromRMLocal: final RM GLOB ");
838  ALIUtils::dumprm( parent()->rmGlob(), "parent rm glob ");
839  }
840 }
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 843 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalRMOriginalOriginal().

844 {
845 
846  theRmGlobOriginalOriginal = rmoriori;
848 }
CLHEP::HepRotation theRmGlobOriginalOriginal
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
void OpticalObject::SetRMLocalFromEntryValues ( )
private

Definition at line 746 of file OpticalObject.cc.

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

Referenced by getSolidShape(), and setGlobalRM().

747 {
748 
749  //---------- Set global rotation matrix
750  //-------- Get rm from Entries
751  theRmGlob = CLHEP::HepRotation();
752  theRmGlob.rotateX( getEntryRMangle(XCoor) );
753  if(ALIUtils::debug >= 4) {
754  std::cout << " getEntryRMangle(XCoor) )" << getEntryRMangle(XCoor) << std::endl;
755  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM after X");
756  }
757  theRmGlob.rotateY( getEntryRMangle(YCoor) );
758  if(ALIUtils::debug >= 4) {
759  std::cout << " getEntryRMangle(YCoor) )" << getEntryRMangle(YCoor) << std::endl;
760  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM after Y");
761  }
762  theRmGlob.rotateZ( getEntryRMangle(ZCoor) );
763  if(ALIUtils::debug >= 4) {
764  std::cout << " getEntryRMangle(ZCoor) )" << getEntryRMangle(ZCoor) << std::endl;
765  ALIUtils::dumprm( theRmGlob, "SetRMLocalFromEntryValues: RM FINAL");
766  }
767 
768  //----- angles are relative to parent, so rotate parent angles first
769  // RmGlob() = 0;
770  //- if(ALIUtils::debug >= 4) ALIUtils::dumprm( parent()->rmGlob(), "OPTO0: RM LOCAL ");
771  // if ( type() != ALIstring("system") ) theRmGlob.transform( parent()->rmGlob() );
772  //----- if anglesIsGlobal, RM is already in global coordinates, else multiply by ancestors
773 
774  /* /////////////
775  CLHEP::Hep3Vector ztest(0.,0.,1.);
776  ztest = theRmGlob * ztest;
777  if( ALIUtils::debug >= 5 ) ALIUtils::dump3v( ztest, "z rotated by theRmGlob ");
778  */
779 }
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 1712 of file OpticalObject.cc.

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

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

1713 {
1714  ALIint last_slash = name().rfind('/');
1715  ALIstring sname = name().substr(last_slash+1, name().size()-1);
1716  if( last_slash == -1 ) { //object of type "system"
1717  sname = name();
1718  } else {
1719  sname = name().substr(last_slash+1, name().size()-1);
1720  }
1721  return sname;
1722 }
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, 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  ALIdouble newcoor[] = { R*cos(phi),
284  R*sin(phi),
285  theCoordinateEntryVector[2]->value() // Z
286  };
287  //- std::cout << " phi " << phi << std::endl;
288  //----- Name is filled from here to include 'centre' or 'angles'
289 
290  for( ii = 0; ii < siz; ii++ ) {
291  if(ALIUtils::debug >= 5 ) std::cout << " OpticalObject::transformCylindrical2Cartesian " << ii << " " << newcoor[ii] << std::endl;
292  theCoordinateEntryVector[ii]->setValue( newcoor[ii] );
293  }
294  // change the names
295  ALIstring name = "centre_X";
296  theCoordinateEntryVector[0]->fillName( name );
297  name = "centre_Y";
298  theCoordinateEntryVector[1]->fillName( name );
299  name = "centre_Z";
300  theCoordinateEntryVector[2]->fillName( name );
301 
302 }
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 305 of file OpticalObject.cc.

Referenced by getSolidShape(), and readCoordinates().

306 {
307 
308 }
const ALIstring& OpticalObject::type ( ) const
inline
void OpticalObject::userDefinedBehaviour ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
virtual

Reimplemented in OptOUserDefined.

Definition at line 970 of file OpticalObject.cc.

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

Referenced by addExtraEntryValueOriginalOriginalToList(), and participateInMeasurement().

971 {
972  std::cerr << "!!! Optical Object " << name() << " of type " << type() << " does not implement user defined behaviour = " << behav << std::endl;
973  std::cerr << " Please read documentation for this object type" << std::endl;
974  exit(1);
975 }
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 1726 of file OpticalObject.cc.

1726  {
1727  os << "OPTICALOBJECT: " << c.theName << " of type: " << c.theType
1728  << " " << c.theCentreGlob
1729  << c.theRmGlob << std::endl;
1730 
1731  return os;
1732 
1733 }
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