CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

EntryMgr Class Reference

#include <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.

Referenced by getInstance().

{};

Member Function Documentation

void EntryMgr::clearEntryData ( ) [inline]

Definition at line 47 of file EntryMgr.h.

References theEntryData.

{ theEntryData.clear(); }
ALIstring EntryMgr::extractShortName ( const ALIstring name)

Definition at line 126 of file EntryMgr.cc.

References mergeVDriftHistosByStation::name.

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

{
  ALIint isl = name.rfind("/");
  if( isl == -1 ) { 
    return name ;
  } else {
    return name.substr( isl+1, name.size() );
  }
}
EntryData * EntryMgr::findEntry ( const std::vector< ALIstring > &  wl) [private]

Definition at line 113 of file EntryMgr.cc.

References data, and findEntryByLongName().

Referenced by readEntryFromReportOut().

{
  EntryData* data = 0;
  ALIstring optoName = wl[2];
  ALIstring entryName = wl[3];
  data = findEntryByLongName( optoName, entryName );
  
  return data;

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

Definition at line 83 of file EntryMgr.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, data, ALIUtils::debug, EntryData::longOptOName(), and theEntryData.

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

{
  EntryData* data = 0;

  int icount = 0;
  std::vector<EntryData*>::iterator ite;
  if(ALIUtils::debug >= 6) std::cout << " findEntryByLongName theEntryData size = " << theEntryData.size() << std::endl;
  for( ite = theEntryData.begin(); ite != theEntryData.end(); ite++ ) {
    if( (*ite)->longOptOName() == optoName && 
        ( (*ite)->entryName() == entryName || entryName == "" ) ) {
    //-    if( (*ite)->longOptOName() == optoName ) {
    //-      std::cout << " equal optoName " << std::endl;
    //-      if( (*ite)->entryName() == entryName || entryName == "" ) {
      if( icount == 0 ) data = (*ite);
      if(ALIUtils::debug >= 6) std::cout << data << " " << icount << " data longOptOName " << (*ite)->longOptOName() << " entryName " <<  (*ite)->entryName() << " " << (*ite)->valueOriginal() << std::endl;

      if( entryName != "" ) icount++;
    }
    //-    std::cout << " looking for longOptOName " << optoName << " entryName " << entryName << std::endl;
  }

  if( icount > 1 ) { 
    std::cerr << "!!! FATAL ERROR in EntryMgr::findEntryByLongName: >1 objects with OptO name= " << optoName << " and entry name = " << entryName << std::endl;
    abort();
  } 
  return data;
}
EntryData* EntryMgr::findEntryByName ( const ALIstring optoName,
const ALIstring entryName = "" 
) [inline]

Definition at line 35 of file EntryMgr.h.

References findEntryByLongName().

                                                                                           {
    return findEntryByLongName( optoName, entryName ); 
  }
EntryData * EntryMgr::findEntryByShortName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 60 of file EntryMgr.cc.

References dtNoiseDBValidation_cfg::cerr, data, extractShortName(), and theEntryData.

Referenced by Entry::fill().

{
  EntryData* data = 0;

  int icount = 0;
  std::vector<EntryData*>::iterator ite;
  for( ite = theEntryData.begin(); ite != theEntryData.end(); ite++ ) {
    if( (*ite)->shortOptOName() == extractShortName(optoName) && 
        ( (*ite)->entryName() == entryName || entryName  == "" ) ) {
      if( icount == 0 ) data = (*ite);
      if( entryName != "" ) icount++;
    }
    //-    std::cout << icount << " findEntryByShortName " << (*ite)->shortOptOName() << " =?= " << extractShortName(optoName) << std::endl <<  (*ite)->entryName() << " =?= " <<entryName << std::endl; 
  }

  if( icount > 1 ) { 
    std::cerr << "!!! WARNING: >1 objects with OptO name= " << optoName << " and entry Name = " << entryName << std::endl;
  } 
  return data;
}
ALIdouble EntryMgr::getDimOutAngleSig ( ) const [inline]

Definition at line 30 of file EntryMgr.h.

References dimOutAngleSig.

Referenced by Entry::fillFromReportOutFileSigma().

                                     {
    return dimOutAngleSig; }
ALIdouble EntryMgr::getDimOutAngleVal ( ) const [inline]

Definition at line 28 of file EntryMgr.h.

References dimOutAngleVal.

Referenced by Entry::fillFromReportOutFileValue().

                                     {
    return dimOutAngleVal; }
ALIdouble EntryMgr::getDimOutLengthSig ( ) const [inline]

Definition at line 26 of file EntryMgr.h.

References dimOutLengthSig.

Referenced by Entry::fillFromReportOutFileSigma().

                                      {
    return dimOutLengthSig; }
ALIdouble EntryMgr::getDimOutLengthVal ( ) const [inline]

Definition at line 24 of file EntryMgr.h.

References dimOutLengthVal.

Referenced by Entry::fillFromReportOutFileValue().

                                      {
    return dimOutLengthVal; }
std::vector<EntryData*> EntryMgr::getEntryData ( ) const [inline]

Definition at line 44 of file EntryMgr.h.

References theEntryData.

                                             {
    return theEntryData; }
EntryMgr * EntryMgr::getInstance ( ) [static]
ALIint EntryMgr::numberOfEntries ( ) [inline]

Definition at line 41 of file EntryMgr.h.

References theEntryData.

Referenced by Model::SetValueDisplacementsFromReportOut().

                           {
    return theEntryData.size();
  }
ALIbool EntryMgr::readEntryFromReportOut ( const std::vector< ALIstring > &  wl)

Definition at line 33 of file EntryMgr.cc.

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

Referenced by Model::readSystemDescription().

{
  //-  std::cout << "  EntryMgr::readEntryFromReportOut " << wl[0] << std::endl;
  if( wl[0] == "DIMENSIONS:" ) {
    //----- Set dimensions of all the file
    dimOutLengthVal = ALIUtils::getDimensionValue( wl[3],"Length");
    if(ALIUtils::debug >= 6) std::cout << " dimOutLengthVal " << dimOutLengthVal << " " << ALIUtils::getDimensionValue( wl[3],"Length") << " " <<  ALIUtils::LengthValueDimensionFactor() << std::endl;
    dimOutLengthSig = ALIUtils::getDimensionValue( wl[5],"Length");
    dimOutAngleVal = ALIUtils::getDimensionValue( wl[8],"Angle");
    if(ALIUtils::debug >= 6) std::cout << " dimOutAngleVal " << dimOutAngleVal << " " << ALIUtils::getDimensionValue( wl[8],"Angle") << " " <<  ALIUtils::AngleValueDimensionFactor() << std::endl;

    dimOutAngleSig = ALIUtils::getDimensionValue( wl[10],"Angle");
  } else if( wl[0] == "FIX:" || wl[0] == "CAL:" || wl[0] == "UNK:" ) {
    //----- check if it exists
    EntryData* data = findEntry( wl );
    if( !data ) {
      data = new EntryData();
      theEntryData.push_back( data );
    }
    data->fill( wl );
  }

  return 1;  
}

Member Data Documentation

Definition at line 55 of file EntryMgr.h.

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

Definition at line 55 of file EntryMgr.h.

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

Definition at line 55 of file EntryMgr.h.

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

Definition at line 55 of file EntryMgr.h.

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

std::vector<EntryData*> EntryMgr::theEntryData [private]
EntryMgr * EntryMgr::theInstance = 0 [static, private]

Definition at line 53 of file EntryMgr.h.

Referenced by getInstance().