]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/macros/DumpTrackSink.C
Using AliPHOSLoader instead of AliPHOSGetter
[u/mrichter/AliRoot.git] / HLT / MUON / macros / DumpTrackSink.C
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Author: Artur Szostak
4 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
5 //
6 ////////////////////////////////////////////////////////////////////////////////
7
8 /* Dumps the contents of the TrackSink 'ts' to the screen.
9  */
10 void DumpTrackSink(AliMUONHLT::TrackSink* ts)
11 {
12         cout << "File  : " << ts->FileName() << endl;
13         cout << "Folder: " << ts->FolderName() << endl;
14         if ( ! ts->GetFirstEvent() )
15         {
16                 cout << "No events found." << endl;
17                 return;
18         };
19         
20         while (ts->MoreEvents())
21         {
22                 cout << "================= Event: " << ts->CurrentEvent() << " =================" << endl;
23                 Int_t blocknum = 0;
24
25                 if ( ! ts->GetFirstBlock() )
26                 {
27                         cout << "No blocks found." << endl;
28                         ts->GetNextEvent();
29                         continue;
30                 };
31
32                 while (ts->MoreBlocks())
33                 {
34                         cout << "Block: " << blocknum++ << endl;
35                         if ( ts->GetFirstTrack() == NULL )
36                         {
37                                 cout << "\tNo tracks found." << endl;
38                                 ts->GetNextBlock();
39                                 continue;
40                         };
41                         
42                         while (ts->MoreTracks())
43                         {
44                                 const AliMUONHLT::Track* data = ts->GetTrack();
45
46                                 cout << "\tTrigger ID = " << data->TriggerID()
47                                         << ", Sign = " << data->ParticleSign()
48                                         << ", P = " << data->P()
49                                         << ", Pt = " << data->Pt()
50                                         << endl;
51                                 cout << "\t\tX\tY\tLeft\tRight\tBottom\tTop" << endl;
52                                 for (Int_t i = 0; i < 10; i++)
53                                 {
54                                         cout << "\t\t" << data->Hit(i).fX
55                                                 << "\t" << data->Hit(i).fY
56                                                 << "\t" << data->RegionOfInterest(i).Left()
57                                                 << "\t" << data->RegionOfInterest(i).Right()
58                                                 << "\t" << data->RegionOfInterest(i).Bottom()
59                                                 << "\t" << data->RegionOfInterest(i).Top()
60                                                 << endl;
61                                 };
62
63                                 ts->GetNextTrack();
64                         };
65                         ts->GetNextBlock();
66                 };
67                 ts->GetNextEvent();
68         };
69 };
70