]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/its_hits_layer_split.C
New detector AD
[u/mrichter/AliRoot.git] / EVE / alice-macros / its_hits_layer_split.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 <TTree.h>
12 #include <TEvePointSet.h>
13 #include <TEveElement.h>
14 #include <TEveManager.h>
15 #include <TEveTreeTools.h>
16
17 #include <AliRunLoader.h>
18 #include <AliEveEventManager.h>
19 #endif
20
21 void its_hits_layer_split(const char *varexp    = "fX:fY:fZ:GetLayer()",
22                           const char *selection = "")
23 {
24   // Extracts 'major' TPC hits (not the compressed ones).
25   // This gives ~2.5% of all hits.
26
27   printf("THIS SCRIPT DOES NOT WORK.\n"
28          "GetLayer() crashes when trying to load ITS geometry.\n"
29          "Needs to be fixed together with ITS experts.\n");
30   return;
31
32   AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
33   rl->LoadHits("ITS");
34
35   TTree* ht = rl->GetTreeH("ITS", false);
36
37   TEvePointSetArray* l = new TEvePointSetArray("ITS hits - Layer Slices", "");
38   l->SetMarkerColor(2);
39   l->SetMarkerStyle(2); // cross
40   l->SetMarkerSize(.2);
41
42   gEve->AddElement(l);
43   l->InitBins("Layer", 6, 0.5, 6.5);
44
45   TEvePointSelector ps(ht, l, varexp, selection);
46   ps.Select();
47
48   l->CloseBins();
49
50   gEve->Redraw3D();
51 }