CMS 3D CMS Logo

GlobalOptionMgr Class Reference

#include <Alignment/CocoaUtilities/interface/GlobalOptionMgr.h>

List of all members.

Public Member Functions

ALIdouble getGlobalOption (const ALIstring &sstr)
int getGlobalOptionValue (const ALIstring &sstr, ALIdouble &val)
 ----- Search a string in theGlobalOptions and return 1 if found
std::map< ALIstring, ALIdouble,
std::less< ALIstring > > & 
GlobalOptions ()
void setDefaultGlobalOptions ()
 Set the list of default global options.
void setGlobalOption (const ALIstring &go, const ALIdouble val, ALIFileIn &filein)
 ~GlobalOptionMgr ()

Static Public Member Functions

static GlobalOptionMgrgetInstance ()

Private Member Functions

 GlobalOptionMgr ()

Private Attributes

std::map< ALIstring, ALIdouble,
std::less< ALIstring > > 
theGlobalOptions
 global options

Static Private Attributes

static GlobalOptionMgrtheInstance = 0


Detailed Description

Definition at line 18 of file GlobalOptionMgr.h.


Constructor & Destructor Documentation

GlobalOptionMgr::GlobalOptionMgr (  )  [inline, private]

Definition at line 21 of file GlobalOptionMgr.h.

00021 { };

GlobalOptionMgr::~GlobalOptionMgr (  )  [inline]

Definition at line 25 of file GlobalOptionMgr.h.

00025 { };


Member Function Documentation

ALIdouble GlobalOptionMgr::getGlobalOption ( const ALIstring sstr  ) 

Definition at line 87 of file GlobalOptionMgr.cc.

References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, end, lat::endl(), and GlobalOptions().

Referenced by ALIUtils::SetLengthDimensionFactors().

00088 {
00089   ALIdouble val = 0.;
00090   //---------- Find Global Option by name
00091   std::map< ALIstring, ALIdouble, std::less<ALIstring> >::const_iterator msdcite = GlobalOptions().find( sstr ); 
00092 
00093   //---------- Dump Global Option found
00094   if( ALIUtils::debug >= 6) {
00095     std::cout << "Global Option " << (*msdcite).first << " = " << (*msdcite).second << std::endl;
00096   }
00097 
00098   if ( msdcite == GlobalOptions().end() ) {
00099     //---------- return 0 if GLobal Option not found
00100     std::cerr << " !!! FATAL ERROR: trying to get the value of an unknown Global Option : " << sstr << std::endl;
00101     abort();
00102   } else {
00103     //---------- return 1 if Global Option found
00104     //-std::cout << "SSparam" << (*msdcite).first << (*msdcite).second << "len" << OptOList().size() << std::endl;
00105     //----- set val to Global Option value
00106     val = (*msdcite).second;
00107   } 
00108 
00109   return val;
00110 
00111 }

ALIint GlobalOptionMgr::getGlobalOptionValue ( const ALIstring sstr,
ALIdouble val 
)

----- Search a string in theGlobalOptions and return 1 if found

Definition at line 114 of file GlobalOptionMgr.cc.

References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, end, lat::endl(), and GlobalOptions().

Referenced by Model::CMSLinkDeleteOptOs(), OptORisleyPrism::constructSolidShape(), OptOMirror::constructSolidShape(), OptOTiltmeter::constructSolidShape(), OptOModifiedRhomboidPrism::constructSolidShape(), OptOLens::constructSolidShape(), OptOCubeSplitter::constructSolidShape(), OptOCameraDetector::constructSolidShape(), OptOXLaser::constructSolidShape(), OptOScreen::constructSolidShape(), OptODistancemeter::constructSolidShape(), OpticalObject::constructSolidShape(), OptOSource::constructSolidShape(), OptOOpticalSquare::constructSolidShape(), OptODistancemeter3dim::constructSolidShape(), OptOCOPS::constructSolidShape(), OptOPinhole::constructSolidShape(), OptOSensor2D::constructSolidShape(), OptOPlateSplitter::constructSolidShape(), OptOLaser::constructSolidShape(), Entry::fill(), Entry::fillFromInputFileSigma(), Fit::FillMatricesWithCalibratedParameters(), Fit::fitNextEvent(), and Fit::getInstance().

00115 {
00116   //---------- Find Global Option by name
00117   std::map< ALIstring, ALIdouble, std::less<ALIstring> >::const_iterator msdcite = GlobalOptions().find( sstr ); 
00118 
00119   //---------- Dump Global Option found
00120   if( ALIUtils::debug >= 6) {
00121     std::cout << "Global Option " << (*msdcite).first << " = " << (*msdcite).second << std::endl;
00122   }
00123 
00124   if ( msdcite == GlobalOptions().end() ) {
00125     //---------- return 0 if GLobal Option not found
00126     return 0;
00127   } else {
00128     //---------- return 1 if Global Option found
00129     //-std::cout << "SSparam" << (*msdcite).first << (*msdcite).second << "len" << OptOList().size() << std::endl;
00130     //----- set val to Global Option value
00131     val = (*msdcite).second;
00132     return 1;
00133   } 
00134 
00135 }

GlobalOptionMgr * GlobalOptionMgr::getInstance (  )  [static]

Definition at line 17 of file GlobalOptionMgr.cc.

References theInstance.

Referenced by Measurement::calculateOriginalSimulatedValue(), MeasurementSensor2D::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDiffEntry::calculateSimulatedValue(), Model::CMSLinkDeleteOptOs(), OptORisleyPrism::constructSolidShape(), OptOMirror::constructSolidShape(), OptOTiltmeter::constructSolidShape(), OptOModifiedRhomboidPrism::constructSolidShape(), OptOLens::constructSolidShape(), OptOCubeSplitter::constructSolidShape(), OptOCameraDetector::constructSolidShape(), OptOXLaser::constructSolidShape(), OptOScreen::constructSolidShape(), OptODistancemeter::constructSolidShape(), OpticalObject::constructSolidShape(), OptOSource::constructSolidShape(), OptOOpticalSquare::constructSolidShape(), OptODistancemeter3dim::constructSolidShape(), OptOCOPS::constructSolidShape(), OptOPinhole::constructSolidShape(), OptOSensor2D::constructSolidShape(), OptOPlateSplitter::constructSolidShape(), OptOLaser::constructSolidShape(), Fit::CreateMatrices(), EntryAngleAffAngles::displace(), OpticalObject::displaceRmGlobOriginal(), OpticalObject::displaceRmGlobOriginalOriginal(), Entry::fill(), DeviationSensor2D::fillData(), Entry::fillFromInputFileSigma(), Fit::FillMatricesWithCalibratedParameters(), Fit::fitNextEvent(), Fit::fitParameters(), Fit::getInstance(), FittedEntriesManager::MakeHistos(), Model::Model(), Fit::PropagateErrors(), Model::readMeasurementsFromFile(), CocoaDaqReaderText::ReadNextEvent(), Model::readSystemDescription(), ALIUtils::SetAngleDimensionFactors(), MeasurementDistancemeter::setConversionFactor(), MeasurementTiltmeter::setConversionFactor(), MeasurementDistancemeter3dim::setConversionFactor(), Fit::setFittableEntries(), ALIUtils::SetLengthDimensionFactors(), ALIUtils::SetOutputAngleDimensionFactors(), ALIUtils::SetOutputLengthDimensionFactors(), OpticalObject::SetRMGlobFromRMLocal(), Fit::startFit(), OptOUserDefined::userDefinedBehaviour(), and Fit::WriteVisualisationFiles().

00018 {
00019   if(!theInstance) {
00020     theInstance = new GlobalOptionMgr;
00021   }
00022 
00023   return theInstance;
00024 }

std::map< ALIstring, ALIdouble, std::less<ALIstring> >& GlobalOptionMgr::GlobalOptions (  )  [inline]

Definition at line 32 of file GlobalOptionMgr.h.

References theGlobalOptions.

Referenced by Measurement::calculateOriginalSimulatedValue(), MeasurementSensor2D::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), MeasurementDistancemeter3dim::calculateSimulatedValue(), MeasurementDistancemeter::calculateSimulatedValue(), MeasurementDiffEntry::calculateSimulatedValue(), Fit::CreateMatrices(), EntryAngleAffAngles::displace(), OpticalObject::displaceRmGlobOriginal(), OpticalObject::displaceRmGlobOriginalOriginal(), DeviationSensor2D::fillData(), Fit::fitNextEvent(), Fit::fitParameters(), getGlobalOption(), getGlobalOptionValue(), FittedEntriesManager::MakeHistos(), Fit::PropagateErrors(), Model::readMeasurementsFromFile(), CocoaDaqReaderText::ReadNextEvent(), ALIUtils::SetAngleDimensionFactors(), MeasurementDistancemeter::setConversionFactor(), MeasurementTiltmeter::setConversionFactor(), MeasurementDistancemeter3dim::setConversionFactor(), Fit::setFittableEntries(), setGlobalOption(), ALIUtils::SetLengthDimensionFactors(), ALIUtils::SetOutputAngleDimensionFactors(), ALIUtils::SetOutputLengthDimensionFactors(), OpticalObject::SetRMGlobFromRMLocal(), Fit::startFit(), OptOUserDefined::userDefinedBehaviour(), and Fit::WriteVisualisationFiles().

00032                                                                       {
00033     return theGlobalOptions;
00034   }

void GlobalOptionMgr::setDefaultGlobalOptions (  ) 

Set the list of default global options.

Definition at line 28 of file GlobalOptionMgr.cc.

References theGlobalOptions.

Referenced by Model::Model().

00029 {
00030   theGlobalOptions[ ALIstring("report_verbose") ] = 3; 
00031   theGlobalOptions[ ALIstring("debug_verbose") ] = 0;  
00032   //  theGlobalOptions[ ALIstring("sparse") ] = 0;  
00033   theGlobalOptions[ ALIstring("saveMatrices") ] = 1;  
00034   //  theGlobalOptions[ ALIstring("external_meas") ] = 0;  
00035   theGlobalOptions[ ALIstring("calcul_type") ] = 0;  
00036   theGlobalOptions[ ALIstring("length_value_dimension") ] = 0;  
00037   theGlobalOptions[ ALIstring("length_error_dimension") ] = 0;  
00038   theGlobalOptions[ ALIstring("angle_value_dimension") ] = 0;  
00039   theGlobalOptions[ ALIstring("angle_error_dimension") ] = 0;  
00040   theGlobalOptions[ ALIstring("output_length_value_dimension") ] = 0;  
00041   theGlobalOptions[ ALIstring("output_length_error_dimension") ] = 0;  
00042   theGlobalOptions[ ALIstring("output_angle_value_dimension") ] = 0;  
00043   theGlobalOptions[ ALIstring("output_angle_error_dimension") ] = 0;  
00044   theGlobalOptions[ ALIstring("checkExtraEntries") ] = 0;  
00045   theGlobalOptions[ ALIstring("cms_link") ] = 0;  
00046   theGlobalOptions[ ALIstring("cms_link_halfplanes") ] = 0;  
00047   theGlobalOptions[ ALIstring("cms_link_method") ] = 0;  
00048   theGlobalOptions[ ALIstring("range_studies") ] = 0;  
00049   theGlobalOptions[ ALIstring("histograms") ] = 0;  
00050   theGlobalOptions[ ALIstring("onlyDeriv") ] = 0; 
00051   theGlobalOptions[ ALIstring("onlyFirstPropagation") ] = 0;
00052 
00053   theGlobalOptions[ ALIstring("VisWriteVRML") ] = 0;  
00054   theGlobalOptions[ ALIstring("VisWriteIguana") ] = 0;  
00055   theGlobalOptions[ ALIstring("VisOnly") ] = 0;  
00056   theGlobalOptions[ ALIstring("VisWriteOptONames") ] = 1;  
00057   theGlobalOptions[ ALIstring("VisGlobalRotationX") ] = 0.;  
00058   theGlobalOptions[ ALIstring("VisGlobalRotationY") ] = 0.;  
00059   theGlobalOptions[ ALIstring("VisGlobalRotationZ") ] = 0.;  
00060   theGlobalOptions[ ALIstring("VisScale") ] = 1.;
00061   theGlobalOptions[ ALIstring("tiltmeter_meas_value_dimension") ] = 0; 
00062   theGlobalOptions[ ALIstring("distancemeter_meas_value_dimension") ] = 0; 
00063   theGlobalOptions[ ALIstring("dumpDateInFittedEntries") ] = 0;
00064   theGlobalOptions[ ALIstring("measurementErrorFromFile") ] = 0;
00065 
00066   theGlobalOptions[ ALIstring("maxNoFitIterations") ] = 50;
00067   theGlobalOptions[ ALIstring("fitQualityCut") ] = 0.1;
00068   theGlobalOptions[ ALIstring("relativeFitQualityCut") ] = 1.E-6;
00069 
00070   //dimension factor to multiply the values in the files that give you the deviatin when traversing an ALMY. Files have numbers in microns, so it has to be 1 if 'length_value_dimension 2', 0.001 if 'length_value_dimension 1' (the same for angles)
00071   theGlobalOptions[ ALIstring("deviffValDimf") ] = 1.;
00072   theGlobalOptions[ ALIstring("deviffAngDimf") ] = 1.;
00073   theGlobalOptions[ ALIstring("rotateAroundLocal") ] = 1; 
00074   theGlobalOptions[ ALIstring("reportOutEntriesByShortName") ] = 0; 
00075   theGlobalOptions[ ALIstring("reportOutReadValue") ] = 1;
00076   theGlobalOptions[ ALIstring("reportOutReadSigma") ] = 1;
00077   theGlobalOptions[ ALIstring("reportOutReadQuality") ] = 1;
00078   theGlobalOptions[ ALIstring("maxDeviDerivative") ] = 1.E-6;
00079 
00080   theGlobalOptions[ ALIstring("stopAfter1stIteration") ] = 0;
00081   theGlobalOptions[ ALIstring("calParamInyfMatrix") ] = 0;
00082   theGlobalOptions[ ALIstring("writeXML") ] = 0;
00083   theGlobalOptions[ ALIstring("dumpInAllFrames") ] = 0;
00084 }

void GlobalOptionMgr::setGlobalOption ( const ALIstring go,
const ALIdouble  val,
ALIFileIn filein 
)

Definition at line 139 of file GlobalOptionMgr.cc.

References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, end, lat::endl(), ALIFileIn::ErrorInLine(), cmsRelvalreport::exit, find(), GlobalOptions(), ALIUtils::setDebugVerbosity(), ALIUtils::setReportVerbosity(), and theGlobalOptions.

Referenced by Model::readSystemDescription().

00140 {
00141 
00142   //----- If global option exists: set it to value read
00143   if ( GlobalOptions().find( gopt ) != GlobalOptions().end() ){
00144     theGlobalOptions[ gopt ] = val;
00145     //------ Verbosity global options change static data
00146     if( gopt == "report_verbose") {
00147       ALIUtils::setReportVerbosity( ALIint(val) );
00148     }
00149     if( gopt == "debug_verbose" ) {
00150       ALIUtils::setDebugVerbosity( ALIint(val) );
00151     }
00152     
00153     //----- if global option does not exist: error
00154   } else {
00155     filein.ErrorInLine();
00156     std::cerr << "!!! global option not found: " << gopt << std::endl;
00157     if ( ALIUtils::debug >= 3 ) {
00158       std::cout << "ALLOWED GLOBAL OPTIONS:" << std::endl;
00159       std::map< ALIstring, ALIdouble, std::less<ALIstring> >::iterator msdite;
00160       for ( msdite = theGlobalOptions.begin(); 
00161             msdite != theGlobalOptions.end(); msdite++) {
00162         std::cout << (*msdite).first.c_str() << std::endl;
00163       }
00164     }
00165     exit(2);
00166   }
00167   
00168 }


Member Data Documentation

std::map< ALIstring, ALIdouble, std::less<ALIstring> > GlobalOptionMgr::theGlobalOptions [private]

global options

Definition at line 45 of file GlobalOptionMgr.h.

Referenced by GlobalOptions(), setDefaultGlobalOptions(), and setGlobalOption().

GlobalOptionMgr * GlobalOptionMgr::theInstance = 0 [static, private]

Definition at line 43 of file GlobalOptionMgr.h.

Referenced by getInstance().


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