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