]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/EVE/macros/hlt_tpc_clusters.C
.so cleanup: more gSystem->Load()
[u/mrichter/AliRoot.git] / HLT / TPCLib / EVE / macros / hlt_tpc_clusters.C
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 HLT TPC clusters in AliEVE.
20  * The cluster data must be stored in an HLTOUT collection originating
21  * either from an HLT simulation or real run with a chain adding
22  * HLT TPC cluster structures of type AliHLTTPCDefinitions::fgkClustersDataType
23  * to the HLTOUT.
24  *
25  * The HLTOUT data is read either from the RawReader which AliEve has been
26  * initialized or the HLT.Digits.root if the RawReader is not available.
27  * Please note: As of Nov 2008, AliEve can handle raw data noy through
28  * AliRawReaderFile. It can only open a RawReader on a single file, by default
29  * raw.root. If the file is not existing, the RawReader is not initialized.
30  *
31  * Usage:
32  * <pre>
33  *   alieve $ALICE_ROOT/EVE/alice-macros/event_next.C \
34  *          $ALICE_ROOT/EVE/macros/alieve_init.C \
35  *          $ALICE_ROOT/EVE/alice-macros/geom_simple.C \
36  *          $ALICE_ROOT/HLT/TPCLib/EVE/macros/hlt_tpc_clusters.C
37  * </pre>
38  * Display is changed to next event by executing event_next()
39  * from the root prompt.
40  * <pre>
41  *   event_next(); hlt_tpc_clusters();
42  * </pre>
43  *
44  * @ingroup alihlt_tpc
45  * @author Matthias.Richter@ift.uib.no
46  * @date   2008-11-22
47  */
48 TEvePointSet* hlt_tpc_clusters(const char* digitfile=NULL, TEveElement* cont=0, Float_t maxR=270)
49 {
50   if (!TClass::GetClass("AliEveEventManager")) {
51     Error("hlt_tpc_clusters.C", "EVE library not loaded, please start alieve correctly");
52     return NULL;
53   }
54
55   AliEveEventManager* eveManager=AliEveEventManager::GetMaster();
56   if (!eveManager) {
57     Error("hlt_tpc_clusters.C", "EVE manager not initialized");
58     return NULL;
59   }
60
61   eveManager->AssertGeometry();
62
63   TClass* pCl=NULL;
64   int iLibResult=0;
65   gSystem->Load("libAliHLTUtil");
66   gSystem->Load("libAliHLTRCU");
67   do {
68     pCl=TClass::GetClass("AliHLTTPDefinitions");
69   } while (!pCl && (iLibResult=gSystem->Load("libAliHLTTPC"))==0);
70   do {
71     pCl=TClass::GetClass("AliHLTTPCEVE");
72   } while (!pCl && (iLibResult=gSystem->Load("libAliHLTTPCEVE"))==0);
73
74   AliHLTTPCEVE hlttpceve;
75   TEvePointSet* clusters = NULL;
76
77   AliESDEvent* pESD=eveManager->AssertESD();
78   // extract from RawReader if available and no digit file has been specified
79   if (digitfile==NULL && eveManager->HasRawReader()) {
80     AliRawReader* pRawReader=eveManager->AssertRawReader();
81     if (pRawReader) {
82       Info("hlt_tpc_clusters.C", "extracting HLT TPC clusters from RawReader");
83       clusters=hlttpceve.MakePointSetFromHLTOUT(pRawReader, cont, maxR);
84     }
85   } else {
86     Info("hlt_tpc_clusters.C", Form("extracting HLT TPC clusters from digit file %s", digitfile!=NULL?digitfile:""));
87     clusters=hlttpceve.MakePointSetFromHLTDigits(digitfile, eveManager->GetEventId(), cont, maxR);
88   }
89   if (!clusters) return NULL;
90   
91   if (clusters->Size() == 0) {
92     Info("hlt_tpc_clusters.C", "No TPC clusters");
93   }
94
95   //clusters->ApplyVizTag(clusters->GetName());
96
97   gEve->AddElement(clusters, cont);
98
99   gEve->Redraw3D();
100
101   return clusters;
102 }