CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 = nullptr
 

Detailed Description

Definition at line 15 of file EntryMgr.h.

Constructor & Destructor Documentation

EntryMgr::EntryMgr ( )
inlineprivate

Definition at line 17 of file EntryMgr.h.

Referenced by getInstance().

17 {};

Member Function Documentation

void EntryMgr::clearEntryData ( )
inline

Definition at line 39 of file EntryMgr.h.

References theEntryData.

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

Definition at line 125 of file EntryMgr.cc.

References mergeVDriftHistosByStation::name.

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

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

Definition at line 115 of file EntryMgr.cc.

References data, and findEntryByLongName().

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

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

Definition at line 82 of file EntryMgr.cc.

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

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

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

Definition at line 30 of file EntryMgr.h.

References findEntryByLongName().

30  {
31  return findEntryByLongName(optoName, entryName);
32  }
EntryData * findEntryByLongName(const ALIstring &optoName, const ALIstring &entryName="")
Definition: EntryMgr.cc:82
EntryData * EntryMgr::findEntryByShortName ( const ALIstring optoName,
const ALIstring entryName = "" 
)

Definition at line 58 of file EntryMgr.cc.

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

Referenced by Entry::fill().

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

Definition at line 26 of file EntryMgr.h.

References dimOutAngleSig.

Referenced by Entry::fillFromReportOutFileSigma().

26 { return dimOutAngleSig; }
ALIdouble dimOutAngleSig
Definition: EntryMgr.h:47
ALIdouble EntryMgr::getDimOutAngleVal ( ) const
inline

Definition at line 25 of file EntryMgr.h.

References dimOutAngleVal.

Referenced by Entry::fillFromReportOutFileValue().

25 { return dimOutAngleVal; }
ALIdouble dimOutAngleVal
Definition: EntryMgr.h:47
ALIdouble EntryMgr::getDimOutLengthSig ( ) const
inline

Definition at line 24 of file EntryMgr.h.

References dimOutLengthSig.

Referenced by Entry::fillFromReportOutFileSigma().

24 { return dimOutLengthSig; }
ALIdouble dimOutLengthSig
Definition: EntryMgr.h:47
ALIdouble EntryMgr::getDimOutLengthVal ( ) const
inline

Definition at line 23 of file EntryMgr.h.

References dimOutLengthVal.

Referenced by Entry::fillFromReportOutFileValue().

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

Definition at line 37 of file EntryMgr.h.

References theEntryData.

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

Definition at line 36 of file EntryMgr.h.

References theEntryData.

Referenced by Model::SetValueDisplacementsFromReportOut().

36 { return theEntryData.size(); }
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48
ALIbool EntryMgr::readEntryFromReportOut ( const std::vector< ALIstring > &  wl)

Definition at line 29 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().

29  {
30  //- std::cout << " EntryMgr::readEntryFromReportOut " << wl[0] << std::endl;
31  if (wl[0] == "DIMENSIONS:") {
32  //----- Set dimensions of all the file
34  if (ALIUtils::debug >= 6)
35  std::cout << " dimOutLengthVal " << dimOutLengthVal << " " << ALIUtils::getDimensionValue(wl[3], "Length") << " "
36  << ALIUtils::LengthValueDimensionFactor() << std::endl;
39  if (ALIUtils::debug >= 6)
40  std::cout << " dimOutAngleVal " << dimOutAngleVal << " " << ALIUtils::getDimensionValue(wl[8], "Angle") << " "
41  << ALIUtils::AngleValueDimensionFactor() << std::endl;
42 
44  } else if (wl[0] == "FIX:" || wl[0] == "CAL:" || wl[0] == "UNK:") {
45  //----- check if it exists
46  EntryData* data = findEntry(wl);
47  if (!data) {
48  data = new EntryData();
49  theEntryData.push_back(data);
50  }
51  data->fill(wl);
52  }
53 
54  return true;
55 }
EntryData * findEntry(const std::vector< ALIstring > &wl)
Definition: EntryMgr.cc:115
ALIdouble dimOutAngleVal
Definition: EntryMgr.h:47
void fill(const std::vector< ALIstring > &wordlist)
Definition: EntryData.cc:18
ALIdouble dimOutLengthSig
Definition: EntryMgr.h:47
static ALIint debug
Definition: ALIUtils.h:34
ALIdouble dimOutLengthVal
Definition: EntryMgr.h:47
static ALIdouble getDimensionValue(const ALIstring &dim, const ALIstring &dimType)
Definition: ALIUtils.cc:477
ALIdouble dimOutAngleSig
Definition: EntryMgr.h:47
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:64
tuple cout
Definition: gather_cfg.py:144
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:62

Member Data Documentation

ALIdouble EntryMgr::dimOutAngleSig
private

Definition at line 47 of file EntryMgr.h.

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

ALIdouble EntryMgr::dimOutAngleVal
private

Definition at line 47 of file EntryMgr.h.

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

ALIdouble EntryMgr::dimOutLengthSig
private

Definition at line 47 of file EntryMgr.h.

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

ALIdouble EntryMgr::dimOutLengthVal
private

Definition at line 47 of file EntryMgr.h.

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

std::vector<EntryData*> EntryMgr::theEntryData
private
EntryMgr * EntryMgr::theInstance = nullptr
staticprivate

Definition at line 45 of file EntryMgr.h.

Referenced by getInstance().