]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/trd_analyse.C
AliEveEventManager
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_analyse.C
1 //
2 // How to access the basic TRD data structures when a 
3 // pointer to an Eve opject is available. One can get a 
4 // valid pointer from the event display by accessing the 
5 // function ExportToCINT 
6 // 
7 // Usage:
8 // .L trd_analysis.C
9 // analyseXXX(ptr)
10 // 
11 // Author:
12 // Alex Bercuci (A.Bercuci@gsi.de)
13 // 
14 void analyseDigits(AliEveTRDDigits *digits = 0x0)
15 {
16 // Simple print digits from a detector
17
18   if(!digits) {
19     Info("analyseDigits", "Invalid digits set.");
20     return;
21   }
22
23   Int_t adc ;
24   AliTRDdataArrayI *data = digits->GetData();
25   Int_t nrows = data->GetNrow(),
26         ncols = data->GetNcol(),
27         ntbs  = data->GetNtime();
28   data->Expand();
29   printf("nrows[%d] ncols[%d] ntbs[%d]\n", nrows, ncols, ntbs);
30   for (Int_t  row = 0;  row <  nrows;  row++)
31   for (Int_t  col = 0;  col <  ncols;  col++)
32     for (Int_t time = 0; time < ntbs; time++) {
33       if((adc = data->GetDataUnchecked(row, col, time)) <= 1) continue;
34       printf("r[%d] c[%d] t[%d] ADC[%d]\n", row, col, time, adc);
35     }
36   data->Compress(1);
37 }
38
39
40 void analyseClusters(TEvePointSet *points = 0x0)
41 {
42 // print some info about clusters in one detector or 
43 // attached to tracks.
44   if(!points) {
45     Info("analyseClusters", "Invalid points set.");
46     return;
47   }
48
49   AliTRDcluster *c = 0x0;
50   for(Int_t ic=0; ic<points->Size(); ic++){
51     if(!(c = (AliTRDcluster*)points->GetPointId(ic))) continue;
52   
53     printf("%2d[%p] Det[%d] LabelMC[%d] TB[%d]\n", ic, c, c->GetDetector(), c->GetLabel(0), c->GetLocalTimeBin());
54   }
55 }
56
57 void analyseTracklet(TEveLine *line)
58 {
59 // print tracklet information
60   if(!line) {
61     Info("analyseTracklet", "Invalid line.");
62     return;
63   }
64   
65   AliTRDseedV1 *tracklet = 0x0;
66   tracklet = (AliTRDseedV1*)line->GetUserData(0);
67   tracklet->Print();
68 }
69