95{
97
98
99 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
100 unsigned long long timestamp = ctx.eventID().time_stamp();
101 if (timestamp)
102 elemMap->
set(ctx.eventID().time_stamp(),
"mdt element map");
103 else
104 elemMap->
set(ctx.eventID().run_number(), ctx.eventID().event_number(),
"mdt element map");
105
106
107
109
110
112
113
116 for (
unsigned int i = 0;
i < 10; ++
i) {
117 IOVDbTestMDTEleMap* elemMap = new IOVDbTestMDTEleMap;
118
119 unsigned long long timestamp = ctx.eventID().time_stamp();
120 if (timestamp)
121 elemMap->
set(ctx.eventID().time_stamp() + 10*i,
"mdt element map");
122 else
123 elemMap->
set(ctx.eventID().run_number() + i, ctx.eventID().event_number(),
"mdt element map");
124
126 elemMapColl->
add(2*i+1+i + offset);
127 }
128
129
130 ATH_CHECK(
detStore()->record(elemMapColl,
"/IOVDbTest/IOVDbTestMDTEleMapColl") );
131
132
133 IOVDbTestAmdbCorrection* amdbCorr = new IOVDbTestAmdbCorrection;
134 HepGeom::Point3D<double>
x(1.0, 2.0, 3.0);
135 HepGeom::Point3D<double>
y(4.0, 5.0, 6.0);
137
138 x = HepGeom::Point3D<double>(11.0, 22.0, 33.0);
139 y = HepGeom::Point3D<double>(44.0, 55.0, 66.0);
140 }
141 amdbCorr->
set(
x,
y,
"amdb correction");
142
144
145
146
147
148 coral::AttributeListSpecification* attrSpec = new coral::AttributeListSpecification();
149 attrSpec->extend("xPosition", "float");
150 attrSpec->extend("id", "int");
151 attrSpec->extend("name", "string");
152
153 if (!attrSpec->size()) {
155 return(StatusCode::FAILURE);
156 }
157
158
159
160
161
162
163 AthenaAttributeList* attrList = new AthenaAttributeList(*attrSpec);
164 (*attrList)[
"xPosition"].setValue((
float)
m_run);
165 (*attrList)["id"].setValue((int)7);
166 (*attrList)["name"].setValue(std::string("TestAttrList"));
168
169 (*attrList)["xPosition"].setValue((float)125.0);
170 (*attrList)["id"].setValue((int)27);
171 (*attrList)["name"].setValue(std::string("TestAttrListNEWTAG"));
172 }
173 std::ostringstream attrStr1;
174
175 attrList->toOutputStream( attrStr1 );
176
178
180
181
182
184 coral::AttributeListSpecification* fanSpec = new coral::AttributeListSpecification();
185 fanSpec->extend("FanBool","bool");
186 fanSpec->extend("FanInt","int");
187 fanSpec->extend("FanUInt","unsigned int");
188 fanSpec->extend("FanI64","long long");
189 fanSpec->extend("FanU64","unsigned long long");
190 fanSpec->extend("FanFloat","float");
191 fanSpec->extend("FanDouble","double");
192 fanSpec->extend("FanSmallString","string");
193 fanSpec->extend("FanBigString","string");
194 fanSpec->extend("FanBlob","blob");
195 AthenaAttributeList* fanList=new AthenaAttributeList(*fanSpec);
196
197 (*fanList)["FanBool"].data<bool>()=true;
198 (*fanList)["FanInt"].data<int>()=-12345;
199 (*fanList)["FanUInt"].data<unsigned int>()=12345;
200 (*fanList)["FanI64"].data<long long>()=-98765432100LL;
201 (*fanList)["FanU64"].data<unsigned long long>()=98765432100LL;
202 (*fanList)["FanFloat"].data<float>()=1.2345;
203 (*fanList)["FanDouble"].data<double>()=1.23456789;
204 (*fanList)["FanSmallString"].data<std::string>()="small string";
205 (*fanList)["FanBigString"].data<std::string>()="potentially long string";
206
207 coral::Blob&
blob=(*fanList)[
"FanBlob"].data<coral::Blob>();
208 unsigned int blobsize=2000;
209 blob.resize(blobsize);
210 unsigned char*
p=
static_cast<unsigned char*
>(
blob.startingAddress());
211 for (
unsigned int i=0;
i<blobsize;++
i,++
p) *p=(i % 256);
212
213 std::ostringstream fanstr;
214 fanList->toOutputStream(fanstr);
217 }
218
219
220
221
222 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
223
224
225 coral::AttributeList attrList0(*attrSpec);
226 attrList0["xPosition"].setValue((float)35.0);
227 attrList0["id"].setValue((int)17);
228 attrList0["name"].setValue(std::string("TestAttrList"));
230
231 std::ostringstream attrStr2;
232 attrList0.toOutputStream( attrStr2 );
233 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr2.str() );
234 attrListColl->
add(chanNum, attrList0);
235
236 coral::AttributeList attrList1(*attrSpec);
237 attrList1["xPosition"].setValue((float)45.0);
238 attrList1["id"].setValue((int)27);
239 attrList1["name"].setValue(std::string("TestAttrList"));
241
242 std::ostringstream attrStr3;
243 attrList1.toOutputStream( attrStr3 );
244 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr3.str() );
245 attrListColl->
add(chanNum, attrList1);
246
247 coral::AttributeList attrList2(*attrSpec);
248 attrList2["xPosition"].setValue((float)55.0);
249 attrList2["id"].setValue((int)37);
250 attrList2["name"].setValue(std::string("TestAttrList"));
252
253 std::ostringstream attrStr4;
254 attrList2.toOutputStream( attrStr4 );
255 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr4.str() );
256 attrListColl->
add(chanNum, attrList2);
257
259
260 coral::AttributeList attrList3(*attrSpec);
261 attrList3["xPosition"].setValue((float)65.0);
262 attrList3["id"].setValue((int)47);
263 attrList3["name"].setValue(std::string("TestAttrList"));
265
266 std::ostringstream attrStr5;
267 attrList3.toOutputStream( attrStr5 );
268 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr5.str() );
269 attrListColl->
add(chanNum, attrList3);
270
271
273 attrListColl->
add(chanNum, range);
275 <<
" till " <<
range.stop().run() <<
" " <<
range.stop().event() );
276
277 coral::AttributeList attrList4(*attrSpec);
278 attrList4["xPosition"].setValue((float)75.0);
279 attrList4["id"].setValue((int)57);
280 attrList4["name"].setValue(std::string("TestAttrList"));
282
283 std::ostringstream attrStr6;
284 attrList4.toOutputStream( attrStr6 );
285 ATH_MSG_DEBUG(
"ChanNum " << chanNum <<
" Attribute list " << attrStr6.str() );
286 attrListColl->
add(chanNum, attrList4);
287
288
290 attrListColl->
add(chanNum, range1);
291 ATH_MSG_DEBUG(
"Add min : since " << range1.start().run() <<
" " << range1.start().event() <<
" till " << range1.stop().run() <<
" " << range1.stop().event() );
292 }
293
297 citr!=attrListColl->
end();++citr) {
299 std::ostringstream
name;
301 attrListColl->
add(chan,
name.str());
302 }
303 }
304
305 ATH_CHECK(
detStore()->record(attrListColl,
"/IOVDbTest/IOVDbTestAttrListColl") );
306
307 return StatusCode::SUCCESS;
308}
#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