BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
AsciiData.cxx
Go to the documentation of this file.
1
2#include "Trigger/AsciiData.h"
3
4// std::string Tagged::s_saved_tag;
5
6std::istream& operator>>( std::istream& is, VERSIONNUM& x ) {
7 x.check_start_tag( is, "VERSION" );
8 if ( !x.initialized() ) return is;
9 is >> x.major;
10 is >> x.minor;
11 x.check_end_tag( is, "VERSION" );
12 return is;
13}
14
15std::ostream& operator<<( std::ostream& os, const VERSIONNUM& x ) {
16 os << std::endl << "{ VERSION" << std::endl;
17 if ( x.initialized() )
18 {
19 os << " " << x.major;
20 os << " " << x.minor;
21 }
22 os << std::endl << "} VERSION" << std::endl;
23 return os;
24}
25
26std::istream& operator>>( std::istream& is, EVHEAD& x ) {
27 x.check_start_tag( is, "EVHEAD" );
28 if ( !x.initialized() ) return is;
29 is >> x.runNo;
30 is >> x.eventNo;
31 x.check_end_tag( is, "EVHEAD" );
32 return is;
33}
34
35std::ostream& operator<<( std::ostream& os, const EVHEAD& x ) {
36 os << std::endl << "{ EVHEAD" << std::endl;
37 if ( x.initialized() )
38 {
39 os << " " << x.runNo;
40 os << " " << x.eventNo;
41 }
42 os << std::endl << "} EVHEAD" << std::endl;
43 return os;
44}
45
46std::istream& operator>>( std::istream& is, DECAYMODE& x ) {
47 x.check_start_tag( is, "DECAYMODE" );
48 if ( !x.initialized() ) return is;
49 is >> x.size;
50 for ( int index = 0; index < x.size; index++ ) { is >> x.data[index]; }
51 x.check_end_tag( is, "DECAYMODE" );
52 return is;
53}
54
55std::ostream& operator<<( std::ostream& os, const DECAYMODE& x ) {
56 os << std::endl << "{ DECAYMODE" << std::endl;
57 if ( x.initialized() )
58 {
59 os << " " << x.size;
60 for ( int index = 0; index < x.size; index++ ) { os << " " << x.data[index]; }
61 }
62 os << std::endl << "} DECAYMODE" << std::endl;
63 return os;
64}
65
66std::istream& operator>>( std::istream& is, TrackTruthType& x ) {
67 is >> x.trackIndex;
68 is >> x.PDGCode;
69 is >> x.PDGCharge;
70 is >> x.v0Index;
71 is >> x.v1Index;
72 is >> x.px;
73 is >> x.py;
74 is >> x.pz;
75 is >> x.E;
76 is >> x.minDaughterIndex;
77 is >> x.maxDaughterIndex;
78 return is;
79}
80
81std::ostream& operator<<( std::ostream& os, const TrackTruthType& x ) {
82 os << " " << x.trackIndex;
83 os << " " << x.PDGCode;
84 os << " " << x.PDGCharge;
85 os << " " << x.v0Index;
86 os << " " << x.v1Index;
87 os << " " << x.px;
88 os << " " << x.py;
89 os << " " << x.pz;
90 os << " " << x.E;
91 os << " " << x.minDaughterIndex;
92 os << " " << x.maxDaughterIndex;
93 os << std::endl;
94 return os;
95}
96
97std::istream& operator>>( std::istream& is, TRACKTRUTH& x ) {
98 x.check_start_tag( is, "TRACKTRUTH" );
99 if ( !x.initialized() ) return is;
100 is >> x.nTruth;
101 x.truthCol.resize( x.nTruth );
102 {
103 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
104 }
105 x.check_end_tag( is, "TRACKTRUTH" );
106 return is;
107}
108
109std::ostream& operator<<( std::ostream& os, const TRACKTRUTH& x ) {
110 os << std::endl << "{ TRACKTRUTH" << std::endl;
111 if ( x.initialized() )
112 {
113 os << " " << x.nTruth;
114 {
115 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
116 }
117 }
118 os << std::endl << "} TRACKTRUTH" << std::endl;
119 return os;
120}
121
122std::istream& operator>>( std::istream& is, VertexTruthType& x ) {
123 is >> x.vertexIndex;
124 is >> x.parentTrackIndex;
125 is >> x.posX;
126 is >> x.posY;
127 is >> x.posZ;
128 is >> x.time;
129 return is;
130}
131
132std::ostream& operator<<( std::ostream& os, const VertexTruthType& x ) {
133 os << " " << x.vertexIndex;
134 os << " " << x.parentTrackIndex;
135 os << " " << x.posX;
136 os << " " << x.posY;
137 os << " " << x.posZ;
138 os << " " << x.time;
139 os << std::endl;
140 return os;
141}
142
143std::istream& operator>>( std::istream& is, VERTEXTRUTH& x ) {
144 x.check_start_tag( is, "VERTEXTRUTH" );
145 if ( !x.initialized() ) return is;
146 is >> x.nTruth;
147 x.truthCol.resize( x.nTruth );
148 {
149 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
150 }
151 x.check_end_tag( is, "VERTEXTRUTH" );
152 return is;
153}
154
155std::ostream& operator<<( std::ostream& os, const VERTEXTRUTH& x ) {
156 os << std::endl << "{ VERTEXTRUTH" << std::endl;
157 if ( x.initialized() )
158 {
159 os << " " << x.nTruth;
160 {
161 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
162 }
163 }
164 os << std::endl << "} VERTEXTRUTH" << std::endl;
165 return os;
166}
167
168std::istream& operator>>( std::istream& is, MdcTruthType& x ) {
169 is >> x.trackIndex;
170 is >> x.layerNo;
171 is >> x.cellNo;
172 is >> x.edep;
173 is >> x.driftD;
174 is >> x.posX;
175 is >> x.posY;
176 is >> x.posZ;
177 is >> x.posFlag;
178 return is;
179}
180
181std::ostream& operator<<( std::ostream& os, const MdcTruthType& x ) {
182 os << " " << x.trackIndex;
183 os << " " << x.layerNo;
184 os << " " << x.cellNo;
185 os << " " << x.edep;
186 os << " " << x.driftD;
187 os << " " << x.posX;
188 os << " " << x.posY;
189 os << " " << x.posZ;
190 os << " " << x.posFlag;
191 os << std::endl;
192 return os;
193}
194
195std::istream& operator>>( std::istream& is, MDCTRUTH& x ) {
196 x.check_start_tag( is, "MDCTRUTH" );
197 if ( !x.initialized() ) return is;
198 is >> x.nTruth;
199 x.truthCol.resize( x.nTruth );
200 {
201 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
202 }
203 x.check_end_tag( is, "MDCTRUTH" );
204 return is;
205}
206
207std::ostream& operator<<( std::ostream& os, const MDCTRUTH& x ) {
208 os << std::endl << "{ MDCTRUTH" << std::endl;
209 if ( x.initialized() )
210 {
211 os << " " << x.nTruth;
212 {
213 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
214 }
215 }
216 os << std::endl << "} MDCTRUTH" << std::endl;
217 return os;
218}
219
220std::istream& operator>>( std::istream& is, TofTruthType& x ) {
221 is >> x.trackIndex;
222 is >> x.partId;
223 is >> x.scinNb;
224 is >> x.posX;
225 is >> x.posY;
226 is >> x.posZ;
227 is >> x.px;
228 is >> x.py;
229 is >> x.pz;
230 is >> x.trackL;
231 is >> x.time;
232 return is;
233}
234
235std::ostream& operator<<( std::ostream& os, const TofTruthType& x ) {
236 os << " " << x.trackIndex;
237 os << " " << x.partId;
238 os << " " << x.scinNb;
239 os << " " << x.posX;
240 os << " " << x.posY;
241 os << " " << x.posZ;
242 os << " " << x.px;
243 os << " " << x.py;
244 os << " " << x.pz;
245 os << " " << x.trackL;
246 os << " " << x.time;
247 os << std::endl;
248 return os;
249}
250
251std::istream& operator>>( std::istream& is, TOFTRUTH& x ) {
252 x.check_start_tag( is, "TOFTRUTH" );
253 if ( !x.initialized() ) return is;
254 is >> x.nTruth;
255 x.truthCol.resize( x.nTruth );
256 {
257 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
258 }
259 x.check_end_tag( is, "TOFTRUTH" );
260 return is;
261}
262
263std::ostream& operator<<( std::ostream& os, const TOFTRUTH& x ) {
264 os << std::endl << "{ TOFTRUTH" << std::endl;
265 if ( x.initialized() )
266 {
267 os << " " << x.nTruth;
268 {
269 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
270 }
271 }
272 os << std::endl << "} TOFTRUTH" << std::endl;
273 return os;
274}
275
276std::istream& operator>>( std::istream& is, EmcTruthType& x ) {
277 is >> x.trackIndex;
278 is >> x.partId;
279 is >> x.numTheta;
280 is >> x.numPhi;
281 is >> x.posX;
282 is >> x.posY;
283 is >> x.posZ;
284 is >> x.px;
285 is >> x.py;
286 is >> x.pz;
287 is >> x.totalEdep;
288 return is;
289}
290
291std::ostream& operator<<( std::ostream& os, const EmcTruthType& x ) {
292 os << " " << x.trackIndex;
293 os << " " << x.partId;
294 os << " " << x.numTheta;
295 os << " " << x.numPhi;
296 os << " " << x.posX;
297 os << " " << x.posY;
298 os << " " << x.posZ;
299 os << " " << x.px;
300 os << " " << x.py;
301 os << " " << x.pz;
302 os << " " << x.totalEdep;
303 os << std::endl;
304 return os;
305}
306
307std::istream& operator>>( std::istream& is, EMCTRUTH& x ) {
308 x.check_start_tag( is, "EMCTRUTH" );
309 if ( !x.initialized() ) return is;
310 is >> x.nTruth;
311 x.truthCol.resize( x.nTruth );
312 {
313 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
314 }
315 x.check_end_tag( is, "EMCTRUTH" );
316 return is;
317}
318
319std::ostream& operator<<( std::ostream& os, const EMCTRUTH& x ) {
320 os << std::endl << "{ EMCTRUTH" << std::endl;
321 if ( x.initialized() )
322 {
323 os << " " << x.nTruth;
324 {
325 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
326 }
327 }
328 os << std::endl << "} EMCTRUTH" << std::endl;
329 return os;
330}
331
332std::istream& operator>>( std::istream& is, MucTruthType& x ) {
333 is >> x.trackIndex;
334 is >> x.partId;
335 is >> x.segId;
336 is >> x.gapId;
337 is >> x.stripId;
338 is >> x.posX;
339 is >> x.posY;
340 is >> x.posZ;
341 is >> x.px;
342 is >> x.py;
343 is >> x.pz;
344 return is;
345}
346
347std::ostream& operator<<( std::ostream& os, const MucTruthType& x ) {
348 os << " " << x.trackIndex;
349 os << " " << x.partId;
350 os << " " << x.segId;
351 os << " " << x.gapId;
352 os << " " << x.stripId;
353 os << " " << x.posX;
354 os << " " << x.posY;
355 os << " " << x.posZ;
356 os << " " << x.px;
357 os << " " << x.py;
358 os << " " << x.pz;
359 os << std::endl;
360 return os;
361}
362
363std::istream& operator>>( std::istream& is, MUCTRUTH& x ) {
364 x.check_start_tag( is, "MUCTRUTH" );
365 if ( !x.initialized() ) return is;
366 is >> x.nTruth;
367 x.truthCol.resize( x.nTruth );
368 {
369 for ( int i = 0; i < x.nTruth; i++ ) { is >> x.truthCol[i]; }
370 }
371 x.check_end_tag( is, "MUCTRUTH" );
372 return is;
373}
374
375std::ostream& operator<<( std::ostream& os, const MUCTRUTH& x ) {
376 os << std::endl << "{ MUCTRUTH" << std::endl;
377 if ( x.initialized() )
378 {
379 os << " " << x.nTruth;
380 {
381 for ( int i = 0; i < x.nTruth; i++ ) { os << " " << x.truthCol[i]; }
382 }
383 }
384 os << std::endl << "} MUCTRUTH" << std::endl;
385 return os;
386}
387
388std::istream& operator>>( std::istream& is, MdcDigiType& x ) {
389 is >> x.trackIndex;
390 is >> x.layerNo;
391 is >> x.cellNo;
392 is >> x.energyDeposit;
393 is >> x.driftTime;
394 return is;
395}
396
397std::ostream& operator<<( std::ostream& os, const MdcDigiType& x ) {
398 os << " " << x.trackIndex;
399 os << " " << x.layerNo;
400 os << " " << x.cellNo;
401 os << " " << x.energyDeposit;
402 os << " " << x.driftTime;
403 os << std::endl;
404 return os;
405}
406
407std::istream& operator>>( std::istream& is, MDCDIGI& x ) {
408 x.check_start_tag( is, "MDCDIGI" );
409 if ( !x.initialized() ) return is;
410 is >> x.nDigi;
411 x.digiCol.resize( x.nDigi );
412 {
413 for ( int i = 0; i < x.nDigi; i++ ) { is >> x.digiCol[i]; }
414 }
415 x.check_end_tag( is, "MDCDIGI" );
416 return is;
417}
418
419std::ostream& operator<<( std::ostream& os, const MDCDIGI& x ) {
420 os << std::endl << "{ MDCDIGI" << std::endl;
421 if ( x.initialized() )
422 {
423 os << " " << x.nDigi;
424 {
425 for ( int i = 0; i < x.nDigi; i++ ) { os << " " << x.digiCol[i]; }
426 }
427 }
428 os << std::endl << "} MDCDIGI" << std::endl;
429 return os;
430}
431
432std::istream& operator>>( std::istream& is, TofDigiType& x ) {
433 is >> x.trackIndex;
434 is >> x.partId;
435 is >> x.scinNb;
436 is >> x.forwADC;
437 is >> x.forwTDC;
438 is >> x.backADC;
439 is >> x.backTDC;
440 return is;
441}
442
443std::ostream& operator<<( std::ostream& os, const TofDigiType& x ) {
444 os << " " << x.trackIndex;
445 os << " " << x.partId;
446 os << " " << x.scinNb;
447 os << " " << x.forwADC;
448 os << " " << x.forwTDC;
449 os << " " << x.backADC;
450 os << " " << x.backTDC;
451 os << std::endl;
452 return os;
453}
454
455std::istream& operator>>( std::istream& is, TOFDIGI& x ) {
456 x.check_start_tag( is, "TOFDIGI" );
457 if ( !x.initialized() ) return is;
458 is >> x.nDigi;
459 x.digiCol.resize( x.nDigi );
460 {
461 for ( int i = 0; i < x.nDigi; i++ ) { is >> x.digiCol[i]; }
462 }
463 x.check_end_tag( is, "TOFDIGI" );
464 return is;
465}
466
467std::ostream& operator<<( std::ostream& os, const TOFDIGI& x ) {
468 os << std::endl << "{ TOFDIGI" << std::endl;
469 if ( x.initialized() )
470 {
471 os << " " << x.nDigi;
472 {
473 for ( int i = 0; i < x.nDigi; i++ ) { os << " " << x.digiCol[i]; }
474 }
475 }
476 os << std::endl << "} TOFDIGI" << std::endl;
477 return os;
478}
479
480std::istream& operator>>( std::istream& is, EmcDigiType& x ) {
481 is >> x.trackIndex;
482 is >> x.partId;
483 is >> x.numTheta;
484 is >> x.numPhi;
485 is >> x.energyDeposit;
486 is >> x.hitTime;
487 return is;
488}
489
490std::ostream& operator<<( std::ostream& os, const EmcDigiType& x ) {
491 os << " " << x.trackIndex;
492 os << " " << x.partId;
493 os << " " << x.numTheta;
494 os << " " << x.numPhi;
495 os << " " << x.energyDeposit;
496 os << " " << x.hitTime;
497 os << std::endl;
498 return os;
499}
500
501std::istream& operator>>( std::istream& is, EMCDIGI& x ) {
502 x.check_start_tag( is, "EMCDIGI" );
503 if ( !x.initialized() ) return is;
504 is >> x.nDigi;
505 x.digiCol.resize( x.nDigi );
506 {
507 for ( int i = 0; i < x.nDigi; i++ ) { is >> x.digiCol[i]; }
508 }
509 x.check_end_tag( is, "EMCDIGI" );
510 return is;
511}
512
513std::ostream& operator<<( std::ostream& os, const EMCDIGI& x ) {
514 os << std::endl << "{ EMCDIGI" << std::endl;
515 if ( x.initialized() )
516 {
517 os << " " << x.nDigi;
518 {
519 for ( int i = 0; i < x.nDigi; i++ ) { os << " " << x.digiCol[i]; }
520 }
521 }
522 os << std::endl << "} EMCDIGI" << std::endl;
523 return os;
524}
525
526std::istream& operator>>( std::istream& is, MucDigiType& x ) {
527 is >> x.trackIndex;
528 is >> x.partNo;
529 is >> x.segNo;
530 is >> x.gapNo;
531 is >> x.stripNo;
532 return is;
533}
534
535std::ostream& operator<<( std::ostream& os, const MucDigiType& x ) {
536 os << " " << x.trackIndex;
537 os << " " << x.partNo;
538 os << " " << x.segNo;
539 os << " " << x.gapNo;
540 os << " " << x.stripNo;
541 os << std::endl;
542 return os;
543}
544
545std::istream& operator>>( std::istream& is, MUCDIGI& x ) {
546 x.check_start_tag( is, "MUCDIGI" );
547 if ( !x.initialized() ) return is;
548 is >> x.nDigi;
549 x.digiCol.resize( x.nDigi );
550 {
551 for ( int i = 0; i < x.nDigi; i++ ) { is >> x.digiCol[i]; }
552 }
553 x.check_end_tag( is, "MUCDIGI" );
554 return is;
555}
556
557std::ostream& operator<<( std::ostream& os, const MUCDIGI& x ) {
558 os << std::endl << "{ MUCDIGI" << std::endl;
559 if ( x.initialized() )
560 {
561 os << " " << x.nDigi;
562 {
563 for ( int i = 0; i < x.nDigi; i++ ) { os << " " << x.digiCol[i]; }
564 }
565 }
566 os << std::endl << "} MUCDIGI" << std::endl;
567 return os;
568}
569std::istream& operator>>( std::istream& is, EVENT& x ) {
570 x.check_start_tag( is, "EVENT" );
571 if ( !x.initialized() ) return is;
572
573 try
574 { is >> x.header; } catch ( AsciiDumpException& )
575 { std::cerr << "Got AsciiDumpException eror while reading header block !!!" << std::endl; }
576
577 try
578 { is >> x.decayMode; } catch ( AsciiDumpException& )
579 {
580 std::cerr << "Got AsciiDumpException eror while reading decay mode block !!!" << std::endl;
581 }
582
583 try
584 { is >> x.trackTruth; } catch ( AsciiDumpException& )
585 {
586 std::cerr << "Got AsciiDumpException eror while reading track truth block !!!"
587 << std::endl;
588 }
589
590 try
591 { is >> x.vertexTruth; } catch ( AsciiDumpException& )
592 {
593 std::cerr << "Got AsciiDumpException eror while reading vertex truth block !!!"
594 << std::endl;
595 }
596
597 try
598 { is >> x.mdcTruth; } catch ( AsciiDumpException& )
599 {
600 std::cerr << "Got AsciiDumpException eror while reading mdc truth block !!!" << std::endl;
601 }
602
603 try
604 { is >> x.mdcDigi; } catch ( AsciiDumpException& )
605 { std::cerr << "Got AsciiDumpException eror while reading mdc digi block !!!" << std::endl; }
606
607 try
608 { is >> x.tofTruth; } catch ( AsciiDumpException& )
609 {
610 std::cerr << "Got AsciiDumpException eror while reading tof truth block !!!" << std::endl;
611 }
612
613 try
614 { is >> x.tofDigi; } catch ( AsciiDumpException& )
615 { std::cerr << "Got AsciiDumpException eror while reading tof digi block !!!" << std::endl; }
616
617 try
618 { is >> x.emcTruth; } catch ( AsciiDumpException& )
619 {
620 std::cerr << "Got AsciiDumpException eror while reading emc truth block !!!" << std::endl;
621 }
622
623 try
624 { is >> x.emcDigi; } catch ( AsciiDumpException& )
625 { std::cerr << "Got AsciiDumpException eror while reading emc digi block !!!" << std::endl; }
626
627 try
628 { is >> x.mucTruth; } catch ( AsciiDumpException& )
629 {
630 std::cerr << "Got AsciiDumpException eror while reading muc truth block !!!" << std::endl;
631 }
632
633 try
634 { is >> x.mucDigi; } catch ( AsciiDumpException& )
635 { std::cerr << "Got AsciiDumpException eror while reading muc digi block !!!" << std::endl; }
636 x.check_end_tag( is, "EVENT" );
637 return is;
638}
639
640std::ostream& operator<<( std::ostream& os, const EVENT& x ) {
641 os << std::endl << "{ EVENT" << std::endl;
642 if ( x.initialized() )
643 {
644 os << " " << x.header;
645 os << " " << x.decayMode;
646 os << " " << x.trackTruth;
647 os << " " << x.vertexTruth;
648 os << " " << x.mdcTruth;
649 os << " " << x.mdcDigi;
650 os << " " << x.tofTruth;
651 os << " " << x.tofDigi;
652 os << " " << x.emcTruth;
653 os << " " << x.emcDigi;
654 os << " " << x.mucTruth;
655 os << " " << x.mucDigi;
656 }
657 os << std::endl << "} EVENT" << std::endl;
658 return os;
659}
std::ostream & operator<<(std::ostream &os, const VERSIONNUM &x)
Definition AsciiData.cxx:15
std::istream & operator>>(std::istream &is, VERSIONNUM &x)
Definition AsciiData.cxx:6