]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/esd_hlt_tracks.C
geometry updated to include in particular the changes introduced in TOF with the...
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_hlt_tracks.C
CommitLineData
b658d7e4 1// $Id$
2//**************************************************************************
3//* This file is property of and copyright by the ALICE HLT Project *
4//* ALICE Experiment at CERN, All rights reserved. *
5//* *
6//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7//* for The ALICE HLT Project. *
8//* *
9//* Permission to use, copy, modify and distribute this software and its *
10//* documentation strictly for non-commercial purposes is hereby granted *
11//* without fee, provided that the above copyright notice appears in all *
12//* copies and that both the copyright notice and this permission notice *
13//* appear in the supporting documentation. The authors make no claims *
14//* about the suitability of this software for any purpose. It is *
15//* provided "as is" without express or implied warranty. *
16//**************************************************************************
17
18/**
19 * Display ESD Tracks from the HLTesdTree in AliEVE.
20 *
21 * Usage:
22 * <pre>
23 * alieve $ALICE_ROOT/EVE/alice-macros/event_next.C \
24 * $ALICE_ROOT/EVE/macros/alieve_init.C \
25 * $ALICE_ROOT/EVE/alice-macros/geom_simple.C \
58a0d147 26 * $ALICE_ROOT/EVE/alice-macros/esd_hlt_tracks.C
b658d7e4 27 * </pre>
28 * Display is changed to next event by executing event_next()
29 * from the root prompt.
30 * <pre>
31 * event_next(); esd_tracks(); esd_hlt_tracks();
32 * </pre>
33 *
34 * @ingroup alihlt_tpc
35 * @author Matthias.Richter@ift.uib.no
36 * @date 2008-11-22
37 */
38TEveTrackList* esd_hlt_tracks()
39{
58a0d147 40 TString macroPath=getenv("ALICE_ROOT");
41 macroPath+="/EVE/alice-macros/esd_tracks.C";
42 if (!gROOT->GetInterpreter()->IsLoaded(macroPath)) {
43 if (gSystem->AccessPathName(macroPath)) {
44 Error("hlt_tpc_clusters.C", "can not load %s, please load the esd_tracks.C macro before", macroPath.Data());
45 return NULL;
46 } else {
47 gROOT->GetInterpreter()->LoadMacro(macroPath);
48 }
49 }
50
b658d7e4 51 if (!TClass::GetClass("AliEveEventManager")) {
52 Error("hlt_tpc_clusters.C", "EVE library not loaded, please start alieve correctly");
53 return NULL;
54 }
55
56 AliEveEventManager* eveManager=AliEveEventManager::GetMaster();
57 if (!eveManager) {
58 Error("esd_hlt_tracks.C", "EVE manager not initialized");
59 return NULL;
60 }
61
62 int eventId=eveManager->GetEventId();
63 TFile* esdFile=eveManager->GetESDFile();
64 if (!esdFile) {
65 Warning("esd_hlt_tracks.C", "can not get esd file from EVE manager");
66 return NULL;
67 }
68
69 TObject* pObj=NULL;
70 TTree* pHLTTree=NULL;
71 esdFile->GetObject("HLTesdTree", pObj);
72 if (!pObj || (pHLTTree=dynamic_cast<TTree*>(pObj))==NULL) {
73 Info("esd_hlt_tracks.C", "no HLT ESD tree in ESD file");
74 return NULL;
75 }
76 if (pHLTTree->GetEntries()<=eventId) {
77 Warning("esd_hlt_tracks.C", "skiping event %d: out of range %d", eventId, pHLTTree->GetEntries());
78 return NULL;
79 }
80
81 AliESDEvent* esd=new AliESDEvent;
82 esd->ReadFromTree(pHLTTree);
83 pHLTTree->GetEntry(eventId);
84
85 TEveTrackList* cont = new TEveTrackList("HLT ESD Tracks");
58a0d147 86 cont->SetMainColor(kCyan+3);
d0545a3c 87 esd_track_propagator_setup(cont->GetPropagator(),
88 0.1*esd->GetMagneticField(), 520);
b658d7e4 89
90 eveManager->AddElement(cont);
91
92 Int_t count = 0;
93 for (Int_t n = 0; n < esd->GetNumberOfTracks(); ++n)
94 {
95 ++count;
96 TEveTrack* track = esd_make_track(esd->GetTrack(n), cont);
97
98 cont->AddElement(track);
99 }
100 cont->SetTitle(Form("N=%d", count));
101 cont->MakeTracks();
102
103 gEve->Redraw3D();
104
105 return cont;
106}