]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/t0_hits.C
doxy: code cleanup: comments and clarifications
[u/mrichter/AliRoot.git] / EVE / alice-macros / t0_hits.C
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TClonesArray.h>
12 #include <TTree.h>
13 #include <TEvePointSet.h>
14 #include <TEveElement.h>
15 #include <TEveManager.h>
16 #include <TEveTreeTools.h>
17
18 #include <AliRunLoader.h>
19 #include <AliEveEventManager.h>
20 #endif
21
22 TEvePointSet*
23 t0_hits(const char *varexp    = "T0.fX:T0.fY:T0.fZ",
24         const char *selection = "")
25 {
26   // Extracts  T0 hits.
27
28
29   AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
30   rl->LoadHits("T0");
31
32   TTree* ht = rl->GetTreeH("T0", false);
33
34   Int_t nTracks = ht->GetEntries();
35   // printf("Found %d tracks. \n",nTracks);
36   for (Int_t it = 0; it < nTracks; it++) {
37
38     TClonesArray *hits = 0;
39     ht->SetBranchAddress("T0",&hits);
40
41     ht->GetEvent(it);
42     // Int_t nHits = hits->GetEntriesFast();
43     // printf("Found %d hits in track %d.\n", nHits, it);
44
45   }
46   TEvePointSet* points = new TEvePointSet(Form("T0 Hits '%s'", selection));
47   points->SetSourceCS(TEvePointSelectorConsumer::kTVT_XYZ);
48
49   TEvePointSelector ps(ht, points, varexp, selection);
50   ps.Select();
51
52   points->SetTitle(Form("N=%d", points->Size()));
53   points->SetMarkerSize(.5);
54   points->SetMarkerColor(3);
55
56   points->SetName(Form("T0 Hits"));
57   const TString viz_tag("SIM Hits T0");
58   points->ApplyVizTag(viz_tag, "Hits");
59
60   gEve->AddElement(points);
61   gEve->Redraw3D();
62
63   return points;
64 }