CMS 3D CMS Logo

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

#include <MeasurementDiffEntry.h>

Inheritance diagram for MeasurementDiffEntry:
Measurement

Public Member Functions

virtual void buildOptONamesList (const std::vector< ALIstring > &wl)
 
virtual void calculateSimulatedValue (ALIbool firstTime)
 
 MeasurementDiffEntry (const ALIint measdim, ALIstring &type, ALIstring &name)
 
 MeasurementDiffEntry ()
 
 ~MeasurementDiffEntry ()
 
- 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 (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 ()
 

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 = 0
 
static ALIstring only1Date = ""
 
static ALIstring only1Time = ""
 
- Protected Member Functions inherited from Measurement
void printStartCalculateSimulatedValue (const Measurement *meas)
 
void Substitute2p (ALIstring &ref, const ALIstring &firstref, int NtwoPoints)
 

Detailed Description

Definition at line 18 of file MeasurementDiffEntry.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file MeasurementDiffEntry.h.

22  : Measurement( measdim, type, name ){};
type
Definition: HCALResponse.h:21
const ALIstring & name() const
Definition: Measurement.h:90
MeasurementDiffEntry::MeasurementDiffEntry ( )
inline

Definition at line 23 of file MeasurementDiffEntry.h.

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

Definition at line 24 of file MeasurementDiffEntry.h.

24 { };

Member Function Documentation

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

Reimplemented from Measurement.

Definition at line 25 of file MeasurementDiffEntry.cc.

References Measurement::AddOptONameListItem(), ecal_dqm_sourceclient-live_cfg::cerr, ALIFileIn::ErrorInLine(), cmsRelvalreport::exit, ALIFileIn::getInstance(), cuy::ii, Model::SDFName(), theEntryNameFirst, and theEntryNameSecond.

26 {
27 
28  int NPairs = (wl.size()+1)/2; // Number of OptO names ( pair of name and '&' )
29 
30  //--------- Fill list with names
31  for ( int ii=0; ii<NPairs; ii++ ) {
32  //--- take out Entry names from object names
33  int isl = wl[ii*2].rfind("/");
34  AddOptONameListItem( wl[ii*2].substr(0,isl) );
35  // Check for separating '&'
36  if (ii != NPairs-1 && wl[2*ii+1] != ALIstring("&") ) {
38  std::cerr << "!!! Measured Optical Objects should be separated by '&', not by"
39  << wl[2*ii+1] << std::endl;
40  exit(2);
41  }
42  //---- Fill entry names
43  if( ii == 0 ){
44  theEntryNameFirst = wl[ii*2].substr(isl+1,999);
45  }else if( ii == 1 ){
46  theEntryNameSecond = wl[ii*2].substr(isl+1,999);
47  }
48 
49  }
50 
51 }
static ALIFileIn & getInstance(const ALIstring &name)
Definition: ALIFileIn.cc:23
static ALIstring & SDFName()
the name of the System Description File
Definition: Model.h:86
int ii
Definition: cuy.py:588
void AddOptONameListItem(ALIstring optos)
Definition: Measurement.h:184
void ErrorInLine()
Definition: ALIFileIn.cc:204
std::string ALIstring
Definition: CocoaGlobals.h:9
void MeasurementDiffEntry::calculateSimulatedValue ( ALIbool  firstTime)
virtual

Reimplemented from Measurement.

Definition at line 56 of file MeasurementDiffEntry.cc.

References begin, ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), alignCSCRings::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().

57 {
58 
59  if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas
60 
61  //---------- Loop list of OptO that take part in measurement
62  std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin();
63  if( ALIUtils::debug >= 5) std::cout << "OptOList size" <<OptOList().size() << std::endl;
64 
65  //----- Check that there are only two objects
66  if( OptOList().size() == !2 ) {
67  std::cerr << "!!! ERROR in MeasurementDiffEntry: " << name() << " There should only be two objects " << std::endl;
68  std::cerr << " 1st " << (*vocite)->name() << " 2nd " << (*vocite+1)->name() << std::endl;
71  }
72 
73 #ifdef COCOA_VIS
74  ALIVisLightPath* vispath = 0;
75  if( ALIUtils::getFirstTime() ) {
77  if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
78  vispath = IgCocoaFileMgr::getInstance().newLightPath( name() );
79  }
80  }
81 #endif
82 
83  //--- 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)
84  Entry* entry1 = Model::getEntryByName( (*(OptOList().begin()))->longName(), theEntryNameFirst );
85  Entry* entry2 = Model::getEntryByName( (*(OptOList().begin()+1))->longName(), theEntryNameSecond );
86  if( ALIUtils::debug >= 5) std::cout << " entry1 " << (*(OptOList().begin()))->longName() << "/" << entry1->name() << " ->valueDisplaced() " << entry1->valueDisplaced() << " entry2 " << (*(OptOList().begin()+1))->longName() << "/" << entry2->name() << " ->valueDisplaced() " << entry2->valueDisplaced() << std::endl;
87  setValueSimulated( 0, entry1->valueDisplaced() - entry2->valueDisplaced() );
88 
89  if (ALIUtils::debug >= 2) {
90  ALIdouble detD = 1000*valueSimulated(0); if(fabs(detD) <= 1.e-9 ) detD = 0.;
91  std::cout << "REAL value: " <<"D: " << 1000.*value()[0] << " (mm) " << (this)->name()
92  << " DIFF= " << detD-1000*value()[0] << std::endl;
93  std::cout << "SIMU value: " << "D: " << detD << " (mm) " << (this)->name() << std::endl;
94  }
95 
96  if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl;
97 
98 }
long double ALIdouble
Definition: CocoaGlobals.h:11
Definition: Entry.h:18
static ALIint debug
Definition: ALIUtils.h:35
static GlobalOptionMgr * getInstance()
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:633
void DumpBadOrderOptOs()
Definition: Measurement.cc:487
void setValueSimulated(ALIint coor, ALIdouble value)
Definition: Measurement.h:196
const ALIstring & name() const
Definition: Entry.h:52
const std::vector< OpticalObject * > & OptOList() const
Definition: Measurement.h:109
static ALIbool getFirstTime()
Definition: ALIUtils.h:100
const ALIdouble * value() const
Definition: Measurement.h:125
#define begin
Definition: vmac.h:30
void printStartCalculateSimulatedValue(const Measurement *meas)
Definition: Measurement.cc:444
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 ALIdouble valueDisplaced() const
Definition: Entry.cc:342
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
tuple size
Write out results.

Member Data Documentation

ALIstring MeasurementDiffEntry::theEntryNameFirst
private

Definition at line 33 of file MeasurementDiffEntry.h.

Referenced by buildOptONamesList(), and calculateSimulatedValue().

ALIstring MeasurementDiffEntry::theEntryNameSecond
private

Definition at line 34 of file MeasurementDiffEntry.h.

Referenced by buildOptONamesList(), and calculateSimulatedValue().