]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/trd_analyse.C
From Magali: small modifications.
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_analyse.C
CommitLineData
8d415c38 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:
bfff47e6 8// .L trd_analyse.C
8d415c38 9// analyseXXX(ptr)
10//
11// Author:
12// Alex Bercuci (A.Bercuci@gsi.de)
13//
a969af30 14
15//_______________________________________________________
16void analyseHits(AliEveTRDHits *hits = 0x0)
17{
18// Simple print hits from a detector
19
20 if(!hits) {
21 Info("analyseHits", "Invalid hits set.");
22 return;
23 }
24
25 AliTRDhit *h = 0x0;
26 for(Int_t ih=0; ih<hits->GetN(); ih++){
27 hits->PointSelected(ih);
28 }
29}
30
bfff47e6 31//_______________________________________________________
8d415c38 32void analyseDigits(AliEveTRDDigits *digits = 0x0)
33{
34// Simple print digits from a detector
35
36 if(!digits) {
37 Info("analyseDigits", "Invalid digits set.");
38 return;
39 }
40
41 Int_t adc ;
42 AliTRDdataArrayI *data = digits->GetData();
43 Int_t nrows = data->GetNrow(),
44 ncols = data->GetNcol(),
45 ntbs = data->GetNtime();
46 data->Expand();
47 printf("nrows[%d] ncols[%d] ntbs[%d]\n", nrows, ncols, ntbs);
48 for (Int_t row = 0; row < nrows; row++)
49 for (Int_t col = 0; col < ncols; col++)
50 for (Int_t time = 0; time < ntbs; time++) {
51 if((adc = data->GetDataUnchecked(row, col, time)) <= 1) continue;
52 printf("r[%d] c[%d] t[%d] ADC[%d]\n", row, col, time, adc);
53 }
54 data->Compress(1);
55}
56
bfff47e6 57//_______________________________________________________
66c3c96b 58void analyseClusters(TEvePointSet *points = 0x0)
59{
8d415c38 60// print some info about clusters in one detector or
61// attached to tracks.
66c3c96b 62 if(!points) {
bfff47e6 63 Info("analyseClusters", "Invalid clusters set.");
66c3c96b 64 return;
65 }
66
67 AliTRDcluster *c = 0x0;
68 for(Int_t ic=0; ic<points->Size(); ic++){
69 if(!(c = (AliTRDcluster*)points->GetPointId(ic))) continue;
70
a969af30 71 c->Print();
66c3c96b 72 }
73}
74
bfff47e6 75//_______________________________________________________
76void analyseTracklet(AliEveTRDTracklet *line)
66c3c96b 77{
8d415c38 78// print tracklet information
66c3c96b 79 if(!line) {
bfff47e6 80 Info("analyseTracklet", "Invalid tracklet.");
66c3c96b 81 return;
82 }
83
84 AliTRDseedV1 *tracklet = 0x0;
bfff47e6 85 tracklet = (AliTRDseedV1*)line->GetUserData();
66c3c96b 86 tracklet->Print();
8d415c38 87}
88
bfff47e6 89//_______________________________________________________
90void analyseTrack(AliEveTRDTrack *line)
91{
92// print tracklet information
93 if(!line) {
94 Info("analyseTrack", "Invalid track.");
95 return;
96 }
97
98 AliTRDtrackV1 *track = 0x0;
99 track = (AliTRDtrackV1*)line->GetUserData();
100
101 AliTRDReconstructor *rec = new AliTRDReconstructor();
102 rec->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
103 track->SetReconstructor(rec);
104
105 rec->SetOption("!nn");
106 track->CookPID();
107 printf("PID LQ : "); for(int is=0; is<AliPID::kSPECIES; is++) printf("%s[%5.2f] ", AliPID::ParticleName(is), 1.E2*track->GetPID(is)); printf("\n");
108
109 rec->SetOption("nn");
110 track->CookPID();
111 printf("PID NN : "); for(int is=0; is<AliPID::kSPECIES; is++) printf("%s[%5.2f] ", AliPID::ParticleName(is), 1.E2*track->GetPID(is)); printf("\n");
112}
113
114//_______________________________________________________
115void trd_analyse()
116{
117 Info("trd_analyse", "******************************");
118 Info("trd_analyse", "Example function which shows how to analyse TRD data exported from the EVE display.");
119 Info("trd_analyse", "Usage : Load the macro. Select a TRD data object (digits, clusters, tracklet, track) and call the function \"ExportToCINT()\". Afterwards call the appropiate function (analyseXXX()) on the pointer.");
120 Info("trd_analyse", "E.g. If \"tracklet\" is a pointer to a TRD track than one can call :");
121 Info("trd_analyse", "analyseTrack(track)");
122
123 //gROOT->LoadMacro("$ALICE_ROOT/EVE/alice-macros/trd_analyse.C");
124 return;
125}