]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/trd_analyse.C
Adding more information to the debug output
[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//
bfff47e6 14//_______________________________________________________
8d415c38 15void analyseDigits(AliEveTRDDigits *digits = 0x0)
16{
17// Simple print digits from a detector
18
19 if(!digits) {
20 Info("analyseDigits", "Invalid digits set.");
21 return;
22 }
23
24 Int_t adc ;
25 AliTRDdataArrayI *data = digits->GetData();
26 Int_t nrows = data->GetNrow(),
27 ncols = data->GetNcol(),
28 ntbs = data->GetNtime();
29 data->Expand();
30 printf("nrows[%d] ncols[%d] ntbs[%d]\n", nrows, ncols, ntbs);
31 for (Int_t row = 0; row < nrows; row++)
32 for (Int_t col = 0; col < ncols; col++)
33 for (Int_t time = 0; time < ntbs; time++) {
34 if((adc = data->GetDataUnchecked(row, col, time)) <= 1) continue;
35 printf("r[%d] c[%d] t[%d] ADC[%d]\n", row, col, time, adc);
36 }
37 data->Compress(1);
38}
39
bfff47e6 40//_______________________________________________________
66c3c96b 41void analyseClusters(TEvePointSet *points = 0x0)
42{
8d415c38 43// print some info about clusters in one detector or
44// attached to tracks.
66c3c96b 45 if(!points) {
bfff47e6 46 Info("analyseClusters", "Invalid clusters set.");
66c3c96b 47 return;
48 }
49
50 AliTRDcluster *c = 0x0;
51 for(Int_t ic=0; ic<points->Size(); ic++){
52 if(!(c = (AliTRDcluster*)points->GetPointId(ic))) continue;
53
54 printf("%2d[%p] Det[%d] LabelMC[%d] TB[%d]\n", ic, c, c->GetDetector(), c->GetLabel(0), c->GetLocalTimeBin());
55 }
56}
57
bfff47e6 58//_______________________________________________________
59void analyseTracklet(AliEveTRDTracklet *line)
66c3c96b 60{
8d415c38 61// print tracklet information
66c3c96b 62 if(!line) {
bfff47e6 63 Info("analyseTracklet", "Invalid tracklet.");
66c3c96b 64 return;
65 }
66
67 AliTRDseedV1 *tracklet = 0x0;
bfff47e6 68 tracklet = (AliTRDseedV1*)line->GetUserData();
66c3c96b 69 tracklet->Print();
8d415c38 70}
71
bfff47e6 72//_______________________________________________________
73void analyseTrack(AliEveTRDTrack *line)
74{
75// print tracklet information
76 if(!line) {
77 Info("analyseTrack", "Invalid track.");
78 return;
79 }
80
81 AliTRDtrackV1 *track = 0x0;
82 track = (AliTRDtrackV1*)line->GetUserData();
83
84 AliTRDReconstructor *rec = new AliTRDReconstructor();
85 rec->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
86 track->SetReconstructor(rec);
87
88 rec->SetOption("!nn");
89 track->CookPID();
90 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");
91
92 rec->SetOption("nn");
93 track->CookPID();
94 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");
95}
96
97//_______________________________________________________
98void trd_analyse()
99{
100 Info("trd_analyse", "******************************");
101 Info("trd_analyse", "Example function which shows how to analyse TRD data exported from the EVE display.");
102 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.");
103 Info("trd_analyse", "E.g. If \"tracklet\" is a pointer to a TRD track than one can call :");
104 Info("trd_analyse", "analyseTrack(track)");
105
106 //gROOT->LoadMacro("$ALICE_ROOT/EVE/alice-macros/trd_analyse.C");
107 return;
108}