CMS 3D CMS Logo

MeasurementSensor2D Class Reference

#include <Alignment/CocoaModel/interface/MeasurementSensor2D.h>

Inheritance diagram for MeasurementSensor2D:

Measurement

List of all members.

Public Member Functions

virtual void calculateSimulatedValue (ALIbool firstTime)
virtual void correctValueAndSigma ()
 MeasurementSensor2D ()
 MeasurementSensor2D (const ALIint measdim, ALIstring &type, ALIstring &name)
virtual void setConversionFactor (const std::vector< ALIstring > &wordlist)
 ~MeasurementSensor2D ()

Private Attributes

ALIdouble theDisplaceX
ALIdouble theDisplaceY
ALIdouble theMultiplyX
ALIdouble theMultiplyY


Detailed Description

Definition at line 18 of file MeasurementSensor2D.h.


Constructor & Destructor Documentation

MeasurementSensor2D::MeasurementSensor2D ( const ALIint  measdim,
ALIstring type,
ALIstring name 
) [inline]

Definition at line 21 of file MeasurementSensor2D.h.

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

MeasurementSensor2D::MeasurementSensor2D (  )  [inline]

Definition at line 22 of file MeasurementSensor2D.h.

00022 { };   

MeasurementSensor2D::~MeasurementSensor2D (  )  [inline]

Definition at line 23 of file MeasurementSensor2D.h.

00023 { };


Member Function Documentation

void MeasurementSensor2D::calculateSimulatedValue ( ALIbool  firstTime  )  [virtual]

Reimplemented from Measurement.

Definition at line 24 of file MeasurementSensor2D.cc.

References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), end, lat::endl(), cmsRelvalreport::exit, ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), Measurement::getMeasuringBehaviour(), GlobalOptionMgr::GlobalOptions(), Measurement::name(), Measurement::OptOList(), LightRay::point(), Measurement::printStartCalculateSimulatedValue(), and size.

00025 {
00026  
00027   if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important
00028   //---------- Create light ray
00029   LightRay lightray;
00030 
00031   int isec = 0;  //security variable to check OptOList().size()
00032 
00033   //---------- Loop list of OptO that take part in measurement
00034   std::vector<OpticalObject*>::const_iterator vocite =  OptOList().begin();
00035   //-  if( ALIUtils::debug >= 5) std::cout  << "OptOList size" <<OptOList().size() << std::endl;
00036 
00037   //----- Check that first object is 'laser' or 'source'
00038   if( (*vocite)->type() != "laser" && (*vocite)->type() != "source" ) { 
00039     std::cerr << " first Optical object should be 'laser' or 'source'" << std::endl;
00040     DumpBadOrderOptOs();
00041     exit(1);
00042   }     
00043 #ifdef COCOA_VIS
00044   ALIVisLightPath* vispath = 0;
00045   if( ALIUtils::getFirstTime() ) {
00046     GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00047     if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
00048       vispath = IgCocoaFileMgr::getInstance().newLightPath( name() );
00049     } 
00050   }
00051 #endif
00052 
00053   //-  while( (*vocite) !=  *(OptOList().end()) ) {
00054   while( (vocite) !=  (OptOList().end()) ) {
00055     if( ALIUtils::debug >= 2) std::cout << std::endl << "@@@@ LR:OBJECT " << (*vocite)->name() << std::endl;  
00056     isec ++;
00057 
00058     //---------- Get the behaviour of the object w.r.t the measurement (if it reflects the light, let it traverse it, ...)
00059     ALIstring behav = getMeasuringBehaviour(vocite);
00060 
00061     //---------- Check that last object is a Sensor (that makes measuremnt and kill the lightray)
00062     if( &lightray ) {
00063       (*vocite)->participateInMeasurement( lightray, *this, behav );
00064 
00065 #ifdef COCOA_VIS
00066       if( ALIUtils::getFirstTime() ) {
00067         GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00068         if(gomgr->GlobalOptions()["VisWriteVRML"] > 1) {
00069           ALIVRMLMgr::getInstance().addLightPoint( lightray.point() );
00070           if(ALIUtils::debug >= 5)std::cout << "ALIVRMLMg  addLightPoint " << lightray.point() << (*vocite)->name() << std::endl;
00071         }
00072         if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
00073           vispath->addLightPoint( lightray.point(), (*vocite) );
00074         }
00075       }
00076 #endif
00077 
00078     } else {
00079       std::cerr << "!! Last object is not Sensor 2D in measurement " << name() << std::endl;
00080       DumpBadOrderOptOs();
00081       exit(1);
00082     }
00083 
00084     vocite++;
00085     if ( isec > OptOList().size() ) {
00086       std::cerr << "ERROR DE PROGRAMACION EN GetSimulatedValue" << std::endl;
00087       exit(5);
00088     }
00089     //-    lightray.normalizeDirection();
00090   }
00091 
00092   //  delete lightray;
00093  
00094   if(ALIUtils::debug >= 9) std::cout << "end calculateSimulatedValue" <<std::endl;
00095   
00096 }

void MeasurementSensor2D::correctValueAndSigma (  )  [virtual]

Reimplemented from Measurement.

Definition at line 138 of file MeasurementSensor2D.cc.

References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, lat::endl(), Measurement::setValue(), theDisplaceX, theDisplaceY, theMultiplyX, theMultiplyY, and Measurement::value().

00139 {
00140    //---------- Make  displacement
00141   ALIdouble val = value()[0];
00142   val += theDisplaceX;
00143   val *= theMultiplyX;
00144   //-  std::cout << " theDisplaceX " <<  theDisplaceX << " theMultiplyX " << theMultiplyX << std::endl;
00145   if(ALIUtils::debug >= 4) std::cout << "MeasurementSensor2D::correctValueAndSigma: " << " old value X " << value()[0] << " new " << val << std::endl;
00146   setValue( 0, val );
00147 
00148   val = value()[1];
00149   val += theDisplaceY;
00150   val *= theMultiplyY;
00151   if(ALIUtils::debug >= 4) std::cout << "MeasurementSensor2D::correctValueAndSigma: old value Y " << value()[1] << " new " << val << std::endl;
00152   setValue( 1, val );
00153 
00154 }

void MeasurementSensor2D::setConversionFactor ( const std::vector< ALIstring > &  wordlist  )  [virtual]

Reimplemented from Measurement.

Definition at line 105 of file MeasurementSensor2D.cc.

References TestMuL1L2Filter_cff::cerr, ALIUtils::dumpVS(), lat::endl(), cmsRelvalreport::exit, ALIUtils::IsNumber(), theDisplaceX, theDisplaceY, theMultiplyX, theMultiplyY, and Measurement::valueDimensionFactor().

00106 {
00107   //--------- Check that the format is OK
00108   theDisplaceX = 0;
00109   theDisplaceY = 0;
00110   theMultiplyX = 1.;
00111   theMultiplyY = 1.;
00112   //-  std::cout << " 0 factors for correction X = " << theDisplaceX << " Y " << theDisplaceY << std::endl;
00113  
00114   if(wordlist.size() == 1) return; 
00115   if( (wordlist.size() != 3 && wordlist.size() != 5 )
00116       || !ALIUtils::IsNumber(wordlist[1]) || !ALIUtils::IsNumber(wordlist[2]) ) {
00117     std::cerr << "!! Sensor2D Measurement setConversionFactor: WRONG FORMAT "<<  std::endl 
00118          << "It should be: SENSOR2D displace_X displace_Y " << std::endl 
00119          << "It is: ";
00120     ALIUtils::dumpVS( wordlist, " ", std::cerr );
00121     exit(1);
00122   }
00123   theDisplaceX = atof(wordlist[1].c_str())* valueDimensionFactor();
00124   theDisplaceY = atof(wordlist[2].c_str())* valueDimensionFactor();
00125   //-  std::cout << " factors for correction X = " << theDisplaceX << " Y " << theDisplaceY << std::endl;
00126 
00127   if( wordlist.size() == 5 ) {
00128     theMultiplyX = atof(wordlist[3].c_str());
00129     theMultiplyY = atof(wordlist[4].c_str());
00130   } else {
00131     theMultiplyX = 1.;
00132     theMultiplyY = 1.;
00133   }  
00134 }


Member Data Documentation

ALIdouble MeasurementSensor2D::theDisplaceX [private]

Definition at line 36 of file MeasurementSensor2D.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementSensor2D::theDisplaceY [private]

Definition at line 36 of file MeasurementSensor2D.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementSensor2D::theMultiplyX [private]

Definition at line 37 of file MeasurementSensor2D.h.

Referenced by correctValueAndSigma(), and setConversionFactor().

ALIdouble MeasurementSensor2D::theMultiplyY [private]

Definition at line 37 of file MeasurementSensor2D.h.

Referenced by correctValueAndSigma(), and setConversionFactor().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:11 2009 for CMSSW by  doxygen 1.5.4