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.

17 {};

Referenced by getInstance().

Member Function Documentation

◆ clearEntryData()

void EntryMgr::clearEntryData ( )
inline

Definition at line 39 of file EntryMgr.h.

39 { theEntryData.clear(); }

References theEntryData.

◆ extractShortName()

ALIstring EntryMgr::extractShortName ( const ALIstring name)

Definition at line 125 of file EntryMgr.cc.

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 }

References Skims_PA_cff::name.

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

◆ findEntry()

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

Definition at line 115 of file EntryMgr.cc.

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 }

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

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

◆ findEntryByLongName()

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

Definition at line 82 of file EntryMgr.cc.

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 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, data, ALIUtils::debug, and theEntryData.

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

◆ findEntryByName()

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

Definition at line 30 of file EntryMgr.h.

30  {
31  return findEntryByLongName(optoName, entryName);
32  }

References findEntryByLongName().

◆ findEntryByShortName()

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

Definition at line 58 of file EntryMgr.cc.

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 }

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

Referenced by Entry::fill().

◆ getDimOutAngleSig()

ALIdouble EntryMgr::getDimOutAngleSig ( ) const
inline

Definition at line 26 of file EntryMgr.h.

26 { return dimOutAngleSig; }

References dimOutAngleSig.

Referenced by Entry::fillFromReportOutFileSigma().

◆ getDimOutAngleVal()

ALIdouble EntryMgr::getDimOutAngleVal ( ) const
inline

Definition at line 25 of file EntryMgr.h.

25 { return dimOutAngleVal; }

References dimOutAngleVal.

Referenced by Entry::fillFromReportOutFileValue().

◆ getDimOutLengthSig()

ALIdouble EntryMgr::getDimOutLengthSig ( ) const
inline

Definition at line 24 of file EntryMgr.h.

24 { return dimOutLengthSig; }

References dimOutLengthSig.

Referenced by Entry::fillFromReportOutFileSigma().

◆ getDimOutLengthVal()

ALIdouble EntryMgr::getDimOutLengthVal ( ) const
inline

Definition at line 23 of file EntryMgr.h.

23 { return dimOutLengthVal; }

References dimOutLengthVal.

Referenced by Entry::fillFromReportOutFileValue().

◆ getEntryData()

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

Definition at line 37 of file EntryMgr.h.

37 { return theEntryData; }

References theEntryData.

◆ getInstance()

EntryMgr * EntryMgr::getInstance ( )
static

◆ numberOfEntries()

ALIint EntryMgr::numberOfEntries ( )
inline

Definition at line 36 of file EntryMgr.h.

36 { return theEntryData.size(); }

References theEntryData.

Referenced by Model::SetValueDisplacementsFromReportOut().

◆ readEntryFromReportOut()

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

Definition at line 29 of file EntryMgr.cc.

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 }

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

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

EntryMgr::dimOutAngleSig
ALIdouble dimOutAngleSig
Definition: EntryMgr.h:47
ALIUtils::getDimensionValue
static ALIdouble getDimensionValue(const ALIstring &dim, const ALIstring &dimType)
Definition: ALIUtils.cc:477
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
EntryMgr::findEntryByLongName
EntryData * findEntryByLongName(const ALIstring &optoName, const ALIstring &entryName="")
Definition: EntryMgr.cc:82
EntryMgr::dimOutLengthVal
ALIdouble dimOutLengthVal
Definition: EntryMgr.h:47
EntryMgr::EntryMgr
EntryMgr()
Definition: EntryMgr.h:17
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
EntryMgr::theEntryData
std::vector< EntryData * > theEntryData
Definition: EntryMgr.h:48
EntryMgr::extractShortName
ALIstring extractShortName(const ALIstring &name)
Definition: EntryMgr.cc:125
ALIUtils::AngleValueDimensionFactor
static ALIdouble AngleValueDimensionFactor()
Definition: ALIUtils.h:64
EntryData
Definition: EntryData.h:15
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ALIint
int ALIint
Definition: CocoaGlobals.h:15
EntryMgr::dimOutAngleVal
ALIdouble dimOutAngleVal
Definition: EntryMgr.h:47
ALIUtils::LengthValueDimensionFactor
static ALIdouble LengthValueDimensionFactor()
Definition: ALIUtils.h:62
EntryMgr::theInstance
static EntryMgr * theInstance
Definition: EntryMgr.h:45
EntryMgr::dimOutLengthSig
ALIdouble dimOutLengthSig
Definition: EntryMgr.h:47
EntryMgr::findEntry
EntryData * findEntry(const std::vector< ALIstring > &wl)
Definition: EntryMgr.cc:115
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8