]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/trd_analyse.C
Adding ALICE specific implementations of Eve
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_analyse.C
CommitLineData
ba978640 1/**************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
3 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
4 * full copyright notice. *
5 **************************************************************************/
6
7#if !defined(__CINT__) || defined(__MAKECINT__)
8#include <TEvePointSet.h>
9
6c49a8e1 10#include <AliPID.h>
11#include <AliTRDhit.h>
12#include <AliTRDarrayADC.h>
13#include <AliTRDcluster.h>
14#include <AliTRDtrackV1.h>
15#include <AliTRDReconstructor.h>
16#include <AliTRDrecoParam.h>
17#include <AliTRDseedV1.h>
18#include <AliEveTRDData.h>
ba978640 19#endif
20
8d415c38 21//
22// How to access the basic TRD data structures when a
23// pointer to an Eve opject is available. One can get a
24// valid pointer from the event display by accessing the
25// function ExportToCINT
26//
27// Usage:
bfff47e6 28// .L trd_analyse.C
8d415c38 29// analyseXXX(ptr)
30//
31// Author:
32// Alex Bercuci (A.Bercuci@gsi.de)
33//
a969af30 34
35//_______________________________________________________
36void analyseHits(AliEveTRDHits *hits = 0x0)
37{
38// Simple print hits from a detector
39
40 if(!hits) {
41 Info("analyseHits", "Invalid hits set.");
42 return;
43 }
44
45 AliTRDhit *h = 0x0;
46 for(Int_t ih=0; ih<hits->GetN(); ih++){
47 hits->PointSelected(ih);
48 }
49}
50
ba978640 51/* Obsolete code
52 *
53 *
bfff47e6 54//_______________________________________________________
8d415c38 55void analyseDigits(AliEveTRDDigits *digits = 0x0)
56{
57// Simple print digits from a detector
58
59 if(!digits) {
60 Info("analyseDigits", "Invalid digits set.");
61 return;
62 }
63
64 Int_t adc ;
65 AliTRDdataArrayI *data = digits->GetData();
66 Int_t nrows = data->GetNrow(),
67 ncols = data->GetNcol(),
68 ntbs = data->GetNtime();
69 data->Expand();
70 printf("nrows[%d] ncols[%d] ntbs[%d]\n", nrows, ncols, ntbs);
71 for (Int_t row = 0; row < nrows; row++)
72 for (Int_t col = 0; col < ncols; col++)
73 for (Int_t time = 0; time < ntbs; time++) {
74 if((adc = data->GetDataUnchecked(row, col, time)) <= 1) continue;
75 printf("r[%d] c[%d] t[%d] ADC[%d]\n", row, col, time, adc);
76 }
77 data->Compress(1);
78}
ba978640 79*/
8d415c38 80
bfff47e6 81//_______________________________________________________
66c3c96b 82void analyseClusters(TEvePointSet *points = 0x0)
83{
8d415c38 84// print some info about clusters in one detector or
85// attached to tracks.
66c3c96b 86 if(!points) {
bfff47e6 87 Info("analyseClusters", "Invalid clusters set.");
66c3c96b 88 return;
89 }
90
91 AliTRDcluster *c = 0x0;
92 for(Int_t ic=0; ic<points->Size(); ic++){
93 if(!(c = (AliTRDcluster*)points->GetPointId(ic))) continue;
94
a969af30 95 c->Print();
66c3c96b 96 }
97}
98
bfff47e6 99//_______________________________________________________
100void analyseTracklet(AliEveTRDTracklet *line)
66c3c96b 101{
8d415c38 102// print tracklet information
66c3c96b 103 if(!line) {
bfff47e6 104 Info("analyseTracklet", "Invalid tracklet.");
66c3c96b 105 return;
106 }
107
108 AliTRDseedV1 *tracklet = 0x0;
bfff47e6 109 tracklet = (AliTRDseedV1*)line->GetUserData();
66c3c96b 110 tracklet->Print();
8d415c38 111}
112
bfff47e6 113//_______________________________________________________
114void analyseTrack(AliEveTRDTrack *line)
115{
116// print tracklet information
117 if(!line) {
118 Info("analyseTrack", "Invalid track.");
119 return;
120 }
121
122 AliTRDtrackV1 *track = 0x0;
123 track = (AliTRDtrackV1*)line->GetUserData();
124
125 AliTRDReconstructor *rec = new AliTRDReconstructor();
126 rec->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
127 track->SetReconstructor(rec);
128
129 rec->SetOption("!nn");
130 track->CookPID();
131 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");
132
133 rec->SetOption("nn");
134 track->CookPID();
135 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");
136}
137
138//_______________________________________________________
139void trd_analyse()
140{
141 Info("trd_analyse", "******************************");
142 Info("trd_analyse", "Example function which shows how to analyse TRD data exported from the EVE display.");
143 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.");
144 Info("trd_analyse", "E.g. If \"tracklet\" is a pointer to a TRD track than one can call :");
145 Info("trd_analyse", "analyseTrack(track)");
146
147 //gROOT->LoadMacro("$ALICE_ROOT/EVE/alice-macros/trd_analyse.C");
148 return;
149}