Algorithm execute once per event.
48{
50
51
52
53
54
55
56
57
58
59
68 }
69
70
71 IAthenaPoolTestData*
data;
72
73
74 for (
int i = 0;
i < 5; ++
i) {
75 data =
new AthenaPoolTestA(i+1, i+2);
76 col1->push_back(
data);
77 }
78
79
80
81 for (
int i = 10;
i < 15; ++
i) {
82 data =
new AthenaPoolTestB(i+1, i+2);
83 col2->push_back(
data);
84 }
85
86
87 for (
int i = 20;
i < 26; ++
i) {
88 if (i < 23) {
89 data =
new AthenaPoolTestA(i+1, i+2);
90 }
91 else {
92 data =
new AthenaPoolTestB(i+1, i+2);
93 }
94 col3->push_back(
data);
95 }
96
98
101 for (;
it != last; ++
it) {
103 }
104
107 last = col2->end();
108 for (;
it != last; ++
it) {
110 }
111
114 last = col3->end();
115 for (;
it != last; ++
it) {
117 }
118
120
121 for (
int i = 0;
i < 5; ++
i) {
122 data =
new AthenaPoolTestC(i+1, i+2, i+3, i+4);
123 col4->push_back(
data);
124 }
125
126
127
128 for (
int i = 10;
i < 15; ++
i) {
129 data =
new AthenaPoolTestD(i+1, i+2, i+3, i+4, i+5, i+6);
130 col5->push_back(
data);
131 }
132
135 last = col4->end();
136 for (;
it != last; ++
it) {
138 }
139
142 last = col5->end();
143 for (;
it != last; ++
it) {
145 }
146 }
147
148
149
153
156 last = col->end();
157 for (;
it != last; ++
it) {
159 }
160
162
165 last = col->end();
166 for (;
it != last; ++
it) {
168 }
169 }
170
172
173
178 }
179
180
181
182
189 }
190
191
192
193
194
195 int nd = 0;
197 for (
int i = 0;
i < 3; ++
i ) {
198
199 AthenaPoolTestMatrix*
matrix =
new AthenaPoolTestMatrix;
200 for ( int j = 0; j < 2; ++j ) {
201 CLHEP::HepMatrix*
mat =
new CLHEP::HepMatrix( 4 + j, 2 + 2*i );
202 CLHEP::HepMatrix& matrx = *
mat;
203 for (
int i = 0;
i < matrx.num_row(); ++
i) {
204 for (int j = 0; j < matrx.num_col(); ++j) {
207 }
208 }
210 }
211
212
213 HepGeom::Transform3D trans1(HepGeom::Point3D<double>( i, 0, 0),
214 HepGeom::Point3D<double>( 0, 1, 0),
215 HepGeom::Point3D<double>( 0, 0, 1),
216 HepGeom::Point3D<double>(-i, 0, 0),
217 HepGeom::Point3D<double>( 0, 1, 0),
218 HepGeom::Point3D<double>( 0, 0, 1));
219 matrix->setTransform(trans1);
220
222 stream <<
"AthenaPoolTestMatrix_" <<
i;
225 ATH_MSG_DEBUG(
"Registering matrix " << i + 1 <<
" " << key );
226
227 const HepGeom::Point3D<double>& point =
matrix->point();
228 const HepGeom::Point3D<double>& point1 =
matrix->point1();
230 << point.x() << " "
231 << point.y() << " "
232 << point.z() << " "
233 << ", x,y,z "
234 << point1.x() << " "
235 << point1.y() << " "
236 << point1.z() << " ");
237 const CLHEP::HepMatrix& smallMatrix =
matrix->smallMatrix();
238 ATH_MSG_DEBUG(
" Small matrix : ( " << smallMatrix.num_row() <<
", " << smallMatrix.num_col() <<
" ) " );
239
241 for (
int i = 0;
i < smallMatrix.num_row(); ++
i) {
242 for (int j = 0; j < smallMatrix.num_col(); ++ j) {
243 stream << smallMatrix[
i][j] <<
", ";
244 }
245 }
247 nd += smallMatrix.num_row()*smallMatrix.num_col();
248
249 const CLHEP::HepMatrix& bigMatrix =
matrix->bigMatrix();
250 ATH_MSG_DEBUG(
" Big matrix : ( " << bigMatrix.num_row() <<
", " << bigMatrix.num_col() <<
" ) " );
251
253 for (
int i = 0;
i < bigMatrix.num_row(); ++
i) {
254 for (int j = 0; j < bigMatrix.num_col(); ++ j) {
255 stream << bigMatrix[
i][j] <<
", ";
256 }
257 }
259 nd += bigMatrix.num_row()*bigMatrix.num_col();
260
262 for (
int i = 0;
i <
matrix->numberOfMatrices(); ++
i ) {
263 const CLHEP::HepMatrix& matrx =
matrix->matrix( i );
264 ATH_MSG_DEBUG(
" ( " << matrx.num_row() <<
", " << matrx.num_col() <<
" ) " );
266 for (
int i = 0;
i < matrx.num_row(); ++
i) {
267 for (int j = 0; j < matrx.num_col(); ++ j) {
269 }
270 }
272
273 nd += matrx.num_row()*matrx.num_col();
274
275 }
276
277 nd += 3;
278
280
281
282
284
286 std::map<unsigned int, CLHEP::HepMatrix>& mp0 = mats[0];
287 std::map<unsigned int, CLHEP::HepMatrix>& mp1 = mats[1];
288 std::map<unsigned int, CLHEP::HepMatrix>::const_iterator itmp = mp0.begin();
290 << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
291 ++itmp;
293 << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
294 itmp = mp1.begin();
296 << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
297 ++itmp;
299 << (*itmp).second.num_row() << ", " << (*itmp).second.num_col() );
300
301
303 const HepGeom::Transform3D& trans =
matrix->trans();
317
318 }
319
320
321
322 AthenaPoolTestMap* tmapPtr = new AthenaPoolTestMap();
323 AthenaPoolTestMap& tmap = *tmapPtr;
324
326 typedef std::vector<AthenaPoolTestMapData::Deposit> deposit_vec;
327
328 deposit_vec deposits;
329
330 deposit_t deposit;
331
332 for (unsigned int j = 0; j < 10; ++j) {
333 for (
unsigned int i = 0;
i < 10; ++
i) {
334
335 deposit.first = AthenaPoolTestMapDataLink(i, i + 10);
336 deposit.second =
i + 20;
337 deposits.push_back(deposit);
338 }
339
340 tmap[j*5] = AthenaPoolTestMapData(deposits, j);
341 deposits.clear();
342 }
343
344
345 AthenaPoolTestMap::const_iterator itm = tmap.begin();
346 AthenaPoolTestMap::const_iterator endm = tmap.end();
347 for (; itm != endm; ++itm) {
348
349 deposits.clear();
350 (*itm).second.deposits(deposits);
352 for (
unsigned int i = 0;
i < deposits.size(); ++
i) {
353 AthenaPoolTestMapDataLink& link = deposits[
i].first;
356 << deposits[
i].second <<
" ";
357 }
359 << " word " << (*itm).second.word()
360 <<
" Deposits: (barCode, evtIndx, wgt) " <<
stream.str());
361 }
362
364
365
366
367 dummy_A* dummyA = new dummy_A();
368 const std::vector<dummy_B>&
b = dummyA->
dummy();
370 for (
unsigned int i = 0;
i <
b.size(); ++
i) {
371 const std::vector<dummy_C>&
c =
b[
i].dummy();
373 for (
unsigned int j = 0; j <
c.size(); ++j) {
375 }
376 }
378
379
380
381 dummy_E* dummyE = new dummy_E();
383 const std::vector<const dummy_D*>&
d = dummyE->
dummy();
385 for (
unsigned int i = 0;
i <
d.size(); ++
i) {
387 }
389
390
391
392
393
396
397 EventType* eventType =
const_cast<EventType*
>(
evt->event_type());
402 <<
evt->event_ID()->run_number() <<
","
403 <<
evt->event_ID()->event_number() <<
":"
404 <<
evt->event_ID()->time_stamp() <<
"] " );
406 <<
evt->event_type()->user_type() <<
" weight 0: "
410
417
418 unsigned int flags = 0;
419
422 if (!evt1->
setEventFlags(EventInfo::EventFlagSubDet(i), flags)) {
423 ATH_MSG_ERROR(
"Error setting flag: i, flags " << i <<
" " << MSG::hex << flags << MSG::dec );
424 }
425 else {
426 ATH_MSG_DEBUG(
"Setting flag: i, flags " << i <<
" " << MSG::hex << flags <<
" "
427 <<
" flags " << evt1->
eventFlags(EventInfo::EventFlagSubDet(i))
428 << MSG::dec );
429 }
432 }
433 else {
436 << MSG::hex <<
" flags " << evt1->
eventFlags(EventInfo::EventFlagSubDet(i))
437 << MSG::dec );
438 }
439 if (!evt1->
setEventFlagBit(EventInfo::EventFlagSubDet(i), 10,
false)) {
441 }
442 else {
445 << MSG::hex <<
" flags " << evt1->
eventFlags(EventInfo::EventFlagSubDet(i))
446 << MSG::dec );
447 }
449 ATH_MSG_ERROR(
"Error trying to set bit 29 for subDet " << i );
450 }
451 else {
452 ATH_MSG_DEBUG(
"Returned false for trying to set bit 29 for subDet " << i <<
" "
453 );
454 }
455
459 if (!evt1->
setErrorState(EventInfo::EventFlagSubDet(i), state)) {
460 ATH_MSG_ERROR(
"Error setting error state: i, state " << i <<
" " << state );
461 }
462 else {
463 ATH_MSG_DEBUG(
"Setting error state: i, state " << i <<
" " << state );
464 }
466 if (error == EventInfo::NotSet)
467 ATH_MSG_DEBUG(
"Subdet: " << i <<
" error state: NotSet " << error );
468 else if (error == EventInfo::Warning)
469 ATH_MSG_DEBUG(
"Subdet: " << i <<
" error state: Warning " << error );
470 else if (error == EventInfo::Error)
471 ATH_MSG_DEBUG(
"Subdet: " << i <<
" error state: Error " << error );
472 }
473
474
475 EventID* pOvrID =
new EventID(
evt->event_ID()->run_number(),
476 evt->event_ID()->event_number(),
477 12,
478 13,
479 14,
480 15,
481 16,
482 17,
483 18,
484 19);
485 EventType* pOvrEt = new EventType();
487
488
489
490 std::vector<unsigned int> level1TriggerInfo;
491 level1TriggerInfo.push_back(14);
492 level1TriggerInfo.push_back(15);
493 std::vector<unsigned int> level2TriggerInfo;
494 level2TriggerInfo.push_back(10);
495 level2TriggerInfo.push_back(11);
496 std::vector<unsigned int> eventFilterInfo;
497 eventFilterInfo.push_back(12);
498 eventFilterInfo.push_back(13);
499 std::vector<TriggerInfo::StreamTag> streamTags;
500 streamTags.push_back(TriggerInfo::StreamTag("StreamA", "TypeA", true));
501 streamTags.push_back(TriggerInfo::StreamTag("StreamB", "TypeB", false));
502
503 TriggerInfo* triggerInfo = new TriggerInfo(7, 8, 9,
504 level1TriggerInfo,
505 level2TriggerInfo,
506 eventFilterInfo,
507 streamTags);
508
510
511 auto newEvt = std::make_unique<EventInfo>(*evt);
512
513
516
517
519
522 << pevt->
event_ID()->run_number() <<
","
523 << pevt->
event_ID()->event_number() <<
":"
524 << pevt->
event_ID()->time_stamp() <<
"] ");
528
533 << " lvl1Info ";
534 for (
unsigned int i = 0;
i < pevt->
trigger_info()->level1TriggerInfo().size(); ++
i) {
536 }
538 for (
unsigned int i = 0;
i < pevt->
trigger_info()->level2TriggerInfo().size(); ++
i) {
540 }
541 stream <<
"EventFilterInfo ";
542 for (
unsigned int i = 0;
i < pevt->
trigger_info()->eventFilterInfo().size(); ++
i) {
544 }
545 stream <<
"EventFilterInfo ";
546 for (
unsigned int i = 0;
i < pevt->
trigger_info()->streamTags().size(); ++
i) {
550 }
552
553
557 if (it1 == end1) {
559 }
560 for (; it1 != end1; ++it1) {
563 << (*it1).time() << " " << (*it1).index()
564 );
565 if (sevt) {
567 << sevt->
event_ID()->run_number() <<
","
568 << sevt->
event_ID()->event_number() <<
":"
569 << sevt->
event_ID()->time_stamp() <<
"] ");
573 << it1->time() << " " << it1->index());
574 }
575 else {
577 }
578 }
579 return StatusCode::SUCCESS;
580}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old PileUpEventInfo
char data[hepevt_bytes_allocation_ATLAS]
DataVector< IAthenaPoolTestData > IAthenaPoolTestCollection
ServiceHandle< StoreGateSvc > & evtStore()
Gaudi::Property< bool > m_partialCreate
Create only part of the collections.
Gaudi::Property< bool > m_readOtherHalf
For partial create read second half of collections.
Gaudi::Property< bool > m_readFirstHalf
For partial create read first half of collections.
index_type eventIndex() const
std::pair< AthenaPoolTestMapDataLink, float > Deposit
std::vector< std::map< unsigned int, CLHEP::HepMatrix > > matrixMaps_t
DataModel_detail::const_iterator< DataVector > const_iterator
bool setEventFlagBit(EventFlagSubDet subDet, unsigned char bit, bool set=true)
Set a bit for an event flag of a particular sub detector.
float actualInteractionsPerCrossing() const
Access to number of interactions per crossing:
EventID * event_ID()
the unique identification of the event.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
return error state for a particular sub-detector
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
bool isEventFlagBitSet(EventFlagSubDet subDet, unsigned char bit) const
check for a event flag bit for a particular sub-detector
bool setEventFlags(EventFlagSubDet subDet, unsigned int flags)
Set event flag for a particular sub detector - maximun size is 28 bits.
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState errorState)
Set error state flag for a particular sub detector.
float averageInteractionsPerCrossing() const
average interactions per crossing for all BCIDs - for out-of-time pile-up
void setActualInteractionsPerCrossing(float interactions)
Setting the number of interactions per crossing:
unsigned int eventFlags(EventFlagSubDet subDet) const
event flags for a particular sub-detector
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
void setAverageInteractionsPerCrossing(float interactions)
average interactions per crossing for all BCIDs - for out-of-time pile-up
float mc_event_weight(unsigned int iweight=0) const
Access to MC weight.
void set_mc_event_weight(float weight, unsigned int iweight=0, unsigned int nWeightsMax=0)
Add in MC weight. For more than 1 weight, add with iweight > 0.
void set_user_type(const std::string &user_type)
Add user (string) type.
std::string user_type(void) const
Access to user type.
void addSubEvt(time_type t, PileUpTimeEventIndex::PileUpType puType, const EventInfo *pse, StoreGateSvc *psg)
setter for the subEvt collection t=0(ns) for the original event
SubEvent::iterator endSubEvt()
SubEvent::iterator beginSubEvt()
number_type level1TriggerType() const
get level1 trigger type
const std::vector< number_type > & eventFilterInfo() const
get event filter trigger info
number_type extendedLevel1ID() const
get extended level1 ID
number_type statusElement() const
get status element
const std::vector< number_type > & level1TriggerInfo() const
get level1 trigger info
const std::vector< StreamTag > & streamTags() const
get stream tags
const std::vector< number_type > & level2TriggerInfo() const
get level2 trigger info
const std::vector< dummy_B > & dummy() const
const std::vector< const dummy_D * > & dummy() const
retrieve(aClass, aKey=None)
EventInfo_v1 EventInfo
Definition of the latest event info version.
std::list< SubEvent >::const_iterator const_iterator