CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Static Private Attributes
Measurement Class Reference

#include <Measurement.h>

Inheritance diagram for Measurement:
MeasurementCOPS MeasurementDiffEntry MeasurementDistancemeter MeasurementDistancemeter3dim MeasurementSensor2D MeasurementTiltmeter

Public Member Functions

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 ()
 
virtual void calculateSimulatedValue (ALIbool firstTime)
 
void construct ()
 
void constructFromOA (OpticalAlignMeasurementInfo &measInfo)
 
void copyMeas (Measurement *meas, const std::string &subsstr1, const std::string &subsstr2)
 
virtual void correctValueAndSigma ()
 
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 ()
 
virtual void setConversionFactor (const std::vector< ALIstring > &wordlist)
 
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 ()
 

Static Public Member Functions

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

static ALIdouble cameraScaleFactor = 1.
 
static ALIbool only1 = 0
 
static ALIstring only1Date = ""
 
static ALIstring only1Time = ""
 

Protected Member Functions

void printStartCalculateSimulatedValue (const Measurement *meas)
 
void Substitute2p (ALIstring &ref, const ALIstring &firstref, int NtwoPoints)
 

Private Attributes

std::vector< OpticalObject * > _OptOList
 
std::vector< ALIstring_OptONameList
 
std::vector< Entry * > theAffectingEntryList
 
ALIuint theDim
 
CLHEP::Hep3Vector theLightRayDirection
 
CLHEP::Hep3Vector theLightRayPosition
 
ALIstring theName
 
ALIdoubletheSigma
 
ALIstring theType
 
ALIdoubletheValue
 
ALIbooltheValueIsSimulated
 
ALIdoubletheValueSimulated
 
ALIdoubletheValueSimulated_orig
 
ALIstringtheValueType
 

Static Private Attributes

static ALIstring theCurrentDate = "99/99/99"
 
static ALIstring theCurrentTime = "99:99"
 
static ALIstring theMeasurementsFileName = ""
 

Detailed Description

Definition at line 27 of file Measurement.h.

Constructor & Destructor Documentation

Measurement::Measurement ( const ALIint  measdim,
ALIstring type,
ALIstring name 
)

Definition at line 44 of file Measurement.cc.

References theDim, theSigma, theValue, theValueIsSimulated, theValueSimulated, theValueSimulated_orig, and theValueType.

45 : theDim(measdim), theType(type), theName( name )
46 {
47  // _OptOnames = new ALIstring[theDim];
48  theValue = new ALIdouble[theDim];
49  theSigma = new ALIdouble[theDim];
51 
55 
56 }
type
Definition: HCALResponse.h:21
ALIdouble * theValueSimulated
Definition: Measurement.h:243
long double ALIdouble
Definition: CocoaGlobals.h:11
bool ALIbool
Definition: CocoaGlobals.h:19
ALIstring theName
Definition: Measurement.h:239
ALIdouble * theSigma
Definition: Measurement.h:238
ALIstring theType
Definition: Measurement.h:236
ALIuint theDim
Definition: Measurement.h:235
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
std::string ALIstring
Definition: CocoaGlobals.h:9
const ALIstring & name() const
Definition: Measurement.h:90
ALIbool * theValueIsSimulated
Definition: Measurement.h:251
ALIstring * theValueType
Definition: Measurement.h:240
ALIdouble * theValue
Definition: Measurement.h:237
Measurement::Measurement ( )
inline

Definition at line 32 of file Measurement.h.

32 { };
Measurement::~Measurement ( )
virtual

Definition at line 579 of file Measurement.cc.

References theSigma, and theValue.

580 {
581  // delete[] _name;
582  delete[] theValue;
583  delete[] theSigma;
584 
585 }
ALIdouble * theSigma
Definition: Measurement.h:238
ALIdouble * theValue
Definition: Measurement.h:237

Member Function Documentation

void Measurement::addAffectingEntriesFromOptO ( const OpticalObject optoP)

Definition at line 389 of file Measurement.cc.

References OpticalObject::CoordinateEntryList(), gather_cfg::cout, ALIUtils::debug, OpticalObject::ExtraEntryList(), spr::find(), OpticalObject::name(), OpticalObject::parent(), and theAffectingEntryList.

Referenced by buildAffectingEntryList().

390 {
391  if(ALIUtils::debug >= 3) std::cout << "Measurement::addAffectingEntriesFromOptO: OptO taking part in Measurement: " << optoP->name() << std::endl;
392  //---------- Loop entries in this OptO
393  std::vector< Entry* >::const_iterator vecite;
394  std::vector< Entry* >::const_iterator fvecite;
395  for (vecite = optoP->CoordinateEntryList().begin();
396  vecite != optoP->CoordinateEntryList().end(); vecite++) {
397  //T if( find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) ) == theAffectingEntryList.end() ){
398  //t theAffectingEntryList.push_back(*vecite);
399  //T }
400  fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) );
401  if (fvecite == theAffectingEntryList.end() ){
402  theAffectingEntryList.push_back(*vecite);
403  if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl;
404  }
405  }
406  for (vecite = optoP->ExtraEntryList().begin();
407  vecite != optoP->ExtraEntryList().end(); vecite++) {
408  fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) );
409  if (fvecite == theAffectingEntryList.end() ){
410  theAffectingEntryList.push_back(*vecite);
411  if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl;
412  }
413  }
414  if(optoP->parent() != 0) {
416  }
417 }
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:65
static ALIint debug
Definition: ALIUtils.h:35
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const OpticalObject * parent() const
Definition: OpticalObject.h:62
void addAffectingEntriesFromOptO(const OpticalObject *optoP)
Definition: Measurement.cc:389
std::vector< Entry * > theAffectingEntryList
Definition: Measurement.h:258
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void Measurement::AddOptOListItem ( OpticalObject opto)
inline

Definition at line 188 of file Measurement.h.

References _OptOList.

188  {
189  _OptOList.push_back( opto );
190  }
std::vector< OpticalObject * > _OptOList
Definition: Measurement.h:256
void Measurement::AddOptONameListItem ( ALIstring  optos)
inline

Definition at line 184 of file Measurement.h.

References _OptONameList.

Referenced by MeasurementDiffEntry::buildOptONamesList().

184  {
185  _OptONameList.push_back( optos );
186  }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
const std::vector<Entry*>& Measurement::affectingEntryList ( ) const
inline

Definition at line 113 of file Measurement.h.

References theAffectingEntryList.

113  {
114  return theAffectingEntryList;
115  }
std::vector< Entry * > theAffectingEntryList
Definition: Measurement.h:258
void Measurement::buildAffectingEntryList ( )

Definition at line 374 of file Measurement.cc.

References _OptOList, and addAffectingEntriesFromOptO().

Referenced by postConstruct().

374  {
375 
376  //---------- Loop OptO MeasuredList
377  std::vector< OpticalObject* >::const_iterator vocite;
378  for (vocite = _OptOList.begin();
379  vocite != _OptOList.end(); vocite++) {
380  addAffectingEntriesFromOptO( *vocite );
381  }
382 }
std::vector< OpticalObject * > _OptOList
Definition: Measurement.h:256
void addAffectingEntriesFromOptO(const OpticalObject *optoP)
Definition: Measurement.cc:389
void Measurement::buildOptOList ( )

Definition at line 316 of file Measurement.cc.

References _OptOList, _OptONameList, dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, Model::getOptOByName(), cuy::ii, OpticalObject::name(), and Substitute2p().

Referenced by postConstruct().

317 {
318  //- if ( ALIUtils::debug >= 3 ) std::cout << std::endl << " MEASUREMENT: " << " " << this->name() << std::endl;
319  ALIstring twopoints(".."); // .. goes one level up in the tree fo OptOs
320 
321 //---------------------------------------- Loop OptONameList
322  std::vector<ALIstring>::iterator vsite;
323  for (vsite = _OptONameList.begin();
324  vsite != _OptONameList.end(); vsite++) {
325 //----------------------------------- Count how many '..' there are in the name
326  ALIuint ii = 0;
327  // ALIuint slen = (*vsite).length();
328  ALIuint Ntwopoints = 0; //---- No '..' in ALIstring
329  for(;;) {
330  int i2p = (*vsite).find_first_of( twopoints, 3*ii ); // if it is ., it also finds it!!!
331  if ( i2p < 0 ) break;
332  if ( i2p != ALIint(3*ii)) {
333  std::cerr << i2p << "!!! Bad position of '..' in reference ALIstring: "
334  << (*vsite).c_str() << std::endl;
335  exit(2);
336  } else {
337  Ntwopoints++;
338  if ( ALIUtils::debug >=9 ) std::cout << "N2p" << Ntwopoints;
339  }
340  ii++;
341  }
342  //------ Substitute '..' by reference (the last OptO in list)
343  if (Ntwopoints != 0) {
344  Substitute2p( (*vsite), *(_OptONameList.end()-1), Ntwopoints);
345  }
346  //----- Get OpticalObject* that correspond to ALIstring and fill list
347  ALIstring referenceOptO = (*vsite);
348  //--- a ':' is used in OptOs that have several possible behavious
349  ALIint colon = referenceOptO.find(':');
350  if ( colon != -1 ) {
351  if (ALIUtils::debug >=99) {
352  std::cout << "colon in reference OptO name " << colon <<
353  referenceOptO.c_str() << std::endl;
354  }
355  referenceOptO = referenceOptO.substr( 0, colon );
356  }
357  OpticalObject* OptOitem = Model::getOptOByName( referenceOptO );
358  if ( ALIUtils::debug >= 3 ) std::cout << "Measurement::buildOptOList: OptO in Measurement: " << OptOitem->name() << std::endl;
359  if ( OptOitem != (OpticalObject*)0 ) {
360  _OptOList.push_back( OptOitem);
361  } else {
362  std::cerr << "!!! Error in Measurement: can't find Optical Object " <<
363  (*vsite).c_str() << std::endl;
364  exit(2);
365  }
366  }
367 }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
std::vector< OpticalObject * > _OptOList
Definition: Measurement.h:256
void Substitute2p(ALIstring &ref, const ALIstring &firstref, int NtwoPoints)
Definition: Measurement.cc:423
int ALIint
Definition: CocoaGlobals.h:15
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:578
static ALIint debug
Definition: ALIUtils.h:35
int ii
Definition: cuy.py:588
std::string ALIstring
Definition: CocoaGlobals.h:9
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void Measurement::buildOptONamesList ( const std::vector< ALIstring > &  wl)
virtual

Reimplemented in MeasurementDiffEntry.

Definition at line 177 of file Measurement.cc.

References _OptONameList, dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, and cuy::ii.

Referenced by construct(), constructFromOA(), and copyMeas().

178 {
179 
180  int NPairs = (wl.size()+1)/2; // Number of OptO names ( pair of name and '&' )
181 
182  //--------- Fill list with names
183  for ( int ii=0; ii<NPairs; ii++ ) {
184  _OptONameList.push_back( wl[ii*2] );
185  // Check for separating '&'
186  if (ii != NPairs-1 && wl[2*ii+1] != ALIstring("&") ) {
187  // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
188  std::cerr << "!!! Measured Optical Objects should be separated by '&', not by"
189  << wl[2*ii+1] << std::endl;
190  exit(2);
191  }
192  }
193 
194 }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
int ii
Definition: cuy.py:588
std::string ALIstring
Definition: CocoaGlobals.h:9
void Measurement::calculateOriginalSimulatedValue ( )

Definition at line 452 of file Measurement.cc.

References calculateSimulatedValue(), gather_cfg::cout, ALIUtils::debug, dim(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), cuy::ii, setValue(), setValueSimulated_orig(), valueIsSimulated(), and valueSimulated().

453 {
454  //---------- Calculate the simulated value of the Measurement
456 
457 #ifdef COCOA_VIS
458  if( ALIUtils::getFirstTime() ) {
460  if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
461  ALIVRMLMgr::getInstance().newLightRay();
462  }
463  /*- if(Model::GlobalOptions()["VisWriteIguana"] > 1) {
464  IgCocoaFileMgr::getInstance().newLightPath( theName );
465  } */
466  }
467 #endif
468 
469  //---------- Set original simulated values to it
470  //- if(ALIUtils::debug >= 5) std::cout << "MEAS DIMENSION" << dim() << std::endl;
471  for ( ALIuint ii = 0; ii < dim(); ii++) {
473  if ( ALIUtils::debug >= 4 ) std::cout << "SETsimuvalOriginal" << valueSimulated(ii) << std::endl;
474  //----- If Measurement has as value 'simulated_value', set the value to the simulated one
475  if( valueIsSimulated(ii) == 1 ){
477  //- std::cout << ii << " setting value as simulated " << valueSimulated(ii) << " " << value(ii) << this << std::endl;
478  }
479  }
480 
481 }
bool valueIsSimulated(ALIint coor)
Definition: Measurement.h:205
const ALIuint dim() const
Definition: Measurement.h:82
void setValue(ALIint coor, ALIdouble val)
Definition: Measurement.h:167
static ALIint debug
Definition: ALIUtils.h:35
static GlobalOptionMgr * getInstance()
int ii
Definition: cuy.py:588
virtual void calculateSimulatedValue(ALIbool firstTime)
Definition: Measurement.h:51
static ALIbool getFirstTime()
Definition: ALIUtils.h:100
void setValueSimulated_orig(ALIint coor, ALIdouble value)
Definition: Measurement.h:192
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:117
tuple cout
Definition: gather_cfg.py:121
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
unsigned int ALIuint
Definition: CocoaGlobals.h:17
virtual void Measurement::calculateSimulatedValue ( ALIbool  firstTime)
inlinevirtual
void Measurement::construct ( )

Definition at line 62 of file Measurement.cc.

References buildOptONamesList(), filterCSVwithJSON::copy, correctValueAndSigma(), gather_cfg::cout, ALIUtils::debug, dim(), fillData(), ALIFileIn::getInstance(), ALIFileIn::getWordsInLine(), cuy::ii, name(), postConstruct(), Model::SDFName(), type(), and valueIsSimulated().

Referenced by Model::readSystemDescription().

63 {
64 
66 
67  //---------- Read OptOs that take part in this Measurement
68  std::vector<ALIstring> wordlist;
69  filein.getWordsInLine( wordlist );
70 
71  //--------- Fill the list of names of OptOs that take part in this measurement ( names only )
72  buildOptONamesList( wordlist );
73 
74  if(ALIUtils::debug >= 3) {
75  std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << std::endl
76  << " MEASURED OPTO NAMES: ";
77  std::ostream_iterator<ALIstring> outs(std::cout," ");
78  copy(wordlist.begin(), wordlist.end(), outs);
79  std::cout << std::endl;
80  }
81 
82 
83  //---------- Read the data
84  for ( unsigned int ii=0; ii<dim(); ii++){
85  filein.getWordsInLine( wordlist );
86  fillData( ii, wordlist );
87  }
88 
90 
91  postConstruct();
92 }
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:23
bool valueIsSimulated(ALIint coor)
Definition: Measurement.h:205
const ALIuint dim() const
Definition: Measurement.h:82
void postConstruct()
Definition: Measurement.cc:154
static ALIint debug
Definition: ALIUtils.h:35
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:86
int ii
Definition: cuy.py:588
void fillData(ALIuint coor, const std::vector< ALIstring > &wl)
Definition: Measurement.cc:200
ALIint getWordsInLine(std::vector< ALIstring > &wl)
Definition: ALIFileIn.cc:83
const ALIstring & type() const
Definition: Measurement.h:86
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:121
virtual void correctValueAndSigma()
Definition: Measurement.h:67
virtual void buildOptONamesList(const std::vector< ALIstring > &wl)
Definition: Measurement.cc:177
void Measurement::constructFromOA ( OpticalAlignMeasurementInfo measInfo)

Definition at line 95 of file Measurement.cc.

References _OptONameList, buildOptONamesList(), gather_cfg::cout, ALIUtils::debug, dim(), ALIUtils::dumpVS(), fillData(), cuy::ii, OpticalAlignMeasurementInfo::isSimulatedValue_, OpticalAlignMeasurementInfo::measObjectNames_, name(), postConstruct(), sigmaDimensionFactor(), type(), valueDimensionFactor(), and OpticalAlignMeasurementInfo::values_.

Referenced by Model::BuildMeasurementsFromOA().

96 {
97  //---- Build wordlist to build object name list
98  std::vector<std::string> objNames = measInfo.measObjectNames_;
99  std::vector<std::string>::const_iterator site;
100  std::vector<ALIstring> wordlist;
101  //--- Fill the list of names of OptOs that take part in this measurement ( names only )
102  for( site = objNames.begin(); site != objNames.end(); site++) {
103  if( site != objNames.begin() ) wordlist.push_back("&");
104  wordlist.push_back(*site);
105  }
106  buildOptONamesList( wordlist );
107 
108  if(ALIUtils::debug >= 3) {
109  std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << " " << measInfo << std::endl
110  << " MEASURED OPTO NAMES: ";
111  for( size_t ii = 0; ii < _OptONameList.size(); ii++ ){
112  std::cout << _OptONameList[ii] << " ";
113  }
114  std::cout << std::endl;
115  }
116 
117  //---------- No data, set to simulated_value
118  for ( unsigned int ii=0; ii<dim(); ii++){
119  wordlist.clear();
120  wordlist.push_back( (measInfo.values_)[ii].name_ );
121  char ctmp[20];
122  if( measInfo.isSimulatedValue_[ii] ){
123  if ( ALIUtils::debug >= 5 ) {
124  std::cout << "Measurement::constructFromOA: meas value " << ii << " " << dim() << " = simulated_value" << std::endl;
125  }
126  wordlist.push_back("simulated_value");
127  } else {
128  if ( ALIUtils::debug >= 5 ) {
129  std::cout << "Measurement::constructFromOA: meas value " << ii << " " << dim() << " = " << measInfo.values_.size() << std::endl;
130  }
131  ALIdouble val = (measInfo.values_)[ii].value_ / valueDimensionFactor(); //in XML values are without dimensions, so neutralize multiplying by valueDimensionFactor() in fillData
132  gcvt( val, 10, ctmp );
133  wordlist.push_back( ctmp );
134  }
135  ALIdouble err = (measInfo.values_)[ii].error_ / sigmaDimensionFactor(); //in XML values are without dimensions, so neutralize multiplying by valueDimensionFactor() in fillData
136  gcvt( err, 10, ctmp );
137  wordlist.push_back( ctmp );
138  std::cout << " sigma " << err << " = " << ctmp << " " << (measInfo.values_)[ii].error_ << std::endl;
139  //- wordlist.push_back( "simulated_value" );
140  //- wordlist.push_back( "1." );
141  if ( ALIUtils::debug >= 5 ) ALIUtils::dumpVS(wordlist, " Measurement: calling fillData ");
142  //- std::cout << " MEAS INFO " << measInfo << std::endl;
143  //- std::cout << ii << " MEAS INFO PARAM " << (measInfo.values_)[ii] << std::endl;
144  //- std::cout << ii << " MEAS INFO PARAM VALUE " << (measInfo.values_)[ii].value_ << std::endl;
145  fillData( ii, wordlist );
146  }
147 
148  postConstruct();
149 
150 }
virtual const ALIdouble sigmaDimensionFactor() const
Definition: Measurement.h:148
long double ALIdouble
Definition: CocoaGlobals.h:11
virtual const ALIdouble valueDimensionFactor() const
Definition: Measurement.h:144
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
const ALIuint dim() const
Definition: Measurement.h:82
void postConstruct()
Definition: Measurement.cc:154
std::vector< std::string > measObjectNames_
static ALIint debug
Definition: ALIUtils.h:35
int ii
Definition: cuy.py:588
void fillData(ALIuint coor, const std::vector< ALIstring > &wl)
Definition: Measurement.cc:200
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
const ALIstring & type() const
Definition: Measurement.h:86
std::vector< OpticalAlignParam > values_
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:121
virtual void buildOptONamesList(const std::vector< ALIstring > &wl)
Definition: Measurement.cc:177
void Measurement::copyMeas ( Measurement meas,
const std::string &  subsstr1,
const std::string &  subsstr2 
)

Definition at line 649 of file Measurement.cc.

References buildOptONamesList(), ALIUtils::changeName(), filterCSVwithJSON::copy, gather_cfg::cout, ALIUtils::debug, dim(), cuy::ii, name(), OptOList(), postConstruct(), sigma(), theDim, theName, theSigma, theType, theValue, theValueIsSimulated, theValueSimulated, theValueSimulated_orig, type(), value(), valueIsSimulated(), valueSimulated(), and valueSimulated_orig().

Referenced by Model::copyMeasurements().

650 {
651  theDim = meas->dim();
652  theType = meas->type();
653  theName = ALIUtils::changeName( meas->name(), subsstr1, subsstr2);
654 
655  // _OptOnames = new ALIstring[theDim];
659  theValue = const_cast<ALIdouble*>(meas->value());
660  theSigma = const_cast<ALIdouble*>(meas->sigma());
661 
662  unsigned int ii;
663  for(ii = 0; ii < theDim; ii++) {
664  theValueSimulated[ii] = meas->valueSimulated( ii );
666  theValueIsSimulated[ii] = meas->valueIsSimulated( ii );
667  }
668 
669  //--------- Fill the list of names of OptOs that take part in this measurement ( names only )
670 
671  std::vector<std::string> wordlist;
672  auto &optolist = meas->OptOList();
673  ALIuint nOptos = optolist.size();
674  for ( ALIuint ii = 0; ii < nOptos; ii++ ) {
675  wordlist.push_back( ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) );
676  std::cout << " copymeas " << ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) << std::endl;
677  if( ii != nOptos -1 ) wordlist.push_back("&");
678  }
679 
680  buildOptONamesList( wordlist );
681 
682  if(ALIUtils::debug >= 3) {
683  std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << std::endl
684  << " MEASURED OPTO NAMES: ";
685  std::ostream_iterator<ALIstring> outs(std::cout," ");
686  copy(wordlist.begin(), wordlist.end(), outs);
687  std::cout << std::endl;
688  }
689 
690 
691  postConstruct();
692 
693 }
ALIdouble * theValueSimulated
Definition: Measurement.h:243
long double ALIdouble
Definition: CocoaGlobals.h:11
bool valueIsSimulated(ALIint coor)
Definition: Measurement.h:205
const ALIuint dim() const
Definition: Measurement.h:82
void postConstruct()
Definition: Measurement.cc:154
static ALIint debug
Definition: ALIUtils.h:35
int ii
Definition: cuy.py:588
bool ALIbool
Definition: CocoaGlobals.h:19
ALIstring theName
Definition: Measurement.h:239
ALIdouble * theSigma
Definition: Measurement.h:238
const ALIdouble * sigma() const
Definition: Measurement.h:132
ALIstring theType
Definition: Measurement.h:236
const ALIdouble valueSimulated_orig(ALIuint ii) const
Definition: Measurement.h:121
const std::vector< OpticalObject * > & OptOList() const
Definition: Measurement.h:109
ALIuint theDim
Definition: Measurement.h:235
static std::string changeName(const std::string &oldName, const std::string &subsstr1, const std::string &subsstr2)
Definition: ALIUtils.cc:573
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
const ALIdouble * value() const
Definition: Measurement.h:125
const ALIstring & type() const
Definition: Measurement.h:86
const ALIstring & name() const
Definition: Measurement.h:90
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:117
tuple cout
Definition: gather_cfg.py:121
virtual void buildOptONamesList(const std::vector< ALIstring > &wl)
Definition: Measurement.cc:177
ALIbool * theValueIsSimulated
Definition: Measurement.h:251
ALIdouble * theValue
Definition: Measurement.h:237
unsigned int ALIuint
Definition: CocoaGlobals.h:17
virtual void Measurement::correctValueAndSigma ( )
inlinevirtual
std::vector< ALIdouble > Measurement::DerivativeRespectEntry ( Entry entry)

Definition at line 511 of file Measurement.cc.

References calculateSimulatedValue(), dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, Entry::displace(), cmsRelvalreport::exit, ALIUtils::getMaximumDeviationDerivative(), cuy::ii, Entry::name(), OpticalObject::name(), name(), Entry::OptOCurrent(), OpticalObject::resetGlobalCoordinates(), Entry::startingDisplacement(), theDim, theValueSimulated, and theValueSimulated_orig.

512 {
513  //---------- std::vector of derivatives to return
514  std::vector<ALIdouble> deriv;
515  ALIdouble sumderiv;
516 
517  //---------- displacement to start with
518  ALIdouble displacement = entry->startingDisplacement();
519  //----- all angles are in radians, so, if displace is not, rescale it before making the displacement
520  //- displacement *= entry->SigmaDimensionFactor();
521  if( ALIUtils::debug >= 3) std::cout << std::endl << "%%% Derivative w.r.t. entry " << entry->name() << ": displacement = " << displacement << std::endl;
522 
523  ALIint count_itera = 0;
524 
525  //---------- Loop decreasing the displacement a factor 2, until the precision set is reached
526  do {
527  count_itera++;
528  entry->displace( displacement );
529 
530  if ( ALIUtils::debug >= 5) std::cout << "Get simulated value for displacement " << displacement << std::endl;
532 
533  //---------- Get sum of derivatives
534  sumderiv = 0;
535  for ( ALIuint ii = 0; ii < theDim; ii++) {
536  sumderiv += fabs( theValueSimulated[ii] - theValueSimulated_orig[ii] );
537  if( ALIUtils::debug >= 4 ) {
538  std::cout << "iteration " << count_itera << " COOR " << ii
539  << " difference =" << ( theValueSimulated[ii] - theValueSimulated_orig[ii] )
540  //- << " " << theValueSimulated[ii] << " " << theValueSimulated_orig[ii]
541  << " derivative = " << (theValueSimulated[ii] - theValueSimulated_orig[ii]) /displacement << " disp " << displacement
542  << " sum derivatives = " << sumderiv << std::endl;
543  }
544  if( ALIUtils::debug >= 5 ) {
545  std::cout << " new simu value= " << theValueSimulated[ii] << " orig simu value " << theValueSimulated_orig[ii] << std::endl;
546  }
547  }
548  if (count_itera >= 100) {
549  std::cerr << "EXITING: too many iterations in derivative, displacement is " <<
550  displacement << " sum of derivatives is " << sumderiv << std::endl;
551  exit(3);
552  }
553  displacement /= 2.;
554  //- std::cout << "sumderiv " << sumderiv << " maximu " << Fit::maximum_deviation_derivative << std::endl;
555  }while( sumderiv > ALIUtils::getMaximumDeviationDerivative() );
556  displacement *= 2;
557 
558  //---------- Enough precision reached: pass result
559  for ( ALIuint ii = 0; ii < theDim; ii++) {
560  deriv.push_back( ( theValueSimulated[ii] - theValueSimulated_orig[ii] ) / displacement );
561  //----- change it to entry sigma dimensions
562  // deriv[ii] /= entry->SigmaDimensionFactor();
563  if( ALIUtils::debug >= 1) std::cout << name() << ": " << entry->OptOCurrent()->name() << " " << entry->name() << " " << ii << "### DERIVATIVE: " << deriv[ii] << std::endl;
564  }
565  //- if(ALIUtils::debug >= 5) std::cout << "END derivative: " << deriv << "disp" << displacement << std::endl;
566 
567  //--------------------- Reset _centreGlob and _rmGlob of OptO entry belongs to (and component OptOs)
569 
570  return deriv;
571 
572 }
ALIdouble * theValueSimulated
Definition: Measurement.h:243
long double ALIdouble
Definition: CocoaGlobals.h:11
void resetGlobalCoordinates()
static ALIdouble getMaximumDeviationDerivative()
Definition: ALIUtils.h:106
int ALIint
Definition: CocoaGlobals.h:15
static ALIint debug
Definition: ALIUtils.h:35
int ii
Definition: cuy.py:588
virtual void calculateSimulatedValue(ALIbool firstTime)
Definition: Measurement.h:51
const ALIstring & name() const
Definition: Entry.h:52
ALIuint theDim
Definition: Measurement.h:235
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
virtual ALIdouble startingDisplacement()
Definition: Entry.h:67
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
virtual void displace(ALIdouble disp)
Definition: Entry.cc:266
unsigned int ALIuint
Definition: CocoaGlobals.h:17
const ALIuint Measurement::dim ( ) const
inline
void Measurement::DumpBadOrderOptOs ( )

Definition at line 487 of file Measurement.cc.

References begin, dtNoiseDBValidation_cfg::cerr, ALIUtils::debug, cmsRelvalreport::exit, and OptONameList().

Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), and MeasurementDiffEntry::calculateSimulatedValue().

488 {
489  std::cerr << " Detector can not make measurement with these optical objects " << std::endl;
490  if (ALIUtils::debug >= 1) {
491  // std::vector<OpticalObject*>::iterator voite;
492  // for ( voite = _OptOList.begin();
493  // voite != _OptOList.end(); voite++) {
494  // std::cout << (*voite)->type() << " : " << (*voite)->name() << std::endl;
495  // }
496  std::vector<ALIstring>::const_iterator vsite;
497  for ( vsite = OptONameList().begin();
498  vsite != OptONameList().end(); vsite++) {
499  std::cerr << (*vsite) << " : " ;
500  }
501  std::cerr << std::endl;
502  }
503  exit(2);
504 
505 }
static ALIint debug
Definition: ALIUtils.h:35
const std::vector< ALIstring > & OptONameList() const
Definition: Measurement.h:105
#define begin
Definition: vmac.h:30
void Measurement::fillData ( ALIuint  coor,
const std::vector< ALIstring > &  wl 
)

Definition at line 200 of file Measurement.cc.

References dtNoiseDBValidation_cfg::cerr, filterCSVwithJSON::copy, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, ParameterMgr::getInstance(), ParameterMgr::getParameterValue(), ALIUtils::IsNumber(), sigmaDimensionFactor(), theDim, theSigma, theValue, theValueIsSimulated, theValueType, and valueDimensionFactor().

Referenced by construct(), constructFromOA(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().

201 {
202  if ( ALIUtils::debug >= 3 ) {
203  std::cout << "@@ Filling coordinate " << coor << std::endl ;
204  //- ostream_iterator<ALIstring> outs(std::cout," ");
205  //- copy(wordlist.begin(), wordlist.end(), outs);
206  }
207 
209 
210  //---------- Check that there are 3 attributes: name, value, error
211  if( wordlist.size() != 3 ) {
212  // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
213  std::cerr << " Incorrect format for Measurement value:" << std::endl;
214  std::ostream_iterator<ALIstring> outs(std::cout," ");
215  copy(wordlist.begin(), wordlist.end(), outs);
216  std::cout << std::endl << "There should be three words: name value sigma " << std::endl;
217  exit(2);
218  }
219 
220  //---------- check coor value
221  if (coor >= theDim ) {
222  // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
223  std::cerr << "Trying to fill Measurement coordinate No "
224  << coor << " but the dimension is " << theDim << std::endl;
225  exit(2);
226  }
227 
228  //---------- set data members
229  //----- Set valueType
230  theValueType[coor] = wordlist[0];
231 
232  //----- Set value (translate it if a PARAMETER is used)
233  ALIdouble val = 0.;
234  theValueIsSimulated[coor] = 0;
235  if( !ALIUtils::IsNumber(wordlist[1]) ) {
236  if ( parmgr->getParameterValue( wordlist[1], val ) == 0 ) {
237  if( wordlist[1] == ALIstring("simulated_value") ) {
238  theValueIsSimulated[coor] = 1;
239  } else {
240  // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
241  std::cerr << "!!! parameter for value not found: " << wordlist[1].c_str() << std::endl;
242  exit(2);
243  }
244  }
245  //d val *= valueDimensionFactor();
246  } else {
247  //d val = DimensionMgr()::getInstance()->extractValue( wordlist[1], ValueDimensionFactor() );
248  val = atof( wordlist[1].c_str() );
249  }
250  val *= valueDimensionFactor();
251  if( ALIUtils::debug >= 3 ) std::cout << "Meas VALUE= " << val << " (ValueDimensionFactor= " << valueDimensionFactor() <<std::endl;
252 
253  //----- Set sigma (translate it if a PARAMETER is used)
254  ALIdouble sig = 0.;
255  if( !ALIUtils::IsNumber(wordlist[2]) ) {
256  if ( parmgr->getParameterValue( wordlist[2], sig ) == 0 ) {
257  // ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
258  std::cerr << "!!! parameter for sigma not found: " << wordlist[2].c_str() << std::endl;
259  exit(2);
260  }
261  //d sig *= sigmaDimensionFactor();
262  } else {
263  // sig = DimensionMgr()::getInstance()->extractValue( wordlist[2], ValueDimensionFactor() );
264  sig = atof( wordlist[2].c_str() );
265  }
266  sig *= sigmaDimensionFactor();
267  if( ALIUtils::debug >= 3) std::cout << "SIGMA= " << sig << " (SigmaDimensionFactor= " << sigmaDimensionFactor() <<std::endl;
268 
269  //----- set theValue & theSigma
270  theValue[coor] = val;
271  theSigma[coor] = sig;
272 
273 }
virtual const ALIdouble sigmaDimensionFactor() const
Definition: Measurement.h:148
long double ALIdouble
Definition: CocoaGlobals.h:11
virtual const ALIdouble valueDimensionFactor() const
Definition: Measurement.h:144
static ParameterMgr * getInstance()
Definition: ParameterMgr.cc:19
static ALIint debug
Definition: ALIUtils.h:35
ALIint getParameterValue(const ALIstring &name, ALIdouble &val)
static int IsNumber(const ALIstring &str)
Definition: ALIUtils.cc:34
ALIdouble * theSigma
Definition: Measurement.h:238
ALIuint theDim
Definition: Measurement.h:235
std::string ALIstring
Definition: CocoaGlobals.h:9
tuple cout
Definition: gather_cfg.py:121
ALIbool * theValueIsSimulated
Definition: Measurement.h:251
ALIstring * theValueType
Definition: Measurement.h:240
ALIdouble * theValue
Definition: Measurement.h:237
void Measurement::fillData ( ALIuint  coor,
OpticalAlignParam oaParam 
)

Definition at line 277 of file Measurement.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), OpticalAlignParam::sigma(), sigmaDimensionFactor(), theDim, theSigma, theValue, theValueIsSimulated, OpticalAlignParam::value(), and valueDimensionFactor().

278 {
279  if ( ALIUtils::debug >= 3 ) {
280  std::cout << "@@ Filling coordinate " << coor << std::endl ;
281  }
282 
283  // ParameterMgr* parmgr = ParameterMgr::getInstance();
284 
285  //---------- check coor value
286  if (coor >= theDim ) {
287  std::cerr << "Trying to fill Measurement coordinate No "
288  << coor << " but the dimension is " << theDim << std::endl;
289  exit(2);
290  }
291 
292  //---------- set data members
293  //----- Set value (translate it if a PARAMETER is used)
294  ALIdouble val = 0.;
295  theValueIsSimulated[coor] = 0;
296  val = oaParam->value();
297  val *= valueDimensionFactor();
298  theValue[coor] = val;
299  if( ALIUtils::debug >= 3 ) std::cout << "Meas VALUE= " << val << " (ValueDimensionFactor= " << valueDimensionFactor() <<std::endl;
300 
301  ALIbool sigmaFF = GlobalOptionMgr::getInstance()->GlobalOptions()["measurementErrorFromFile"];
302  if( sigmaFF ) {
303  //----- Set sigma (translate it if a PARAMETER is used)
304  ALIdouble sig = 0.;
305  sig = oaParam->sigma(); // it is in mm always
306  sig *= sigmaDimensionFactor();
307  theSigma[coor] = sig;
308  if( ALIUtils::debug >= 3) std::cout << "SIGMA= " << sig << " (SigmaDimensionFactor= " << sigmaDimensionFactor() <<std::endl;
309 
310  }
311 }
virtual const ALIdouble sigmaDimensionFactor() const
Definition: Measurement.h:148
long double ALIdouble
Definition: CocoaGlobals.h:11
virtual const ALIdouble valueDimensionFactor() const
Definition: Measurement.h:144
static ALIint debug
Definition: ALIUtils.h:35
static GlobalOptionMgr * getInstance()
double sigma() const
bool ALIbool
Definition: CocoaGlobals.h:19
ALIdouble * theSigma
Definition: Measurement.h:238
double value() const
ALIuint theDim
Definition: Measurement.h:235
tuple cout
Definition: gather_cfg.py:121
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
ALIbool * theValueIsSimulated
Definition: Measurement.h:251
ALIdouble * theValue
Definition: Measurement.h:237
static ALIstring Measurement::getCurrentDate ( )
inlinestatic

Definition at line 152 of file Measurement.h.

References theCurrentDate.

Referenced by FittedEntriesSet::FittedEntriesSet().

152  {
153  return theCurrentDate;
154  }
static ALIstring theCurrentDate
Definition: Measurement.h:264
static ALIstring Measurement::getCurrentTime ( )
inlinestatic

Definition at line 155 of file Measurement.h.

References theCurrentTime.

Referenced by FittedEntriesSet::FittedEntriesSet().

155  {
156  return theCurrentTime;
157  }
static ALIstring theCurrentTime
Definition: Measurement.h:265
const CLHEP::Hep3Vector& Measurement::getLightRayDirection ( ) const
inline

Definition at line 162 of file Measurement.h.

References theLightRayDirection.

162  {
163  return theLightRayDirection;
164  }
CLHEP::Hep3Vector theLightRayDirection
Definition: Measurement.h:261
const CLHEP::Hep3Vector& Measurement::getLightRayPosition ( ) const
inline

Definition at line 159 of file Measurement.h.

References theLightRayPosition.

159  {
160  return theLightRayPosition;
161  }
CLHEP::Hep3Vector theLightRayPosition
Definition: Measurement.h:260
ALIstring Measurement::getMeasuringBehaviour ( const std::vector< OpticalObject * >::const_iterator  vocite)

Definition at line 591 of file Measurement.cc.

References _OptOList, and _OptONameList.

Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), and MeasurementCOPS::calculateSimulatedValue().

591  {
592  std::vector<ALIstring>::const_iterator vscite = _OptONameList.begin() +
593  ( vocite - _OptOList.begin() ); // point to corresponding name of this OptO
594  ALIint colon = (*vscite).find(':');
595  ALIstring behav;
596  if(colon != -1 ) {
597  behav = (*vscite).substr(colon+1,(*vscite).size());
598  } else {
599  behav = " ";
600  }
601  return behav;
602 }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
std::vector< OpticalObject * > _OptOList
Definition: Measurement.h:256
int ALIint
Definition: CocoaGlobals.h:15
std::string ALIstring
Definition: CocoaGlobals.h:9
const OpticalObject * Measurement::getPreviousOptO ( const OpticalObject Popto) const

Definition at line 608 of file Measurement.cc.

References _OptOList, dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, OpticalObject::name(), and name().

Referenced by OptODistancemeter::makeMeasurement(), and OptODistancemeter3dim::makeMeasurement().

609 {
610  //--------- Loop OptOs that take part in this measurement
611  std::vector<OpticalObject*>::const_iterator vocite;
612  for( vocite = _OptOList.begin(); vocite != _OptOList.end(); vocite++ ){
613  if( *vocite == Popto ) {
614  if( vocite == _OptOList.begin() ) {
615  std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl;
616  std::cerr << " OptO " << Popto->name() << " is the first one " << std::endl;
617  exit(1);
618  } else {
619  return *(vocite-1);
620  }
621  }
622  }
623 
624  std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl;
625  std::cerr << " OptO " << Popto->name() << " not found " << std::endl;
626  exit(1);
627 }
std::vector< OpticalObject * > _OptOList
Definition: Measurement.h:256
const ALIstring & name() const
Definition: Measurement.h:90
const ALIstring & name() const
Definition: OpticalObject.h:60
static ALIstring& Measurement::measurementsFileName ( )
inlinestatic

Definition at line 213 of file Measurement.h.

References theMeasurementsFileName.

Referenced by Model::readMeasurementsFromFile().

213  {
215  }
static ALIstring theMeasurementsFileName
Definition: Measurement.h:262
const ALIstring& Measurement::name ( ) const
inline
const std::vector<OpticalObject*>& Measurement::OptOList ( ) const
inline
const std::vector<ALIstring>& Measurement::OptONameList ( ) const
inline

Definition at line 105 of file Measurement.h.

References _OptONameList.

Referenced by DumpBadOrderOptOs(), and CocoaToDDLMgr::measurementsAsSpecPars().

105  {
106  return _OptONameList;
107  }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
void Measurement::postConstruct ( )

Definition at line 154 of file Measurement.cc.

References Model::addMeasurementToList(), buildAffectingEntryList(), buildOptOList(), gather_cfg::cout, ALIUtils::debug, Model::MeasurementList(), and setName().

Referenced by construct(), constructFromOA(), and copyMeas().

155 {
156  //---------- Set name as name of last OptO
157  setName();
158 
159  //---------- Transform for each Measurement the Measured OptO names to Measured OptO pointers
160  buildOptOList();
161 
162  //---------- Build list of Entries that affect a Measurement
164 
165  //---------- add this measurement to the global list of measurements
167 
168  if ( ALIUtils::debug >= 10 ) {
169  std::cout << Model::MeasurementList().size() << std::endl;
170  }
171 }
void setName()
Definition: Measurement.cc:697
void buildAffectingEntryList()
Definition: Measurement.cc:374
static ALIint debug
Definition: ALIUtils.h:35
static void addMeasurementToList(Measurement *measadd)
Definition: Model.h:150
void buildOptOList()
Definition: Measurement.cc:316
tuple cout
Definition: gather_cfg.py:121
static std::vector< Measurement * > & MeasurementList()
Definition: Model.h:79
void Measurement::printStartCalculateSimulatedValue ( const Measurement meas)
protected

Definition at line 444 of file Measurement.cc.

References gather_cfg::cout, name(), and type().

Referenced by MeasurementSensor2D::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), and MeasurementDiffEntry::calculateSimulatedValue().

445 {
446  std::cout << std::endl << "@@@ Start calculation of simulated value of " << meas->type() << " Measurement " << meas->name() << std::endl;
447 }
const ALIstring & type() const
Definition: Measurement.h:86
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:121
const ALIstring& Measurement::sensorName ( )
inline

Definition at line 94 of file Measurement.h.

References theName.

94  {
95  ALIstring sensName = theName;
96  ALIint colon = theName.find(':');
97  theName = theName.substr(colon+1, theName.length()-colon);
98  return theName;
99  }
int ALIint
Definition: CocoaGlobals.h:15
ALIstring theName
Definition: Measurement.h:239
std::string ALIstring
Definition: CocoaGlobals.h:9
virtual void Measurement::setConversionFactor ( const std::vector< ALIstring > &  wordlist)
inlinevirtual

Reimplemented in MeasurementCOPS, MeasurementSensor2D, MeasurementDistancemeter, MeasurementDistancemeter3dim, and MeasurementTiltmeter.

Definition at line 70 of file Measurement.h.

References dtNoiseDBValidation_cfg::cerr, and cmsRelvalreport::exit.

Referenced by Model::readSystemDescription().

70  {
71  std::cerr << " Measurement::setConversionFactor should never be called " << std::endl;
72  exit(1); };
void Measurement::setCurrentDate ( const std::vector< ALIstring > &  wl)
static

set the date of the current measurement

Definition at line 631 of file Measurement.cc.

References dtNoiseDBValidation_cfg::cerr, ALIUtils::dumpVS(), cmsRelvalreport::exit, theCurrentDate, and theCurrentTime.

Referenced by Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().

632 {
633 
634  if( wl.size() != 3 ){
635  std::cerr << "!!!EXITING: reading DATE of measurements set: it must have three words, it is though " << std::endl;
636  ALIUtils::dumpVS(wl, " ");
637  exit(1);
638  } else if(wl[0] != "DATE:" ){
639  std::cerr << "!!!EXITING: reading DATE of measurements set: first word must be 'DATE:', it is though " << std::endl;
640  ALIUtils::dumpVS( wl, " ");
641  exit(1);
642  } else {
643  theCurrentDate = wl[1];
644  theCurrentTime = wl[2];
645  }
646 }
static ALIstring theCurrentTime
Definition: Measurement.h:265
static ALIstring theCurrentDate
Definition: Measurement.h:264
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
void Measurement::SetDimension ( ALIuint  dim)
inline

Definition at line 180 of file Measurement.h.

References dim(), and theDim.

180  {
181  theDim = dim;
182  }
const ALIuint dim() const
Definition: Measurement.h:82
ALIuint theDim
Definition: Measurement.h:235
void Measurement::setLightRayDirection ( const CLHEP::Hep3Vector &  lightRayDirection)
inline

Definition at line 224 of file Measurement.h.

References theLightRayDirection.

Referenced by OptOSensor2D::makeMeasurement().

225  { theLightRayDirection = lightRayDirection; }
CLHEP::Hep3Vector theLightRayDirection
Definition: Measurement.h:261
void Measurement::setLightRayPosition ( const CLHEP::Hep3Vector &  lightRayPosition)
inline

Definition at line 222 of file Measurement.h.

References theLightRayPosition.

Referenced by OptOSensor2D::makeMeasurement().

223  { theLightRayPosition = lightRayPosition; }
CLHEP::Hep3Vector theLightRayPosition
Definition: Measurement.h:260
static void Measurement::setMeasurementsFileName ( const ALIstring filename)
inlinestatic

Definition at line 216 of file Measurement.h.

References lut2db_cfg::filename, and theMeasurementsFileName.

216  {
217  //- std::cout << " setting file name " << filename << std::endl;
219  //- std::cout << " dsetting file name " << filename << std::endl;
220  }
static ALIstring theMeasurementsFileName
Definition: Measurement.h:262
tuple filename
Definition: lut2db_cfg.py:20
void Measurement::setName ( )

Definition at line 697 of file Measurement.cc.

References _OptONameList, dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, theName, and type().

Referenced by Vispa.Gui.PortWidget.PortWidget::__init__(), Vispa.Views.PropertyView.Property::__init__(), and postConstruct().

698 {
699  // name already set by passing one argument with sensor type
700  if( theName != "" ) return;
701  if( _OptONameList.size() == 0) {
702  std::cerr << " !!! Error in your code, you cannot ask for the name of the Measurement before the OptONameList is build " << std::endl;
703  exit(9);
704  }
705  std::vector<ALIstring>::iterator vsite = (_OptONameList.end()-1);
706  theName = type() + ":" + (*vsite);
707 }
std::vector< ALIstring > _OptONameList
Definition: Measurement.h:254
ALIstring theName
Definition: Measurement.h:239
const ALIstring & type() const
Definition: Measurement.h:86
void Measurement::setSigma ( ALIint  coor,
ALIdouble  val 
)
inline

Definition at line 171 of file Measurement.h.

References theSigma.

Referenced by MeasurementDistancemeter::correctValueAndSigma(), MeasurementTiltmeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().

171  {
172  theSigma[coor] = val;
173  //- std::cout << coor << " setting sigma " << theSigma[coor] << std::endl;
174  }
ALIdouble * theSigma
Definition: Measurement.h:238
void Measurement::setType ( ALIstring  type)
inline

Definition at line 176 of file Measurement.h.

References theType, and type().

176  {
177  theType = type;
178  }
ALIstring theType
Definition: Measurement.h:236
const ALIstring & type() const
Definition: Measurement.h:86
void Measurement::setValue ( ALIint  coor,
ALIdouble  val 
)
inline
void Measurement::setValueSimulated ( ALIint  coor,
ALIdouble  value 
)
inline
void Measurement::setValueSimulated_orig ( ALIint  coor,
ALIdouble  value 
)
inline

Definition at line 192 of file Measurement.h.

References theValueSimulated_orig, and value().

Referenced by calculateOriginalSimulatedValue().

192  {
194  }
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
const ALIdouble * value() const
Definition: Measurement.h:125
virtual void Measurement::setXlaserLine ( ALIuint  ii,
int  val 
)
inlinevirtual

Reimplemented in MeasurementCOPS.

Definition at line 209 of file Measurement.h.

Referenced by OptOCOPS::makeMeasurement().

209 { };
const ALIdouble* Measurement::sigma ( ) const
inline
const ALIdouble Measurement::sigma ( ALIuint  ii) const
inline

Definition at line 136 of file Measurement.h.

References cuy::ii, and theSigma.

136  {
137  return theSigma[ii];
138  }
int ii
Definition: cuy.py:588
ALIdouble * theSigma
Definition: Measurement.h:238
virtual const ALIdouble Measurement::sigmaDimensionFactor ( ) const
inlinevirtual

Definition at line 148 of file Measurement.h.

References ALIUtils::LengthSigmaDimensionFactor().

Referenced by constructFromOA(), fillData(), and MeasurementTiltmeter::setConversionFactor().

148  {
150  }
static ALIdouble LengthSigmaDimensionFactor()
Definition: ALIUtils.h:73
void Measurement::Substitute2p ( ALIstring ref,
const ALIstring firstref,
int  NtwoPoints 
)
protected

Definition at line 423 of file Measurement.cc.

References gather_cfg::cout, ALIUtils::debug, cuy::ii, and pickleFileParser::slash.

Referenced by buildOptOList().

424 {
425  // '/' sets hierarchy of OptOs
426  ALIstring slash("/");
427 
428  int pos1st = firstref.length();
429  // Go back an '/' in firstref for each '..' in ref
430  for (int ii=0; ii < Ntwopoints; ii++) {
431  pos1st = firstref.find_last_of( slash, pos1st-1);
432  if ( ALIUtils::debug >=9 ) std::cout << "pos1st=" << pos1st;
433  }
434 
435  if ( ALIUtils::debug >=9 ) std::cout << "before change ref: " << ref << " 1ref " << firstref << std::endl;
436  // Substitute name
437  ref.replace( 0, (Ntwopoints*3)-1, firstref, 0, pos1st);
438  if ( ALIUtils::debug >=9 ) std::cout << "after change ref: " << ref << " 1ref " << firstref << std::endl;
439 
440 }
static ALIint debug
Definition: ALIUtils.h:35
int ii
Definition: cuy.py:588
std::string ALIstring
Definition: CocoaGlobals.h:9
tuple cout
Definition: gather_cfg.py:121
const ALIstring& Measurement::type ( ) const
inline
const ALIdouble* Measurement::value ( ) const
inline

Definition at line 125 of file Measurement.h.

References theValue.

Referenced by Types.int32::__nonzero__(), Types.uint32::__nonzero__(), Types.int64::__nonzero__(), Types.uint64::__nonzero__(), Types.double::__nonzero__(), Types.bool::__nonzero__(), Types.string::__nonzero__(), average.Average::average(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), MeasurementDiffEntry::calculateSimulatedValue(), Types.string::configValue(), Types.FileInPath::configValue(), copyMeas(), MeasurementSensor2D::correctValueAndSigma(), MeasurementCOPS::correctValueAndSigma(), MeasurementTiltmeter::correctValueAndSigma(), MeasurementDistancemeter::correctValueAndSigma(), MeasurementDistancemeter3dim::correctValueAndSigma(), Mixins.UsingBlock::dumpPython(), OptOSensor2D::fastTraversesLightRay(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Mixins.UsingBlock::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.FileInPath::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Vispa.Views.PropertyView.FileProperty::labelDoubleClicked(), OptOTiltmeter::makeMeasurement(), OptOSensor2D::makeMeasurement(), OptODistancemeter3dim::makeMeasurement(), OptODistancemeter::makeMeasurement(), OptOCOPS::makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), setValueSimulated(), and setValueSimulated_orig().

125  {
126  return theValue;
127  }
ALIdouble * theValue
Definition: Measurement.h:237
const ALIdouble Measurement::value ( ALIuint  ii) const
inline
virtual const ALIdouble Measurement::valueDimensionFactor ( ) const
inlinevirtual
bool Measurement::valueIsSimulated ( ALIint  coor)
inline

Definition at line 205 of file Measurement.h.

References theValueIsSimulated.

Referenced by calculateOriginalSimulatedValue(), construct(), copyMeas(), and CocoaToDDLMgr::measurementsAsSpecPars().

205  {
206  return theValueIsSimulated[coor];
207  }
ALIbool * theValueIsSimulated
Definition: Measurement.h:251
const ALIdouble Measurement::valueSimulated ( ALIuint  ii) const
inline
const ALIdouble Measurement::valueSimulated_orig ( ALIuint  ii) const
inline

Definition at line 121 of file Measurement.h.

References cuy::ii, and theValueSimulated_orig.

Referenced by copyMeas().

121  {
122  return theValueSimulated_orig[ii];
123  }
int ii
Definition: cuy.py:588
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
const ALIstring Measurement::valueType ( ALIuint  ii) const
inline

Definition at line 140 of file Measurement.h.

References cuy::ii, and theValueType.

Referenced by OptOSensor2D::makeMeasurement(), CocoaToDDLMgr::measurementsAsSpecPars(), Model::readMeasurementsFromFile(), and CocoaDaqReaderText::ReadNextEvent().

140  {
141  return theValueType[ii];
142  }
int ii
Definition: cuy.py:588
ALIstring * theValueType
Definition: Measurement.h:240
virtual int Measurement::xlaserLine ( ALIuint  ii)
inlinevirtual

Reimplemented in MeasurementCOPS.

Definition at line 199 of file Measurement.h.

References dtNoiseDBValidation_cfg::cerr.

Referenced by OptOCOPS::makeMeasurement().

199 { std::cerr << "!!!! Measurement::xlaserLine is not returning anything " << std::endl; abort(); };

Member Data Documentation

std::vector<OpticalObject*> Measurement::_OptOList
private
std::vector<ALIstring> Measurement::_OptONameList
private
ALIdouble Measurement::cameraScaleFactor = 1.
static

Definition at line 209 of file Measurement.h.

Referenced by Fit::FillMatricesWithMeasurements().

ALIbool Measurement::only1 = 0
static
ALIstring Measurement::only1Date = ""
static

Definition at line 268 of file Measurement.h.

Referenced by Model::readMeasurementsFromFile(), and Model::readSystemDescription().

ALIstring Measurement::only1Time = ""
static

Definition at line 269 of file Measurement.h.

Referenced by Model::readMeasurementsFromFile(), and Model::readSystemDescription().

std::vector<Entry*> Measurement::theAffectingEntryList
private

Definition at line 258 of file Measurement.h.

Referenced by addAffectingEntriesFromOptO(), and affectingEntryList().

ALIstring Measurement::theCurrentDate = "99/99/99"
staticprivate

Definition at line 264 of file Measurement.h.

Referenced by getCurrentDate(), and setCurrentDate().

ALIstring Measurement::theCurrentTime = "99:99"
staticprivate

Definition at line 265 of file Measurement.h.

Referenced by getCurrentTime(), and setCurrentDate().

ALIuint Measurement::theDim
private
CLHEP::Hep3Vector Measurement::theLightRayDirection
private

Definition at line 261 of file Measurement.h.

Referenced by getLightRayDirection(), and setLightRayDirection().

CLHEP::Hep3Vector Measurement::theLightRayPosition
private

Definition at line 260 of file Measurement.h.

Referenced by getLightRayPosition(), and setLightRayPosition().

ALIstring Measurement::theMeasurementsFileName = ""
staticprivate

Definition at line 262 of file Measurement.h.

Referenced by measurementsFileName(), and setMeasurementsFileName().

ALIstring Measurement::theName
private
ALIdouble* Measurement::theSigma
private

Definition at line 238 of file Measurement.h.

Referenced by copyMeas(), fillData(), Measurement(), setSigma(), sigma(), and ~Measurement().

ALIstring Measurement::theType
private

Definition at line 236 of file Measurement.h.

Referenced by twikiExport.Constituent::__str__(), copyMeas(), setType(), and type().

ALIdouble* Measurement::theValue
private

Definition at line 237 of file Measurement.h.

Referenced by copyMeas(), fillData(), Measurement(), setValue(), value(), and ~Measurement().

ALIbool* Measurement::theValueIsSimulated
private

Definition at line 251 of file Measurement.h.

Referenced by copyMeas(), fillData(), Measurement(), and valueIsSimulated().

ALIdouble* Measurement::theValueSimulated
private
ALIdouble* Measurement::theValueSimulated_orig
private
ALIstring* Measurement::theValueType
private

Definition at line 240 of file Measurement.h.

Referenced by fillData(), Measurement(), and valueType().