CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Friends
EntryData Class Reference

#include <EntryData.h>

Public Member Functions

 EntryData ()
 
const ALIstringentryName () const
 
void fill (const std::vector< ALIstring > &wordlist)
 
const ALIstringlongOptOName () const
 
const ALIstringoptOName () const
 
ALIint quality () const
 
void setValueDisplacement (const ALIdouble val)
 
const ALIstringshortOptOName () const
 
ALIdouble sigma () const
 
ALIdouble valueDisplacement () const
 
ALIdouble valueOriginal () const
 
 ~EntryData ()
 

Protected Attributes

ALIstring fEntryName
 
ALIstring fLongOptOName
 
ALIuint fQuality
 
ALIstring fShortOptOName
 
ALIdouble fSigma
 
ALIdouble fValueDisplacement
 
ALIdouble fValueOriginal
 

Friends

std::ostream & operator<< (std::ostream &os, const EntryData &c)
 

Detailed Description

Definition at line 15 of file EntryData.h.

Constructor & Destructor Documentation

◆ EntryData()

EntryData::EntryData ( )

Definition at line 16 of file EntryData.cc.

16 {}

◆ ~EntryData()

EntryData::~EntryData ( )

Definition at line 83 of file EntryData.cc.

83 {}

Member Function Documentation

◆ entryName()

const ALIstring& EntryData::entryName ( ) const
inline

Definition at line 29 of file EntryData.h.

29 { return fEntryName; }

References fEntryName.

Referenced by operator<<().

◆ fill()

void EntryData::fill ( const std::vector< ALIstring > &  wordlist)

Definition at line 18 of file EntryData.cc.

18  {
19  if (ALIUtils::debug >= 4)
20  std::cout << "Filling entry data:" << std::endl;
21  //----------- Check there are > 10 words
22  if (wordlist.size() < 10) {
23  //t ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
24  ALIUtils::dumpVS(wordlist, " !!! Incorrect format for EntryData:", std::cerr);
25  std::cerr << std::endl << " There should be at least 10 words" << std::endl;
26  abort();
27  }
28 
29  EntryMgr* entryMgr = EntryMgr::getInstance();
30  //----- set name and type
31  fLongOptOName = wordlist[2];
32  fShortOptOName = entryMgr->extractShortName(wordlist[2]);
33  fEntryName = wordlist[3];
34 
35  //----- set value
36  fValueOriginal = ALIUtils::getFloat(wordlist[4]);
37  fValueDisplacement = 0.;
38  // fValueOriginal = ALIUtils::getFloat( wordlist[7] );
39  // fValueDisplacement = ALIUtils::getFloat( wordlist[12] );
40  /* done in Entry.cc
41  if( wordlist[3].substr(0,6) == "centre" ) {
42  fValue *= entryMgr->getDimOutLengthVal();
43  if(ALIUtils::debug >= 5) std::cout << "value " << fValue << " " << entryMgr->getDimOutLengthVal() << std::endl;
44  } else if( wordlist[3].substr(0,6) == "angles" ) {
45  fValue *= entryMgr->getDimOutAngleVal();
46  } else {
47  std::cerr << "!!!FATAL ERROR: reading from 'report.out' only supports centre or angles, NOT " << wordlist[3] << std::endl;
48  abort();
49  }
50  */
51 
52  //----- set sigma
53  fSigma = ALIUtils::getFloat(wordlist[6]);
54  /* done in Entry.cc
55  if( wordlist[3].substr(0,6) == "centre" ) {
56  fSigma *= entryMgr->getDimOutLengthSig();
57  }else if( wordlist[3].substr(0,6) == "angles" ) {
58  fSigma *= entryMgr->getDimOutAngleSig();
59  }
60  */
61 
62  //----- set quality
63  if (wordlist[0] == ALIstring("UNK:")) {
64  fQuality = 2;
65  } else if (wordlist[0] == ALIstring("CAL:")) {
66  fQuality = 1;
67  } else if (wordlist[0] == ALIstring("FIX:")) {
68  fQuality = 0;
69  } else {
70  //- ALIFileIn::getInstance( Model::SDFName() ).ErrorInLine();
71  std::cerr << " quality should be 'UNK:' or 'CAL:' or 'FIX:', instead of " << wordlist[0] << std::endl;
72  abort();
73  }
74 
75  if (ALIUtils::debug >= 4) {
76  //t std::cout << *this << std::endl;
77  }
78 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, ALIUtils::dumpVS(), EntryMgr::extractShortName(), fEntryName, fLongOptOName, fQuality, fShortOptOName, fSigma, fValueDisplacement, fValueOriginal, ALIUtils::getFloat(), and EntryMgr::getInstance().

◆ longOptOName()

const ALIstring& EntryData::longOptOName ( ) const
inline

Definition at line 26 of file EntryData.h.

26 { return fLongOptOName; }

References fLongOptOName.

Referenced by operator<<(), and optOName().

◆ optOName()

const ALIstring& EntryData::optOName ( ) const
inline

Definition at line 28 of file EntryData.h.

28 { return longOptOName(); }

References longOptOName().

◆ quality()

ALIint EntryData::quality ( ) const
inline

Definition at line 33 of file EntryData.h.

33 { return fQuality; }

References fQuality.

Referenced by Entry::fillFromReportOutFileQuality(), and operator<<().

◆ setValueDisplacement()

void EntryData::setValueDisplacement ( const ALIdouble  val)
inline

Definition at line 34 of file EntryData.h.

References fValueDisplacement, and heppy_batch::val.

Referenced by Entry::fillFromReportOutFileValue().

◆ shortOptOName()

const ALIstring& EntryData::shortOptOName ( ) const
inline

Definition at line 27 of file EntryData.h.

27 { return fShortOptOName; }

References fShortOptOName.

◆ sigma()

ALIdouble EntryData::sigma ( ) const
inline

Definition at line 32 of file EntryData.h.

32 { return fSigma; }

References fSigma.

Referenced by Entry::fillFromReportOutFileSigma(), and operator<<().

◆ valueDisplacement()

ALIdouble EntryData::valueDisplacement ( ) const
inline

◆ valueOriginal()

ALIdouble EntryData::valueOriginal ( ) const
inline

Definition at line 30 of file EntryData.h.

30 { return fValueOriginal; }

References fValueOriginal.

Referenced by Entry::fillFromReportOutFileValue(), and operator<<().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const EntryData c 
)
friend

Definition at line 86 of file EntryData.cc.

86  {
87  os << "ENTRY: " << ent.longOptOName() << " : " << ent.entryName() << " valueOriginal " << ent.valueOriginal()
88  << " valueDisplacement " << ent.valueDisplacement() << " sigma " << ent.sigma() << " quality " << ent.quality()
89  << std::endl;
90 
91  return os;
92 }

Member Data Documentation

◆ fEntryName

ALIstring EntryData::fEntryName
protected

Definition at line 42 of file EntryData.h.

Referenced by entryName(), and fill().

◆ fLongOptOName

ALIstring EntryData::fLongOptOName
protected

Definition at line 40 of file EntryData.h.

Referenced by fill(), and longOptOName().

◆ fQuality

ALIuint EntryData::fQuality
protected

Definition at line 46 of file EntryData.h.

Referenced by fill(), and quality().

◆ fShortOptOName

ALIstring EntryData::fShortOptOName
protected

Definition at line 41 of file EntryData.h.

Referenced by fill(), and shortOptOName().

◆ fSigma

ALIdouble EntryData::fSigma
protected

Definition at line 45 of file EntryData.h.

Referenced by fill(), and sigma().

◆ fValueDisplacement

ALIdouble EntryData::fValueDisplacement
protected

Definition at line 44 of file EntryData.h.

Referenced by fill(), setValueDisplacement(), and valueDisplacement().

◆ fValueOriginal

ALIdouble EntryData::fValueOriginal
protected

Definition at line 43 of file EntryData.h.

Referenced by fill(), and valueOriginal().

ALIUtils::getFloat
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:373
EntryMgr
Definition: EntryMgr.h:15
EntryData::fQuality
ALIuint fQuality
Definition: EntryData.h:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
EntryData::fSigma
ALIdouble fSigma
Definition: EntryData.h:45
EntryData::fLongOptOName
ALIstring fLongOptOName
Definition: EntryData.h:40
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
EntryData::longOptOName
const ALIstring & longOptOName() const
Definition: EntryData.h:26
EntryData::fValueOriginal
ALIdouble fValueOriginal
Definition: EntryData.h:43
EntryMgr::extractShortName
ALIstring extractShortName(const ALIstring &name)
Definition: EntryMgr.cc:125
EntryData::fEntryName
ALIstring fEntryName
Definition: EntryData.h:42
ALIUtils::dumpVS
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
Definition: ALIUtils.cc:465
heppy_batch.val
val
Definition: heppy_batch.py:351
EntryMgr::getInstance
static EntryMgr * getInstance()
Definition: EntryMgr.cc:16
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
EntryData::fValueDisplacement
ALIdouble fValueDisplacement
Definition: EntryData.h:44
EntryData::fShortOptOName
ALIstring fShortOptOName
Definition: EntryData.h:41