1 // How to fill the list analyser with objects via a macro: Please see example below!
2 // How to use the list analyser (and especially this macro):
4 // -- Primary selection (to add e.g. tracklets, tracks, etc.):
5 // - Load the objects you want to analyse with a sufficient macro (e.g. for tracks and tracklets you can use ana_list_load_tracks.C)
6 // - Run this macro (ana_list.C)
7 // - In the tab "eve" in the browser select the list analyser (called "Analysis objects" in the standard case)
8 // - Select the "list" tab in the editor of this object.
9 // - Click the button "start"
10 // - Select the objects you want to add by left-clicking on them in the viewer (or as well in the browser (left panel))
11 // - When you have finished adding the desired objects, click the button "stop"
12 // Use the list analyser "as usual" (see class documentation)
14 // -- Secondary selection (to add e.g. single clusters (of a TEvePointSet) or digits (of a TEveQuadSet)):
15 // To add e.g. AliTrackPoints or tracks you can do the following:
16 // - Run e.g. the macro "esd_tracks.C"
17 // - Select some track you want to analyse as follows: Hold "shift" und right-click on the track (sometimes you have to hold the right mouse button). The menu pops up
18 // -> Select "ImportClustersFromIndex"
19 // -> Do this for all tracks you want to analyse.
20 // - Run this macro (ana_list.C)
21 // - In the tab "eve" in the browser select the list analyser (called "Analysis objects" in the standard case)
22 // - Select the "list" tab in the editor of this object.
23 // - Click the button "start"
24 // - Select e.g. clusters by holding "ctrl"+"alt" (depending on your system, holding the "alt" only can also be fine) and left-clicking on the desired cluster
25 // - When you have finished adding the desired objects, click the button "stop"
26 // Use the list analyser "as usual" (see class documentation)
28 #if !defined(__CINT__) || defined(__MAKECINT__)
29 #include <TEveManager.h>
31 #include <AliTRDarrayADC.h>
32 #include <AliEveListAnalyser.h>
35 void ana_list(TEveElement *cont = 0)
37 AliEveListAnalyser * objList = new AliEveListAnalyser("Analysis objects");
39 objList->SetTitle("Analysis objects (0)");
41 gEve->AddElement(objList, cont);
47 // Example about filling the list analyser with objects via a macro. You can use the following example macro to load the list with trd tracks:
49 // Launches the list analyser and loads tracks into the list.
50 // If you already have a list (or rather a list analyser) with objects and you want to add the tracks to this list, do the following:
51 // Right-click the list analyser in the eve-browser and select "ExportToCint". Choose e.g. "list" for the name in the window that pops up.
52 // In the console type ".x ana_list_load_tracks.C(list)"
53 // For more information please see "ana_list.C" or have a look at the class documentation.
56 #include <TGLViewer.h>
57 #include <TEveManager.h>
58 #include <EveBase/AliEveEventManager.h>
59 #include "TRD/AliTRDarrayADC.h"
60 #include <EveDet/AliEveListAnalyser.h>
62 #include "AliESDEvent.h"
63 #include "AliESDfriend.h"
64 #include "TRD/AliTRDReconstructor.h"
65 #include "TRD/AliTRDtrackV1.h"
68 void ana_list_load_trd_tracks(AliEveListAnalyser* objects = 0, TEveElement *cont = 0)
70 // Link data containers
71 AliESDfriend *eventESDfriend = 0x0;
72 if(!(eventESDfriend = AliEveEventManager::AssertESDfriend())){
73 Warning("ana_list_load_tracks", "AliESDfriend not found");
77 AliESDEvent* esd = AliEveEventManager::AssertESD();
79 AliEveEventManager::AssertGeometry();
81 AliTRDrecoParam *trdRecoParam = AliTRDrecoParam::GetLowFluxParam();
84 printf("Could not load AliTRDrecoParam\n");
87 trdRecoParam->SetPIDNeuralNetwork();
88 AliTRDReconstructor *reco = new AliTRDReconstructor();
91 printf("Could not load AliTRDReconstructor\n");
94 reco->SetRecoParam(trdRecoParam);
99 objects = new AliEveListAnalyser("Analysis Objects");
100 gEve->AddElement(objects, cont);
103 // Number of elements already in the list
104 Int_t nOld = objects->NumChildren();
108 for (Int_t n = 0; n < esd->GetNumberOfTracks(); n++)
110 AliESDtrack* esdTrack = esd->GetTrack(n);
111 AliESDfriendTrack *friendTrack = eventESDfriend->GetTrack(n);
113 if (!esdTrack || !friendTrack)
115 printf("Problem with track %d\n", n);
120 AliTRDtrackV1 *trackObj = 0x0;
121 AliEveTRDTrack *trackEve = 0x0;
124 while((cal = friendTrack->GetCalibObject(ical++))){
125 if(strcmp(cal->IsA()->GetName(), "AliTRDtrackV1") != 0) continue;
126 trackObj = new AliTRDtrackV1(*((AliTRDtrackV1*)cal));
129 printf("Cast to AliTRDtrackV1 failed!\n");
132 if (trackObj->IsOwner()) trackObj->SetOwner();
133 trackObj->SetReconstructor(reco);
135 trackEve = new AliEveTRDTrack(trackObj);
138 prWintf("Cast to AliEveTRDTrack failed!\n");
141 objects->AddElement(trackEve);
142 trackEve->SetESDstatus(esdTrack->GetStatus());
143 trackEve->SetName(Form("[%4d] %s", count + nOld, trackEve->GetName()));
148 objects->SetTitle(Form("Objects %d", objects->NumChildren()));
149 objects->StampObjProps();