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

Definition at line 16 of file EntryData.cc.

17 {
18 }
EntryData::~EntryData ( )

Definition at line 86 of file EntryData.cc.

87 {
88 }

Member Function Documentation

const ALIstring& EntryData::entryName ( ) const
inline

Definition at line 30 of file EntryData.h.

References fEntryName.

Referenced by operator<<().

30 { return fEntryName; }
ALIstring fEntryName
Definition: EntryData.h:44
void EntryData::fill ( const std::vector< ALIstring > &  wordlist)

Definition at line 20 of file EntryData.cc.

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

Referenced by EntryMgr::readEntryFromReportOut().

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

Definition at line 27 of file EntryData.h.

References fLongOptOName.

Referenced by EntryMgr::findEntryByLongName(), operator<<(), and optOName().

27 { return fLongOptOName; }
ALIstring fLongOptOName
Definition: EntryData.h:42
const ALIstring& EntryData::optOName ( ) const
inline

Definition at line 29 of file EntryData.h.

References longOptOName().

29 { return longOptOName(); }
const ALIstring & longOptOName() const
Definition: EntryData.h:27
ALIint EntryData::quality ( ) const
inline

Definition at line 34 of file EntryData.h.

References fQuality.

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

34 { return fQuality; }
ALIuint fQuality
Definition: EntryData.h:48
void EntryData::setValueDisplacement ( const ALIdouble  val)
inline

Definition at line 35 of file EntryData.h.

References fValueDisplacement, and heppy_batch::val.

Referenced by Entry::fillFromReportOutFileValue().

36  { fValueDisplacement = val; }
ALIdouble fValueDisplacement
Definition: EntryData.h:46
const ALIstring& EntryData::shortOptOName ( ) const
inline

Definition at line 28 of file EntryData.h.

References fShortOptOName.

28 { return fShortOptOName; }
ALIstring fShortOptOName
Definition: EntryData.h:43
ALIdouble EntryData::sigma ( ) const
inline

Definition at line 33 of file EntryData.h.

References fSigma.

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

33 { return fSigma; }
ALIdouble fSigma
Definition: EntryData.h:47
ALIdouble EntryData::valueDisplacement ( ) const
inline

Definition at line 32 of file EntryData.h.

References fValueDisplacement.

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

32 { return fValueDisplacement; }
ALIdouble fValueDisplacement
Definition: EntryData.h:46
ALIdouble EntryData::valueOriginal ( ) const
inline

Definition at line 31 of file EntryData.h.

References fValueOriginal.

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

31 { return fValueOriginal; }
ALIdouble fValueOriginal
Definition: EntryData.h:45

Friends And Related Function Documentation

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

Definition at line 92 of file EntryData.cc.

93 {
94 
95  os << "ENTRY: " << ent.longOptOName() << " : " << ent.entryName()
96  << " valueOriginal " << ent.valueOriginal()
97  << " valueDisplacement " << ent.valueDisplacement()
98  << " sigma " << ent.sigma()
99  << " quality " << ent.quality() << std::endl;
100 
101  return os;
102 
103 }

Member Data Documentation

ALIstring EntryData::fEntryName
protected

Definition at line 44 of file EntryData.h.

Referenced by entryName(), and fill().

ALIstring EntryData::fLongOptOName
protected

Definition at line 42 of file EntryData.h.

Referenced by fill(), and longOptOName().

ALIuint EntryData::fQuality
protected

Definition at line 48 of file EntryData.h.

Referenced by fill(), and quality().

ALIstring EntryData::fShortOptOName
protected

Definition at line 43 of file EntryData.h.

Referenced by fill(), and shortOptOName().

ALIdouble EntryData::fSigma
protected

Definition at line 47 of file EntryData.h.

Referenced by fill(), and sigma().

ALIdouble EntryData::fValueDisplacement
protected

Definition at line 46 of file EntryData.h.

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

ALIdouble EntryData::fValueOriginal
protected

Definition at line 45 of file EntryData.h.

Referenced by fill(), and valueOriginal().