CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
EntryMgr Class Reference

#include <EntryMgr.h>

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

Definition at line 18 of file EntryMgr.h.

Referenced by getInstance().

18 {};

Member Function Documentation

void EntryMgr::clearEntryData ( )
inline

Definition at line 47 of file EntryMgr.h.

References theEntryData.

47 { theEntryData.clear(); }
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
ALIstring EntryMgr::extractShortName ( const ALIstring name)

Definition at line 126 of file EntryMgr.cc.

References mergeVDriftHistosByStation::name.

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

127 {
128  ALIint isl = name.rfind("/");
129  if( isl == -1 ) {
130  return name ;
131  } else {
132  return name.substr( isl+1, name.size() );
133  }
134 }
int ALIint
Definition: CocoaGlobals.h:15
EntryData * EntryMgr::findEntry ( const std::vector< ALIstring > &  wl)
private

Definition at line 113 of file EntryMgr.cc.

References data, and findEntryByLongName().

Referenced by QGLikelihoodCalculator.QGLikelihoodCalculator::computeQGLikelihood(), and readEntryFromReportOut().

114 {
115  EntryData* data = 0;
116  ALIstring optoName = wl[2];
117  ALIstring entryName = wl[3];
118  data = findEntryByLongName( optoName, entryName );
119 
120  return data;
121 
122 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string ALIstring
Definition: CocoaGlobals.h:9
EntryData * findEntryByLongName(const ALIstring &optoName, const ALIstring &entryName="")
Definition: EntryMgr.cc:83
EntryData * EntryMgr::findEntryByLongName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 83 of file EntryMgr.cc.

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

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

84 {
85  EntryData* data = 0;
86 
87  int icount = 0;
88  std::vector<EntryData*>::iterator ite;
89  if(ALIUtils::debug >= 6) std::cout << " findEntryByLongName theEntryData size = " << theEntryData.size() << std::endl;
90  for( ite = theEntryData.begin(); ite != theEntryData.end(); ++ite ) {
91  if( (*ite)->longOptOName() == optoName &&
92  ( (*ite)->entryName() == entryName || entryName == "" ) ) {
93  //- if( (*ite)->longOptOName() == optoName ) {
94  //- std::cout << " equal optoName " << std::endl;
95  //- if( (*ite)->entryName() == entryName || entryName == "" ) {
96  if( icount == 0 ) data = (*ite);
97  if(ALIUtils::debug >= 6) std::cout << data << " " << icount << " data longOptOName " << (*ite)->longOptOName() << " entryName " << (*ite)->entryName() << " " << (*ite)->valueOriginal() << std::endl;
98 
99  if( entryName != "" ) icount++;
100  }
101  //- std::cout << " looking for longOptOName " << optoName << " entryName " << entryName << std::endl;
102  }
103 
104  if( icount > 1 ) {
105  std::cerr << "!!! FATAL ERROR in EntryMgr::findEntryByLongName: >1 objects with OptO name= " << optoName << " and entry name = " << entryName << std::endl;
106  abort();
107  }
108  return data;
109 }
static ALIint debug
Definition: ALIUtils.h:35
const ALIstring & longOptOName() const
Definition: EntryData.h:27
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
tuple cout
Definition: gather_cfg.py:121
EntryData* EntryMgr::findEntryByName ( const ALIstring optoName,
const ALIstring entryName = "" 
)
inline

Definition at line 35 of file EntryMgr.h.

References findEntryByLongName().

35  {
36  return findEntryByLongName( optoName, entryName );
37  }
EntryData * findEntryByLongName(const ALIstring &optoName, const ALIstring &entryName="")
Definition: EntryMgr.cc:83
EntryData * EntryMgr::findEntryByShortName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 60 of file EntryMgr.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, data, extractShortName(), and theEntryData.

Referenced by Entry::fill().

61 {
62  EntryData* data = 0;
63 
64  int icount = 0;
65  std::vector<EntryData*>::iterator ite;
66  for( ite = theEntryData.begin(); ite != theEntryData.end(); ++ite ) {
67  if( (*ite)->shortOptOName() == extractShortName(optoName) &&
68  ( (*ite)->entryName() == entryName || entryName == "" ) ) {
69  if( icount == 0 ) data = (*ite);
70  if( entryName != "" ) icount++;
71  }
72  //- std::cout << icount << " findEntryByShortName " << (*ite)->shortOptOName() << " =?= " << extractShortName(optoName) << std::endl << (*ite)->entryName() << " =?= " <<entryName << std::endl;
73  }
74 
75  if( icount > 1 ) {
76  std::cerr << "!!! WARNING: >1 objects with OptO name= " << optoName << " and entry Name = " << entryName << std::endl;
77  }
78  return data;
79 }
ALIstring extractShortName(const ALIstring &name)
Definition: EntryMgr.cc:126
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
ALIdouble EntryMgr::getDimOutAngleSig ( ) const
inline

Definition at line 30 of file EntryMgr.h.

References dimOutAngleSig.

Referenced by Entry::fillFromReportOutFileSigma().

30  {
31  return dimOutAngleSig; }
ALIdouble dimOutAngleSig
Definition: EntryMgr.h:55
ALIdouble EntryMgr::getDimOutAngleVal ( ) const
inline

Definition at line 28 of file EntryMgr.h.

References dimOutAngleVal.

Referenced by Entry::fillFromReportOutFileValue().

28  {
29  return dimOutAngleVal; }
ALIdouble dimOutAngleVal
Definition: EntryMgr.h:55
ALIdouble EntryMgr::getDimOutLengthSig ( ) const
inline

Definition at line 26 of file EntryMgr.h.

References dimOutLengthSig.

Referenced by Entry::fillFromReportOutFileSigma().

26  {
27  return dimOutLengthSig; }
ALIdouble dimOutLengthSig
Definition: EntryMgr.h:55
ALIdouble EntryMgr::getDimOutLengthVal ( ) const
inline

Definition at line 24 of file EntryMgr.h.

References dimOutLengthVal.

Referenced by Entry::fillFromReportOutFileValue().

24  {
25  return dimOutLengthVal; }
ALIdouble dimOutLengthVal
Definition: EntryMgr.h:55
std::vector<EntryData*> EntryMgr::getEntryData ( ) const
inline

Definition at line 44 of file EntryMgr.h.

References theEntryData.

44  {
45  return theEntryData; }
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
EntryMgr * EntryMgr::getInstance ( )
static
ALIint EntryMgr::numberOfEntries ( )
inline

Definition at line 41 of file EntryMgr.h.

References theEntryData.

Referenced by Model::SetValueDisplacementsFromReportOut().

41  {
42  return theEntryData.size();
43  }
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
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().

34 {
35  //- std::cout << " EntryMgr::readEntryFromReportOut " << wl[0] << std::endl;
36  if( wl[0] == "DIMENSIONS:" ) {
37  //----- Set dimensions of all the file
39  if(ALIUtils::debug >= 6) std::cout << " dimOutLengthVal " << dimOutLengthVal << " " << ALIUtils::getDimensionValue( wl[3],"Length") << " " << ALIUtils::LengthValueDimensionFactor() << std::endl;
42  if(ALIUtils::debug >= 6) std::cout << " dimOutAngleVal " << dimOutAngleVal << " " << ALIUtils::getDimensionValue( wl[8],"Angle") << " " << ALIUtils::AngleValueDimensionFactor() << std::endl;
43 
45  } else if( wl[0] == "FIX:" || wl[0] == "CAL:" || wl[0] == "UNK:" ) {
46  //----- check if it exists
47  EntryData* data = findEntry( wl );
48  if( !data ) {
49  data = new EntryData();
50  theEntryData.push_back( data );
51  }
52  data->fill( wl );
53  }
54 
55  return 1;
56 }
EntryData * findEntry(const std::vector< ALIstring > &wl)
Definition: EntryMgr.cc:113
ALIdouble dimOutAngleVal
Definition: EntryMgr.h:55
void fill(const std::vector< ALIstring > &wordlist)
Definition: EntryData.cc:20
ALIdouble dimOutLengthSig
Definition: EntryMgr.h:55
static ALIint debug
Definition: ALIUtils.h:35
ALIdouble dimOutLengthVal
Definition: EntryMgr.h:55
static ALIdouble getDimensionValue(const ALIstring &dim, const ALIstring &dimType)
Definition: ALIUtils.cc:515
ALIdouble dimOutAngleSig
Definition: EntryMgr.h:55
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:56
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:75
tuple cout
Definition: gather_cfg.py:121
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:71

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
EntryMgr * EntryMgr::theInstance = 0
staticprivate

Definition at line 53 of file EntryMgr.h.

Referenced by getInstance().