CMS 3D CMS Logo

MeasurementDiffEntry Class Reference

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

Inheritance diagram for MeasurementDiffEntry:

Measurement

List of all members.

Public Member Functions

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

Private Attributes

ALIstring theEntryNameFirst
ALIstring theEntryNameSecond


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.

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

MeasurementDiffEntry::MeasurementDiffEntry (  )  [inline]

Definition at line 23 of file MeasurementDiffEntry.h.

00023 { };   

MeasurementDiffEntry::~MeasurementDiffEntry (  )  [inline]

Definition at line 24 of file MeasurementDiffEntry.h.

00024 { };


Member Function Documentation

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

Reimplemented from Measurement.

Definition at line 24 of file MeasurementDiffEntry.cc.

References Measurement::AddOptONameListItem(), TestMuL1L2Filter_cff::cerr, lat::endl(), ALIFileIn::ErrorInLine(), cmsRelvalreport::exit, ALIFileIn::getInstance(), Model::SDFName(), theEntryNameFirst, and theEntryNameSecond.

00025 {
00026 
00027   int NPairs = (wl.size()+1)/2;   // Number of OptO names ( pair of name and '&' )
00028 
00029   //--------- Fill list with names 
00030   for ( int ii=0; ii<NPairs; ii++ ) {
00031     //--- take out Entry names from object names
00032     int isl = wl[ii*2].rfind("/");
00033     AddOptONameListItem( wl[ii*2].substr(0,isl) );
00034     // Check for separating '&'
00035     if (ii != NPairs-1 && wl[2*ii+1] != ALIstring("&") ) {
00036       ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
00037       std::cerr << "!!! Measured Optical Objects should be separated by '&', not by" 
00038                 << wl[2*ii+1] << std::endl; 
00039       exit(2);
00040     }
00041     //---- Fill entry names
00042     if( ii == 0 ){
00043       theEntryNameFirst = wl[ii*2].substr(isl+1,999);
00044     }else if( ii == 1 ){
00045       theEntryNameSecond = wl[ii*2].substr(isl+1,999);
00046     }
00047 
00048   }
00049  
00050 }

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

Reimplemented from Measurement.

Definition at line 55 of file MeasurementDiffEntry.cc.

References begin, TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, Measurement::DumpBadOrderOptOs(), e, lat::endl(), exception, Model::getEntryByName(), ALIUtils::getFirstTime(), GlobalOptionMgr::getInstance(), GlobalOptionMgr::GlobalOptions(), Measurement::name(), Entry::name(), Measurement::OptOList(), Measurement::printStartCalculateSimulatedValue(), Measurement::setValueSimulated(), size, theEntryNameFirst, theEntryNameSecond, Measurement::value(), Entry::valueDisplaced(), and Measurement::valueSimulated().

00056 {
00057  
00058   if( ALIUtils::debug >= 2) printStartCalculateSimulatedValue( this ); // important for Examples/FakeMeas
00059 
00060   //---------- Loop list of OptO that take part in measurement
00061   std::vector<OpticalObject*>::const_iterator vocite =  OptOList().begin();
00062   if( ALIUtils::debug >= 5) std::cout  << "OptOList size" <<OptOList().size() << std::endl;
00063 
00064   //----- Check that there are only two objects
00065   if( OptOList().size() == !2 ) {
00066     std::cerr << "!!! ERROR in MeasurementDiffEntry: " << name() << " There should only be two objects " << std::endl;
00067     std::cerr << " 1st " << (*vocite)->name() << " 2nd " << (*vocite+1)->name()  << std::endl;
00068     DumpBadOrderOptOs();
00069     std::exception();
00070   }     
00071 
00072 #ifdef COCOA_VIS
00073   ALIVisLightPath* vispath = 0;
00074   if( ALIUtils::getFirstTime() ) {
00075     GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00076     if(gomgr->GlobalOptions()["VisWriteIguana"] > 1) {
00077       vispath = IgCocoaFileMgr::getInstance().newLightPath( name() );
00078     } 
00079   }
00080 #endif
00081 
00082   //--- 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)
00083   Entry* entry1 = Model::getEntryByName( (*(OptOList().begin()))->longName(), theEntryNameFirst );
00084   Entry* entry2 = Model::getEntryByName( (*(OptOList().begin()+1))->longName(), theEntryNameSecond );
00085   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;
00086   setValueSimulated( 0, entry1->valueDisplaced() - entry2->valueDisplaced() );
00087 
00088   if (ALIUtils::debug >= 2) {
00089     ALIdouble detD = 1000*valueSimulated(0); if(fabs(detD) <= 1.e-9 ) detD = 0.;
00090     std::cout << "REAL value: " <<"D: " << 1000.*value()[0] << " (mm)  " << (this)->name() 
00091               << "   DIFF= " << detD-1000*value()[0] << std::endl;
00092     std::cout << "SIMU value: " << "D: " << detD << " (mm)  " << (this)->name() << std::endl;
00093   }
00094   
00095   if(ALIUtils::debug >= 5) std::cout << "end calculateSimulatedValue" <<std::endl;
00096   
00097 }


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().


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