In muon-related macros in EVE:
[u/mrichter/AliRoot.git] / EVE / alice-macros / ana_list.C
CommitLineData
938315b8 1#ifndef __CINT__
2#include <TGLViewer.h>
3#include <TEveManager.h>
4#include <EveBase/AliEveEventManager.h>
5#include "TRD/AliTRDarrayADC.h"
6#include <EveDet/AliEveListAnalyser.h>
7
8#include "AliESDEvent.h"
9#include "AliESDfriend.h"
10#include "TRD/AliTRDReconstructor.h"
11#include "TRD/AliTRDtrackV1.h"
12#endif
13
14void ana_list(TEveElement *cont = 0)
15{
16 // Link data containers
17 AliESDfriend *eventESDfriend = 0x0;
18 if(!(eventESDfriend = AliEveEventManager::AssertESDfriend())){
19 Warning("trd_loadObjectList", "AliESDfriend not found");
20 return;
21 }
22
23 AliESDEvent* esd = AliEveEventManager::AssertESD();
24
25 AliEveEventManager::AssertGeometry();
26
27 AliTRDrecoParam *trdRecoParam = AliTRDrecoParam::GetLowFluxParam();
28 if (!trdRecoParam)
29 {
30 printf("Could not load AliTRDrecoParam\n");
31 return;
32 }
33 trdRecoParam->SetPIDNeuralNetwork();
34 AliTRDReconstructor *reco = new AliTRDReconstructor();
35 if (!reco)
36 {
37 printf("Could not load AliTRDReconstructor\n");
38 return;
39 }
40 reco->SetRecoParam(trdRecoParam);
41
42
43 AliEveListAnalyser *objects = new AliEveListAnalyser("TRD Analysis Object");
44
45 for (Int_t n = 0; n < esd->GetNumberOfTracks(); n++)
46 {
47 AliESDtrack* esdTrack = esd->GetTrack(n);
48 AliESDfriendTrack *friendTrack = eventESDfriend->GetTrack(n);
49
50 if (!esdTrack || !friendTrack)
51 {
52 printf("Problem with track %d\n", n);
53 continue;
54 }
55
56 TObject *cal = 0x0;
57 Int_t ical = 0;
58
59 while((cal = friendTrack->GetCalibObject(ical++))){
60 if(strcmp(cal->IsA()->GetName(), "AliTRDtrackV1") != 0) continue;
61 AliTRDtrackV1 *trackObj = dynamic_cast<AliTRDtrackV1 *>(cal);
62 if (!trackObj)
63 {
64 printf("Cast to AliTRDtrackV1 failed!\n");
65 continue;
66 }
67 trackObj->SetReconstructor(reco);
68 AliEveTRDTrack *trackEve = new AliEveTRDTrack(trackObj);
69 if (!trackEve)
70 {
71 printf("Cast to AliEveTRDTrack failed!\n");
72 continue;
73 }
74 objects->AddElement(trackEve);
75 trackEve->SetESDstatus(esdTrack->GetStatus());
76 trackEve->SetName(Form("[%4d] %s", n, trackEve->GetName()));
77 }
78 }
79
80 delete reco;
81
82 objects->SetTitle(Form("Objects %d", objects->NumChildren()));
83 objects->StampObjProps();
84
85 gEve->AddElement(objects, cont);
86
87
88 gEve->Redraw3D();
89
90 // TGLViewer *v = gEve->GetDefaultGLViewer();
91 // v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
92 // ((TGLOrthoCamera&)v->CurrentCamera()).SetEnableRotate(kTRUE);
93 // v->UpdateScene();
94
95 return;
96}