143{
145
146
147 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
148 unsigned long long timestamp = ctx.eventID().time_stamp();
149 if (timestamp)
150 elemMap->
set(ctx.eventID().time_stamp(),
"mdt element map");
151 else
152 elemMap->
set(ctx.eventID().run_number(), ctx.eventID().event_number(),
"mdt element map");
153
154
155
157
158
160
161
164 for (
unsigned int i = 0;
i < 10; ++
i) {
165 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
166
167 unsigned long long timestamp = ctx.eventID().time_stamp();
168 if (timestamp)
169 elemMap->
set(ctx.eventID().time_stamp() + 10*i,
"mdt element map");
170 else
171 elemMap->
set(ctx.eventID().run_number() + i, ctx.eventID().event_number(),
"mdt element map");
172
174 elemMapColl->
add(2*i+1+i + offset);
175 }
176
177
178 ATH_CHECK(
detStore()->record(elemMapColl,
"/IOVDbTest/IOVDbTestMDTEleMapColl") );
179
180
181 IOVDbTestAmdbCorrection* amdbCorr = new IOVDbTestAmdbCorrection;
182 HepGeom::Point3D<double>
x(1.0, 2.0, 3.0);
183 HepGeom::Point3D<double>
y(4.0, 5.0, 6.0);
185
186 x = HepGeom::Point3D<double>(11.0, 22.0, 33.0);
187 y = HepGeom::Point3D<double>(44.0, 55.0, 66.0);
188 }
189 amdbCorr->
set(
x,
y,
"amdb correction");
190
192
193
194
195
196 coral::AttributeListSpecification* attrSpec = new coral::AttributeListSpecification();
197 attrSpec->extend("xPosition", "float");
198 attrSpec->extend("id", "int");
199 attrSpec->extend("name", "string");
200
201 if (!attrSpec->size()) {
203 return(StatusCode::FAILURE);
204 }
205
206
207
208
209
210
211 AthenaAttributeList* attrList = new AthenaAttributeList(*attrSpec);
212 (*attrList)[
"xPosition"].setValue((
float)
m_run);
213 (*attrList)["id"].setValue((int)7);
214 (*attrList)["name"].setValue(std::string("TestAttrList"));
216
217 (*attrList)["xPosition"].setValue((float)125.0);
218 (*attrList)["id"].setValue((int)27);
219 (*attrList)["name"].setValue(std::string("TestAttrListNEWTAG"));
220 }
221 std::ostringstream attrStr1;
222
223 attrList->toOutputStream( attrStr1 );
224
226
228
229
230
232 coral::AttributeListSpecification* fanSpec = new coral::AttributeListSpecification();
233 fanSpec->extend("FanBool","bool");
234 fanSpec->extend("FanInt","int");
235 fanSpec->extend("FanUInt","unsigned int");
236 fanSpec->extend("FanI64","long long");
237 fanSpec->extend("FanU64","unsigned long long");
238 fanSpec->extend("FanFloat","float");
239 fanSpec->extend("FanDouble","double");
240 fanSpec->extend("FanSmallString","string");
241 fanSpec->extend("FanBigString","string");
242 fanSpec->extend("FanBlob","blob");
243 AthenaAttributeList* fanList=new AthenaAttributeList(*fanSpec);
244
245 (*fanList)["FanBool"].data<bool>()=true;
246 (*fanList)["FanInt"].data<int>()=-12345;
247 (*fanList)["FanUInt"].data<unsigned int>()=12345;
248 (*fanList)["FanI64"].data<long long>()=-98765432100LL;
249 (*fanList)["FanU64"].data<unsigned long long>()=98765432100LL;
250 (*fanList)["FanFloat"].data<float>()=1.2345;
251 (*fanList)["FanDouble"].data<double>()=1.23456789;
252 (*fanList)["FanSmallString"].data<std::string>()="small string";
253 (*fanList)["FanBigString"].data<std::string>()="potentially long string";
254
255 coral::Blob&
blob=(*fanList)[
"FanBlob"].data<coral::Blob>();
256 unsigned int blobsize=2000;
257 blob.resize(blobsize);
258 unsigned char*
p=
static_cast<unsigned char*
>(
blob.startingAddress());
259 for (
unsigned int i=0;
i<blobsize;++
i,++
p) *p=(i % 256);
260
261 std::ostringstream fanstr;
262 fanList->toOutputStream(fanstr);
265 }
266
267
268
269
270 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
271
272
273 coral::AttributeList attrList0(*attrSpec);
274 attrList0["xPosition"].setValue((float)35.0);
275 attrList0["id"].setValue((int)17);
276 attrList0["name"].setValue(std::string("TestAttrList"));
278
279 std::ostringstream attrStr2;
280 attrList0.toOutputStream( attrStr2 );
281 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr2.str() );
282 attrListColl->
add(chanNum, attrList0);
283
284 coral::AttributeList attrList1(*attrSpec);
285 attrList1["xPosition"].setValue((float)45.0);
286 attrList1["id"].setValue((int)27);
287 attrList1["name"].setValue(std::string("TestAttrList"));
289
290 std::ostringstream attrStr3;
291 attrList1.toOutputStream( attrStr3 );
292 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr3.str() );
293 attrListColl->
add(chanNum, attrList1);
294
295 coral::AttributeList attrList2(*attrSpec);
296 attrList2["xPosition"].setValue((float)55.0);
297 attrList2["id"].setValue((int)37);
298 attrList2["name"].setValue(std::string("TestAttrList"));
300
301 std::ostringstream attrStr4;
302 attrList2.toOutputStream( attrStr4 );
303 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr4.str() );
304 attrListColl->
add(chanNum, attrList2);
305
307
308 coral::AttributeList attrList3(*attrSpec);
309 attrList3["xPosition"].setValue((float)65.0);
310 attrList3["id"].setValue((int)47);
311 attrList3["name"].setValue(std::string("TestAttrList"));
313
314 std::ostringstream attrStr5;
315 attrList3.toOutputStream( attrStr5 );
316 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr5.str() );
317 attrListColl->
add(chanNum, attrList3);
318
319
321 attrListColl->
add(chanNum, range);
323 <<
" till " <<
range.stop().run() <<
" " <<
range.stop().event() );
324
325 coral::AttributeList attrList4(*attrSpec);
326 attrList4["xPosition"].setValue((float)75.0);
327 attrList4["id"].setValue((int)57);
328 attrList4["name"].setValue(std::string("TestAttrList"));
330
331 std::ostringstream attrStr6;
332 attrList4.toOutputStream( attrStr6 );
333 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr6.str() );
334 attrListColl->
add(chanNum, attrList4);
335
336
338 attrListColl->
add(chanNum, range1);
339 ATH_MSG_DEBUG(
"Add min : since " << range1.start().run() <<
" " << range1.start().event() <<
" till " << range1.stop().run() <<
" " << range1.stop().event() );
340 }
341
345 citr!=attrListColl->
end();++citr) {
347 std::ostringstream
name;
349 attrListColl->
add(chan,
name.str());
350 }
351 }
352
353 ATH_CHECK(
detStore()->record(attrListColl,
"/IOVDbTest/IOVDbTestAttrListColl") );
354
355 return StatusCode::SUCCESS;
356}
#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