CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MeasurementDiffEntry Class Reference

#include <MeasurementDiffEntry.h>

Inheritance diagram for MeasurementDiffEntry:
Measurement

Public Member Functions

void buildOptONamesList (const std::vector< ALIstring > &wl) override
 
void calculateSimulatedValue (ALIbool firstTime) override
 
 MeasurementDiffEntry ()
 
 MeasurementDiffEntry (const ALIint measdim, ALIstring &type, ALIstring &name)
 
 ~MeasurementDiffEntry () override
 
- Public Member Functions inherited from Measurement
void addAffectingEntriesFromOptO (const OpticalObject *optoP)
 
void AddOptOListItem (OpticalObject *opto)
 
void AddOptONameListItem (ALIstring optos)
 
const std::vector< Entry * > & affectingEntryList () const
 
void buildAffectingEntryList ()
 
void buildOptOList ()
 
void calculateOriginalSimulatedValue ()
 
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 ()
 
 Measurement (const ALIint measdim, ALIstring &type, ALIstring &name)
 
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 ()
 

Private Attributes

ALIstring theEntryNameFirst
 
ALIstring theEntryNameSecond
 

Additional Inherited Members

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

Detailed Description

Definition at line 18 of file MeasurementDiffEntry.h.

Constructor & Destructor Documentation

◆ MeasurementDiffEntry() [1/2]

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

Definition at line 20 of file MeasurementDiffEntry.h.

20 : Measurement(measdim, type, name){};

◆ MeasurementDiffEntry() [2/2]

MeasurementDiffEntry::MeasurementDiffEntry ( )
inline

Definition at line 21 of file MeasurementDiffEntry.h.

21 {};

◆ ~MeasurementDiffEntry()

MeasurementDiffEntry::~MeasurementDiffEntry ( )
inlineoverride

Definition at line 22 of file MeasurementDiffEntry.h.

22 {};

Member Function Documentation

◆ buildOptONamesList()

void MeasurementDiffEntry::buildOptONamesList ( const std::vector< ALIstring > &  wl)
overridevirtual

Reimplemented from Measurement.

Definition at line 25 of file MeasurementDiffEntry.cc.

25  {
26  int NPairs = (wl.size() + 1) / 2; // Number of OptO names ( pair of name and '&' )
27 
28  //--------- Fill list with names
29  for (int ii = 0; ii < NPairs; ii++) {
30  //--- take out Entry names from object names
31  int isl = wl[ii * 2].rfind('/');
32  AddOptONameListItem(wl[ii * 2].substr(0, isl));
33  // Check for separating '&'
34  if (ii != NPairs - 1 && wl[2 * ii + 1] != ALIstring("&")) {
36  std::cerr << "!!! Measured Optical Objects should be separated by '&', not by" << wl[2 * ii + 1] << std::endl;
37  exit(2);
38  }
39  //---- Fill entry names
40  if (ii == 0) {
41  theEntryNameFirst = wl[ii * 2].substr(isl + 1, 999);
42  } else if (ii == 1) {
43  theEntryNameSecond = wl[ii * 2].substr(isl + 1, 999);
44  }
45  }
46 }

References Measurement::AddOptONameListItem(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, ALIFileIn::ErrorInLine(), beamvalidation::exit(), ALIFileIn::getInstance(), cuy::ii, Model::SDFName(), theEntryNameFirst, theEntryNameSecond, and LaserClient_cfi::wl.

◆ calculateSimulatedValue()

void MeasurementDiffEntry::calculateSimulatedValue ( ALIbool  firstTime)
overridevirtual

Reimplemented from Measurement.

Definition at line 51 of file MeasurementDiffEntry.cc.

51  {
52  if (ALIUtils::debug >= 2)
53  printStartCalculateSimulatedValue(this); // important for Examples/FakeMeas
54 
55  //---------- Loop list of OptO that take part in measurement
56  std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin();
57  if (ALIUtils::debug >= 5)
58  std::cout << "OptOList size" << OptOList().size() << std::endl;
59 
60  //----- Check that there are only two objects
61  if (OptOList().size() == !true) {
62  std::cerr << "!!! ERROR in MeasurementDiffEntry: " << name() << " There should only be two objects " << std::endl;
63  std::cerr << " 1st " << (*vocite)->name() << " 2nd " << (*vocite + 1)->name() << std::endl;
66  }
67 
68 #ifdef COCOA_VIS
69  ALIVisLightPath* vispath = 0;
70  if (ALIUtils::getFirstTime()) {
72  if (gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
73  vispath = IgCocoaFileMgr::getInstance().newLightPath(name());
74  }
75  }
76 #endif
77 
78  //--- This is a special 'measurement': it represents the fact that you have measured two entries one relative to the other (e.g. relative angle of two objects)
79  Entry* entry1 = Model::getEntryByName((*(OptOList().begin()))->longName(), theEntryNameFirst);
80  Entry* entry2 = Model::getEntryByName((*(OptOList().begin() + 1))->longName(), theEntryNameSecond);
81  if (ALIUtils::debug >= 5)
82  std::cout << " entry1 " << (*(OptOList().begin()))->longName() << "/" << entry1->name() << " ->valueDisplaced() "
83  << entry1->valueDisplaced() << " entry2 " << (*(OptOList().begin() + 1))->longName() << "/"
84  << entry2->name() << " ->valueDisplaced() " << entry2->valueDisplaced() << std::endl;
85  setValueSimulated(0, entry1->valueDisplaced() - entry2->valueDisplaced());
86 
87  if (ALIUtils::debug >= 2) {
88  ALIdouble detD = 1000 * valueSimulated(0);
89  if (std::abs(detD) <= 1.e-9)
90  detD = 0.;
91  std::cout << "REAL value: "
92  << "D: " << 1000. * value()[0] << " (mm) " << (this)->name() << " DIFF= " << detD - 1000 * value()[0]
93  << std::endl;
94  std::cout << "SIMU value: "
95  << "D: " << detD << " (mm) " << (this)->name() << std::endl;
96  }
97 
98  if (ALIUtils::debug >= 5)
99  std::cout << "end calculateSimulatedValue" << std::endl;
100 }

References funct::abs(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, Model::getEntryByName(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), Entry::name(), Measurement::name(), Measurement::OptOList(), Measurement::printStartCalculateSimulatedValue(), Measurement::setValueSimulated(), findQualityFiles::size, theEntryNameFirst, theEntryNameSecond, Measurement::value(), Entry::valueDisplaced(), and Measurement::valueSimulated().

Member Data Documentation

◆ theEntryNameFirst

ALIstring MeasurementDiffEntry::theEntryNameFirst
private

Definition at line 31 of file MeasurementDiffEntry.h.

Referenced by buildOptONamesList(), and calculateSimulatedValue().

◆ theEntryNameSecond

ALIstring MeasurementDiffEntry::theEntryNameSecond
private

Definition at line 32 of file MeasurementDiffEntry.h.

Referenced by buildOptONamesList(), and calculateSimulatedValue().

Measurement::printStartCalculateSimulatedValue
void printStartCalculateSimulatedValue(const Measurement *meas)
Definition: Measurement.cc:427
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
GlobalOptionMgr::GlobalOptions
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
Definition: GlobalOptionMgr.h:31
GlobalOptionMgr
Definition: GlobalOptionMgr.h:18
Measurement::AddOptONameListItem
void AddOptONameListItem(ALIstring optos)
Definition: Measurement.h:140
GlobalOptionMgr::getInstance
static GlobalOptionMgr * getInstance()
Definition: GlobalOptionMgr.cc:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Model::getEntryByName
static Entry * getEntryByName(const ALIstring &opto_name, const ALIstring &entry_name)
--— Search an Entry name in the Entry* list and return a pointer to it
Definition: Model.cc:623
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
Entry::name
const ALIstring & name() const
Definition: Entry.h:50
Measurement::setValueSimulated
void setValueSimulated(ALIint coor, ALIdouble value)
Definition: Measurement.h:146
Model::SDFName
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:93
Measurement::Measurement
Measurement()
Definition: Measurement.h:31
ALIUtils::getFirstTime
static ALIbool getFirstTime()
Definition: ALIUtils.h:87
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
ALIFileIn::getInstance
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:22
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
ALIFileIn::ErrorInLine
void ErrorInLine()
Definition: ALIFileIn.cc:196
MeasurementDiffEntry::theEntryNameSecond
ALIstring theEntryNameSecond
Definition: MeasurementDiffEntry.h:32
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
Measurement::OptOList
const std::vector< OpticalObject * > & OptOList() const
Definition: Measurement.h:101
Entry
Definition: Entry.h:18
Measurement::DumpBadOrderOptOs
void DumpBadOrderOptOs()
Definition: Measurement.cc:469
Entry::valueDisplaced
virtual ALIdouble valueDisplaced() const
Definition: Entry.cc:311
MeasurementDiffEntry::theEntryNameFirst
ALIstring theEntryNameFirst
Definition: MeasurementDiffEntry.h:31
Measurement::valueSimulated
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:105
Measurement::name
const ALIstring & name() const
Definition: Measurement.h:86
Measurement::value
const ALIdouble * value() const
Definition: Measurement.h:109
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
cuy.ii
ii
Definition: cuy.py:590
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37