CMS 3D CMS Logo

EntryMgr Class Reference

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

List of all members.

Public Member Functions

void clearEntryData ()
ALIstring extractShortName (const ALIstring &name)
EntryDatafindEntryByLongName (const ALIstring &optoName, const ALIstring &entryName="")
EntryDatafindEntryByName (const ALIstring &optoName, const ALIstring &entryName="")
EntryDatafindEntryByShortName (const ALIstring &optoName, const ALIstring &entryName="")
ALIdouble getDimOutAngleSig () const
ALIdouble getDimOutAngleVal () const
ALIdouble getDimOutLengthSig () const
ALIdouble getDimOutLengthVal () const
std::vector< EntryData * > getEntryData () const
ALIint numberOfEntries ()
ALIbool readEntryFromReportOut (const std::vector< ALIstring > &wl)

Static Public Member Functions

static EntryMgrgetInstance ()

Private Member Functions

 EntryMgr ()
EntryDatafindEntry (const std::vector< ALIstring > &wl)

Private Attributes

ALIdouble dimOutAngleSig
ALIdouble dimOutAngleVal
ALIdouble dimOutLengthSig
ALIdouble dimOutLengthVal
std::vector< EntryData * > theEntryData

Static Private Attributes

static EntryMgrtheInstance = 0


Detailed Description

Definition at line 15 of file EntryMgr.h.


Constructor & Destructor Documentation

EntryMgr::EntryMgr (  )  [inline, private]

Definition at line 18 of file EntryMgr.h.

00018 {};


Member Function Documentation

void EntryMgr::clearEntryData (  )  [inline]

Definition at line 47 of file EntryMgr.h.

References theEntryData.

00047 { theEntryData.clear(); }

ALIstring EntryMgr::extractShortName ( const ALIstring name  ) 

Definition at line 125 of file EntryMgr.cc.

Referenced by EntryData::fill(), and findEntryByShortName().

00126 {
00127   ALIint isl = name.rfind("/");
00128   if( isl == -1 ) { 
00129     return name ;
00130   } else {
00131     return name.substr( isl+1, name.size() );
00132   }
00133 }

EntryData * EntryMgr::findEntry ( const std::vector< ALIstring > &  wl  )  [private]

Definition at line 112 of file EntryMgr.cc.

References data, and findEntryByLongName().

Referenced by readEntryFromReportOut().

00113 {
00114   EntryData* data = 0;
00115   ALIstring optoName = wl[2];
00116   ALIstring entryName = wl[3];
00117   data = findEntryByLongName( optoName, entryName );
00118   
00119   return data;
00120 
00121 }

EntryData * EntryMgr::findEntryByLongName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 82 of file EntryMgr.cc.

References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, data, ALIUtils::debug, lat::endl(), EntryData::longOptOName(), and theEntryData.

Referenced by Entry::fill(), findEntry(), findEntryByName(), and Model::SetValueDisplacementsFromReportOut().

00083 {
00084   EntryData* data = 0;
00085 
00086   int icount = 0;
00087   std::vector<EntryData*>::iterator ite;
00088   if(ALIUtils::debug >= 6) std::cout << " findEntryByLongName theEntryData size = " << theEntryData.size() << std::endl;
00089   for( ite = theEntryData.begin(); ite != theEntryData.end(); ite++ ) {
00090     if( (*ite)->longOptOName() == optoName && 
00091         ( (*ite)->entryName() == entryName || entryName == "" ) ) {
00092     //-    if( (*ite)->longOptOName() == optoName ) {
00093     //-      std::cout << " equal optoName " << std::endl;
00094     //-      if( (*ite)->entryName() == entryName || entryName == "" ) {
00095       if( icount == 0 ) data = (*ite);
00096       if(ALIUtils::debug >= 6) std::cout << data << " " << icount << " data longOptOName " << (*ite)->longOptOName() << " entryName " <<  (*ite)->entryName() << " " << (*ite)->valueOriginal() << std::endl;
00097 
00098       if( entryName != "" ) icount++;
00099     }
00100     //-    std::cout << " looking for longOptOName " << optoName << " entryName " << entryName << std::endl;
00101   }
00102 
00103   if( icount > 1 ) { 
00104     std::cerr << "!!! FATAL ERROR in EntryMgr::findEntryByLongName: >1 objects with OptO name= " << optoName << " and entry name = " << entryName << std::endl;
00105     abort();
00106   } 
00107   return data;
00108 }

EntryData* EntryMgr::findEntryByName ( const ALIstring optoName,
const ALIstring entryName = "" 
) [inline]

Definition at line 35 of file EntryMgr.h.

References findEntryByLongName().

00035                                                                                            {
00036     return findEntryByLongName( optoName, entryName ); 
00037   }

EntryData * EntryMgr::findEntryByShortName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 59 of file EntryMgr.cc.

References TestMuL1L2Filter_cff::cerr, data, lat::endl(), extractShortName(), and theEntryData.

Referenced by Entry::fill().

00060 {
00061   EntryData* data = 0;
00062 
00063   int icount = 0;
00064   std::vector<EntryData*>::iterator ite;
00065   for( ite = theEntryData.begin(); ite != theEntryData.end(); ite++ ) {
00066     if( (*ite)->shortOptOName() == extractShortName(optoName) && 
00067         ( (*ite)->entryName() == entryName || entryName  == "" ) ) {
00068       if( icount == 0 ) data = (*ite);
00069       if( entryName != "" ) icount++;
00070     }
00071     //-    std::cout << icount << " findEntryByShortName " << (*ite)->shortOptOName() << " =?= " << extractShortName(optoName) << std::endl <<  (*ite)->entryName() << " =?= " <<entryName << std::endl; 
00072   }
00073 
00074   if( icount > 1 ) { 
00075     std::cerr << "!!! WARNING: >1 objects with OptO name= " << optoName << " and entry Name = " << entryName << std::endl;
00076   } 
00077   return data;
00078 }

ALIdouble EntryMgr::getDimOutAngleSig (  )  const [inline]

Definition at line 30 of file EntryMgr.h.

References dimOutAngleSig.

Referenced by Entry::fillFromReportOutFileSigma().

00030                                      {
00031     return dimOutAngleSig; }

ALIdouble EntryMgr::getDimOutAngleVal (  )  const [inline]

Definition at line 28 of file EntryMgr.h.

References dimOutAngleVal.

Referenced by Entry::fillFromReportOutFileValue().

00028                                      {
00029     return dimOutAngleVal; }

ALIdouble EntryMgr::getDimOutLengthSig (  )  const [inline]

Definition at line 26 of file EntryMgr.h.

References dimOutLengthSig.

Referenced by Entry::fillFromReportOutFileSigma().

00026                                       {
00027     return dimOutLengthSig; }

ALIdouble EntryMgr::getDimOutLengthVal (  )  const [inline]

Definition at line 24 of file EntryMgr.h.

References dimOutLengthVal.

Referenced by Entry::fillFromReportOutFileValue().

00024                                       {
00025     return dimOutLengthVal; }

std::vector<EntryData*> EntryMgr::getEntryData (  )  const [inline]

Definition at line 44 of file EntryMgr.h.

References theEntryData.

00044                                              {
00045     return theEntryData; }

EntryMgr * EntryMgr::getInstance (  )  [static]

Definition at line 16 of file EntryMgr.cc.

References dimOutAngleSig, dimOutAngleVal, dimOutLengthSig, dimOutLengthVal, and theInstance.

Referenced by EntryData::fill(), Entry::fill(), Entry::fillFromReportOutFileSigma(), Entry::fillFromReportOutFileValue(), OpticalObject::readCoordinates(), Model::readSystemDescription(), and Model::SetValueDisplacementsFromReportOut().

00017 {
00018   if( !theInstance ) {
00019     theInstance = new EntryMgr;
00020     theInstance->dimOutLengthVal = 0; 
00021     theInstance->dimOutLengthSig = 0;
00022     theInstance->dimOutAngleVal = 0;
00023     theInstance->dimOutAngleSig = 0;
00024   }
00025   
00026   return theInstance;
00027   
00028 }

ALIint EntryMgr::numberOfEntries (  )  [inline]

Definition at line 41 of file EntryMgr.h.

References theEntryData.

Referenced by Model::SetValueDisplacementsFromReportOut().

00041                            {
00042     return theEntryData.size();
00043   }

ALIbool EntryMgr::readEntryFromReportOut ( const std::vector< ALIstring > &  wl  ) 

Definition at line 32 of file EntryMgr.cc.

References ALIUtils::AngleValueDimensionFactor(), GenMuonPlsPt100GeV_cfg::cout, data, ALIUtils::debug, dimOutAngleSig, dimOutAngleVal, dimOutLengthSig, dimOutLengthVal, lat::endl(), EntryData::fill(), findEntry(), ALIUtils::getDimensionValue(), ALIUtils::LengthValueDimensionFactor(), and theEntryData.

Referenced by Model::readSystemDescription().

00033 {
00034   //-  std::cout << "  EntryMgr::readEntryFromReportOut " << wl[0] << std::endl;
00035   if( wl[0] == "DIMENSIONS:" ) {
00036     //----- Set dimensions of all the file
00037     dimOutLengthVal = ALIUtils::getDimensionValue( wl[3],"Length");
00038     if(ALIUtils::debug >= 6) std::cout << " dimOutLengthVal " << dimOutLengthVal << " " << ALIUtils::getDimensionValue( wl[3],"Length") << " " <<  ALIUtils::LengthValueDimensionFactor() << std::endl;
00039     dimOutLengthSig = ALIUtils::getDimensionValue( wl[5],"Length");
00040     dimOutAngleVal = ALIUtils::getDimensionValue( wl[8],"Angle");
00041     if(ALIUtils::debug >= 6) std::cout << " dimOutAngleVal " << dimOutAngleVal << " " << ALIUtils::getDimensionValue( wl[8],"Angle") << " " <<  ALIUtils::AngleValueDimensionFactor() << std::endl;
00042 
00043     dimOutAngleSig = ALIUtils::getDimensionValue( wl[10],"Angle");
00044   } else if( wl[0] == "FIX:" || wl[0] == "CAL:" || wl[0] == "UNK:" ) {
00045     //----- check if it exists
00046     EntryData* data = findEntry( wl );
00047     if( !data ) {
00048       data = new EntryData();
00049       theEntryData.push_back( data );
00050     }
00051     data->fill( wl );
00052   }
00053 
00054   return 1;  
00055 }


Member Data Documentation

ALIdouble EntryMgr::dimOutAngleSig [private]

Definition at line 55 of file EntryMgr.h.

Referenced by getDimOutAngleSig(), getInstance(), and readEntryFromReportOut().

ALIdouble EntryMgr::dimOutAngleVal [private]

Definition at line 55 of file EntryMgr.h.

Referenced by getDimOutAngleVal(), getInstance(), and readEntryFromReportOut().

ALIdouble EntryMgr::dimOutLengthSig [private]

Definition at line 55 of file EntryMgr.h.

Referenced by getDimOutLengthSig(), getInstance(), and readEntryFromReportOut().

ALIdouble EntryMgr::dimOutLengthVal [private]

Definition at line 55 of file EntryMgr.h.

Referenced by getDimOutLengthVal(), getInstance(), and readEntryFromReportOut().

std::vector<EntryData*> EntryMgr::theEntryData [private]

Definition at line 56 of file EntryMgr.h.

Referenced by clearEntryData(), findEntryByLongName(), findEntryByShortName(), getEntryData(), numberOfEntries(), and readEntryFromReportOut().

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

Definition at line 53 of file EntryMgr.h.

Referenced by getInstance().


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