CMS 3D CMS Logo

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

Definition at line 17 of file EntryMgr.h.

Referenced by getInstance().

17 {};

Member Function Documentation

◆ clearEntryData()

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

◆ extractShortName()

ALIstring EntryMgr::extractShortName ( const ALIstring name)

Definition at line 125 of file EntryMgr.cc.

References Skims_PA_cff::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

◆ findEntry()

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

Definition at line 115 of file EntryMgr.cc.

References data, findEntryByLongName(), and LaserClient_cfi::wl.

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

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

◆ findEntryByLongName()

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

Definition at line 82 of file EntryMgr.cc.

References DMR_cfg::cerr, gather_cfg::cout, data, ALIUtils::debug, 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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48

◆ findEntryByName()

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

◆ findEntryByShortName()

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

Definition at line 58 of file EntryMgr.cc.

References DMR_cfg::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:80
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48

◆ getDimOutAngleSig()

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

◆ getDimOutAngleVal()

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

◆ getDimOutLengthSig()

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

◆ getDimOutLengthVal()

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

◆ getEntryData()

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

◆ getInstance()

EntryMgr * EntryMgr::getInstance ( )
static

◆ numberOfEntries()

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

◆ readEntryFromReportOut()

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, findEntry(), ALIUtils::getDimensionValue(), ALIUtils::LengthValueDimensionFactor(), theEntryData, and LaserClient_cfi::wl.

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
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
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:80
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:64
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:62

Member Data Documentation

◆ dimOutAngleSig

ALIdouble EntryMgr::dimOutAngleSig
private

Definition at line 47 of file EntryMgr.h.

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

◆ dimOutAngleVal

ALIdouble EntryMgr::dimOutAngleVal
private

Definition at line 47 of file EntryMgr.h.

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

◆ dimOutLengthSig

ALIdouble EntryMgr::dimOutLengthSig
private

Definition at line 47 of file EntryMgr.h.

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

◆ dimOutLengthVal

ALIdouble EntryMgr::dimOutLengthVal
private

Definition at line 47 of file EntryMgr.h.

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

◆ theEntryData

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

◆ theInstance

EntryMgr * EntryMgr::theInstance = nullptr
staticprivate

Definition at line 45 of file EntryMgr.h.

Referenced by getInstance().