test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
virtual void displace (ALIdouble disp)
 
virtual void displaceOriginal (ALIdouble disp)
 
virtual void displaceOriginalOriginal (ALIdouble disp)
 
 EntryAngleAffAngles (const ALIstring &type)
 
virtual void FillName (const ALIstring &name)
 
virtual ALIdouble valueDisplaced () const
 
 ~EntryAngleAffAngles ()
 
- Public Member Functions inherited from EntryAngle
 EntryAngle (const ALIstring &type)
 
virtual ALIdouble OutputSigmaDimensionFactor () const
 
virtual ALIdouble OutputValueDimensionFactor () const
 
virtual ALIdouble SigmaDimensionFactor () const
 
virtual ALIdouble startingDisplacement ()
 
virtual ALIdouble ValueDimensionFactor () const
 
 ~EntryAngle ()
 
- 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 16 of file EntryAngleAffAngles.h.

Constructor & Destructor Documentation

EntryAngleAffAngles::EntryAngleAffAngles ( const ALIstring type)

Definition at line 13 of file EntryAngleAffAngles.cc.

14  : EntryAngle( type )
15 {
16 }
type
Definition: HCALResponse.h:21
EntryAngle(const ALIstring &type)
Definition: EntryAngle.h:20
EntryAngleAffAngles::~EntryAngleAffAngles ( )
inline

Definition at line 20 of file EntryAngleAffAngles.h.

20 {};

Member Function Documentation

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 154 of file EntryAngleAffAngles.cc.

References Entry::name().

155 {
156  CLHEP::Hep3Vector axis = _axis;
157  CLHEP::Hep3Vector axisOrig = _axisOrig;
158  int inam = 0;
159  if( name() == "angles_X" ) {
160  inam = 1;
161  }else if( name() == "angles_Y" ) {
162  inam = 2;
163  }else if( name() == "angles_Z" ) {
164  inam = 3;
165  }
166  switch( inam ){
167  case 1:
168  axis.rotateX( localrot[0] );
169  axisOrig.rotateX( localrotorig[0] );
170  case 2:
171  axis.rotateY( localrot[1] );
172  axisOrig.rotateY( localrotorig[1] );
173  case 3:
174  axis.rotateZ( localrot[2] );
175  axisOrig.rotateZ( localrotorig[2] );
176  break;
177  }
178 
179  ALIdouble ang = axis.angle( axisOrig );
180 
181  /* }else if( name() == "angles_Y" ) {
182  return localrot[1] - localrotorig[1];
183  }else if( name() == "angles_Z" ) {
184  return localrot[2] - localrotorig[2];
185  }*/
186 
187  return ang;
188 }
long double ALIdouble
Definition: CocoaGlobals.h:11
const ALIstring & name() const
Definition: Entry.h:52
void EntryAngleAffAngles::displace ( ALIdouble  disp)
virtual

Reimplemented from Entry.

Definition at line 31 of file EntryAngleAffAngles.cc.

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

32 {
33  XYZcoor coor = XCoor;
34  ALIint namelength = name().length()-1;
35  //- std::cout << this << "ENtryAnglesAffAngle" << name_ << namelength <<std::endl;
36  if ( name_[namelength] == 'X' ) {
37  coor = XCoor;
38  } else if ( name_[namelength] == 'Y' ) {
39  coor = YCoor;
40  } else if ( name_[namelength] == 'Z' ) {
41  coor = ZCoor;
42  }
43 
45  if(gomgr->GlobalOptions()["rotateAroundLocal"] == 0) {
47  }else {
49  }
50 
51 }
int ALIint
Definition: CocoaGlobals.h:15
static GlobalOptionMgr * getInstance()
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)
const ALIstring & name() const
Definition: Entry.h:52
ALIstring name_
Definition: Entry.h:101
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
void EntryAngleAffAngles::displaceOriginal ( ALIdouble  disp)
virtual

Reimplemented from Entry.

Definition at line 55 of file EntryAngleAffAngles.cc.

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

56 {
57  ALIint namelength = name().length()-1;
58  //- std::cout << this << "ENtryAnglesAffAngle" << name_ << namelength <<std::endl;
59  if ( name_[namelength] == 'X' ) {
60  //- std::cout << "displaX";
62  } else if ( name_[namelength] == 'Y' ) {
63  //- std::cout << "displaY";
65  } else if ( name_[namelength] == 'Z' ) {
67  }
68 
69 }
int ALIint
Definition: CocoaGlobals.h:15
void displaceRmGlobOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
const ALIstring & name() const
Definition: Entry.h:52
ALIstring name_
Definition: Entry.h:101
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
void EntryAngleAffAngles::displaceOriginalOriginal ( ALIdouble  disp)
virtual

Reimplemented from Entry.

Definition at line 72 of file EntryAngleAffAngles.cc.

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

73 {
74  ALIint namelength = name().length()-1;
75  if(ALIUtils::debug >= 5) std::cout << this << "ENtryAnglesAffAngle displaceOriginalOriginal" << name_ <<std::endl;
76  if ( name_[namelength] == 'X' ) {
77  //- std::cout << "displaX";
79  } else if ( name_[namelength] == 'Y' ) {
80  //- std::cout << "displaY";
82  } else if ( name_[namelength] == 'Z' ) {
84  }
85 
86 }
void displaceRmGlobOriginalOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:35
const ALIstring & name() const
Definition: Entry.h:52
ALIstring name_
Definition: Entry.h:101
tuple cout
Definition: gather_cfg.py:145
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
void EntryAngleAffAngles::FillName ( const ALIstring name)
virtual

Definition at line 20 of file EntryAngleAffAngles.cc.

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

21 {
22  ALIstring nn = "Angles ";
23  nn += name;
24  setName( nn );
25 }
void setName(const ALIstring &name)
Definition: Entry.h:75
const ALIstring & name() const
Definition: Entry.h:52
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIdouble EntryAngleAffAngles::valueDisplaced ( ) const
virtual

Reimplemented from Entry.

Definition at line 91 of file EntryAngleAffAngles.cc.

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

92 {
93 
94  // std::cout << " EntryAngleAffAngles::valueDisplaced() parent " << OptOCurrent()->parent()->name() << std::endl;
95  // ALIUtils::dumprm( OptOCurrent()->parent()->rmGlob() , " parent RmGlob ");
96  if(ALIUtils::debug >= 5) {
97  std::cout << " EntryAngleAffAngles::valueDisplaced() parent opto " << OptOCurrent()->parent()->name() << std::endl;
98  ALIUtils::dumprm( OptOCurrent()->rmGlob() , " RmGlob ");
99  ALIUtils::dumprm( OptOCurrent()->rmGlobOriginal() , " RmGlobOriginal ");
100  ALIUtils::dumprm( OptOCurrent()->parent()->rmGlobOriginal() , " parent RmGlobOriginal ");
101  }
102 
103  CLHEP::HepRotation diffRm = OptOCurrent()->rmGlob() * OptOCurrent()->rmGlobOriginal().inverse();
104  CLHEP::HepRotation rmLocal = diffRm * OptOCurrent()->parent()->rmGlobOriginal().inverse();
105  std::vector<double> localrot = OptOCurrent()->getRotationAnglesFromMatrix( rmLocal, OptOCurrent()->CoordinateEntryList() );
106  if(ALIUtils::debug >= 5) {
107  ALIUtils::dumprm( diffRm , " diffRm ");
108  ALIUtils::dumprm( rmLocal , " rmLocal ");
109  std::cout << " localrot " << localrot[0] << " " << localrot[1] << " " << localrot[2] << std::endl;
110  }
111 
112  if( name() == "angles_X" ) {
113  return localrot[0];
114  }else if( name() == "angles_Y" ) {
115  return localrot[1];
116  }else if( name() == "angles_Z" ) {
117  return localrot[2];
118  }
119 
120  /*
121  CLHEP::HepRotation rmLocalOrig = OptOCurrent()->parent()->rmGlobOriginal().inverse() * OptOCurrent()->rmGlobOriginal();
122 
123  CLHEP::HepRotation rmLocal = OptOCurrent()->parent()->rmGlob().inverse() * OptOCurrent()->rmGlob();
124  std::vector<double> localrot = OptOCurrent()->getRotationAnglesFromMatrix( rmLocal, OptOCurrent()->CoordinateEntryList() );
125 
126  std::cout << " localrot " << localrot[0] << " " << localrot[1] << " " << localrot[2] << std::endl;
127  std::cout << " localrotorig " << localrotorig[0] << " " << localrotorig[1] << " " << localrotorig[2] << std::endl;
128  ALIdouble diff;
129  CLHEP::Hep3Vector Xaxis(0.,0.,1.);
130  Xaxis = OptOCurrent()->parent()->rmGlob() * Xaxis;
131  CLHEP::Hep3Vector XaxisOrig(0.,0.,1.);
132  XaxisOrig = OptOCurrent()->parent()->rmGlobOriginal() * XaxisOrig;
133 
134  diff = fabs( checkDiff( Xaxis, XaxisOrig, localrot, localrotorig ) );
135 
136  //maybe X is not a good axis because the rotation is done precisely around X
137  if( diff <= 1.E-9 ){
138  CLHEP::Hep3Vector Yaxis(0.,1.,0.);
139  Yaxis = OptOCurrent()->parent()->rmGlob() * Yaxis;
140  CLHEP::Hep3Vector YaxisOrig(0.,1.,0.);
141  YaxisOrig = OptOCurrent()->parent()->rmGlobOriginal() * YaxisOrig;
142 
143  diff = fabs( checkDiff( Yaxis, YaxisOrig, localrot, localrotorig ) );
144  }
145 
146  return diff;
147  */
148 
149  return 0.; // to avoid warning
150 }
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
const ALIstring & name() const
Definition: Entry.h:52
const CLHEP::HepRotation & rmGlobOriginal() const
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
tuple cout
Definition: gather_cfg.py:145
const ALIstring & name() const
Definition: OpticalObject.h:60
OpticalObject * OptOCurrent() const
Definition: Entry.h:61