BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Supersede.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/rdbModel/src/Tables/Supersede.cxx,v 1.1.1.1 2005/10/17 06:10:53 maqm Exp $
2
6
7namespace rdbModel {
8
10 m_myTable(table), m_onlyIf(onlyIf), m_normalized(false) {
11 m_setOld.clear();
12 m_setNew.clear();
13 m_oldDefaults.clear();
14 m_oldForced.clear();
15 m_ask.clear();
16 m_fixed.clear();
17 }
18
20 FIELDTYPE vtype = s->getDestType();
21 switch(vtype) {
22 case FIELDTYPEold:
23 case FIELDTYPEoldDef: // this shouldn't occur
24 m_setOld.push_back(s); break;
25 case FIELDTYPEtoBe:
26 case FIELDTYPEtoBeDef: // nor this
27 m_setNew.push_back(s); break;
28 default: throw RdbException("Bad value type for <set> destination");
29 }
30 return;
31 }
32
33
35 if (m_normalized) return;
36 // unsigned nOld = m_setOld.size();
37 unsigned nNew = m_setNew.size();
38 // For each object in m_setNew, store information in one of the
39 // vectors of column names or in m_fixed for easy access later
40 for (unsigned iNew = 0; iNew < nNew; iNew++) {
41 // FIELDTYPE srcType = m_setOld[iOld]->getSrcType();
42 // switch (srcType) {
43 switch (m_setNew[iNew]->getSrcType()) {
44 case FIELDTYPEold:
45 m_oldForced.push_back(m_setNew[iNew]->getDestColName());
46 break;
47 case FIELDTYPEoldDef:
48 m_oldDefaults.push_back(m_setNew[iNew]->getDestColName());
49 break;
50 case FIELDTYPEask:
51 m_ask.push_back(m_setNew[iNew]->getDestColName());
52 break;
53 case FIELDTYPElit:
54 m_fixed.push_back(FieldVal(m_setNew[iNew]->getDestColName(),
55 m_setNew[iNew]->getSrcValue()));
56 m_fixedInterp.push_back(m_setNew[iNew]->getInterp());
57 break;
58 default:
59 throw RdbException("Supersede::normalize Unrecognized <set>");
60 }
61 }
62
63 m_fromOld.reserve(m_oldDefaults.size() + m_oldForced.size());
64 m_fromOld.clear();
65 for (unsigned i = 0; i < m_oldDefaults.size(); i++) {
66 m_fromOld.push_back(m_oldDefaults[i]);
67 }
68 for (unsigned i = 0; i < m_oldForced.size(); i++) {
69 m_fromOld.push_back(m_oldForced[i]);
70 }
71 m_normalized = true;
72 }
73
74
76 while (m_setOld.size() ) {
77 Set* s = m_setOld.back();
78 m_setOld.pop_back();
79 delete s;
80 }
81 while (m_setNew.size() ) {
82 Set* s = m_setNew.back();
83 m_setNew.pop_back();
84 delete s;
85 }
86 // delete m_onlyIf; probably already handled by ~Table
87 }
88 // For now assume visitSupersede will handle everything. Don't need
89 // separate visitSet method.
91 Visitor::VisitorState state = v->visitSupersede(this);
92 if (state == Visitor::VBRANCHDONE) return Visitor::VCONTINUE;
93 return state;
94 }
95
96
97}
XmlRpcServer s
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
Supersede(Table *table, Assertion *onlyIf=0)
Definition Supersede.cxx:9
void addSet(Set *s)
Definition Supersede.cxx:19
Visitor::VisitorState accept(Visitor *v)
Definition Supersede.cxx:90
FIELDTYPE
Definition Rdb.h:21
@ FIELDTYPEtoBe
Definition Rdb.h:24
@ FIELDTYPEold
Definition Rdb.h:23
@ FIELDTYPElit
Definition Rdb.h:22
@ FIELDTYPEtoBeDef
Definition Rdb.h:28
@ FIELDTYPEoldDef
Definition Rdb.h:27
@ FIELDTYPEask
Definition Rdb.h:25