BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
write/SubDetectorFragment.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/write/SubDetectorFragment.h
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Helps the user to define and build a SubDetector fragment.
11 */
12
13#ifndef EFORMAT_WRITE_SUBDETECTORFRAGMENT_H
14#define EFORMAT_WRITE_SUBDETECTORFRAGMENT_H
15
17
18namespace eformat {
19
20 namespace write {
21
22 class FullEventFragment; ///< forward
23
24 /**
25 * Defines a helper class to aid the creation of SubDetector fragments.
26 */
28
29 public:
30
31 /**
32 * Builds a new SubDetector fragment from scratch
33 *
34 * @param source_id The source identifier to be using for this
35 * SubDetector
36 */
38
39 /**
40 * Builds a new SubDetector fragment from an existing
41 * SubDetector fragment in contiguous memory.
42 *
43 * @param sd The existing SubDetector fragment
44 */
45 SubDetectorFragment (uint32_t* sd);
46
47 /**
48 * Builds a new SubDetector fragment from an existing SubDetector
49 * fragment in non-contiguous memory. The top-level fragment header is
50 * expected to be on a contiguous area of memory, together with the first
51 * word of the first child fragment (i.e. the ROS header marker). The
52 * following data can be spread around.
53 *
54 * @param sd The existing SubDetector fragment, as a list of nodes,
55 * pre-concatenated by the caller.
56 */
58
59 /**
60 * Builds a new empty SubDetectorFragment, otherwise invalid. This is
61 * useful for array builds and standard containers.
62 */
64
65 /**
66 * Copy constructor. This will only copy the meta data, not the fragment
67 * relationships and block-data (children, parent and status block)
68 * contained in the to-be-copied fragment. If you wish this fragment has
69 * the same parents, and children of the copied fragment, you have to do
70 * this operation manually, after copying. If you wish to make a copy of
71 * the status as well, do it manually and then assign it to this
72 * fragment using the status() method.
73 *
74 * @param other The other fragment to take the meta data from.
75 */
77
78 /**
79 * Base destructor
80 */
82
83 /**
84 * Assigment operator. This will only copy the meta data, not the
85 * fragment relationships and block-data (children and parent and status
86 * block) contained in the to-be-copied fragment. If you wish this
87 * fragment has the same parents, and children of the copied fragment,
88 * you have to do this operation manually, after copying. If you wish to
89 * make a copy of the status as well, do it manually and then assign it
90 * to this fragment using the status() method.
91 *
92 * @param other The other fragment to take the meta data from.
93 */
95
96 /**
97 * Changes the number of status words and the status words themselves
98 * from the fragment
99 *
100 * @param n How many status words the underlying SubDetectorFragment
101 * fragment supposed to have.
102 * @param status A pointer to <tt>n</tt> pre-allocated words
103 */
104 void status (uint32_t n, const uint32_t* status);
105
106 /**
107 * Returns the number of status wors in this fragment
108 */
109 inline uint32_t nstatus (void) const { return m_node[0].base[5]; }
110
111 /**
112 * Returns a pointer to the first status word to be used by this fragment
113 */
114 inline const uint32_t* status (void) const { return m_node[1].base; }
115
116 /**
117 * Changes the minor version number of the fragment
118 *
119 * @param s The new minor version for this header
120 */
121 inline void minor_version (uint16_t v)
122 { m_node[0].base[3] = eformat::DEFAULT_VERSION | v; }
123
124 /**
125 * Returns the minor version number of the fragment
126 */
127 inline uint16_t minor_version (void) const
128 { return 0xffff & m_node[0].base[3]; }
129
130 /**
131 * Changes the source identifier for this fragment
132 *
133 * @param s The new value to set
134 */
135 inline void source_id (uint32_t s)
136 { m_node[0].base[4] = s; }
137
138 /**
139 * Returns the source identifier of this fragment
140 */
141 inline uint32_t source_id (void) const
142 { return m_node[0].base[4]; }
143
144 /**
145 * Returns the total size for the meta data (everything that does @b not
146 * encompass the contents of the m_data pointer in the private
147 * representation of this class) in the fragment, in words
148 */
149 inline uint32_t meta_size_word (void) const
150 { return m_node[0].base[2]; }
151
152 /**
153 * Returns the total size for this fragment, in words
154 */
155 inline uint32_t size_word (void) const
156 { return m_node[0].base[1]; }
157
158 /**
159 * Appends a new ROS fragment to this SubDetector fragment.
160 *
161 * @warning This will change the page structure of the last ROS fragment
162 * inserted here, in order to concatenate the ROS fragments
163 * together. Please note that this operation is not compatible with
164 * multiple threads of operation, if you would like to share
165 * eformat::write::ROSFragment's between threads. A better strategy would
166 * be create, for every thread of operation, a proper ROSFragment
167 * instead.
168 *
169 * @param ros The ROS fragment to be appended to myself
170 */
172
173 /**
174 * This returns the first child of this fragment. The system operates as
175 * a concatenated list of fragments. From this child you can get to the
176 * next.
177 */
178 inline const ROSFragment* first_child (void) const { return m_child; }
179
180 /**
181 * This method is used by children of this fragment to notify fragment
182 * size changes.
183 *
184 * @param o The old size, in 32-bit words
185 * @param n The new size, in 32-bit words
186 */
187 void size_change (uint32_t o, uint32_t n);
188
189 /**
190 * This returns the parent fragment
191 */
192 inline const FullEventFragment* parent (void) const
193 { return m_parent; }
194
195 /**
196 * This sets the parent fragment
197 *
198 * @param fe The FullEventFragment parent fragment of this SubDetector
199 */
201 { m_parent = fe; }
202
203 /**
204 * Returns the next sibling
205 */
206 inline const SubDetectorFragment* next (void) const { return m_next; }
207
208 /**
209 * Sets the next sibling
210 *
211 * @param n The sibling following this fragment
212 */
213 inline void next (const SubDetectorFragment* n) { m_next = n; }
214
215 /**
216 * Returns the total number of (raw memory) pages this fragment is
217 * composed of.
218 *
219 * @warning This operation navigates at a potentially large list of child
220 * page nodes (for a full ATLAS event this should be bigger than 2,000
221 * pages when built from scratch). If you don't do your bookkeeping,
222 * avoid calling this too often.
223 */
224 uint32_t page_count (void) const;
225
226 /**
227 * Returns the first node of a list of nodes that represent the fragment
228 * you have constructed. To make use of it, just browse the list as
229 * defined in node.h
230 */
231 const eformat::write::node_t* bind (void);
232
233 private: //representation
234
235 uint32_t m_header[7]; ///< The SubDetector Header
236 eformat::write::node_t m_node[3]; ///< Node representation
237 eformat::write::FullEventFragment* m_parent; ///< my parent
238 eformat::write::ROSFragment* m_child; ///< my ROS children
239 eformat::write::ROSFragment* m_last; ///< my last ROS child
240 const eformat::write::SubDetectorFragment* m_next; ///< Next sibling
241 eformat::write::node_t m_extra; ///< Extra pages I may have
242 uint32_t m_extra_count; ///< How many extra pages I have
243
244 };
245
246 }
247
248}
249
250#endif /* EFORMAT_WRITE_SUBDETECTORFRAGMENT_H */
const Int_t n
XmlRpcServer s
Definition: HelloServer.cpp:11
**********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
const FullEventFragment * parent(void) const
const ROSFragment * first_child(void) const
SubDetectorFragment & operator=(const SubDetectorFragment &other)
void parent(eformat::write::FullEventFragment *fe)
const SubDetectorFragment * next(void) const
const eformat::write::node_t * bind(void)
void append(eformat::write::ROSFragment *ros)
void next(const SubDetectorFragment *n)
void size_change(uint32_t o, uint32_t n)
const uint32_t DEFAULT_VERSION
Definition: Version.h:24
uint32_t * base
The base address for this page.
Definition: node.h:27
Helps the user to define and build a ROS fragment.