BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/calibUtil/calibUtil/StripSrv.h
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/calibUtil/calibUtil/StripSrv.h,v 1.1.1.1 2005/10/17 06:12:26 maqm Exp $
2#ifndef CALIBUTIL_STRIPSRV_H
3#define CALIBUTIL_STRIPSRV_H
4
5#include <string>
6#include <iostream>
7#include <vector>
8#include <xercesc/dom/DOMElement.hpp>
9
10namespace calibUtil {
11
12 class GenericSrv;
13
14 /** Visitor callbacks can indicate whether traversal should continue
15 or not.
16 CONT normal return: continue processing
17 USER_DONE client has all information desired; no more traversal
18 ERROR client has serious error; abort
19 DONE not used by client. Will be returned by
20 BadStrips::traverse in case processing was normal.
21 */
23
24 typedef std::vector<unsigned short int> StripCol;
25
26 /** Visitor class interface definition, required for invoking
27 StripSrv::traverse
28 */
29 class ClientObject {
30 public:
31 /** Handle bad tower
32 @param row zero-based row of tower
33 @param col zero-based column of tower
34 @param badness bit mask including 3 least sig. bits
35 These bits are defined in ChannelStatusDef.h
36
37 */
38 virtual eVisitorRet badTower(unsigned int row, unsigned int col,
39 int badness)=0;
40
41 /** Handle bad uniplane with some or all bad strips
42 @param row zero-based row of tower
43 @param col zero-based column of tower
44 @param badness bit mask including 3 least sig. bits:
45 These bits are defined in ChannelStatusDef.h (same as for tower)
46 @param allBad if true all strips are bad. @arg strips should
47 be ignored
48 @param strips vector of strips of badness @arg badness. If
49 empty, entire plane is bad.
50 */
51 virtual eVisitorRet badPlane(unsigned int row, unsigned int col,
52 unsigned int tray, bool top,
53 int badness, bool allBad,
54 const StripCol& strips)=0;
55
56 }; // end pure virtual visitor class definition
57
58
59 class StripSrv {
60
61
62 public:
63
65 /// Clients should use as return values for readData
66
67 typedef struct stowerRC {
68 unsigned short int row;
69 unsigned short int col;
71 typedef std::vector<unsigned short int> StripCol;
72
73 /// constructor. Initializes strip service by creating a DOM structure
74 /// out of the XML file and filling in the internal data structures
75 StripSrv(std::string xmlFileName);
76
77 /// Constructor to be used when creating new calibrations
78 StripSrv(eBadType badType, const GenericSrv& gen);
79
80 /// destructor. Deallocates memory
82
83 /// returns the status (Hot or Dead) of the strip
85
86 /// lists all towers with bad strips
87 void getBadTowers(std::vector<towerRC>& towerIds) const;
88
89
90
91 /// methods giving access to generic data
92
93 /// Get instrument name
94 std::string getInst() const;
95
96 /// Get timestamp
97 std::string getTimestamp() const;
98
99 /// Get calibration type
100 std::string getCalType() const;
101
102 /// Get format Version
103 std::string getFmtVer() const;
104
105 /// call back method for client to access large data
106 //maqm fix
107 //eVisitorRet StripSrv::traverseInfo(ClientObject *client) const;
109
110 eVisitorRet writeXml(std::ostream* out);
111
112 private:
113
114 // A tower just has a collection of uniplanes,
115 // each identified by tray number, top or bottom, and badness
116 //
117
118 typedef struct sUniplane {
119 bool m_allBad; // if true, StripCol may be ignored
120 int m_howBad;
121 int m_tray;
122 bool m_top;
123 StripCol m_strips;
124 } Uniplane;
125
126 typedef struct sTower {
127 // towerRC id;
128 unsigned short m_row;
129 unsigned short m_col;
130 bool m_allBad; // if true, uniplanes may be ignored
131 int m_howBad;
132 std::vector<Uniplane> m_uniplanes;
133 } Tower;
134
135 std::vector<Tower> m_towers;
136 eBadType m_badType;
137
138 enum eState {
139 FROM_PERS, // read in from persistent form; read-only
140 BUILDING, // in process of building the list
141 WRITTEN }; // built and written to persistent form (read-only)
142
143 eState m_state;
144
145 // object to store generic data
146 GenericSrv *m_genSrv;
147
148
149 /// this function takes in a stripList in string format and
150 /// fills a vector with corresponding strip numbers
151 void strToNum(std::string strips, std::vector<unsigned short int> &v);
152
153 /// Handles all the messy of details of extracting information
154 /// about a single unilayer from the XML representation
155 // void fillUni(const DOM_Element& uniElt, Unilayer* uni);
156 void fillUni(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* uniElt,
157 Uniplane* uni);
158
159 void fillStrips(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* badElt,
160 StripCol& list);
161
162 /// Internal utility, used when this object must be mutable (e.g. addBad)
163 Tower* findTower(towerRC& towerId);
164 /// const version of findTower, used by const public methods
165 const Tower* findTower(const towerRC& towerId) const;
166
167 };
168
169}// end of namespace calibUtil
170
171#endif
172
173
174
175
176
177
178
179
180
181
182
**********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
virtual eVisitorRet badTower(unsigned int row, unsigned int col, int badness)=0
virtual eVisitorRet badPlane(unsigned int row, unsigned int col, unsigned int tray, bool top, int badness, bool allBad, const StripCol &strips)=0
eVisitorRet writeXml(std::ostream *out)
eBadType getBadType() const
returns the status (Hot or Dead) of the strip
StripSrv(std::string xmlFileName)
std::string getInst() const
methods giving access to generic data
std::string getCalType() const
Get calibration type.
eVisitorRet traverseInfo(ClientObject *client) const
call back method for client to access large data
std::string getTimestamp() const
Get timestamp.
StripSrv(eBadType badType, const GenericSrv &gen)
Constructor to be used when creating new calibrations.
~StripSrv()
destructor. Deallocates memory
void getBadTowers(std::vector< towerRC > &towerIds) const
lists all towers with bad strips
struct calibUtil::StripSrv::stowerRC towerRC
Clients should use as return values for readData.
std::string getFmtVer() const
Get format Version.
Module implements methods for clients to get generic services.