CMS 3D CMS Logo

Public Member Functions

OptODistancemeter Class Reference

#include <OptODistancemeter.h>

Inheritance diagram for OptODistancemeter:
OpticalObject

List of all members.

Public Member Functions

void constructSolidShape ()
virtual void defaultBehaviour (LightRay &lightray, Measurement &meas)
virtual void makeMeasurement (LightRay &lightray, Measurement &meas)
 OptODistancemeter (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 OptODistancemeter ()
 ~OptODistancemeter ()

Detailed Description

Definition at line 18 of file OptODistancemeter.h.


Constructor & Destructor Documentation

OptODistancemeter::OptODistancemeter ( ) [inline]

Definition at line 23 of file OptODistancemeter.h.

{ };
OptODistancemeter::OptODistancemeter ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
) [inline]

Definition at line 24 of file OptODistancemeter.h.

                                                                                                                  : 
  OpticalObject( parent, type, name, copy_data){ };
OptODistancemeter::~OptODistancemeter ( ) [inline]

Definition at line 26 of file OptODistancemeter.h.

{ };

Member Function Documentation

void OptODistancemeter::constructSolidShape ( ) [virtual]

Reimplemented from OpticalObject.

Definition at line 110 of file OptODistancemeter.cc.

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

{
  ALIdouble go;
  GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
  gomgr->getGlobalOptionValue("VisScale", go );

  theSolidShape = new CocoaSolidShapeTubs( "Tubs", go*0.*cm/m, go*2.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
}
void OptODistancemeter::defaultBehaviour ( LightRay lightray,
Measurement meas 
) [virtual]

Reimplemented from OpticalObject.

Definition at line 24 of file OptODistancemeter.cc.

References makeMeasurement().

{
  makeMeasurement( lightray, meas);

}
void OptODistancemeter::makeMeasurement ( LightRay lightray,
Measurement meas 
) [virtual]

Reimplemented from OpticalObject.

Definition at line 34 of file OptODistancemeter.cc.

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Measurement::getPreviousOptO(), ALILine::intersect(), OpticalObject::name(), trackerHitRTTI::proj, OpticalObject::rmGlob(), Measurement::setValueSimulated(), Measurement::value(), and Measurement::valueSimulated().

Referenced by defaultBehaviour().

{
  const OpticalObject* opto_prev = meas.getPreviousOptO( this );
  CLHEP::Hep3Vector dm_centre = centreGlob();
  CLHEP::Hep3Vector ZAxis(0.,0.,1.);
  CLHEP::HepRotation rmt = rmGlob();
  ZAxis = rmt * ZAxis;

  //----- intersect z of distancemeter with distance target
  ALILine dm_line( centreGlob(), ZAxis );

  CLHEP::Hep3Vector ZAxisdt(0.,0.,1.);
  CLHEP::HepRotation rmtdt = opto_prev->rmGlob();
  ZAxisdt = rmtdt * ZAxisdt;
  ALIPlane dt_plane( opto_prev->centreGlob(), ZAxisdt ); 

  if(ALIUtils::debug >= 3) {
    ALIUtils::dump3v( dm_centre, "distancemeter centre");
    ALIUtils::dump3v( ZAxis, "distancemeter direc");
    ALIUtils::dump3v( opto_prev->centreGlob(),"distance_target centre");
    ALIUtils::dump3v( ZAxisdt,"distance_target direc");
  }

  CLHEP::Hep3Vector inters = dm_line.intersect( dt_plane );

  dm_centre = inters - dm_centre;
  if (ALIUtils::debug >= 4) {
    std::cout << "OptO dm" << name() << dm_line << std::endl;
    //    ALIUtils::dump3v( centreGlob(), " centre Glob ");
    std::cout << "OptO dt" << opto_prev->name() << std::endl;
    ALIUtils::dump3v( opto_prev->centreGlob(), " previous OptO centre Glob ");
    ALIUtils::dump3v( inters, " intersection with target ");
    ALIUtils::dump3v( dm_centre, " distance std::vector");
  }
  ALIdouble proj = dm_centre*ZAxis;

  //- ALIUtils::dump3v( ZAxis, " zaxis ");
  //-  std::cout << " proj " << proj << std::endl;

  meas.setValueSimulated (0 , proj );
  if (ALIUtils::debug >= 1) { 
    std::cout << "SIMU value: D: " << meas.valueSimulated(0)*1000.
         << " (mm)  " << (this)->name() << std::endl;
    std::cout << "REAL value: D: " << meas.value()[0]*1000. 
         << " (mm)  " << (this)->name() << std::endl;
  }
}