File indexing completed on 2024-04-06 11:56:01
0001
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/CocoaModel/interface/EntryData.h"
0009 #include "Alignment/CocoaModel/interface/EntryMgr.h"
0010 #include "Alignment/CocoaUtilities/interface/ALIUtils.h"
0011 #include <cstdlib>
0012
0013
0014
0015
0016 EntryData::EntryData() {}
0017
0018 void EntryData::fill(const std::vector<ALIstring>& wordlist) {
0019 if (ALIUtils::debug >= 4)
0020 std::cout << "Filling entry data:" << std::endl;
0021
0022 if (wordlist.size() < 10) {
0023
0024 ALIUtils::dumpVS(wordlist, " !!! Incorrect format for EntryData:", std::cerr);
0025 std::cerr << std::endl << " There should be at least 10 words" << std::endl;
0026 abort();
0027 }
0028
0029 EntryMgr* entryMgr = EntryMgr::getInstance();
0030
0031 fLongOptOName = wordlist[2];
0032 fShortOptOName = entryMgr->extractShortName(wordlist[2]);
0033 fEntryName = wordlist[3];
0034
0035
0036 fValueOriginal = ALIUtils::getFloat(wordlist[4]);
0037 fValueDisplacement = 0.;
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 fSigma = ALIUtils::getFloat(wordlist[6]);
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 if (wordlist[0] == ALIstring("UNK:")) {
0064 fQuality = 2;
0065 } else if (wordlist[0] == ALIstring("CAL:")) {
0066 fQuality = 1;
0067 } else if (wordlist[0] == ALIstring("FIX:")) {
0068 fQuality = 0;
0069 } else {
0070
0071 std::cerr << " quality should be 'UNK:' or 'CAL:' or 'FIX:', instead of " << wordlist[0] << std::endl;
0072 abort();
0073 }
0074
0075 if (ALIUtils::debug >= 4) {
0076
0077 }
0078 }
0079
0080
0081
0082
0083 EntryData::~EntryData() {}
0084
0085
0086 std::ostream& operator<<(std::ostream& os, const EntryData& ent) {
0087 os << "ENTRY: " << ent.longOptOName() << " : " << ent.entryName() << " valueOriginal " << ent.valueOriginal()
0088 << " valueDisplacement " << ent.valueDisplacement() << " sigma " << ent.sigma() << " quality " << ent.quality()
0089 << std::endl;
0090
0091 return os;
0092 }