CMS 3D CMS Logo

List of all members | Public Member Functions
EntryAngleAffAngles Class Reference

#include <EntryAngleAffAngles.h>

Inheritance diagram for EntryAngleAffAngles:
EntryAngle Entry

Public Member Functions

ALIdouble checkDiff (const CLHEP::Hep3Vector &axis, const CLHEP::Hep3Vector &axisOrig, const std::vector< double > &localrot, const std::vector< double > &localrotorig) const
 
void displace (ALIdouble disp) override
 
void displaceOriginal (ALIdouble disp) override
 
void displaceOriginalOriginal (ALIdouble disp) override
 
 EntryAngleAffAngles (const ALIstring &type)
 
virtual void FillName (const ALIstring &name)
 
ALIdouble valueDisplaced () const override
 
 ~EntryAngleAffAngles () override
 
- Public Member Functions inherited from EntryAngle
 EntryAngle (const ALIstring &type)
 
ALIdouble OutputSigmaDimensionFactor () const override
 
ALIdouble OutputValueDimensionFactor () const override
 
ALIdouble SigmaDimensionFactor () const override
 
ALIdouble startingDisplacement () override
 
ALIdouble ValueDimensionFactor () const override
 
 ~EntryAngle () override
 
- Public Member Functions inherited from Entry
void addFittedDisplacementToValue (const ALIdouble val)
 
 Entry (const ALIstring &type)
 
void fill (const std::vector< ALIstring > &wordlist)
 
virtual void fillName (const ALIstring &name)
 
void fillNull ()
 
ALIint fitPos () const
 
EntryDim getDimType () const
 
ALIdouble lastAdditionToValueDisplacementByFitting () const
 
const ALIstring longName () const
 
const ALIstringname () const
 
OpticalObjectOptOCurrent () const
 
ALIint quality () const
 
void resetValueDisplacementByFitting ()
 
void setFitPos (const ALIint fitpos)
 
void setLastAdditionToValueDisplacementByFitting (const ALIdouble val)
 
void setName (const ALIstring &name)
 
void setOptOCurrent (OpticalObject *opto)
 
void setQuality (ALIuint qual)
 
void setSigma (ALIdouble sig)
 
void setType (ALIstring type)
 
void setValue (ALIdouble val)
 
ALIdouble sigma () const
 
ALIdouble sigmaOriginalOriginal () const
 
void substractToHalfFittedDisplacementToValue ()
 
const ALIstringtype () const
 
ALIdouble value () const
 
ALIdouble valueDisplacementByFitting () const
 
virtual ALIdouble valueInGlobalReferenceFrame () const
 
ALIdouble valueOriginalOriginal () const
 
virtual ~Entry ()
 

Additional Inherited Members

- Protected Attributes inherited from Entry
ALIint fitPos_
 
ALIdouble lastAdditionToValueDisplacementByFitting_
 
ALIstring name_
 
OpticalObjectOptOCurrent_
 
ALIuint quality_
 
ALIdouble sigma_
 
ALIdouble sigmaOriginalOriginal_
 
EntryDim theDimType
 
ALIstring type_
 
ALIdouble value_
 
ALIdouble valueDisplacementByFitting_
 
ALIdouble valueOriginalOriginal_
 

Detailed Description

Definition at line 15 of file EntryAngleAffAngles.h.

Constructor & Destructor Documentation

◆ EntryAngleAffAngles()

EntryAngleAffAngles::EntryAngleAffAngles ( const ALIstring type)

Definition at line 13 of file EntryAngleAffAngles.cc.

13 : EntryAngle(type) {}
EntryAngle(const ALIstring &type)
Definition: EntryAngle.h:19

◆ ~EntryAngleAffAngles()

EntryAngleAffAngles::~EntryAngleAffAngles ( )
inlineoverride

Definition at line 18 of file EntryAngleAffAngles.h.

18 {};

Member Function Documentation

◆ checkDiff()

ALIdouble EntryAngleAffAngles::checkDiff ( const CLHEP::Hep3Vector &  axis,
const CLHEP::Hep3Vector &  axisOrig,
const std::vector< double > &  localrot,
const std::vector< double > &  localrotorig 
) const

Definition at line 139 of file EntryAngleAffAngles.cc.

References Entry::name().

142  {
143  CLHEP::Hep3Vector axis = _axis;
144  CLHEP::Hep3Vector axisOrig = _axisOrig;
145  int inam = 0;
146  if (name() == "angles_X") {
147  inam = 1;
148  } else if (name() == "angles_Y") {
149  inam = 2;
150  } else if (name() == "angles_Z") {
151  inam = 3;
152  }
153  switch (inam) {
154  case 1:
155  axis.rotateX(localrot[0]);
156  axisOrig.rotateX(localrotorig[0]);
157  [[fallthrough]];
158  case 2:
159  axis.rotateY(localrot[1]);
160  axisOrig.rotateY(localrotorig[1]);
161  [[fallthrough]];
162  case 3:
163  axis.rotateZ(localrot[2]);
164  axisOrig.rotateZ(localrotorig[2]);
165  break;
166  }
167 
168  ALIdouble ang = axis.angle(axisOrig);
169 
170  /* }else if( name() == "angles_Y" ) {
171  return localrot[1] - localrotorig[1];
172  }else if( name() == "angles_Z" ) {
173  return localrot[2] - localrotorig[2];
174  }*/
175 
176  return ang;
177 }
long double ALIdouble
Definition: CocoaGlobals.h:11
const ALIstring & name() const
Definition: Entry.h:50

◆ displace()

void EntryAngleAffAngles::displace ( ALIdouble  disp)
overridevirtual

Reimplemented from Entry.

Definition at line 25 of file EntryAngleAffAngles.cc.

References OpticalObject::displaceRmGlobAroundGlobal(), OpticalObject::displaceRmGlobAroundLocal(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), Entry::name(), Entry::name_, Entry::OptOCurrent(), XCoor, YCoor, and ZCoor.

25  {
26  XYZcoor coor = XCoor;
27  ALIint namelength = name().length() - 1;
28  //- std::cout << this << "ENtryAnglesAffAngle" << name_ << namelength <<std::endl;
29  if (name_[namelength] == 'X') {
30  coor = XCoor;
31  } else if (name_[namelength] == 'Y') {
32  coor = YCoor;
33  } else if (name_[namelength] == 'Z') {
34  coor = ZCoor;
35  }
36 
38  if (gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
40  } else {
42  }
43 }
const ALIstring & name() const
Definition: Entry.h:50
int ALIint
Definition: CocoaGlobals.h:15
static GlobalOptionMgr * getInstance()
OpticalObject * OptOCurrent() const
Definition: Entry.h:59
XYZcoor
Definition: OpticalObject.h:33
void displaceRmGlobAroundGlobal(OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
void displaceRmGlobAroundLocal(OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
ALIstring name_
Definition: Entry.h:102
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()

◆ displaceOriginal()

void EntryAngleAffAngles::displaceOriginal ( ALIdouble  disp)
overridevirtual

Reimplemented from Entry.

Definition at line 46 of file EntryAngleAffAngles.cc.

References OpticalObject::displaceRmGlobOriginal(), Entry::name(), Entry::name_, Entry::OptOCurrent(), XCoor, YCoor, and ZCoor.

46  {
47  ALIint namelength = name().length() - 1;
48  //- std::cout << this << "ENtryAnglesAffAngle" << name_ << namelength <<std::endl;
49  if (name_[namelength] == 'X') {
50  //- std::cout << "displaX";
52  } else if (name_[namelength] == 'Y') {
53  //- std::cout << "displaY";
55  } else if (name_[namelength] == 'Z') {
57  }
58 }
const ALIstring & name() const
Definition: Entry.h:50
int ALIint
Definition: CocoaGlobals.h:15
OpticalObject * OptOCurrent() const
Definition: Entry.h:59
void displaceRmGlobOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
ALIstring name_
Definition: Entry.h:102

◆ displaceOriginalOriginal()

void EntryAngleAffAngles::displaceOriginalOriginal ( ALIdouble  disp)
overridevirtual

Reimplemented from Entry.

Definition at line 61 of file EntryAngleAffAngles.cc.

References gather_cfg::cout, ALIUtils::debug, OpticalObject::displaceRmGlobOriginalOriginal(), Entry::name(), Entry::name_, Entry::OptOCurrent(), XCoor, YCoor, and ZCoor.

61  {
62  ALIint namelength = name().length() - 1;
63  if (ALIUtils::debug >= 5)
64  std::cout << this << "ENtryAnglesAffAngle displaceOriginalOriginal" << name_ << std::endl;
65  if (name_[namelength] == 'X') {
66  //- std::cout << "displaX";
68  } else if (name_[namelength] == 'Y') {
69  //- std::cout << "displaY";
71  } else if (name_[namelength] == 'Z') {
73  }
74 }
const ALIstring & name() const
Definition: Entry.h:50
void displaceRmGlobOriginalOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:34
OpticalObject * OptOCurrent() const
Definition: Entry.h:59
ALIstring name_
Definition: Entry.h:102

◆ FillName()

void EntryAngleAffAngles::FillName ( const ALIstring name)
virtual

Definition at line 16 of file EntryAngleAffAngles.cc.

References Entry::name(), groupFilesInBlocks::nn, and Entry::setName().

16  {
17  ALIstring nn = "Angles ";
18  nn += name;
19  setName(nn);
20 }
const ALIstring & name() const
Definition: Entry.h:50
void setName(const ALIstring &name)
Definition: Entry.h:76
std::string ALIstring
Definition: CocoaGlobals.h:9

◆ valueDisplaced()

ALIdouble EntryAngleAffAngles::valueDisplaced ( ) const
overridevirtual

Reimplemented from Entry.

Definition at line 77 of file EntryAngleAffAngles.cc.

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dumprm(), OpticalObject::getRotationAnglesFromMatrix(), Entry::name(), OpticalObject::name(), Entry::OptOCurrent(), OpticalObject::parent(), class-composition::parent, OpticalObject::rmGlob(), and OpticalObject::rmGlobOriginal().

77  {
78  // std::cout << " EntryAngleAffAngles::valueDisplaced() parent " << OptOCurrent()->parent()->name() << std::endl;
79  // ALIUtils::dumprm( OptOCurrent()->parent()->rmGlob() , " parent RmGlob ");
80  if (ALIUtils::debug >= 5) {
81  std::cout << " EntryAngleAffAngles::valueDisplaced() parent opto " << OptOCurrent()->parent()->name()
82  << std::endl;
83  ALIUtils::dumprm(OptOCurrent()->rmGlob(), " RmGlob ");
84  ALIUtils::dumprm(OptOCurrent()->rmGlobOriginal(), " RmGlobOriginal ");
85  ALIUtils::dumprm(OptOCurrent()->parent()->rmGlobOriginal(), " parent RmGlobOriginal ");
86  }
87 
88  CLHEP::HepRotation diffRm = OptOCurrent()->rmGlob() * OptOCurrent()->rmGlobOriginal().inverse();
89  CLHEP::HepRotation rmLocal = diffRm * OptOCurrent()->parent()->rmGlobOriginal().inverse();
90  std::vector<double> localrot =
91  OptOCurrent()->getRotationAnglesFromMatrix(rmLocal, OptOCurrent()->CoordinateEntryList());
92  if (ALIUtils::debug >= 5) {
93  ALIUtils::dumprm(diffRm, " diffRm ");
94  ALIUtils::dumprm(rmLocal, " rmLocal ");
95  std::cout << " localrot " << localrot[0] << " " << localrot[1] << " " << localrot[2] << std::endl;
96  }
97 
98  if (name() == "angles_X") {
99  return localrot[0];
100  } else if (name() == "angles_Y") {
101  return localrot[1];
102  } else if (name() == "angles_Z") {
103  return localrot[2];
104  }
105 
106  /*
107  CLHEP::HepRotation rmLocalOrig = OptOCurrent()->parent()->rmGlobOriginal().inverse() * OptOCurrent()->rmGlobOriginal();
108 
109  CLHEP::HepRotation rmLocal = OptOCurrent()->parent()->rmGlob().inverse() * OptOCurrent()->rmGlob();
110  std::vector<double> localrot = OptOCurrent()->getRotationAnglesFromMatrix( rmLocal, OptOCurrent()->CoordinateEntryList() );
111 
112  std::cout << " localrot " << localrot[0] << " " << localrot[1] << " " << localrot[2] << std::endl;
113  std::cout << " localrotorig " << localrotorig[0] << " " << localrotorig[1] << " " << localrotorig[2] << std::endl;
114  ALIdouble diff;
115  CLHEP::Hep3Vector Xaxis(0.,0.,1.);
116  Xaxis = OptOCurrent()->parent()->rmGlob() * Xaxis;
117  CLHEP::Hep3Vector XaxisOrig(0.,0.,1.);
118  XaxisOrig = OptOCurrent()->parent()->rmGlobOriginal() * XaxisOrig;
119 
120  diff = fabs( checkDiff( Xaxis, XaxisOrig, localrot, localrotorig ) );
121 
122  //maybe X is not a good axis because the rotation is done precisely around X
123  if( diff <= 1.E-9 ){
124  CLHEP::Hep3Vector Yaxis(0.,1.,0.);
125  Yaxis = OptOCurrent()->parent()->rmGlob() * Yaxis;
126  CLHEP::Hep3Vector YaxisOrig(0.,1.,0.);
127  YaxisOrig = OptOCurrent()->parent()->rmGlobOriginal() * YaxisOrig;
128 
129  diff = fabs( checkDiff( Yaxis, YaxisOrig, localrot, localrotorig ) );
130  }
131 
132  return diff;
133  */
134 
135  return 0.; // to avoid warning
136 }
const ALIstring & name() const
Definition: Entry.h:50
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry *> &entries) const
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
OpticalObject * OptOCurrent() const
Definition: Entry.h:59
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
const OpticalObject * parent() const
Definition: OpticalObject.h:60
const CLHEP::HepRotation & rmGlobOriginal() const
Definition: OpticalObject.h:87