CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual void userDefinedBehaviour (LightRay &lightray, Measurement &meas, ALIstring &behav)
 
 ~OptOUserDefined ()
 
- 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=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 (std::vector< Entry * > entries) const
 
CocoaMaterialElementarygetMaterial () const
 
ALIPlane getPlate (const ALIbool forwardPlate, const ALIbool applyWedge)
 
std::vector< double > getRotationAnglesFromMatrix (CLHEP::HepRotation &rmLocal, std::vector< Entry * > entries) const
 
std::vector< double > getRotationAnglesInOptOFrame (const OpticalObject *optoAncestor, 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 ()
 

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::OptOUserDefined ( )
inline

Definition at line 23 of file OptOUserDefined.h.

23 { };
OptOUserDefined::OptOUserDefined ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)
inline

Definition at line 24 of file OptOUserDefined.h.

24  :
25  OpticalObject( parent, type, name, copy_data){ };
type
Definition: HCALResponse.h:22
const ALIstring & name() const
Definition: OpticalObject.h:60
OptOUserDefined::~OptOUserDefined ( )
inline

Definition at line 26 of file OptOUserDefined.h.

26 { };

Member Function Documentation

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

Definition at line 24 of file OptOUserDefined.cc.

References OpticalObject::centreGlob(), dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, LightRay::direction(), ALIUtils::dump3v(), LightRay::dumpData(), cmsRelvalreport::exit, OpticalObject::ExtraEntryList(), OpticalObject::findExtraEntryValue(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), OpticalObject::getPlate(), GlobalOptionMgr::GlobalOptions(), LightRay::intersect(), OpticalObject::name(), Measurement::name(), LightRay::point(), OpticalObject::rmGlob(), LightRay::setDirection(), LightRay::setPoint(), and findQualityFiles::size.

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