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 **************************************************************************/
7 #if !defined(__CINT__) || defined(__MAKECINT__)
8 #include <TEvePointSet.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>
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
32 // Alex Bercuci (A.Bercuci@gsi.de)
35 //_______________________________________________________
36 void analyseHits(AliEveTRDHits *hits = 0x0)
38 // Simple print hits from a detector
41 Info("analyseHits", "Invalid hits set.");
46 for(Int_t ih=0; ih<hits->GetN(); ih++){
47 hits->PointSelected(ih);
54 //_______________________________________________________
55 void analyseDigits(AliEveTRDDigits *digits = 0x0)
57 // Simple print digits from a detector
60 Info("analyseDigits", "Invalid digits set.");
65 AliTRDdataArrayI *data = digits->GetData();
66 Int_t nrows = data->GetNrow(),
67 ncols = data->GetNcol(),
68 ntbs = data->GetNtime();
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);
81 //_______________________________________________________
82 void analyseClusters(TEvePointSet *points = 0x0)
84 // print some info about clusters in one detector or
85 // attached to tracks.
87 Info("analyseClusters", "Invalid clusters set.");
91 AliTRDcluster *c = 0x0;
92 for(Int_t ic=0; ic<points->Size(); ic++){
93 if(!(c = (AliTRDcluster*)points->GetPointId(ic))) continue;
99 //_______________________________________________________
100 void analyseTracklet(AliEveTRDTracklet *line)
102 // print tracklet information
104 Info("analyseTracklet", "Invalid tracklet.");
108 AliTRDseedV1 *tracklet = 0x0;
109 tracklet = (AliTRDseedV1*)line->GetUserData();
113 //_______________________________________________________
114 void analyseTrack(AliEveTRDTrack *line)
116 // print tracklet information
118 Info("analyseTrack", "Invalid track.");
122 AliTRDtrackV1 *track = 0x0;
123 track = (AliTRDtrackV1*)line->GetUserData();
125 AliTRDReconstructor *rec = new AliTRDReconstructor();
126 rec->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
127 track->SetReconstructor(rec);
129 rec->SetOption("!nn");
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");
133 rec->SetOption("nn");
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");
138 //_______________________________________________________
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)");
147 //gROOT->LoadMacro("$ALICE_ROOT/EVE/alice-macros/trd_analyse.C");