A TTask and corresponding macro to convert SPD TestBeam data into AliRoot ITS
[u/mrichter/AliRoot.git] / ITS / AliITSspdTestBeam.cxx
CommitLineData
37c3bb97 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17 $Id$
18*/
19
20#include <stddef.h>
21#include <iomanip>
22#include <Riostream.h>
23#include <fstream>
24#include <AliRunLoader.h>
25#include <AliLoader.h>
26#include <AliITS.h>
27
28#include "AliITSspdTestBeam.h"
29
30ClassImp(AliITSspdTestBeam)
31
32//----------------------------------------------------------------------
33AliITSspdTestBeam::AliITSspdTestBeam(){
34 // Default Constructor for the Task AliITSspdTestBeam.
35 // Inputs:
36 // none.
37 // Outputs:
38 // none.
39 // Return:
40 // A default constructed AliITSspdTestBeam class
41
42 fNBrst = 0;
43 fBrstSize = 0;
44 fBrst = 0;
45 fNData = 0;
46 fData = 0;
47 fHData = 0;
48 fTData = 0;
49 SetTerminationWord();
50 fNEvents = 0;
51 fBuffSize = 0;
52 fBuff = 0;
53 fVersion = 0;
54 fITS = 0;
55 fNfiles = 0;
56 fMaxFiles = 0;
57 fFiles = 0;
58 fNeventsStart = 0;
59 fNeventsEnd = 0;
60}
61//----------------------------------------------------------------------
62AliITSspdTestBeam::AliITSspdTestBeam(const Char_t *filename,const Char_t *opt,
63 AliITS *its){
64 // Standard Constructor for the Task AliITSspdTestBeam.
65 // Inputs:
66 // const Char_t *filename File where to read in the SPD test beam data
67 // const Char_t *opt Option, 2002 => 2002 test beam data.
68 // Outputs:
69 // none.
70 // Return:
71 // A default constructed AliITSspdTestBeam class
72
73 fNBrst = 0;
74 fBrstSize = 0;
75 fBrst = 0;
76 fNData = 0;
77 fData = 0;
78 fHData = 0;
79 fTData = 0;
80 SetTerminationWord();
81 fNEvents = 0;
82 fBuffSize = 0;
83 fBuff = 0;
84 fVersion = 0;
85 fITS = 0;
86 fNfiles = 0;
87 fMaxFiles = 0;
88 fFiles = 0;
89 fNeventsStart = 0;
90 fNeventsEnd = 0;
91 //
92 fITS = its;
93 fNfiles = 0;
94 OpenInputFile(filename,0,-1);
95 if(strcmp(opt,"2002")) cout << "2002 assumed" << endl;
96}
97
98//----------------------------------------------------------------------
99AliITSspdTestBeam::~AliITSspdTestBeam(){
100 // Destructor. Frees up any memory allocated or closes any files opened.
101 // Inputs:
102 // none.
103 // Outputs:
104 // none.
105 // Return:
106 // nothing.
107
108 DeletefBrst();
109 DeletefNData();
110 DeletefData();
111 DeletefHData();
112 DeletefTData();
113 DeletefFiles();
114 DeletefBrstSize();
115 DeletefBuff();
116 DeletefITS();
117 DeletefNeventsStart();
118 DeletefNeventsEnd();
119}
120//----------------------------------------------------------------------
121void AliITSspdTestBeam::DeletefBrst(){
122 // Properly deletes fBrst object.
123 // Inputs:
124 // none.
125 // Outputs:
126 // none.
127 // Return:
128 // none.
129 Int_t i;
130
131 if(fBrst){
132 for(i=0;i<fNBrst;i++) if(fBrst[i]){
133 delete[] fBrst[i];
134 fBrst[i] = 0;
135 } // end for i/if
136 delete[] fBrst;
137 fBrst = 0;
138 } // end if
139}
140//----------------------------------------------------------------------
141void AliITSspdTestBeam::DeletefNData(){
142 // Properly deletes fNData object.
143 // Inputs:
144 // none.
145 // Outputs:
146 // none.
147 // Return:
148 // none.
149 Int_t i,np=GetNumberOfPilots();
150
151 if(fNData){
152 for(i=0;i<np;i++) if(fNData[i]){
153 delete[] fNData[i];
154 fNData[i] = 0;
155 } // end for i
156 delete[] fNData;
157 fNData = 0;
158 } // end if
159}
160//----------------------------------------------------------------------
161void AliITSspdTestBeam::DeletefData(){
162 // Properly deletes fData object.
163 // Inputs:
164 // none.
165 // Outputs:
166 // none.
167 // Return:
168 // none.
169 Int_t i,j,np=GetNumberOfPilots();
170
171 if(fData){
172 for(i=0;i<np;i++) if(fData[i]){
173 for(j=0;j<fNEvents;j++){
174 delete[] fData[i][j];
175 fData[i][j] = 0;
176 } // end for j
177 delete[] fData[i];
178 fData[i] = 0;
179 } // end for i
180 delete[] fData;
181 fData = 0;
182 } // end if
183}
184//----------------------------------------------------------------------
185void AliITSspdTestBeam::DeletefHData(){
186 // Properly deletes fHData object.
187 // Inputs:
188 // none.
189 // Outputs:
190 // none.
191 // Return:
192 // none.
193 Int_t i,j,np=GetNumberOfPilots();
194
195 if(fHData){
196 for(i=0;i<np;i++) if(fHData[i]){
197 for(j=0;j<fNEvents;j++){
198 delete[] fHData[i][j];
199 fHData[i][j] = 0;
200 } // end for j
201 delete[] fHData[i];
202 fHData[i] = 0;
203 } // end for i
204 delete[] fHData;
205 fHData = 0;
206 } // end if
207}
208//----------------------------------------------------------------------
209void AliITSspdTestBeam::DeletefTData(){
210 // Properly deletes fTData object.
211 // Inputs:
212 // none.
213 // Outputs:
214 // none.
215 // Return:
216 // none.
217 Int_t i,j,np=GetNumberOfPilots();
218
219 if(fTData){
220 for(i=0;i<np;i++) if(fTData[i]){
221 for(j=0;j<fNEvents;j++){
222 delete[] fTData[i][j];
223 fTData[i][j] = 0;
224 } // end for j
225 delete[] fTData[i];
226 fTData[i] = 0;
227 } // end for i
228 delete[] fTData;
229 fTData = 0;
230 } // end if
231}
232//----------------------------------------------------------------------
233void AliITSspdTestBeam::DeletefFiles(){
234 // Properly deletes fBrst object.
235 // Inputs:
236 // none.
237 // Outputs:
238 // none.
239 // Return:
240 // none.
241 Int_t i;
242
243 if(fFiles){
244 for(i=0;i<fMaxFiles;i++){
245 if(fFiles[i]!=0) delete fFiles[i];
246 } // end for i
247 } // end if
248}
249//----------------------------------------------------------------------
250void AliITSspdTestBeam::DeletefBrstSize(){
251 // Properly deletes fBrstSize object.
252 // Inputs:
253 // none.
254 // Outputs:
255 // none.
256 // Return:
257 // none.
258 Int_t i,np=GetNumberOfPilots();
259
260 if(fBrstSize){
261 for(i=0;i<np;i++){
262 if(fBrstSize[i]){
263 delete[] fBrstSize[i];
264 fBrstSize[i] = 0;
265 } // end if
266 } // end for i
267 delete[] fBrstSize;
268 fBrstSize = 0;
269 } // end if
270}
271//----------------------------------------------------------------------
272Int_t AliITSspdTestBeam::OpenInputFile(const Char_t *filename,Int_t start,Int_t end){
273 // Opens input file for reading spd test beam data.
274 // Inputs:
275 // const Char_t *filename file name to read data from
276 // Outputs:
277 // none.
278 // Return:
279 // An error number. 0=success, -1=failure.
280 Int_t stat = 0,i;
281
282 if(fMaxFiles==0) {
283 fMaxFiles = 5;
284 fFiles = new ifstream*[fMaxFiles];
285 for(i=0;i<fMaxFiles;i++) fFiles[i] = 0;
286 fNeventsStart = new Int_t[fMaxFiles];
287 fNeventsEnd = new Int_t[fMaxFiles];
288 } // end if
289 if(fNfiles==fMaxFiles){// Need to expand array of open files.
290 ifstream *tmp[fMaxFiles];
291 Int_t st[fMaxFiles],en[fMaxFiles];
292 for(i=0;i<fMaxFiles;i++) { // copy pointers into tmp
293 tmp[i] = fFiles[i];
294 fFiles[i] = 0;
295 st[i] = fNeventsStart[i];
296 en[i] = fNeventsEnd[i];
297 } // end for i
298 delete fFiles;
299 fMaxFiles += 5; // expand by 5.
300 fFiles = new ifstream*[fMaxFiles];
301 fNeventsStart = new Int_t[fMaxFiles];
302 fNeventsEnd = new Int_t[fMaxFiles];
303 for(i=0;i<fMaxFiles;i++) { // copy pointers back into fFiles
304 fFiles[i] = 0; // and zero rest.
305 fNeventsStart[i] = 0;
306 fNeventsEnd[i] = 0;
307 if(i<fNfiles) {
308 fFiles[i] = tmp[i];
309 tmp[i] = 0;
310 fNeventsStart[i] = st[i];
311 fNeventsEnd[i] = en[i];
312 } // end if i<fNfiles
313 } // end for i
314 // the array of pointers tmp is deleted automatically.
315 } // end if
316 // Open file
317 fFiles[fNfiles] = new ifstream(filename,ios::in|ios::binary);
318 if(fFiles[fNfiles]==0){// file open error
319 cout << "Error opening input file " << filename << endl;
320 stat = -1;
321 return stat;
322 } // end if
323 fNeventsStart[fNfiles] = start;
324 fNeventsEnd[fNfiles] = end;
325 fNfiles++;
326 return stat;
327}
328//----------------------------------------------------------------------
329Int_t AliITSspdTestBeam::Read(Int_t i){
330 // Read in one buffer's worth of the file.
331 // Inputs:
332 // Int_t i Which file from the array of files to be read in.
333 // Outputs:
334 // none.
335 // Return:
336 // size of file.
337 Int_t filesize=0;
338
339 fFiles[i]->seekg(0,ios::end);
340 filesize = fFiles[i]->tellg();
341 fFiles[i]->seekg(0,ios::beg);
342 if(fBuff) delete[] fBuff;
343 fBuffSize = filesize;
344 fBuff = new UChar_t[fBuffSize];
345 fFiles[i]->read((Char_t*)fBuff,fBuffSize);
346 fFiles[i] ->close();
347 return filesize;
348}
349//----------------------------------------------------------------------
350Int_t AliITSspdTestBeam::Decode(){
351 // Decode the fBuff read in.
352 // Inputs:
353 // none.
354 // Outputs:
355 // none.
356 // Return:
357 // sets up the array fData fRH, and fRT
358 Int_t stat=0;
359 UInt_t *tr;
360 union {
361 UInt_t *wd;
362 UChar_t *bt;
363 }u; // end union
364 Int_t size;
365 Int_t *ivnt,iburst,ip,np,i,j;
366 AliITSspdTestBeamData *d;
367 AliITSspdTestBeamBurst *b;
368
369 np = GetNumberOfPilots();
370 cout << "Sizeof(Headder)=" << fRH.SizeOf() << endl;
371 cout << "Sizeof(Tail)=" << fRT.SizeOf() << endl;
372 ivnt = new Int_t[np];
373 for(i=0;i<np;i++) ivnt[i] = 0;
374 fRH.SetBuffer(fBuff);//Set Run Header
375 size = fRT.SizeOf();
376 size = fBuffSize - size;
377 cout <<"fBuffSize-sizeof(AliITSspdTestBeamTail) "<< size << endl;
378 fRT.SetBuffer(&(fBuff[size]));
379 // Check termination
380 size -= sizeof(UInt_t);
381 tr = (UInt_t*) &(fBuff[size]);
382 if(!(*tr==fTermination)){
383 cout << "Error Termination word not found at " << size << " tr=0x" <<
384 hex << *tr << dec << endl;
385 exit(-1);
386 } // end if
387 DeletefBrst();
388 DeletefNData();
389 DeletefData();
390 DeletefHData();
391 DeletefTData();
392 DeletefBrstSize();
393 fNEvents = fRH.GetNumberOfEvents();
394 if(fRT.GetNumberOfEvents()>fNEvents) fNEvents = fRT.GetNumberOfEvents();
395 fNBrst = fNEvents/fRH.GetBurstSize();
396 fBrst = new AliITSspdTestBeamBurst*[fNBrst];
397 fBrstSize = new Int_t*[np];
398 fNData = new Int_t*[np];
399 fData = new AliITSspdTestBeamData**[np];
400 fHData = new AliITSspdTestBeamData**[np];
401 fTData = new AliITSspdTestBeamData**[np];
402 for(i=0;i<np;i++){
403 fBrstSize[i] = new Int_t[fNBrst];
404 fNData[i] = new Int_t[fNEvents];
405 fData[i] = new AliITSspdTestBeamData*[fNEvents];
406 fHData[i] = new AliITSspdTestBeamData*[fNEvents];
407 fTData[i] = new AliITSspdTestBeamData*[fNEvents];
408 for(j=0;j<fNEvents;j++){
409 fNData[i][j] = 0;
410 fData[i][j] = 0;
411 fHData[i][j] = 0;
412 fTData[i][j] = 0;
413 } // end for j
414 } // end for i
415 size = fRH.SizeOf();
416 u.bt = &fBuff[size];
417 //
418 for(iburst=0;(*(u.wd) != fTermination)&&(u.wd<tr);iburst++){
419 // loop over Bursts
420 b = new AliITSspdTestBeamBurst(u.bt);
421 fBrst[iburst] = b;
422 u.bt += b->SizeOf(); // increment wd byte wise
423 for(ip=0;ip<np;ip++){ // loop over pilots
424 // Get size of data stored for this pilot.
425 AliITSTestBeamData::Swapit(4,u.bt);
426 fBrstSize[ip][iburst] = (UInt_t) *(u.wd);
427 u.bt += sizeof(UInt_t); // increment wd byte wise
428 for(i=0;i<fBrstSize[ip][iburst];i++){ // loop over data
429 AliITSTestBeamData::Swapit(4,u.bt);
430 d = new AliITSspdTestBeamData(u.bt);
431 switch (d->Mode()){
432 case AliITSTestBeamData::kData :
433 fNData[ip][ivnt[ip]]++;
434 // set pointer to first data member
435 if(fData[ip][ivnt[ip]] == 0 ){
436 fData[ip][ivnt[ip]] = d;
437 } // end if
438 break;
439 case AliITSTestBeamData::kHead :
440 fHData[ip][ivnt[ip]] = d;
441 fTData[ip][ivnt[ip]] = 0;
442 fNData[ip][ivnt[ip]] = 0;
443 fData[ip][ivnt[ip]] = 0;
444 break;
445 case AliITSTestBeamData::kTail :
446 case AliITSTestBeamData::kAbort :
447 fTData[ip][ivnt[ip]++] = d;
448 break;
449 default:
450 cout << "Unknown Data Type: wd="<<hex<<*(u.wd)<<dec<<endl;
451 break;
452 } // end switch
453 u.bt += d->SizeOf(); // increment wd byte wise
454 } // end for i (next data word).
455 } // end for loop over pilots (ip).
456 } // end for loop over bursts
457 delete[] ivnt;
458 return stat;
459}
460//----------------------------------------------------------------------
461Int_t AliITSspdTestBeam::DecodeModule(Int_t pilot,Int_t chip){
462 // Determines the Module number based on the pilot and chip
463 // valules and the fVersion of the simulation.
464 // Inputs:
465 // Int_t pilot Pilot number
466 // Int_t chip chip number
467 // Outputs:
468 // none.
469 // Return:
470 // The module number (see simulations geometry).
471
472 switch (fVersion) {
473 case 2002:
474 if(pilot==0) return chip;
475 if(pilot==1) return 2;
476 if(pilot==2) return chip+3;
477 break;
478 default:
479 if(pilot==0) return chip;
480 if(pilot==1) return 2;
481 if(pilot==2) return chip+3;
482 break;
483 } // end switch
484 return -1;
485}
486//----------------------------------------------------------------------
487void AliITSspdTestBeam::Digitize(Int_t evnt){
488 // Write out ITS SPD Digits.
489 // Inputs:
490 // Int_t evnt events number
491 // Outputs:
492 // none.
493 // Return:
494 // none.
495 Int_t p,i;
496 Int_t module,chip,row,colm,digit[3];
497 Int_t oldmodule=-1;
498
499 fLoader->GetRunLoader()->SetEventNumber(evnt);
500 fLoader->SetEvent();
501 if(!(fLoader->TreeD())){
502 fLoader->MakeTree("D");
503 } // end if
504
505 fITS->MakeBranch("D");
506 //fITS->SetTreeAddress();
507 fITS->SetTreeAddressD(fLoader->TreeD());
508
509 for(p=0;p<GetNumberOfPilots();p++)
510 for(i=0;i<fNData[p][evnt];i++){
511 chip = fData[p][evnt]->Chip(i);
512 module = DecodeModule(p,chip);
513 row = fData[p][evnt]->Row(i);
514 colm = fData[p][evnt]->Colm(i);
515 digit[0] = row; digit[1] = colm, digit[2] = 1;
516 fITS->AddRealDigit(0,digit);
517 if(module!=oldmodule) { // New Module
518 oldmodule= module;
519 fLoader->TreeD()->Fill();
520 fITS->ResetDigits();
521 } // end if
522 } // end for p
523 fITS->ClearModules();
524 fLoader->TreeD()->GetEntries();
525 fLoader->TreeD()->AutoSave();
526 fLoader->TreeD()->Reset();
527}
528//----------------------------------------------------------------------
529void AliITSspdTestBeam::PrintHeadder(ostream *os){
530 // Prints the Run Headder.
531 // Inputs:
532 // ostream *os Output stream where the data should go to
533 // Outputs:
534 // none.
535 // Return:
536 // none.
537 fRH.Print(os);
538}
539//----------------------------------------------------------------------
540void AliITSspdTestBeam::PrintTrailer(ostream *os){
541 // Prints the Run Trailer.
542 // Inputs:
543 // ostream *os Output stream where the data should go to
544 // Outputs:
545 // none.
546 // Return:
547 // none.
548 fRT.Print(os);
549}
550//----------------------------------------------------------------------
551void AliITSspdTestBeam::PrintBurstInfo(Int_t i,ostream *os){
552 // Prints the specified burts information
553 // Inputs:
554 // Int_t i Specifies which burst to print.
555 // ostream *os Output stream where the data should go to
556 // Outputs:
557 // none.
558 // Return:
559 // none.
560 fBrst[i]->Print(os);
561}
562//----------------------------------------------------------------------
563void AliITSspdTestBeam::PrintEventData(Int_t evnt,ostream *os){
564 // Prints the data for a specified event number.
565 // Inputs:
566 // Int_t evnt events number
567 // ostream *os Output stream where the data should go to
568 // Outputs:
569 // none.
570 // Return:
571 // none.
572 Int_t p,i;
573
574 for(p=0;p<GetNumberOfPilots();p++)
575 for(i=0;i<fNData[p][evnt];i++){
576 *os << "Pilot=" << setw(3) << p << " ";
577 fData[p][evnt]->Print(os,i);
578 *os << endl;
579 } // end for p
580}
581//----------------------------------------------------------------------
582void AliITSspdTestBeam::PrintEventHead(Int_t evnt,ostream *os){
583 // Prints the data Headder for a specified event number.
584 // Inputs:
585 // Int_t evnt events number
586 // ostream *os Output stream where the data should go to
587 // Outputs:
588 // none.
589 // Return:
590 // none.
591 Int_t p;
592
593 for(p=0;p<GetNumberOfPilots();p++){
594 *os << "Pilot=" << setw(3) << p << " " << *(fHData[p][evnt]);
595 } // end for p
596}
597//----------------------------------------------------------------------
598void AliITSspdTestBeam::PrintEventTail(Int_t evnt,ostream *os){
599 // Prints the data Trailer for a specified event number.
600 // Inputs:
601 // Int_t evnt events number
602 // ostream *os Output stream where the data should go to
603 // Outputs:
604 // none.
605 // Return:
606 // none.
607 Int_t p;
608
609 for(p=0;p<GetNumberOfPilots();p++){
610 *os << "Pilot=" << setw(3) << p << " " << *(fTData[p][evnt]);
611 } // end for p
612}
613//============================================================================
614void AliITSTestBeamData::Swapit(Int_t i,UChar_t *a){
615 // Swap the order of the bits
616 // Inputs:
617 // Int_t i Size of UChar_t array a.
618 // UChar_t a Array of bytes to be swapped.
619 // Outputs:
620 // UChar_t a Array with bytes swapped
621 // Return:
622 // none.
623 Int_t j;
624 UChar_t c[i];
625
626 for(j=0;j<i;j++) c[j] = a[i-j-1];
627 for(j=0;j<i;j++) a[j] = c[j];
628}
629//============================================================================
630void AliITSspdTestBeamHeader::Print(ostream *os){
631 // print out the header information
632 // Inputs:
633 // ostream *os Pointer to the output stream.
634 // Outputs:
635 // none.
636 // Return:
637 // none.
638/*
639#if defined __GNUC__
640#if __GNUC__ > 2
641 ios::fmtflags fmt;
642#else
643 Int_t fmt;
644#endif
645#else
646#if defined __ICC || defined __ECC
647 ios::fmtflags fmt;
648#else
649 Int_t fmt;
650#endif
651#endif
652*/
653 *os<<"Version: "<<GetVersion()<<" Written: "<<fUnion->fHead.fDate;
654 *os<<" " << fUnion->fHead.fTime << endl;
655 *os<<"Buffer Size [0], [1], [2]: " << GetBuffSize(0) << ",";
656 *os<<GetBuffSize(1)<<"," <<GetBuffSize(2) << endl;
657 *os<<"Test Pulse: " << GetTestPulse() << endl;
658 *os<<"Trigger Mode General, [0], [1], [2]: " << GetTriggerMode();
659 *os<<","<<GetTrigger(0)<<","<<GetTrigger(1)<< ",";
660 *os<<GetTrigger(2) << endl;
661 *os<<"Number of Events: " << GetNumberOfEvents() << " Burst Size: ";
662 *os<<GetBurstSize() << endl;
663 return;
664}
665//----------------------------------------------------------------------
666ostream &operator<<(ostream &os,AliITSspdTestBeamHeader &p){
667 // Standard output operator. See Print
668 // Inputs:
669 // ostream &os the output stream.
670 // AliITSspdTestBeamHeader &p the data to be printed out.
671 // Outputs:
672 // none.
673 // Return:
674 // ostream &os pointing now to the end of the present stream.
675
676 p.Print(&os);
677 return os;
678}
679//============================================================================
680void AliITSspdTestBeamTail::Print(ostream *os){
681 // print out the Tail information
682 // Inputs:
683 // ostream *os Pointer to the output stream.
684 // Outputs:
685 // none.
686 // Return:
687 // none.
688/*
689#if defined __GNUC__
690#if __GNUC__ > 2
691 ios::fmtflags fmt;
692#else
693 Int_t fmt;
694#endif
695#else
696#if defined __ICC || defined __ECC
697 ios::fmtflags fmt;
698#else
699 Int_t fmt;
700#endif
701#endif
702*/
703 *os << "Number of Events: "<< GetNumberOfEvents() << " Written: "
704 << fUnion->fTail.fDate;
705 *os << " " << fUnion->fTail.fTime << endl;
706 *os <<"Termination Flag: " << GetTermMode() << endl;
707 return;
708}
709//----------------------------------------------------------------------
710ostream &operator<<(ostream &os,AliITSspdTestBeamTail &p){
711 // Standard output operator. See Print
712 // Inputs:
713 // ostream &os the output stream.
714 // AliITSspdTestBeamHeader &p the data to be printed out.
715 // Outputs:
716 // none.
717 // Return:
718 // ostream &os pointing now to the end of the present stream.
719
720 p.Print(&os);
721 return os;
722}
723//============================================================================
724void AliITSspdTestBeamBurst::Print(ostream *os){
725 // print out the Burst information
726 // Inputs:
727 // ostream *os Pointer to the output stream.
728 // Outputs:
729 // none.
730 // Return:
731 // none.
732/*
733#if defined __GNUC__
734#if __GNUC__ > 2
735 ios::fmtflags fmt;
736#else
737 Int_t fmt;
738#endif
739#else
740#if defined __ICC || defined __ECC
741 ios::fmtflags fmt;
742#else
743 Int_t fmt;
744#endif
745#endif
746*/
747 *os << "Burst Number: "<< GetEventNumber()<< " Transfers: "
748 << GetTransfers() << endl;
749 return;
750}
751//----------------------------------------------------------------------
752ostream &operator<<(ostream &os,AliITSspdTestBeamBurst &p){
753 // Standard output operator. See Print
754 // Inputs:
755 // ostream &os the output stream.
756 // AliITSspdTestBeamHeader &p the data to be printed out.
757 // Outputs:
758 // none.
759 // Return:
760 // ostream &os pointing now to the end of the present stream.
761
762 p.Print(&os);
763 return os;
764}
765//======================================================================
766void AliITSspdTestBeamData::Print(ostream *os,Int_t i){
767 // print out the the Test Beam Data information
768 // Inputs:
769 // ostream *os Pointer to the output stream.
770 // Outputs:
771 // none.
772 // Return:
773 // none.
774/*
775#if defined __GNUC__
776#if __GNUC__ > 2
777 ios::fmtflags fmt;
778#else
779 Int_t fmt;
780#endif
781#else
782#if defined __ICC || defined __ECC
783 ios::fmtflags fmt;
784#else
785 Int_t fmt;
786#endif
787#endif
788*/
789 //*os << "Word=" << hex << (fUnion+i)->fBuf[0] << hex << (fUnion+i)->fBuf[1]
790 // << hex << (fUnion+i)->fBuf[2] << hex << (fUnion+i)->fBuf[3]
791 *os << "Word=" << hex << (fUnion+i)->fIBuff
792 << dec;
793 switch (this->Mode(i)){
794 case AliITSTestBeamData::kData :
795 *os << " kData chip=" << setw(3) << Chip(i);
796 *os << " Row=" << setw(3) << Row(i);
797 *os << " Column=" << setw(3) << Colm(i);
798 break;
799 case AliITSTestBeamData::kHead :
800 *os << " kHead Event Sync =" << EventCounter();
801 break;
802 case AliITSTestBeamData::kTail :
803 *os << " kTail Transmitted word count =" << TransWordCount();
804 break;
805 case AliITSTestBeamData::kAbort :
806 *os << " kAbort Transmitted word count =" << TransWordCount();
807 break;
808 default:
809 *os << " Unknown Data Type";
810 break;
811 } // end switch
812 *os << endl;
813 return;
814}
815//----------------------------------------------------------------------
816ostream &operator<<(ostream &os,AliITSspdTestBeamData &p){
817 // Standard output operator. See Print
818 // Inputs:
819 // ostream &os the output stream.
820 // AliITSspdTestBeamHeader &p the data to be printed out.
821 // Outputs:
822 // none.
823 // Return:
824 // ostream &os pointing now to the end of the present stream.
825
826 p.Print(&os,0);
827 return os;
828}