CMS 3D CMS Logo

List of all members | Public Member Functions
OptOUserDefined Class Reference

#include <OptOUserDefined.h>

Inheritance diagram for OptOUserDefined:
OpticalObject

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from OpticalObject
virtual void fillExtraEntry (std::vector< ALIstring > &wordlist)
 
- Protected Attributes inherited from OpticalObject
CocoaMaterialElementarytheMaterial
 
CocoaSolidShapetheSolidShape
 
ALIint verbose
 

Detailed Description

Definition at line 18 of file OptOUserDefined.h.

Constructor & Destructor Documentation

◆ OptOUserDefined() [1/2]

OptOUserDefined::OptOUserDefined ( )
inline

Definition at line 21 of file OptOUserDefined.h.

21 {}

◆ OptOUserDefined() [2/2]

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

Definition at line 22 of file OptOUserDefined.h.

23  : OpticalObject(parent, type, name, copy_data) {}
const ALIstring & name() const
Definition: OpticalObject.h:58
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ ~OptOUserDefined()

OptOUserDefined::~OptOUserDefined ( )
inlineoverride

Definition at line 24 of file OptOUserDefined.h.

24 {}

Member Function Documentation

◆ userDefinedBehaviour()

void OptOUserDefined::userDefinedBehaviour ( LightRay lightray,
Measurement meas,
const ALIstring behav 
)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 24 of file OptOUserDefined.cc.

References OpticalObject::centreGlob(), DMR_cfg::cerr, gather_cfg::cout, ALIUtils::debug, LightRay::direction(), ALIUtils::dump3v(), LightRay::dumpData(), relativeConstraints::empty, beamvalidation::exit(), OpticalObject::ExtraEntryList(), OpticalObject::findExtraEntryValue(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), OpticalObject::getPlate(), GlobalOptionMgr::GlobalOptions(), LightRay::intersect(), OpticalObject::meas(), OpticalObject::name(), Measurement::name(), LightRay::point(), OpticalObject::rmGlob(), LightRay::setDirection(), and LightRay::setPoint().

24  {
25 #ifdef COCOA_VIS
26  ALIVisLightPath* vispath = 0;
27  if (ALIUtils::getFirstTime()) {
29  if (gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
30  vispath = IgCocoaFileMgr::getInstance().newLightPath(name());
31  }
32  }
33 #endif
34 
35  if (ALIUtils::debug >= 5)
36  ALIUtils::dump3v(centreGlob(), " user Defined centre ");
37  //---- Object is not a basic one
38  if (ExtraEntryList().empty()) {
39  std::cerr << "OpticalObject: !!! EXITING at Measurement: " << meas.name() << " in OptO: " << name()
40  << " behaviour ':" << behav << "' is not adequate " << std::endl;
41  std::cerr << "an OptO has to indicate if detailed simulation traverses (:T) or deviates (:D) or Fast Simulation "
42  "traverses (:FT) or deviates (:FD) or default behaviour () "
43  << std::endl;
44  exit(4);
45  } else {
46  ALIint behavSize = behav.size();
47  // if( !(nSet[0]).isNumber() ) nSet = "";
48  ALIstring nSet;
49  if (behavSize != 2 || behav[0] != 'D') { //|| !behav[1]).isNumber() )
50  std::cerr << "OpticalObject: !!! EXITING at Measurement: " << meas.name() << " in OptO: " << name()
51  << " behaviour ':" << behav << "' is not adequate " << std::endl;
52  std::cerr << "an OptO has to indicate detailed simulation by (:Dn) where n is an integer number " << std::endl;
53  exit(4);
54  } else {
55  nSet = behav.substr(behavSize - 1, behavSize);
56  }
57  //- std::cout << behavSize << " nSet " << nSet << std::endl;
58  ALIdouble shiftZ = findExtraEntryValue("shiftZ" + nSet);
59  ALIdouble shiftX = findExtraEntryValue("shiftX" + nSet);
60  ALIdouble shiftY = findExtraEntryValue("shiftY" + nSet);
61  ALIdouble deviX = findExtraEntryValue("deviX" + nSet);
62  ALIdouble deviY = findExtraEntryValue("deviY" + nSet);
63  ALIdouble deviZ = findExtraEntryValue("deviZ" + nSet);
64  CLHEP::Hep3Vector shift3D(shiftX, shiftY, shiftZ);
65  CLHEP::HepRotation rmt = rmGlob();
66  shift3D = rmt * shift3D;
67  if (ALIUtils::debug >= 5) {
68  lightray.dumpData("OptOUserDefined: lightray incoming");
69  ALIUtils::dump3v(shift3D, " shift 3D ");
70  //-std::cout << " shift " << shiftX << " shiftY " << shiftY << " shiftZ " << shiftZ
71  //- << " deviX " << deviX << " deviY " << deviY << std::endl;
72  }
73 
74  ALIPlane plate = getPlate(false, false);
75  lightray.intersect(plate);
76 
77 #ifdef COCOA_VIS
78  //--- draw a point at intersection
80  if (ALIUtils::getFirstTime()) {
81  if (gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
82  ALIVRMLMgr::getInstance().addLightPoint(lightray.point());
83  if (ALIUtils::debug >= 5)
84  std::cout << "ALIVRMLMgr addLightPoint " << lightray.point() << name() << std::endl;
85  }
86  if (gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
87  vispath->addLightPoint(lightray.point(), this);
88  }
89  }
90 #endif
91 
92  lightray.setPoint(lightray.point() + shift3D);
93  if (ALIUtils::debug >= 5) {
94  lightray.dumpData("OptOUserDefined: lightray after shift");
95  }
96  CLHEP::Hep3Vector direc = lightray.direction();
97  CLHEP::Hep3Vector XAxis(1., 0., 0.);
98  XAxis = rmt * XAxis;
99  direc.rotate(deviX, XAxis);
100  if (ALIUtils::debug >= 5) {
101  std::cout << "Direction after deviX " << direc << std::endl;
102  std::cout << " deviX " << deviX << std::endl;
103  }
104  CLHEP::Hep3Vector YAxis(0., 1., 0.);
105  YAxis = rmt * YAxis;
106  direc.rotate(deviY, YAxis);
107  lightray.setDirection(direc);
108  if (ALIUtils::debug >= 5) {
109  std::cout << "Direction after deviY " << direc << std::endl;
110  std::cout << " deviY " << deviY << std::endl;
111  }
112  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
113  ZAxis = rmt * ZAxis;
114  direc.rotate(deviZ, ZAxis);
115  lightray.setDirection(direc);
116  if (ALIUtils::debug >= 5) {
117  std::cout << "Direction after deviZ " << direc << std::endl;
118  std::cout << " deviZ " << deviZ << std::endl;
119  }
120  if (ALIUtils::debug >= 4) {
121  lightray.dumpData("OptOUserDefined: lightray at exiting");
122  }
123  }
124 
125 #ifdef COCOA_VIS
126  //--- draw a point at exiting
127  if (ALIUtils::getFirstTime()) {
129  if (gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
130  ALIVRMLMgr::getInstance().addLightPoint(lightray.point());
131  if (ALIUtils::debug >= 5)
132  std::cout << "ALIVRMLMg addLightPoint " << lightray.point() << name() << std::endl;
133  }
134  if (gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
135  vispath->addLightPoint(lightray.point(), this);
136  }
137  }
138 #endif
139 }
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
long double ALIdouble
Definition: CocoaGlobals.h:11
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
static GlobalOptionMgr * getInstance()
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:65
void setDirection(const CLHEP::Hep3Vector &direc)
Definition: LightRay.h:62
void setPoint(const CLHEP::Hep3Vector &point)
Definition: LightRay.h:63
const CLHEP::Hep3Vector & direction() const
Definition: LightRay.h:58
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:374
const CLHEP::Hep3Vector & point() const
Definition: LightRay.h:57
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:93
static ALIbool getFirstTime()
Definition: ALIUtils.h:87
Measurement * meas()
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: Measurement.h:86
def exit(msg="")