test
CMS 3D CMS Logo

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

#include <MeasurementTiltmeter.h>

Inheritance diagram for MeasurementTiltmeter:
Measurement

Public Member Functions

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

Private Attributes

ALIdouble theConstantTerm
 
ALIdouble theConstantTermSigma
 
ALIdouble theFactor
 
ALIdouble theFactorSigma
 
ALIdouble thePedestal
 
ALIdouble thePedestalSigma
 

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 MeasurementTiltmeter.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file MeasurementTiltmeter.h.

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

Definition at line 23 of file MeasurementTiltmeter.h.

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

Definition at line 24 of file MeasurementTiltmeter.h.

24 { };

Member Function Documentation

void MeasurementTiltmeter::calculateSimulatedValue ( ALIbool  firstTime)
virtual

Reimplemented from Measurement.

Definition at line 20 of file MeasurementTiltmeter.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), cmsRelvalreport::exit, Measurement::getMeasuringBehaviour(), Measurement::name(), Measurement::OptOList(), Measurement::printStartCalculateSimulatedValue(), and findQualityFiles::size.

21 {
22 
23  if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas
24 
25  //--------- Check there is only one OptO of type 'tiltmeter'
26  std::vector<OpticalObject*>::const_iterator vocite = OptOList().begin();
27  if( OptOList().size() != 1 ||
28  (*vocite)->type() == "distancemeter") {
29  std::cerr << "!!! ERROR in MeasurementTiltmeter: " << name() << " There should only be one object of type 'tiltmeter' " << std::endl;
31  exit(1);
32  }
33 
34  //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...)
35  ALIstring behav = getMeasuringBehaviour(vocite);
36 
37  //---------- participate in Measurement
38  LightRay ll;
39  (*vocite)->participateInMeasurement( ll, *this, behav );
40 
41  if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl;
42 
43 }
static ALIint debug
Definition: ALIUtils.h:35
ALIstring getMeasuringBehaviour(const std::vector< OpticalObject * >::const_iterator vocite)
Definition: Measurement.cc:592
void DumpBadOrderOptOs()
Definition: Measurement.cc:488
const std::vector< OpticalObject * > & OptOList() const
Definition: Measurement.h:109
std::string ALIstring
Definition: CocoaGlobals.h:9
void printStartCalculateSimulatedValue(const Measurement *meas)
Definition: Measurement.cc:445
const ALIstring & name() const
Definition: Measurement.h:90
tuple cout
Definition: gather_cfg.py:145
tuple size
Write out results.
void MeasurementTiltmeter::correctValueAndSigma ( )
virtual

Reimplemented from Measurement.

Definition at line 100 of file MeasurementTiltmeter.cc.

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

101 {
102  ALIdouble val = value()[0];
103  ALIdouble sig = sigma()[0];
104  if(ALIUtils::debug >= 4) std::cout << "MeasurementTiltmeter::correctValueAndSigma: old value" << val << " +- " << sig << std::endl;
105  //---------- Substract pedestal
106  val -= theConstantTerm;
107  //- sig = sqrt(sig*sig + thePedestalSigma*thePedestalSigma );
108  //- std::cout << " sigma + pedestalSigma " << sig << " " << thePedestalSigma << std::endl;
109  //-if( thePedestal != 0. ) {
110  //- sig += sqrt( sig*sig + val*val*thePedestalSigma*thePedestalSigma/thePedestal/thePedestal );
111  //-}
112  //---------- Add error in constant term
114  //- std::cout << " sigma + costantTermSigma " << sig << " " << theConstantTermSigma << std::endl;
115 
116  //---------- Convert to rad
117  //- std::cout << "FACTOR " << theFactor << "correct " << val << " " << thePedestal << std::endl;
118  val *= theFactor;
119  //-------- Do not correct the sigma!!!!
120  //- sig /= theFactor;
121  if(ALIUtils::debug >= 4) std::cout << "MeasurementTiltmeter::correctValueAndSigma: new value " << val << " +- " << sig << std::endl;
122  setValue( 0, val );
123  setSigma( 0, sig );
124 
125 }
long double ALIdouble
Definition: CocoaGlobals.h:11
void setValue(ALIint coor, ALIdouble val)
Definition: Measurement.h:167
static ALIint debug
Definition: ALIUtils.h:35
void setSigma(ALIint coor, ALIdouble val)
Definition: Measurement.h:171
const ALIdouble * sigma() const
Definition: Measurement.h:132
T sqrt(T t)
Definition: SSEVec.h:18
const ALIdouble * value() const
Definition: Measurement.h:125
tuple cout
Definition: gather_cfg.py:145
void MeasurementTiltmeter::setConversionFactor ( const std::vector< ALIstring > &  wordlist)
virtual

Reimplemented from Measurement.

Definition at line 52 of file MeasurementTiltmeter.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, ALIUtils::dumpVS(), cmsRelvalreport::exit, GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), ALIUtils::IsNumber(), Measurement::sigmaDimensionFactor(), theConstantTerm, theConstantTermSigma, theFactor, theFactorSigma, and Measurement::valueDimensionFactor().

53 {
54  //--------- Check that the format is OK
55  if(wordlist.size() == 1) return;
56  if( wordlist.size() != 7
57  || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[3])
58  || !ALIUtils::IsNumber(wordlist[4]) || !ALIUtils::IsNumber(wordlist[6])
59  || wordlist[2] != ALIstring("+-")|| wordlist[5] != ALIstring("+-") ){
60  std::cerr << "!! Tiltmeter Measurement setConversionFactor: WRONG FORMAT "<< std::endl
61  << "It should be: TILTEMETER factor +- error constant_term +- error"
62  << (wordlist.size() != 7)
63  << !ALIUtils::IsNumber(wordlist[1]) << !ALIUtils::IsNumber(wordlist[3])
64  << !ALIUtils::IsNumber(wordlist[4]) << !ALIUtils::IsNumber(wordlist[6])
65  // << (wordlist[2] != ALIstring("+-")) << (wordlist[5] != ALIstring("+-"))
66 << std::endl
67  << "It is: ";
68  ALIUtils::dumpVS( wordlist, " ", std::cerr );
69  exit(1);
70  }
71  theFactor = atof(wordlist[1].c_str());
72 
73  //------ correct by dimension of value of tiltmeter
75  ALIint dimfac = ALIint( gomgr->GlobalOptions()[ ALIstring("tiltmeter_meas_value_dimension") ] );
76  if( dimfac == 0 ) {
77  theFactor *= 1.;
78  } else if( dimfac == 1 ) {
79  theFactor *= 1.E-3;
80  } else if( dimfac == 2 ) {
81  theFactor *= 1.E-6;
82  } else {
83  std::cerr << " !!!EXITING: error in global option tiltmeter_meas_value_dimension, it can only take values 0,1,2, not " << dimfac;
84  }
85  theFactorSigma = atof(wordlist[3].c_str());
86  theConstantTerm = atof(wordlist[4].c_str()) * valueDimensionFactor();
87  theConstantTermSigma = atof(wordlist[6].c_str()) * sigmaDimensionFactor();
88  //- std::cout << "correctVal theConstantTerm" << theConstantTerm << valueDimensionFactor() << std::endl;
89  //----- Change value and sigma to dimensions used in SDF, because constant term and pedestal are in dimensions of SDF
90  //- thePedestal = atof(wordlist[7].c_str()) * valueDimensionFactor();
91  //-thePedestalSigma = atof(wordlist[9].c_str()) * sigmaDimensionFactor();
92  // std::cout << "reading thePedestalSigma " << thePedestalSigma << "= " << wordlist[9] << std::endl;
93  // TILTMETER 458.84 +- 1.58 0. +- 0. 1 +- 0
94 }
virtual const ALIdouble sigmaDimensionFactor() const
Definition: Measurement.h:148
virtual const ALIdouble valueDimensionFactor() const
Definition: Measurement.h:144
int ALIint
Definition: CocoaGlobals.h:15
static GlobalOptionMgr * getInstance()
static int IsNumber(const ALIstring &str)
Definition: ALIUtils.cc:34
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
Definition: ALIUtils.cc:501
std::string ALIstring
Definition: CocoaGlobals.h:9
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()

Member Data Documentation

ALIdouble MeasurementTiltmeter::theConstantTerm
private

Definition at line 38 of file MeasurementTiltmeter.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementTiltmeter::theConstantTermSigma
private

Definition at line 39 of file MeasurementTiltmeter.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementTiltmeter::theFactor
private

Definition at line 36 of file MeasurementTiltmeter.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementTiltmeter::theFactorSigma
private

Definition at line 37 of file MeasurementTiltmeter.h.

Referenced by setConversionFactor().

ALIdouble MeasurementTiltmeter::thePedestal
private

Definition at line 40 of file MeasurementTiltmeter.h.

ALIdouble MeasurementTiltmeter::thePedestalSigma
private

Definition at line 41 of file MeasurementTiltmeter.h.