Added support to display the HLT ESD Tree. See the comment in visscan_local.C for How
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_tracks.C
CommitLineData
ba978640 1#if !defined(__CINT__) || defined(__MAKECINT__)
9fb2a3ed 2#include <TGLViewer.h>
3#include <TEveManager.h>
9fb2a3ed 4
6c49a8e1 5#include <AliESDEvent.h>
6#include <AliESDfriend.h>
7#include <AliTRDarrayADC.h>
8#include <AliTRDReconstructor.h>
9#include <AliTRDtrackV1.h>
10#include <AliEveEventManager.h>
11#include <AliEveTRDTrackList.h>
9fb2a3ed 12#endif
13
db16b708 14void trd_tracks(TEveElement *cont = 0)
15{
db16b708 16 // Link data containers
607a7020 17 AliESDEvent* esd(AliEveEventManager::AssertESD());
18 AliESDfriend *esdFriend(AliEveEventManager::AssertESDfriend());
19 if(!esd || !esdFriend){
20 Warning("trd_tracks", "Full ESD data missing.");
9fb2a3ed 21 return;
db16b708 22 }
23
527ceac3 24/* AliEveEventManager::AssertGeometry();
25 AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
26*/
93ad0d1c 27 AliTRDrecoParam *trdRecoParam = AliTRDrecoParam::GetLowFluxParam();
28 trdRecoParam->SetPIDNeuralNetwork();
db16b708 29 AliTRDReconstructor *reco = new AliTRDReconstructor();
93ad0d1c 30 reco->SetRecoParam(trdRecoParam);
db16b708 31
32 AliEveTRDTrackList *tracks = new AliEveTRDTrackList("TRD Tracks");
33 for (Int_t n=0; n<esd->GetNumberOfTracks(); n++){
607a7020 34 AliESDtrack* esdTrack(esd->GetTrack(n));
35 if(!esdTrack) continue;
ba978640 36 AliESDfriendTrack *friendTrack = new AliESDfriendTrack(*(esdTrack->GetFriendTrack()));
607a7020 37 if(!friendTrack) continue;
527ceac3 38 //Info("trd_tracks", Form("Track[%3d] esd[%p] friend[%p]", n, (void*)esdTrack, (void*)friendTrack));
68ca2fe7 39
607a7020 40 TObject *cal(NULL);
41 Int_t ical(0);
b631c5f2 42 while((cal = friendTrack->GetCalibObject(ical++))){
607a7020 43 //Info("trd_tracks", Form(" Obj[%d] %s", ical-1, cal->IsA()->GetName()));
db16b708 44 if(strcmp(cal->IsA()->GetName(), "AliTRDtrackV1") != 0) continue;
45 AliTRDtrackV1 *trackObj = dynamic_cast<AliTRDtrackV1 *>(cal);
46 trackObj->SetReconstructor(reco);
664d520c 47 AliEveTRDTrack *trackEve = new AliEveTRDTrack(new AliTRDtrackV1(*trackObj));
db16b708 48 tracks->AddElement(trackEve);
49 trackEve->SetESDstatus(esdTrack->GetStatus());
57d55fae 50 trackEve->SetName(Form("[%4d] %s", n, trackEve->GetName()));
db16b708 51 }
52 }
9fb2a3ed 53
54 delete reco;
68ca2fe7 55
db16b708 56 tracks->SetTitle(Form("Tracks %d", tracks->NumChildren()));
57 tracks->StampObjProps();
58 gEve->AddElement(tracks, cont);
68ca2fe7 59
db16b708 60 gEve->Redraw3D();
61
44c97b40 62 // TGLViewer *v = gEve->GetDefaultGLViewer();
63 // v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
64 // ((TGLOrthoCamera&)v->CurrentCamera()).SetEnableRotate(kTRUE);
65 // v->UpdateScene();
68ca2fe7 66
db16b708 67 return;
68}