CMS 3D CMS Logo

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 = false
 
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 45 of file Measurement.cc.

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

46 : theDim(measdim), theType(type), theName( name )
47 {
48  // _OptOnames = new ALIstring[theDim];
49  theValue = new ALIdouble[theDim];
50  theSigma = new ALIdouble[theDim];
52 
56 
57 }
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
Measurement::~Measurement ( )
virtual

Definition at line 580 of file Measurement.cc.

References theSigma, and theValue.

Referenced by Measurement().

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

Member Function Documentation

void Measurement::addAffectingEntriesFromOptO ( const OpticalObject optoP)

Definition at line 390 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(), and Measurement().

391 {
392  if(ALIUtils::debug >= 3) std::cout << "Measurement::addAffectingEntriesFromOptO: OptO taking part in Measurement: " << optoP->name() << std::endl;
393  //---------- Loop entries in this OptO
394  std::vector< Entry* >::const_iterator vecite;
395  std::vector< Entry* >::const_iterator fvecite;
396  for (vecite = optoP->CoordinateEntryList().begin();
397  vecite != optoP->CoordinateEntryList().end(); ++vecite) {
398  //T if( find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) ) == theAffectingEntryList.end() ){
399  //t theAffectingEntryList.push_back(*vecite);
400  //T }
401  fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) );
402  if (fvecite == theAffectingEntryList.end() ){
403  theAffectingEntryList.push_back(*vecite);
404  if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl;
405  }
406  }
407  for (vecite = optoP->ExtraEntryList().begin();
408  vecite != optoP->ExtraEntryList().end(); ++vecite) {
409  fvecite = find( theAffectingEntryList.begin(), theAffectingEntryList.end(), (*vecite) );
410  if (fvecite == theAffectingEntryList.end() ){
411  theAffectingEntryList.push_back(*vecite);
412  if(ALIUtils::debug >= 4) std::cout << "Entry that may affect Measurement: " << (*vecite)->name() << std::endl;
413  }
414  }
415  if(optoP->parent() != nullptr) {
417  }
418 }
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:36
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const OpticalObject * parent() const
Definition: OpticalObject.h:62
void addAffectingEntriesFromOptO(const OpticalObject *optoP)
Definition: Measurement.cc:390
std::vector< Entry * > theAffectingEntryList
Definition: Measurement.h:258
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 375 of file Measurement.cc.

References _OptOList, and addAffectingEntriesFromOptO().

Referenced by Measurement(), and postConstruct().

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

Definition at line 317 of file Measurement.cc.

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

Referenced by Measurement(), and postConstruct().

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

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

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

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

Definition at line 453 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().

Referenced by calculateSimulatedValue().

454 {
455  //---------- Calculate the simulated value of the Measurement
456  calculateSimulatedValue( true );
457 
458 #ifdef COCOA_VIS
459  if( ALIUtils::getFirstTime() ) {
461  if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
462  ALIVRMLMgr::getInstance().newLightRay();
463  }
464  /*- if(Model::GlobalOptions()["VisWriteIguana"] > 1) {
465  IgCocoaFileMgr::getInstance().newLightPath( theName );
466  } */
467  }
468 #endif
469 
470  //---------- Set original simulated values to it
471  //- if(ALIUtils::debug >= 5) std::cout << "MEAS DIMENSION" << dim() << std::endl;
472  for ( ALIuint ii = 0; ii < dim(); ii++) {
474  if ( ALIUtils::debug >= 4 ) std::cout << "SETsimuvalOriginal" << valueSimulated(ii) << std::endl;
475  //----- If Measurement has as value 'simulated_value', set the value to the simulated one
476  if( valueIsSimulated(ii) == 1 ){
478  //- std::cout << ii << " setting value as simulated " << valueSimulated(ii) << " " << value(ii) << this << std::endl;
479  }
480  }
481 
482 }
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:36
static GlobalOptionMgr * getInstance()
virtual void calculateSimulatedValue(ALIbool firstTime)
Definition: Measurement.h:51
ii
Definition: cuy.py:588
static ALIbool getFirstTime()
Definition: ALIUtils.h:101
void setValueSimulated_orig(ALIint coor, ALIdouble value)
Definition: Measurement.h:192
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:117
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 63 of file Measurement.cc.

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

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

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

Definition at line 96 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(), heppy_batch::val, valueDimensionFactor(), and OpticalAlignMeasurementInfo::values_.

Referenced by Model::BuildMeasurementsFromOA(), and setConversionFactor().

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

Definition at line 650 of file Measurement.cc.

References buildOptONamesList(), ALIUtils::changeName(), popcon2dropbox::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(), and setConversionFactor().

651 {
652  theDim = meas->dim();
653  theType = meas->type();
654  theName = ALIUtils::changeName( meas->name(), subsstr1, subsstr2);
655 
656  // _OptOnames = new ALIstring[theDim];
660  theValue = const_cast<ALIdouble*>(meas->value());
661  theSigma = const_cast<ALIdouble*>(meas->sigma());
662 
663  unsigned int ii;
664  for(ii = 0; ii < theDim; ii++) {
665  theValueSimulated[ii] = meas->valueSimulated( ii );
667  theValueIsSimulated[ii] = meas->valueIsSimulated( ii );
668  }
669 
670  //--------- Fill the list of names of OptOs that take part in this measurement ( names only )
671 
672  std::vector<std::string> wordlist;
673  auto &optolist = meas->OptOList();
674  ALIuint nOptos = optolist.size();
675  for ( ALIuint ii = 0; ii < nOptos; ii++ ) {
676  wordlist.push_back( ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) );
677  std::cout << " copymeas " << ALIUtils::changeName( optolist[ii]->longName(), subsstr1, subsstr2) << std::endl;
678  if( ii != nOptos -1 ) wordlist.push_back("&");
679  }
680 
681  buildOptONamesList( wordlist );
682 
683  if(ALIUtils::debug >= 3) {
684  std::cout << "@@@@ Reading Measurement " << name() << " TYPE= " << type() << std::endl
685  << " MEASURED OPTO NAMES: ";
686  std::ostream_iterator<ALIstring> outs(std::cout," ");
687  copy(wordlist.begin(), wordlist.end(), outs);
688  std::cout << std::endl;
689  }
690 
691 
692  postConstruct();
693 
694 }
ALIdouble * theValueSimulated
Definition: Measurement.h:243
long double ALIdouble
Definition: CocoaGlobals.h:11
bool valueIsSimulated(ALIint coor)
Definition: Measurement.h:205
def copy(args, dbName)
const ALIuint dim() const
Definition: Measurement.h:82
void postConstruct()
Definition: Measurement.cc:155
static ALIint debug
Definition: ALIUtils.h:36
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
ii
Definition: cuy.py:588
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
virtual void buildOptONamesList(const std::vector< ALIstring > &wl)
Definition: Measurement.cc:178
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 512 of file Measurement.cc.

References funct::abs(), calculateSimulatedValue(), MessageLogger_cfi::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.

Referenced by calculateSimulatedValue().

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

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

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

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

Definition at line 201 of file Measurement.cc.

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

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

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

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

279 {
280  if ( ALIUtils::debug >= 3 ) {
281  std::cout << "@@ Filling coordinate " << coor << std::endl ;
282  }
283 
284  // ParameterMgr* parmgr = ParameterMgr::getInstance();
285 
286  //---------- check coor value
287  if (coor >= theDim ) {
288  std::cerr << "Trying to fill Measurement coordinate No "
289  << coor << " but the dimension is " << theDim << std::endl;
290  exit(2);
291  }
292 
293  //---------- set data members
294  //----- Set value (translate it if a PARAMETER is used)
295  ALIdouble val = 0.;
296  theValueIsSimulated[coor] = false;
297  val = oaParam->value();
298  val *= valueDimensionFactor();
299  theValue[coor] = val;
300  if( ALIUtils::debug >= 3 ) std::cout << "Meas VALUE= " << val << " (ValueDimensionFactor= " << valueDimensionFactor() <<std::endl;
301 
302  ALIbool sigmaFF = GlobalOptionMgr::getInstance()->GlobalOptions()["measurementErrorFromFile"];
303  if( sigmaFF ) {
304  //----- Set sigma (translate it if a PARAMETER is used)
305  ALIdouble sig = 0.;
306  sig = oaParam->sigma(); // it is in mm always
307  sig *= sigmaDimensionFactor();
308  theSigma[coor] = sig;
309  if( ALIUtils::debug >= 3) std::cout << "SIGMA= " << sig << " (SigmaDimensionFactor= " << sigmaDimensionFactor() <<std::endl;
310 
311  }
312 }
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:36
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
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 592 of file Measurement.cc.

References _OptOList, and _OptONameList.

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

592  {
593  std::vector<ALIstring>::const_iterator vscite = _OptONameList.begin() +
594  ( vocite - _OptOList.begin() ); // point to corresponding name of this OptO
595  ALIint colon = (*vscite).find(':');
596  ALIstring behav;
597  if(colon != -1 ) {
598  behav = (*vscite).substr(colon+1,(*vscite).size());
599  } else {
600  behav = " ";
601  }
602  return behav;
603 }
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 609 of file Measurement.cc.

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

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

610 {
611  //--------- Loop OptOs that take part in this measurement
612  std::vector<OpticalObject*>::const_iterator vocite;
613  for( vocite = _OptOList.begin(); vocite != _OptOList.end(); ++vocite ){
614  if( *vocite == Popto ) {
615  if( vocite == _OptOList.begin() ) {
616  std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl;
617  std::cerr << " OptO " << Popto->name() << " is the first one " << std::endl;
618  exit(1);
619  } else {
620  return *(vocite-1);
621  }
622  }
623  }
624 
625  std::cerr << " ERROR in getPreviousOptO of measurement " << name() << std::endl;
626  std::cerr << " OptO " << Popto->name() << " not found " << std::endl;
627  exit(1);
628 }
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 155 of file Measurement.cc.

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

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

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

Definition at line 445 of file Measurement.cc.

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

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

446 {
447  std::cout << std::endl << "@@@ Start calculation of simulated value of " << meas->type() << " Measurement " << meas->name() << std::endl;
448 }
const ALIstring & type() const
Definition: Measurement.h:86
const ALIstring & name() const
Definition: Measurement.h:90
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
void Measurement::setCurrentDate ( const std::vector< ALIstring > &  wl)
static

set the date of the current measurement

Definition at line 632 of file Measurement.cc.

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

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

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

Definition at line 698 of file Measurement.cc.

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

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

699 {
700  // name already set by passing one argument with sensor type
701  if( theName != "" ) return;
702  if( _OptONameList.empty()) {
703  std::cerr << " !!! Error in your code, you cannot ask for the name of the Measurement before the OptONameList is build " << std::endl;
704  exit(9);
705  }
706  std::vector<ALIstring>::iterator vsite = (_OptONameList.end()-1);
707  theName = type() + ":" + (*vsite);
708 }
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, and heppy_batch::val.

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.

References cameraScaleFactor.

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  }
ALIdouble * theSigma
Definition: Measurement.h:238
ii
Definition: cuy.py:588
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:74
void Measurement::Substitute2p ( ALIstring ref,
const ALIstring firstref,
int  NtwoPoints 
)
protected

Definition at line 424 of file Measurement.cc.

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

Referenced by buildOptOList(), and setLightRayDirection().

425 {
426  // '/' sets hierarchy of OptOs
427  ALIstring slash("/");
428 
429  int pos1st = firstref.length();
430  // Go back an '/' in firstref for each '..' in ref
431  for (int ii=0; ii < Ntwopoints; ii++) {
432  pos1st = firstref.find_last_of( slash, pos1st-1);
433  if ( ALIUtils::debug >=9 ) std::cout << "pos1st=" << pos1st;
434  }
435 
436  if ( ALIUtils::debug >=9 ) std::cout << "before change ref: " << ref << " 1ref " << firstref << std::endl;
437  // Substitute name
438  ref.replace( 0, (Ntwopoints*3)-1, firstref, 0, pos1st);
439  if ( ALIUtils::debug >=9 ) std::cout << "after change ref: " << ref << " 1ref " << firstref << std::endl;
440 
441 }
static ALIint debug
Definition: ALIUtils.h:36
ii
Definition: cuy.py:588
std::string ALIstring
Definition: CocoaGlobals.h:9
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(), Types.double::insertInto(), Mixins.UsingBlock::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  }
ii
Definition: cuy.py:588
ALIdouble * theValueSimulated_orig
Definition: Measurement.h:245
const ALIstring Measurement::valueType ( ALIuint  ii) const
inline
virtual int Measurement::xlaserLine ( ALIuint  ii)
inlinevirtual

Reimplemented in MeasurementCOPS.

Definition at line 199 of file Measurement.h.

References MessageLogger_cfi::cerr, and setName().

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(), and setXlaserLine().

ALIbool Measurement::only1 = false
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().