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.

References fEntryName.

Referenced by operator<<().

29 { return fEntryName; }
ALIstring fEntryName
Definition: EntryData.h:42

◆ fill()

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

Definition at line 18 of file EntryData.cc.

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

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 }
ALIuint fQuality
Definition: EntryData.h:46
static ALIint debug
Definition: ALIUtils.h:34
ALIdouble fValueOriginal
Definition: EntryData.h:43
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:373
ALIstring extractShortName(const ALIstring &name)
Definition: EntryMgr.cc:125
ALIstring fLongOptOName
Definition: EntryData.h:40
ALIstring fEntryName
Definition: EntryData.h:42
ALIdouble fValueDisplacement
Definition: EntryData.h:44
ALIdouble fSigma
Definition: EntryData.h:45
static EntryMgr * getInstance()
Definition: EntryMgr.cc:16
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
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIstring fShortOptOName
Definition: EntryData.h:41

◆ longOptOName()

const ALIstring& EntryData::longOptOName ( ) const
inline

Definition at line 26 of file EntryData.h.

References fLongOptOName.

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

26 { return fLongOptOName; }
ALIstring fLongOptOName
Definition: EntryData.h:40

◆ optOName()

const ALIstring& EntryData::optOName ( ) const
inline

Definition at line 28 of file EntryData.h.

References longOptOName().

28 { return longOptOName(); }
const ALIstring & longOptOName() const
Definition: EntryData.h:26

◆ quality()

ALIint EntryData::quality ( ) const
inline

Definition at line 33 of file EntryData.h.

References fQuality.

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

33 { return fQuality; }
ALIuint fQuality
Definition: EntryData.h:46

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

ALIdouble fValueDisplacement
Definition: EntryData.h:44

◆ shortOptOName()

const ALIstring& EntryData::shortOptOName ( ) const
inline

Definition at line 27 of file EntryData.h.

References fShortOptOName.

27 { return fShortOptOName; }
ALIstring fShortOptOName
Definition: EntryData.h:41

◆ sigma()

ALIdouble EntryData::sigma ( ) const
inline

Definition at line 32 of file EntryData.h.

References fSigma.

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

32 { return fSigma; }
ALIdouble fSigma
Definition: EntryData.h:45

◆ valueDisplacement()

ALIdouble EntryData::valueDisplacement ( ) const
inline

Definition at line 31 of file EntryData.h.

References fValueDisplacement.

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

31 { return fValueDisplacement; }
ALIdouble fValueDisplacement
Definition: EntryData.h:44

◆ valueOriginal()

ALIdouble EntryData::valueOriginal ( ) const
inline

Definition at line 30 of file EntryData.h.

References fValueOriginal.

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

30 { return fValueOriginal; }
ALIdouble fValueOriginal
Definition: EntryData.h:43

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