CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Definition at line 41 of file OpticalObject.h.

41 { };
OpticalObject::OpticalObject ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)

Definition at line 53 of file OpticalObject.cc.

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

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

Definition at line 1701 of file OpticalObject.cc.

1702 {
1703 }

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

Definition at line 153 of file OpticalObject.h.

References theExtraEntryValueOriginalOriginalVector.

Referenced by setOriginalEntryValues().

153  {
154  theExtraEntryValueOriginalOriginalVector.push_back( entry_value );
155  }
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
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 1906 of file OpticalObject.cc.

References M_PI.

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

Definition at line 1897 of file OpticalObject.cc.

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

Definition at line 709 of file OpticalObject.cc.

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

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

Definition at line 426 of file OpticalObject.cc.

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

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

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

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

1791 {
1792  axisXLocalInGlobal = CLHEP::Hep3Vector(1.,0.,0.);
1794  axisYLocalInGlobal = CLHEP::Hep3Vector(0.,1.,0.);
1796  axisZLocalInGlobal = CLHEP::Hep3Vector(0.,0.,1.);
1798  if( ALIUtils::debug >= 4 ){
1799  std::cout << name() << " axis X local in global " << axisXLocalInGlobal << std::endl;
1800  std::cout << name() << " axis Y local in global " << axisYLocalInGlobal << std::endl;
1801  std::cout << name() << " axis Z local in global " << axisZLocalInGlobal << std::endl;
1802  }
1803 
1804 }
CLHEP::HepRotation theRmGlob
static ALIint debug
Definition: ALIUtils.h:35
CLHEP::Hep3Vector axisYLocalInGlobal
CLHEP::Hep3Vector axisXLocalInGlobal
tuple cout
Definition: gather_cfg.py:121
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().

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

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

Referenced by CocoaToDDLMgr::pv().

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

References dtNoiseDBValidation_cfg::cerr, funct::cos(), eq2ang(), and funct::sin().

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

67 {
68  //---------- Get file handler
70  /*- if(!filein) {
71  filein.ErrorInLine();
72  std::cerr << "cannot open file SystemDescription.txt" << std::endl;
73  exit(0);
74  }*/
75 
76  if( theParent != 0 ) { //----- OptO 'system' has no parent (and no affine frame)
77  //---------- Read or copy Data
78  if(!fcopyData) {
79  if(ALIUtils::debug >=4) std::cout << "@@@@ Reading data of Optical Object " << name() << std::endl;
80  readData( filein );
81  } else {
82  if(ALIUtils::debug >=4) std::cout << "Copy data of Optical Object " << name() << std::endl;
83  copyData();
84  }
85 
86  //---------- Set global coordinates
88  //---------- Set ValueDisplacementByFitting to 0. !!done at Entry construction
89  /* std::vector<Entry*>::const_iterator vecite;
90  for ( vecite = CoordinateEntryList().begin(); vecite != CoordinateEntryList().end(); vecite++) {
91  (*vecite)->setValueDisplacementByFitting( 0. );
92  }
93  */
94 
95  //---------- Set original entry values
97  }
98 
99  //---------- Create the OptO that compose this one
100  createComponentOptOs( filein );
101 
102  //---------- Construct material
104 
105  //---------- Construct solid shape
107 
108 }
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:23
static ALIint debug
Definition: ALIUtils.h:35
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
tuple cout
Definition: gather_cfg.py:121
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 2108 of file OpticalObject.cc.

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

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

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

Definition at line 2089 of file OpticalObject.cc.

References theMaterial.

Referenced by construct(), and constructFromOptAligInfo().

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

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

Referenced by construct(), and constructFromOptAligInfo().

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

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

Definition at line 469 of file OpticalObject.cc.

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

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

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

Referenced by constructFromOptAligInfo().

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

Definition at line 542 of file OpticalObject.cc.

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

Referenced by createComponentOptOs(), and createComponentOptOsFromOptAlignInfo().

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

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

Referenced by participateInMeasurement().

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

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

Referenced by participateInMeasurement().

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

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

Referenced by participateInMeasurement().

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

References diffTreeTool::diff, and M_PI.

Referenced by eq2ang().

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

Definition at line 1038 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displace().

1039 {
1040  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: coor " << coor << " disp = " << disp << std::endl;
1041 
1043  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1044  theCentreGlob += dispVec;
1045 
1046  //----------- Displace CentreGlob() of every component
1047  std::vector<OpticalObject*> vopto;
1048  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1049  if( !igetood ) {
1050  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
1051  return;
1052  }
1053  std::vector<OpticalObject*>::const_iterator vocite;
1054  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1055  (*vocite)->displaceCentreGlob( dispVec );
1056  }
1057 
1058 }
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:35
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::displaceCentreGlob ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1087 of file OpticalObject.cc.

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

1088 {
1089  if ( ALIUtils::debug >= 5 ) std::cout << name() << " displaceCentreGlob: dispVec = " << dispVec << std::endl;
1090 
1092  theCentreGlob += dispVec;
1093 
1094  //----------- Displace CentreGlob() of every component
1095  std::vector<OpticalObject*> vopto;
1096  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
1097  if( !igetood ) {
1098  return;
1099  }
1100  std::vector<OpticalObject*>::const_iterator vocite;
1101  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1102  (*vocite)->displaceCentreGlob( dispVec );
1103  }
1104 
1105 }
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:35
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::Hep3Vector & centreGlobOriginal() const
Definition: OpticalObject.h:95
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
CLHEP::Hep3Vector theCentreGlob
void OpticalObject::displaceCentreGlobOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1129 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginal().

1130 {
1131  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1132  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original 0");
1133  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1134  theCentreGlobOriginal += dispVec;
1135 
1136  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original displaced");
1137 
1138  //----------- Displace CentreGlob() of every component
1139  std::vector<OpticalObject*> vopto;
1140  Model::getComponentOptOs(name(), vopto);
1141  std::vector<OpticalObject*>::const_iterator vocite;
1142  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1143  (*vocite)->displaceCentreGlobOriginal( dispVec );
1144  }
1145 
1146 }
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:35
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)
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1152 of file OpticalObject.cc.

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

1153 {
1154  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1155 
1156  theCentreGlobOriginal += dispVec;
1157 
1158  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginal, "the centre glob original");
1159 
1160  //----------- Displace CentreGlob() of every component
1161  std::vector<OpticalObject*> vopto;
1162  Model::getComponentOptOs(name(), vopto);
1163  std::vector<OpticalObject*>::const_iterator vocite;
1164  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1165  (*vocite)->displaceCentreGlobOriginal( dispVec );
1166  }
1167 
1168 }
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:35
CLHEP::Hep3Vector theCentreGlobOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginalOriginal ( const XYZcoor  coor,
const ALIdouble  disp 
)

Definition at line 1172 of file OpticalObject.cc.

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

Referenced by EntryLengthAffCentre::displaceOriginalOriginal().

1173 {
1174  if ( ALIUtils::debug >= 4 ) std::cout << "@@ OpticalObject::displaceCentreGloboriginal " << name() << " " << coor << " " << disp << std::endl;
1175  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob originalOriginal 0");
1176  CLHEP::Hep3Vector dispVec = getDispVec( coor, disp );
1177  theCentreGlobOriginalOriginal += dispVec;
1178 
1179  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original displaced");
1180 
1181  //----------- Displace CentreGlob() of every component
1182  std::vector<OpticalObject*> vopto;
1183  Model::getComponentOptOs(name(), vopto);
1184  std::vector<OpticalObject*>::const_iterator vocite;
1185  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1186  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1187  }
1188 
1189 }
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:35
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)
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceCentreGlobOriginalOriginal ( const CLHEP::Hep3Vector &  dispVec)

Definition at line 1195 of file OpticalObject.cc.

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

1196 {
1197  if ( ALIUtils::debug >= 4 ) std::cout << " OpticalObject::displaceCentreGloboriginal " << name() << " dispVec " << dispVec << std::endl;
1198 
1199  theCentreGlobOriginalOriginal += dispVec;
1200 
1201  if ( ALIUtils::debug >= 5 ) ALIUtils::dump3v(theCentreGlobOriginalOriginal, "the centre glob original");
1202 
1203  //----------- Displace CentreGlob() of every component
1204  std::vector<OpticalObject*> vopto;
1205  Model::getComponentOptOs(name(), vopto);
1206  std::vector<OpticalObject*>::const_iterator vocite;
1207  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1208  (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1209  }
1210 
1211 }
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:35
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OpticalObject::displaceExtraEntry ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1111 of file OpticalObject.cc.

References theExtraEntryValueOriginalVector, and theExtraEntryValueVector.

Referenced by Entry::displace().

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

References theExtraEntryValueOriginalVector.

Referenced by Entry::displaceOriginal().

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

Definition at line 1530 of file OpticalObject.cc.

References theExtraEntryValueOriginalOriginalVector.

Referenced by Entry::displaceOriginalOriginal().

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

1219 {
1220  if(ALIUtils::debug>=5) std::cout << name() << "DISPLACERMGLOBAROUNDGLOBAL" << coor << "disp" << disp << std::endl;
1221  //-------------------- Rotate rotation matrix
1224  if(ALIUtils::debug >= 5 ) {
1225  std::cout << this->name() << std::endl;
1226  ALIUtils::dumprm( theRmGlob, "before disp rm " );
1227  }
1228  rotateItAroundGlobal( theRmGlob, coor, disp );
1229  if(ALIUtils::debug >= 5 ) {
1230  ALIUtils::dumprm( theRmGlob, "after disp rm " );
1231  }
1232  //-------------------- Rotation translate the centre of component OptO
1233  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob before rotation" );
1234  if(ALIUtils::debug >= 5 ) ALIUtils::dump3v( centreGlobOriginal(), " centreGlobOriginal before rotation" );
1235  if(opto1stRotated != this ) { //own _centre_glob is not displaced
1236  //---------- Distance to 1st rotated OptO
1237  CLHEP::Hep3Vector radiusOriginal = centreGlobOriginal() - opto1stRotated->centreGlobOriginal();
1238  CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1239  rotateItAroundGlobal( radius_rotated, coor, disp );
1240  theCentreGlob = centreGlobOriginal() + (radius_rotated - radiusOriginal);
1241  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlob(), " centre_glob after rotation" );
1242  if(ALIUtils::debug >= 5) ALIUtils::dump3v( centreGlobOriginal(), " centre_globOriginal() after rotation" );
1243  }
1244 
1245  //----------- Displace every component
1246  std::vector<OpticalObject*> vopto;
1247  Model::getComponentOptOs(name(), vopto);
1248  std::vector<OpticalObject*>::const_iterator vocite;
1249  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1250  (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1251  }
1252 
1253 }
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:35
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
tuple cout
Definition: gather_cfg.py:121
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 1260 of file OpticalObject.cc.

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

Referenced by EntryAngleAffAngles::displace().

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

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

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

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

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

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

Referenced by checkMatrixEquations().

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

References begin, and ExtraEntryList().

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

1542 {
1543  //- std::cout << ExtraEntryList().size() << "entry name " << entry_name << std::endl;
1544 
1545  std::vector<Entry*>::const_iterator vecite;
1546  for (vecite = ExtraEntryList().begin(); vecite != ExtraEntryList().end(); vecite++) {
1547  //- std::cout <<"in entryno" << (*vecite)->name() << entry_name << std::endl;
1548  if ((*vecite)->name() == entry_name ) {
1549  return (vecite - ExtraEntryList().begin());
1550  }
1551  //- std::cout <<"DD in entryno" << (*vecite)->name() << entry_name << std::endl;
1552  }
1553  //- std::cout << "!!: extra entry name not found: " << entry_name << " in OptO " << name() << std::endl;
1554  // exit(2);
1555  return ALIint(-1);
1556 }
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 918 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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

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

Referenced by participateInMeasurement().

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

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

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

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

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

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

Definition at line 56 of file OpticalObject.h.

56 { };
virtual void OpticalObject::fillVRML ( )
inlinevirtual

Definition at line 55 of file OpticalObject.h.

55 { } ;
const ALIdouble OpticalObject::findExtraEntryValue ( const ALIstring eename) const

Definition at line 1562 of file OpticalObject.cc.

References dtNoiseDBValidation_cfg::cerr, CastorDataFrameFilter_impl::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(), LightRay::shiftAndDeviateWhileTraversing(), and OptOUserDefined::userDefinedBehaviour().

1562  {
1563  ALIdouble retval;
1564  const ALIint entryNo = extraEntryNo( eename );
1565  if( entryNo >= 0 ) {
1566  const ALIdouble Pentry_value = *(theExtraEntryValueVector.begin() + entryNo);
1567  retval = (Pentry_value);
1568  } else {
1569  // if(ALIUtils::debug >= 0) std::cerr << "!!Warning: entry not found; " << eename << ", in object " << name() << " returns 0. " << std::endl;
1570  ALIdouble check;
1572  gomgr->getGlobalOptionValue("check_extra_entries", check );
1573  if( check == 1) {
1574  // if( check <= 1) {//exit temporarily
1575  std::cerr << "!!OpticalObject:ERROR: entry not found; " << eename << ", in object " << name() << std::endl;
1576  exit(1);
1577  } else {
1578  //- std::cerr << "!!temporal WARNING in OpticalObject::findExtraEntryValue: entry not found; " << eename << ", in object " << name() << std::endl;
1579  retval = 0.;
1580  }
1581  }
1582 
1583  if(ALIUtils::debug >= 5) std::cout << " OpticalObject::findExtraEntryValue: " << eename << " = " << retval << std::endl;
1584  return retval;
1585 }
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:35
static GlobalOptionMgr * getInstance()
std::vector< ALIdouble > theExtraEntryValueVector
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
const ALIint extraEntryNo(const ALIstring &entry_name) const
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIbool OpticalObject::findExtraEntryValueIfExists ( const ALIstring eename,
ALIdouble value 
) const

Definition at line 1607 of file OpticalObject.cc.

References extraEntryNo(), and findExtraEntryValue().

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

1608 {
1609  value = findExtraEntryValue( eename );
1610  const ALIint entryNo = extraEntryNo( eename );
1611  //- std::cout << eename << " entryNo " << entryNo << " value " << value << std::endl;
1612  return( entryNo >= 0 );
1613 }
int ALIint
Definition: CocoaGlobals.h:15
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const ALIint extraEntryNo(const ALIstring &entry_name) const
const ALIdouble OpticalObject::findExtraEntryValueMustExist ( const ALIstring eename) const

Definition at line 1591 of file OpticalObject.cc.

References dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, extraEntryNo(), findExtraEntryValue(), and name().

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

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

Referenced by constructFromOptAligInfo().

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

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

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

Definition at line 1988 of file OpticalObject.cc.

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

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

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

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

Referenced by SetCentreLocalFromEntryValues().

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

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

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

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

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

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

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

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

References getRotationAnglesInOptOFrame(), and theParent.

Referenced by CocoaDBMgr::GetOptAlignInfoFromOptO().

1746 {
1748 }
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 986 of file OpticalObject.cc.

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

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

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

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

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

1778 {
1779  std::vector<double> newang(3);
1780  double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1781  double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1782  double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1783  if( ALIUtils::debug >= 5 ) {
1784  std::cout << " angles as value entries: X= " << angleX << " Y= " << angleY << " Z " << angleZ << std::endl;
1785  }
1786  return ALIUtils::getRotationAnglesFromMatrix( rmLocal, angleX, angleY, angleZ );
1787 }
const CLHEP::HepRotation rmLocal() const
static ALIint debug
Definition: ALIUtils.h:35
tuple cout
Definition: gather_cfg.py:121
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 1751 of file OpticalObject.cc.

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

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

1752 {
1753  CLHEP::HepRotation rmParent = optoAncestor->rmGlob(); //ORIGINAL ?????????????????
1754  CLHEP::HepRotation rmLocal = rmParent.inverse() * theRmGlob;
1755 
1756  //I was using theRmGlobOriginal, assuming it has been set to theRmGlob already, check it, in case it may have other consequences
1757  if( theRmGlobOriginal != theRmGlob ){
1758  std::cerr << " !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1759  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1760  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1761  exit(1);
1762  }
1763 
1764  if( ALIUtils::debug >= 5 ) {
1765  std::cout << " OpticalObject::getRotationAnglesInOptOFrame " << name() << " optoAncestor " << optoAncestor->name() << std::endl;
1766  ALIUtils::dumprm( rmParent, " rm parent ");
1767  ALIUtils::dumprm( rmLocal, " rm local ");
1768  ALIUtils::dumprm( theRmGlobOriginal, " theRmGlobOriginal ");
1769  ALIUtils::dumprm( theRmGlob, " theRmGlob ");
1770  }
1771  return getRotationAnglesFromMatrix( rmLocal, entries );
1772 
1773 }
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:35
const CLHEP::HepRotation & rmGlob() const
CLHEP::HepRotation theRmGlobOriginal
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
CocoaSolidShape* OpticalObject::getSolidShape ( ) const
inline

Definition at line 260 of file OpticalObject.h.

References theSolidShape.

260  {
261  return theSolidShape; }
CocoaSolidShape * theSolidShape
CLHEP::Hep3Vector OpticalObject::getZAxis ( )
inline

Definition at line 180 of file OpticalObject.h.

References rmGlob().

180  {
181  CLHEP::Hep3Vector ZAxis(0.,0.,1.);
182  CLHEP::HepRotation rmt = rmGlob();
183  ZAxis = rmt*ZAxis;
184  return ZAxis;
185  }
const CLHEP::HepRotation & rmGlob() const
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 962 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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

Definition at line 241 of file OpticalObject.h.

References theCurrentMeas.

Referenced by setMeas().

241  {
242  return theCurrentMeas;
243  }
Measurement * theCurrentMeas
const ALIstring& OpticalObject::name ( ) const
inline

Definition at line 60 of file OpticalObject.h.

References theName.

Referenced by dataset.Dataset::__getDataType(), dataset.Dataset::__getFileInfoList(), cuy.divideElement::__init__(), cuy.plotElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), 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(), 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(), LightRay::LightRay(), Entry::longName(), longName(), CocoaToDDLMgr::lv(), OptODistancemeter::makeMeasurement(), OptODistancemeter3dim::makeMeasurement(), makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), Fit::printCentreInOptOFrame(), propagateGlobalRMOriginalOriginalChangeToChildren(), CocoaToDDLMgr::pv(), resetGlobalCoordinates(), resetOriginalOriginalCoordinates(), setAnglesNull(), SetCentreGlobFromCentreLocal(), setGlobalCoordinatesOfComponents(), setGlobalRMOriginalOriginal(), FittedEntriesSet::SetOptOEntries(), SetRMGlobFromRMLocal(), shortName(), CocoaToDDLMgr::specPar(), LightRay::startLightRay(), transformCylindrical2Cartesian(), OptOUserDefined::userDefinedBehaviour(), userDefinedBehaviour(), 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 BeautifulSoup.PageElement::_invert(), 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(), 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 OptOLens, and OptORisleyPrism.

Definition at line 882 of file OpticalObject.cc.

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

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

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

686 {
687  std::cout << " propagateGlobalRMOriginalOriginalChangeToChildren OptO " << name() << std::endl;
688  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
689  theRmGlobOriginalOriginal = rmoriorinew.inverse() * theRmGlobOriginalOriginal;
691  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
692 
693  //----------- Reset RMGlobOriginalOriginal() of every component
694  std::vector<OpticalObject*> vopto;
695  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
696  if( !igetood ) {
697  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
698  return;
699  }
700  std::vector<OpticalObject*>::const_iterator vocite;
701  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
702  // CLHEP::HepRotation rmoriorid = buildRmFromEntryValues();
703  (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
704  }
705 
706 }
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
tuple cout
Definition: gather_cfg.py:121
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 218 of file OpticalObject.cc.

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

Referenced by readData().

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

Definition at line 115 of file OpticalObject.cc.

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

Referenced by construct().

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

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

Referenced by readData().

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

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

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

1620 {
1621 
1622  //---------- Reset centre and rm
1625 
1626  //---------- Reset extra entries
1627  //---------- Set extra entry values list
1628  std::vector<ALIdouble>::iterator vdite;
1629  std::vector<ALIdouble>::const_iterator vdcite_o = ExtraEntryValueOriginalList().begin() ;
1630  for (vdite = ExtraEntryValueList().begin();
1631  vdite != ExtraEntryValueList().end(); vdite++,vdcite_o++) {
1632  (*vdite) = (*vdcite_o);
1633  }
1634 
1635  //----------- Reset entries of every component
1636  std::vector<OpticalObject*> vopto;
1637  Model::getComponentOptOs(name(), vopto);
1638  std::vector<OpticalObject*>::const_iterator vocite;
1639  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1640  (*vocite)->resetGlobalCoordinates();
1641  }
1642 
1644 }
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 1650 of file OpticalObject.cc.

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

1651 {
1652  // std::cout << " !!! CALLING resetOriginalOriginalCoordinates(). STOP " << std::endl;
1653 
1654  //---------- Reset centre and rm
1659 
1660 
1661  //---------- Reset extra entry values list
1662  std::vector<ALIdouble>::iterator vdite;
1663  std::vector<ALIdouble>::iterator vdite_o = theExtraEntryValueOriginalVector.begin() ;
1664  std::vector<ALIdouble>::const_iterator vdcite_oo = theExtraEntryValueOriginalOriginalVector.begin() ;
1665  std::vector<Entry*>::const_iterator vdciteE = ExtraEntryList().begin() ;
1666  for (vdite = ExtraEntryValueList().begin();
1667  vdite != ExtraEntryValueList().end(); vdite++,vdite_o++,vdcite_oo++,vdciteE++) {
1668  (*vdite) = (*vdcite_oo);
1669  (*vdite_o) = (*vdcite_oo);
1670  (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1671  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdcite_oo) << std::endl;
1672  // std::cout << " resetting extra entry origorig " << (*vdciteE)->name() << " = " << (*vdite) << " ? " << (*vdciteE)->value() << std::endl;
1673  // std::cout << " check extra entry " << (*vdciteE)->value() << " =? " << (*vdite) << std::endl;
1674  }
1675 
1676  /* std::vector< Entry* >::iterator eite;
1677  for( eite = theCoordinateEntryVector.begin(); eite != theCoordinateEntryVector.end(); eite++ ){
1678  (*eite)->addFittedDisplacementToValue( - (*eite)->valueDisplacementByFitting() );
1679  }
1680  */
1681 
1682 
1684 
1685  //----------- Reset entries of every component
1686  std::vector<OpticalObject*> vopto;
1687  Model::getComponentOptOs(name(), vopto);
1688  std::vector<OpticalObject*>::const_iterator vocite;
1689  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1690  (*vocite)->resetOriginalOriginalCoordinates();
1691  }
1692 
1693 
1694 }
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 1734 of file OpticalObject.cc.

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

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

1735 {
1736  CLHEP::HepRotation rm;
1737  rm.rotateX( theCoordinateEntryVector[3]->value() );
1738  rm.rotateY( theCoordinateEntryVector[4]->value() );
1739  rm.rotateZ( theCoordinateEntryVector[5]->value() );
1740 
1741  return rm;
1742 }
std::vector< Entry * > theCoordinateEntryVector
string rm
Definition: submit.py:76
template<class T >
void OpticalObject::rotateItAroundGlobal ( T object,
const XYZcoor  coor,
const double  disp 
)
private

Definition at line 1809 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundGlobal().

1810 {
1811  switch (coor) {
1812  case 0:
1813  object.rotateX(disp);
1814  break;
1815  case 1:
1816  object.rotateY(disp);
1817  break;
1818  case 2:
1819  object.rotateZ(disp);
1820  break;
1821  }
1822  // CLHEP::Hep3Vector axisToRotate = GetAxisForDisplacement( coor );
1823  // object.rotate(disp, axisToRotate);
1824  if( ALIUtils::debug >= 5 ) std::cout << " rotateItAroundGlobal coor " << coor << " disp " << disp << std::endl;
1825 }
static ALIint debug
Definition: ALIUtils.h:35
tuple cout
Definition: gather_cfg.py:121
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 345 of file OpticalObject.cc.

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

Referenced by readData().

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

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

Referenced by setGlobalCentre().

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

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

Referenced by setGlobalCentre().

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

Referenced by constructFromOptAligInfo().

123 { theCmsswID = id; }
ALIuint theCmsswID
void OpticalObject::setExtraEntryValue ( const ALIuint  entryNo,
const ALIdouble  disp 
)

Definition at line 1123 of file OpticalObject.cc.

References theExtraEntryValueVector.

1124 {
1125  theExtraEntryValueVector[entryNo] = val;
1126 }
std::vector< ALIdouble > theExtraEntryValueVector
void OpticalObject::setGlobalCentre ( )
private

Definition at line 617 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundLocal(), and setGlobalCoordinates().

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

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

1348 {
1349 
1350  // Calculate the displaced centreGlob and rmGlob of components
1351  std::vector<OpticalObject*> vopto;
1352  Model::getComponentOptOs(name(), vopto);
1353  std::vector<OpticalObject*>::const_iterator vocite;
1354  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
1355  (*vocite)->setGlobalCoordinates();
1356  }
1357 
1358 }
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 631 of file OpticalObject.cc.

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

Referenced by setGlobalCoordinates().

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

Definition at line 646 of file OpticalObject.cc.

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

Referenced by FittedEntriesReader::readFittedEntriesFromFile().

647 {
648  CLHEP::HepRotation rmorioriold = rmGlobOriginalOriginal();
649  if ( ALIUtils::debug >= 5 ) {
650  std::cout << " setGlobalRMOriginalOriginal OptO " << name() << std::endl;
651  ALIUtils::dumprm(rmorioriLocal," setGlobalRMOriginalOriginal new local");
652  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal old ");
653  }
654 
655  SetRMGlobFromRMLocalOriginalOriginal( rmorioriLocal );
656 
657  /* //---- multiplyt it by parent rmGlobOriginalOriginal
658  if( parent()->type() != ALIstring("system") ) {
659  theRmGlobOriginalOriginal = parent()->rmGlobOriginalOriginal() * theRmGlobOriginalOriginal;
660  }*/
661 
662  if ( ALIUtils::debug >= 5 ) {
663  ALIUtils::dumprm( parent()->rmGlobOriginalOriginal()," parent rmoriori glob ");
664  ALIUtils::dumprm(rmGlobOriginalOriginal()," setGlobalRMOriginalOriginal new ");
665  }
666 
667  //----------- Reset RMGlobOriginalOriginal() of every component
668  std::vector<OpticalObject*> vopto;
669  ALIbool igetood = Model::getComponentOptOs(name(), vopto);
670  if( !igetood ) {
671  // std::cout << " NO MORE COMPONENTS IN THIS OptO" << name() << std::endl ;
672  return;
673  }
674  std::vector<OpticalObject*>::const_iterator vocite;
675  for (vocite = vopto.begin(); vocite != vopto.end(); vocite++) {
676  CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
677  (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
678  // (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmGlobOriginalOriginal() );
679  }
680 
681 }
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:35
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
const OpticalObject * parent() const
Definition: OpticalObject.h:62
tuple cout
Definition: gather_cfg.py:121
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 theCmsswID.

Referenced by createComponentOptOs().

124 { theCmsswID = id; }
ALIuint theCmsswID
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 853 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(), and FittedEntriesSet::SetOptOEntries().

854 {
855  //---------- Set orig coordinates
858 
861 
862  /* if ( ALIUtils::debug >= 5 ) {
863  ALIUtils::dump3v( centreGlob(), "OPTO: CENTRE GLOB ");
864  ALIUtils::dumprm( rmGlob(), "OPTO: RM GLOB ");
865  }*/
866 
867  //---------- Set extra entry values
868  std::vector<ALIdouble>::const_iterator vdcite;
869  for (vdcite = ExtraEntryValueList().begin();
870  vdcite != ExtraEntryValueList().end(); vdcite++) {
873  }
874  //- test();
875  if( ALIUtils::debug >= 6 ) std::cout << " setOriginalEntryValues " << std::endl;
876 }
std::vector< ALIdouble > & ExtraEntryValueList()
Definition: OpticalObject.h:73
static ALIint debug
Definition: ALIUtils.h:35
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
tuple cout
Definition: gather_cfg.py:121
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
string rm
Definition: submit.py:76
void OpticalObject::setRmGlobalOriginal ( const CLHEP::HepRotation &  rm)
inline

Definition at line 127 of file OpticalObject.h.

References submit::rm, and theRmGlobOriginal.

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

127  {
129  }
string rm
Definition: submit.py:76
CLHEP::HepRotation theRmGlobOriginal
void OpticalObject::SetRMGlobFromRMLocal ( )
private

Definition at line 810 of file OpticalObject.cc.

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

Referenced by displaceRmGlobAroundLocal(), and setGlobalRM().

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

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

Referenced by setGlobalRMOriginalOriginal().

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

Definition at line 745 of file OpticalObject.cc.

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

Referenced by setGlobalRM().

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

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

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

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

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

277 {
278  ALIuint ii;
279  ALIuint siz = theCoordinateEntryVector.size();
280  ALIdouble newcoor[3];
281  ALIdouble R = theCoordinateEntryVector[0]->value();
283  newcoor[0] = R*cos(phi);
284  newcoor[1] = R*sin(phi);
285  newcoor[2] = theCoordinateEntryVector[2]->value(); // Z
286  //- std::cout << " phi " << phi << std::endl;
287  //----- Name is filled from here to include 'centre' or 'angles'
288 
289  for( ii = 0; ii < siz; ii++ ) {
290  if(ALIUtils::debug >= 5 ) std::cout << " OpticalObject::transformCylindrical2Cartesian " << ii << " " << newcoor[ii] << std::endl;
291  theCoordinateEntryVector[ii]->setValue( newcoor[ii] );
292  }
293  // change the names
294  ALIstring name = "centre_X";
295  theCoordinateEntryVector[0]->fillName( name );
296  name = "centre_Y";
297  theCoordinateEntryVector[1]->fillName( name );
298  name = "centre_Z";
299  theCoordinateEntryVector[2]->fillName( name );
300 
301 }
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:35
int ii
Definition: cuy.py:588
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::string ALIstring
Definition: CocoaGlobals.h:9
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:75
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:71
unsigned int ALIuint
Definition: CocoaGlobals.h:17
Definition: DDAxes.h:10
void OpticalObject::transformGlobal2Local ( )
private
void OpticalObject::transformSpherical2Cartesian ( )
private

Definition at line 304 of file OpticalObject.cc.

Referenced by readCoordinates().

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

Definition at line 969 of file OpticalObject.cc.

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

Referenced by participateInMeasurement().

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

Friends And Related Function Documentation

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

Definition at line 1723 of file OpticalObject.cc.

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