ROOT logo
// How to fill the list analyser with objects via a macro: Please see example below!
// How to use the list analyser (and especially this macro):

// -- Primary selection (to add e.g. tracklets, tracks, etc.):
// - 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)
// - Run this macro (ana_list.C)
// - In the tab "eve" in the browser select the list analyser (called "Analysis objects" in the standard case)
// - Select the "list" tab in the editor of this object.
// - Click the button "start"
// - Select the objects you want to add by left-clicking on them in the viewer (or as well in the browser (left panel))
// - When you have finished adding the desired objects, click the button "stop"
// Use the list analyser "as usual" (see class documentation)

// -- Secondary selection (to add e.g. single clusters (of a TEvePointSet) or digits (of a TEveQuadSet)):
// To add e.g. AliTrackPoints or tracks you can do the following:
// - Run e.g. the macro "esd_tracks.C" 
// - 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
// -> Select "ImportClustersFromIndex"
// -> Do this for all tracks you want to analyse.
// - Run this macro (ana_list.C)
// - In the tab "eve" in the browser select the list analyser (called "Analysis objects" in the standard case)
// - Select the "list" tab in the editor of this object.
// - Click the button "start"
// - 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
// - When you have finished adding the desired objects, click the button "stop"
// Use the list analyser "as usual" (see class documentation)

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TEveManager.h>

#include <AliTRDarrayADC.h>
#include <AliEveListAnalyser.h>
#endif

void ana_list(TEveElement *cont = 0)
{
  AliEveListAnalyser * objList = new AliEveListAnalyser("Analysis objects");
  
  objList->SetTitle("Analysis objects (0)");

  gEve->AddElement(objList, cont);

  gEve->Redraw3D();
}


// 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:
/*
// Launches the list analyser and loads tracks into the list.
// 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:
// 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.
// In the console type ".x ana_list_load_tracks.C(list)"
// For more information please see "ana_list.C" or have a look at the class documentation.

#ifndef __CINT__
#include <TGLViewer.h>
#include <TEveManager.h>
#include <EveBase/AliEveEventManager.h>
#include "TRD/AliTRDarrayADC.h"
#include <EveDet/AliEveListAnalyser.h>

#include "AliESDEvent.h"
#include "AliESDfriend.h"
#include "TRD/AliTRDReconstructor.h"
#include "TRD/AliTRDtrackV1.h"
#endif

void ana_list_load_trd_tracks(AliEveListAnalyser* objects = 0, TEveElement *cont = 0)
{
  // Link data containers
  AliESDfriend *eventESDfriend = 0x0;
  if(!(eventESDfriend = AliEveEventManager::AssertESDfriend())){
    Warning("ana_list_load_tracks", "AliESDfriend not found");
    return;
  }

  AliESDEvent* esd = AliEveEventManager::AssertESD();

  AliEveEventManager::AssertGeometry();

  AliTRDrecoParam *trdRecoParam = AliTRDrecoParam::GetLowFluxParam();
  if (!trdRecoParam)
  {
    printf("Could not load AliTRDrecoParam\n");
    return;
  }
  trdRecoParam->SetPIDNeuralNetwork();
  AliTRDReconstructor *reco = new AliTRDReconstructor();
  if (!reco)
  {
    printf("Could not load AliTRDReconstructor\n");
    return;
  }
  reco->SetRecoParam(trdRecoParam);


  if (!objects)
  {
    objects = new AliEveListAnalyser("Analysis Objects");
    gEve->AddElement(objects, cont);
  }

  // Number of elements already in the list
  Int_t nOld = objects->NumChildren();

  Int_t count = 0;

  for (Int_t n = 0; n < esd->GetNumberOfTracks(); n++)
  {
    AliESDtrack* esdTrack = esd->GetTrack(n);
    AliESDfriendTrack *friendTrack = eventESDfriend->GetTrack(n);

    if (!esdTrack || !friendTrack)
    {
      printf("Problem with track %d\n", n);
      continue;
    }

    TObject *cal = 0x0;
    AliTRDtrackV1 *trackObj = 0x0;
    AliEveTRDTrack *trackEve = 0x0;
    Int_t ical = 0;

    while((cal = friendTrack->GetCalibObject(ical++))){
      if(strcmp(cal->IsA()->GetName(), "AliTRDtrackV1") != 0) continue;
      trackObj = new AliTRDtrackV1(*((AliTRDtrackV1*)cal));
      if (!trackObj)
      {
        printf("Cast to AliTRDtrackV1 failed!\n");
        continue;
      }
      if (trackObj->IsOwner()) trackObj->SetOwner();
      trackObj->SetReconstructor(reco);   
      
      trackEve = new AliEveTRDTrack(trackObj);
      if (!trackEve)
      {
        prWintf("Cast to AliEveTRDTrack failed!\n");
        continue;
      }
      objects->AddElement(trackEve);
      trackEve->SetESDstatus(esdTrack->GetStatus());
      trackEve->SetName(Form("[%4d] %s", count + nOld, trackEve->GetName()));
      ++count;
    }
  }

  objects->SetTitle(Form("Objects %d", objects->NumChildren()));
  objects->StampObjProps();

  gEve->Redraw3D();

  return;
}
*/
 ana_list.C:1
 ana_list.C:2
 ana_list.C:3
 ana_list.C:4
 ana_list.C:5
 ana_list.C:6
 ana_list.C:7
 ana_list.C:8
 ana_list.C:9
 ana_list.C:10
 ana_list.C:11
 ana_list.C:12
 ana_list.C:13
 ana_list.C:14
 ana_list.C:15
 ana_list.C:16
 ana_list.C:17
 ana_list.C:18
 ana_list.C:19
 ana_list.C:20
 ana_list.C:21
 ana_list.C:22
 ana_list.C:23
 ana_list.C:24
 ana_list.C:25
 ana_list.C:26
 ana_list.C:27
 ana_list.C:28
 ana_list.C:29
 ana_list.C:30
 ana_list.C:31
 ana_list.C:32
 ana_list.C:33
 ana_list.C:34
 ana_list.C:35
 ana_list.C:36
 ana_list.C:37
 ana_list.C:38
 ana_list.C:39
 ana_list.C:40
 ana_list.C:41
 ana_list.C:42
 ana_list.C:43
 ana_list.C:44
 ana_list.C:45
 ana_list.C:46
 ana_list.C:47
 ana_list.C:48
 ana_list.C:49
 ana_list.C:50
 ana_list.C:51
 ana_list.C:52
 ana_list.C:53
 ana_list.C:54
 ana_list.C:55
 ana_list.C:56
 ana_list.C:57
 ana_list.C:58
 ana_list.C:59
 ana_list.C:60
 ana_list.C:61
 ana_list.C:62
 ana_list.C:63
 ana_list.C:64
 ana_list.C:65
 ana_list.C:66
 ana_list.C:67
 ana_list.C:68
 ana_list.C:69
 ana_list.C:70
 ana_list.C:71
 ana_list.C:72
 ana_list.C:73
 ana_list.C:74
 ana_list.C:75
 ana_list.C:76
 ana_list.C:77
 ana_list.C:78
 ana_list.C:79
 ana_list.C:80
 ana_list.C:81
 ana_list.C:82
 ana_list.C:83
 ana_list.C:84
 ana_list.C:85
 ana_list.C:86
 ana_list.C:87
 ana_list.C:88
 ana_list.C:89
 ana_list.C:90
 ana_list.C:91
 ana_list.C:92
 ana_list.C:93
 ana_list.C:94
 ana_list.C:95
 ana_list.C:96
 ana_list.C:97
 ana_list.C:98
 ana_list.C:99
 ana_list.C:100
 ana_list.C:101
 ana_list.C:102
 ana_list.C:103
 ana_list.C:104
 ana_list.C:105
 ana_list.C:106
 ana_list.C:107
 ana_list.C:108
 ana_list.C:109
 ana_list.C:110
 ana_list.C:111
 ana_list.C:112
 ana_list.C:113
 ana_list.C:114
 ana_list.C:115
 ana_list.C:116
 ana_list.C:117
 ana_list.C:118
 ana_list.C:119
 ana_list.C:120
 ana_list.C:121
 ana_list.C:122
 ana_list.C:123
 ana_list.C:124
 ana_list.C:125
 ana_list.C:126
 ana_list.C:127
 ana_list.C:128
 ana_list.C:129
 ana_list.C:130
 ana_list.C:131
 ana_list.C:132
 ana_list.C:133
 ana_list.C:134
 ana_list.C:135
 ana_list.C:136
 ana_list.C:137
 ana_list.C:138
 ana_list.C:139
 ana_list.C:140
 ana_list.C:141
 ana_list.C:142
 ana_list.C:143
 ana_list.C:144
 ana_list.C:145
 ana_list.C:146
 ana_list.C:147
 ana_list.C:148
 ana_list.C:149
 ana_list.C:150
 ana_list.C:151
 ana_list.C:152
 ana_list.C:153
 ana_list.C:154
 ana_list.C:155
 ana_list.C:156