124{
126
127
128 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
129 unsigned long long timestamp = ctx.eventID().time_stamp();
130 if (timestamp)
131 elemMap->
set(ctx.eventID().time_stamp(),
"mdt element map");
132 else
133 elemMap->
set(ctx.eventID().run_number(), ctx.eventID().event_number(),
"mdt element map");
134
135
136
138
139
141
142
145 for (
unsigned int i = 0;
i < 10; ++
i) {
146 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
147
148 unsigned long long timestamp = ctx.eventID().time_stamp();
149 if (timestamp)
150 elemMap->
set(ctx.eventID().time_stamp() + 10*i,
"mdt element map");
151 else
152 elemMap->
set(ctx.eventID().run_number() + i, ctx.eventID().event_number(),
"mdt element map");
153
155 elemMapColl->
add(2*i+1+i + offset);
156 }
157
158
159 ATH_CHECK(
detStore()->record(elemMapColl,
"/IOVDbTest/IOVDbTestMDTEleMapColl") );
160
161
162 IOVDbTestAmdbCorrection* amdbCorr = new IOVDbTestAmdbCorrection;
163 HepGeom::Point3D<double>
x(1.0, 2.0, 3.0);
164 HepGeom::Point3D<double>
y(4.0, 5.0, 6.0);
166
167 x = HepGeom::Point3D<double>(11.0, 22.0, 33.0);
168 y = HepGeom::Point3D<double>(44.0, 55.0, 66.0);
169 }
170 amdbCorr->
set(
x,
y,
"amdb correction");
171
173
174
175
176
177 coral::AttributeListSpecification* attrSpec = new coral::AttributeListSpecification();
178 attrSpec->extend("xPosition", "float");
179 attrSpec->extend("id", "int");
180 attrSpec->extend("name", "string");
181
182 if (!attrSpec->size()) {
184 return(StatusCode::FAILURE);
185 }
186
187
188
189
190
191
192 AthenaAttributeList* attrList = new AthenaAttributeList(*attrSpec);
193 (*attrList)[
"xPosition"].setValue((
float)
m_run);
194 (*attrList)["id"].setValue((int)7);
195 (*attrList)["name"].setValue(std::string("TestAttrList"));
197
198 (*attrList)["xPosition"].setValue((float)125.0);
199 (*attrList)["id"].setValue((int)27);
200 (*attrList)["name"].setValue(std::string("TestAttrListNEWTAG"));
201 }
202 std::ostringstream attrStr1;
203
204 attrList->toOutputStream( attrStr1 );
205
207
209
210
211
213 coral::AttributeListSpecification* fanSpec = new coral::AttributeListSpecification();
214 fanSpec->extend("FanBool","bool");
215 fanSpec->extend("FanInt","int");
216 fanSpec->extend("FanUInt","unsigned int");
217 fanSpec->extend("FanI64","long long");
218 fanSpec->extend("FanU64","unsigned long long");
219 fanSpec->extend("FanFloat","float");
220 fanSpec->extend("FanDouble","double");
221 fanSpec->extend("FanSmallString","string");
222 fanSpec->extend("FanBigString","string");
223 fanSpec->extend("FanBlob","blob");
224 AthenaAttributeList* fanList=new AthenaAttributeList(*fanSpec);
225
226 (*fanList)["FanBool"].data<bool>()=true;
227 (*fanList)["FanInt"].data<int>()=-12345;
228 (*fanList)["FanUInt"].data<unsigned int>()=12345;
229 (*fanList)["FanI64"].data<long long>()=-98765432100LL;
230 (*fanList)["FanU64"].data<unsigned long long>()=98765432100LL;
231 (*fanList)["FanFloat"].data<float>()=1.2345;
232 (*fanList)["FanDouble"].data<double>()=1.23456789;
233 (*fanList)["FanSmallString"].data<std::string>()="small string";
234 (*fanList)["FanBigString"].data<std::string>()="potentially long string";
235
236 coral::Blob&
blob=(*fanList)[
"FanBlob"].data<coral::Blob>();
237 unsigned int blobsize=2000;
238 blob.resize(blobsize);
239 unsigned char*
p=
static_cast<unsigned char*
>(
blob.startingAddress());
240 for (
unsigned int i=0;
i<blobsize;++
i,++
p) *p=(i % 256);
241
242 std::ostringstream fanstr;
243 fanList->toOutputStream(fanstr);
246 }
247
248
249
250
251 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
252
253
254 coral::AttributeList attrList0(*attrSpec);
255 attrList0["xPosition"].setValue((float)35.0);
256 attrList0["id"].setValue((int)17);
257 attrList0["name"].setValue(std::string("TestAttrList"));
259
260 std::ostringstream attrStr2;
261 attrList0.toOutputStream( attrStr2 );
262 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr2.str() );
263 attrListColl->
add(chanNum, attrList0);
264
265 coral::AttributeList attrList1(*attrSpec);
266 attrList1["xPosition"].setValue((float)45.0);
267 attrList1["id"].setValue((int)27);
268 attrList1["name"].setValue(std::string("TestAttrList"));
270
271 std::ostringstream attrStr3;
272 attrList1.toOutputStream( attrStr3 );
273 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr3.str() );
274 attrListColl->
add(chanNum, attrList1);
275
276 coral::AttributeList attrList2(*attrSpec);
277 attrList2["xPosition"].setValue((float)55.0);
278 attrList2["id"].setValue((int)37);
279 attrList2["name"].setValue(std::string("TestAttrList"));
281
282 std::ostringstream attrStr4;
283 attrList2.toOutputStream( attrStr4 );
284 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr4.str() );
285 attrListColl->
add(chanNum, attrList2);
286
288
289 coral::AttributeList attrList3(*attrSpec);
290 attrList3["xPosition"].setValue((float)65.0);
291 attrList3["id"].setValue((int)47);
292 attrList3["name"].setValue(std::string("TestAttrList"));
294
295 std::ostringstream attrStr5;
296 attrList3.toOutputStream( attrStr5 );
297 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr5.str() );
298 attrListColl->
add(chanNum, attrList3);
299
300
302 attrListColl->
add(chanNum, range);
304 <<
" till " <<
range.stop().run() <<
" " <<
range.stop().event() );
305
306 coral::AttributeList attrList4(*attrSpec);
307 attrList4["xPosition"].setValue((float)75.0);
308 attrList4["id"].setValue((int)57);
309 attrList4["name"].setValue(std::string("TestAttrList"));
311
312 std::ostringstream attrStr6;
313 attrList4.toOutputStream( attrStr6 );
314 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr6.str() );
315 attrListColl->
add(chanNum, attrList4);
316
317
319 attrListColl->
add(chanNum, range1);
320 ATH_MSG_DEBUG(
"Add min : since " << range1.start().run() <<
" " << range1.start().event() <<
" till " << range1.stop().run() <<
" " << range1.stop().event() );
321 }
322
326 citr!=attrListColl->
end();++citr) {
328 std::ostringstream
name;
330 attrListColl->
add(chan,
name.str());
331 }
332 }
333
334 ATH_CHECK(
detStore()->record(attrListColl,
"/IOVDbTest/IOVDbTestAttrListColl") );
335
336 return StatusCode::SUCCESS;
337}
#define ATH_CHECK
Evaluate an expression and check for errors.
CondMultChanCollection< IOVDbTestMDTEleMap > IOVDbTestMDTEleMapColl
This typedef represents a collection of IOVDbTestMDTEleMap objects.
const ServiceHandle< StoreGateSvc > & detStore() const
const_iterator end() const
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
void add(ChanNum chanNum)
Adding in channel numbers.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
BooleanProperty m_writeNewTag
BooleanProperty m_fancylist
BooleanProperty m_createExtraChans
BooleanProperty m_nameChans
void set(const HepGeom::Point3D< double > &trans, const HepGeom::Point3D< double > &rot, const std::string &name)
void set(int runNumber, int eventNumber, const std::string &name)
static constexpr uint32_t MAXRUN
static constexpr uint32_t MINEVENT
static constexpr uint32_t MAXEVENT