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 | Private Attributes
MeasurementDistancemeter3dim Class Reference

#include <MeasurementDistancemeter3dim.h>

Inheritance diagram for MeasurementDistancemeter3dim:
Measurement

Public Member Functions

virtual void calculateSimulatedValue (ALIbool firstTime)
 
virtual void correctValueAndSigma ()
 
 MeasurementDistancemeter3dim (const ALIint measdim, ALIstring &type, ALIstring &name)
 
 MeasurementDistancemeter3dim ()
 
virtual void setConversionFactor (const std::vector< ALIstring > &wordlist)
 
 ~MeasurementDistancemeter3dim ()
 
- Public Member Functions inherited from Measurement
void addAffectingEntriesFromOptO (const OpticalObject *optoP)
 
void AddOptOListItem (OpticalObject *opto)
 
void AddOptONameListItem (ALIstring optos)
 
const std::vector< Entry * > & affectingEntryList () const
 
void buildAffectingEntryList ()
 
void buildOptOList ()
 
virtual void buildOptONamesList (const std::vector< ALIstring > &wl)
 
void calculateOriginalSimulatedValue ()
 
void construct ()
 
void constructFromOA (OpticalAlignMeasurementInfo &measInfo)
 
void copyMeas (Measurement *meas, const std::string &subsstr1, const std::string &subsstr2)
 
std::vector< ALIdoubleDerivativeRespectEntry (Entry *entry)
 
const ALIuint dim () const
 
void DumpBadOrderOptOs ()
 
void fillData (ALIuint coor, const std::vector< ALIstring > &wl)
 
void fillData (ALIuint coor, OpticalAlignParam *oaParam)
 
const CLHEP::Hep3Vector & getLightRayDirection () const
 
const CLHEP::Hep3Vector & getLightRayPosition () const
 
ALIstring getMeasuringBehaviour (const std::vector< OpticalObject * >::const_iterator vocite)
 
const OpticalObjectgetPreviousOptO (const OpticalObject *Popto) const
 
 Measurement (const ALIint measdim, ALIstring &type, ALIstring &name)
 
 Measurement ()
 
const ALIstringname () const
 
const std::vector
< OpticalObject * > & 
OptOList () const
 
const std::vector< ALIstring > & OptONameList () const
 
void postConstruct ()
 
const ALIstringsensorName ()
 
void SetDimension (ALIuint dim)
 
void setLightRayDirection (const CLHEP::Hep3Vector &lightRayDirection)
 
void setLightRayPosition (const CLHEP::Hep3Vector &lightRayPosition)
 
void setName ()
 
void setSigma (ALIint coor, ALIdouble val)
 
void setType (ALIstring type)
 
void setValue (ALIint coor, ALIdouble val)
 
void setValueSimulated (ALIint coor, ALIdouble value)
 
void setValueSimulated_orig (ALIint coor, ALIdouble value)
 
virtual void setXlaserLine (ALIuint ii, int val)
 
const ALIdoublesigma () const
 
const ALIdouble sigma (ALIuint ii) const
 
virtual const ALIdouble sigmaDimensionFactor () const
 
const ALIstringtype () const
 
const ALIdoublevalue () const
 
const ALIdouble value (ALIuint ii) const
 
virtual const ALIdouble valueDimensionFactor () const
 
bool valueIsSimulated (ALIint coor)
 
const ALIdouble valueSimulated (ALIuint ii) const
 
const ALIdouble valueSimulated_orig (ALIuint ii) const
 
const ALIstring valueType (ALIuint ii) const
 
virtual int xlaserLine (ALIuint ii)
 
virtual ~Measurement ()
 

Private Attributes

ALIdouble theFactor
 
ALIdouble theFactorSigma
 

Additional Inherited Members

- Static Public Member Functions inherited from Measurement
static ALIstring getCurrentDate ()
 
static ALIstring getCurrentTime ()
 
static ALIstringmeasurementsFileName ()
 
static void setCurrentDate (const std::vector< ALIstring > &wl)
 set the date of the current measurement More...
 
static void setMeasurementsFileName (const ALIstring &filename)
 
- Static Public Attributes inherited from Measurement
static ALIdouble cameraScaleFactor = 1.
 
static ALIbool only1 = 0
 
static ALIstring only1Date = ""
 
static ALIstring only1Time = ""
 
- Protected Member Functions inherited from Measurement
void printStartCalculateSimulatedValue (const Measurement *meas)
 
void Substitute2p (ALIstring &ref, const ALIstring &firstref, int NtwoPoints)
 

Detailed Description

Definition at line 18 of file MeasurementDistancemeter3dim.h.

Constructor & Destructor Documentation

MeasurementDistancemeter3dim::MeasurementDistancemeter3dim ( const ALIint  measdim,
ALIstring type,
ALIstring name 
)
inline

Definition at line 21 of file MeasurementDistancemeter3dim.h.

22  : Measurement( measdim, type, name ), theFactor(1.), theFactorSigma(0.){ };
type
Definition: HCALResponse.h:21
const ALIstring & name() const
Definition: Measurement.h:90
MeasurementDistancemeter3dim::MeasurementDistancemeter3dim ( )
inline

Definition at line 23 of file MeasurementDistancemeter3dim.h.

23 { };
MeasurementDistancemeter3dim::~MeasurementDistancemeter3dim ( )
inline

Definition at line 24 of file MeasurementDistancemeter3dim.h.

24 { };

Member Function Documentation

void MeasurementDistancemeter3dim::calculateSimulatedValue ( ALIbool  firstTime)
virtual

Reimplemented from Measurement.

Definition at line 26 of file MeasurementDistancemeter3dim.cc.

References begin, dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), cppFunctionSkipper::exception, ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), Measurement::getMeasuringBehaviour(), GlobalOptionMgr::GlobalOptions(), Measurement::name(), Measurement::OptOList(), LightRay::point(), Measurement::printStartCalculateSimulatedValue(), findQualityFiles::size, and Measurement::type().

27 {
28 
29  if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas
30 
31  //---------- Loop list of OptO that take part in measurement
32  std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin();
33  if( ALIUtils::debug >= 5) std::cout << "OptOList size" <<OptOList().size() << std::endl;
34 
35  //----- Check that there are only two measurements that are 'distance_target' and 'distancemeter3dim'
36  ALIbool right_objects = 0;
37  if( OptOList().size() == 2 ) {
38  if( (*vocite)->type() == "distance_target"
39  && ( (*(vocite+1))->type() == "distancemeter3dim" ) ) {
40  right_objects = 1;
41  }
42  }
43  if( !right_objects ) {
44  std::cerr << "!!! ERROR in MeasurementDistancemeter3dim: " << name() << " There should only be two objects of type 'distance_target' and 'distancemeter3dim' " << std::endl;
45  std::cerr << " 1st " << (*vocite)->name() << " 2nd " << (*vocite+1)->name() << std::endl;
46  std::cerr << " 1st " << (*vocite)->type() << " 2nd " << (*vocite+1)->type() << std::endl;
47 
50  }
51 
52 #ifdef COCOA_VIS
53  ALIVisLightPath* vispath = 0;
54  if( ALIUtils::getFirstTime() ) {
56  if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
57  vispath = IgCocoaFileMgr::getInstance().newLightPath( name() );
58  }
59  }
60 #endif
61 
62  ALIuint isec = 0; //security variable to check OptOList().size()
63  for( vocite = OptOList().begin(); vocite != OptOList().end(); vocite++) {
64  if( ALIUtils::debug >= 2) std::cout << std::endl << "@@@@ LR:OBJECT " << (*vocite)->name() << std::endl;
65  isec ++;
66 
67  //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...)
68  ALIstring behav = getMeasuringBehaviour(vocite);
69 
70  //---------- participate in measurement
71  LightRay lightray; //it is not used in this measurement type
72  (*vocite)->participateInMeasurement( lightray, *this, behav);
73 
74 #ifdef COCOA_VIS
75  if( ALIUtils::getFirstTime() ) {
77  if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
78  ALIVRMLMgr::getInstance().addLightPoint( lightray.point() );
79  if(ALIUtils::debug >= 5)std::cout << "ALIVRMLMg addLightPoint " << lightray.point() << (*vocite)->name() << std::endl;
80  }
81  if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
82  vispath->addLightPoint( lightray.point(), *vocite );
83  }
84  }
85 #endif
86 
87  if ( isec > OptOList().size() ) {
88  std::cerr << "ERROR DE PROGRAMACION EN GetSimulatedValue" << std::endl;
90  }
91  }
92 
93  if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl;
94 
95 }
static ALIint debug
Definition: ALIUtils.h:35
static GlobalOptionMgr * getInstance()
ALIstring getMeasuringBehaviour(const std::vector< OpticalObject * >::const_iterator vocite)
Definition: Measurement.cc:591
void DumpBadOrderOptOs()
Definition: Measurement.cc:487
bool ALIbool
Definition: CocoaGlobals.h:19
const CLHEP::Hep3Vector & point() const
Definition: LightRay.h:52
const std::vector< OpticalObject * > & OptOList() const
Definition: Measurement.h:109
static ALIbool getFirstTime()
Definition: ALIUtils.h:100
#define begin
Definition: vmac.h:30
const ALIstring & type() const
Definition: Measurement.h:86
std::string ALIstring
Definition: CocoaGlobals.h:9
void printStartCalculateSimulatedValue(const Measurement *meas)
Definition: Measurement.cc:444
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:121
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
tuple size
Write out results.
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void MeasurementDistancemeter3dim::correctValueAndSigma ( )
virtual

Reimplemented from Measurement.

Definition at line 138 of file MeasurementDistancemeter3dim.cc.

References gather_cfg::cout, ALIUtils::debug, Measurement::setSigma(), Measurement::setValue(), Measurement::sigma(), theFactor, and Measurement::value().

139 {
140  ALIdouble val = value()[0];
141  ALIdouble sig = sigma()[0];
142  if(ALIUtils::debug >= 4) std::cout << "MeasurementDistancemeter3dim::correctValueAndSigma: old value" << val << " +- " << sig << std::endl;
143 
144  //- std::cout << "FACTOR " << theFactor << "correct " << val << " " << thePedestal << std::endl;
145  val *= theFactor;
146  //-------- Do not correct the sigma!!!!
147  //- sig *= theFactor;
148  if(ALIUtils::debug >= 4) std::cout << "MeasuremenDistancemeter3dim::correctValueAndSigma: new value " << val << " +- " << sig << std::endl;
149  setValue( 0, val );
150  setSigma( 0, sig );
151 
152 }
long double ALIdouble
Definition: CocoaGlobals.h:11
void setValue(ALIint coor, ALIdouble val)
Definition: Measurement.h:167
static ALIint debug
Definition: ALIUtils.h:35
void setSigma(ALIint coor, ALIdouble val)
Definition: Measurement.h:171
const ALIdouble * sigma() const
Definition: Measurement.h:132
const ALIdouble * value() const
Definition: Measurement.h:125
tuple cout
Definition: gather_cfg.py:121
void MeasurementDistancemeter3dim::setConversionFactor ( const std::vector< ALIstring > &  wordlist)
virtual

Reimplemented from Measurement.

Definition at line 103 of file MeasurementDistancemeter3dim.cc.

References dtNoiseDBValidation_cfg::cerr, ALIUtils::dumpVS(), cppFunctionSkipper::exception, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), ALIUtils::IsNumber(), theFactor, and theFactorSigma.

104 {
105  //--------- Check that the format is OK
106  if(wordlist.size() == 1) return;
107  if( wordlist.size() != 4
108  || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[3])
109  || wordlist[2] != ALIstring("+-") ){
110  std::cerr << "!! Distancemeter3dim Measurement setConversionFactor: WRONG FORMAT "<< std::endl
111  << "It should be: DISTANCEMETER3DIM factor +- error " << std::endl
112  << "It is: ";
113  ALIUtils::dumpVS( wordlist, " ", std::cerr );
114  std::exception();
115  }
116  theFactor = atof(wordlist[1].c_str());
117  //------ correct by dimension of value of tiltmeter
119  ALIint dimfac = ALIint( gomgr->GlobalOptions()[ ALIstring("distancemeter_meas_value_dimension") ] );
120  if( dimfac == 0 ) {
121  theFactor *= 1.;
122  } else if( dimfac == 1 ) {
123  theFactor *= 1.E-3;
124  } else if( dimfac == 2 ) {
125  theFactor *= 1.E-6;
126  } else {
127  std::cerr << " !!!EXITING: error in global option distancemeter3dim_meas_value_dimension, it can only take values 0,1,2, not " << dimfac;
128  std::exception();
129  }
130  theFactorSigma = atof(wordlist[3].c_str());
131 
132 }
int ALIint
Definition: CocoaGlobals.h:15
static GlobalOptionMgr * getInstance()
static int IsNumber(const ALIstring &str)
Definition: ALIUtils.cc:34
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
Definition: ALIUtils.cc:501
std::string ALIstring
Definition: CocoaGlobals.h:9
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()

Member Data Documentation

ALIdouble MeasurementDistancemeter3dim::theFactor
private

Definition at line 36 of file MeasurementDistancemeter3dim.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementDistancemeter3dim::theFactorSigma
private

Definition at line 37 of file MeasurementDistancemeter3dim.h.

Referenced by setConversionFactor().