Put all classes in Alieve/ sub-module out of the Alieve namespace and
[u/mrichter/AliRoot.git] / EVE / test-macros / tpc_digi_test.C
CommitLineData
d810d0de 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 **************************************************************************/
915dabe1 9class TTree;
10
11namespace Alieve {
d810d0de 12class AliEveTPCData;
915dabe1 13}
14
d810d0de 15AliEveTPCData* x = 0;
915dabe1 16TTree* tree = 0;
17
18void tpc_digi_test()
19{
20 gROOT->Macro("alieve_loadlibs.C");
21 gSystem->Load("libAlieve");
22
23 TFile* f = new TFile("coctail_1k/TPC.Digits.root");
24 tree = (TTree*) gDirectory->Get("Event0/TreeD");
25
d810d0de 26 x = new AliEveTPCData;
915dabe1 27 // x->SetSectorBlockSize(8192);
28 // x->SetLoadThreshold(5);
29 x->CreateAllSectors();
30 x->LoadDigits(tree, kFALSE);
31 gStyle->SetPalette(1, 0);
32
d810d0de 33 AliEveTPCSector2D* s = new AliEveTPCSector2D();
915dabe1 34 s->SetDataSource(x);
35 s->SetMainColor(36);
84aff7a4 36 gEve->AddElement(s);
37 gEve->DrawElement(s);
915dabe1 38}
39
40
41void tpc_digi_pad_dump(Int_t s, Int_t r, Int_t p)
42{
d810d0de 43 if(r >= AliEveTPCSectorData::GetInnSeg().fNRows) {
44 r -= AliEveTPCSectorData::GetInnSeg().fNRows;
915dabe1 45 s += 36;
46 }
47
48 AliSimDigits *digit = 0;
49 tree->GetBranch("Segment")->SetAddress(&digit);
50
51 Int_t sbr = (Int_t) tree->GetEntries();
52 for (Int_t ent=0; ent<sbr; ent++) {
53 tree->GetEntry(ent);
54 Int_t sector, row;
d810d0de 55 AliEveTPCSectorData::GetParam().AdjustSectorRow(digit->GetID(), sector, row);
915dabe1 56
57 if(sector != s || row != r)
58 continue;
59
60 printf("Entry = %d, ID = %d, Sec = %d, Row = %d\n",
61 ent, digit->GetID(), sector, row);
62
63 Int_t pad;
64 Short_t time, signal;
65 digit->First();
66 do {
67 pad = digit->CurrentColumn();
68 time = digit->CurrentRow();
69 signal = digit->CurrentDigit();
70
71 if(p == pad)
72 printf("%d %d\n", time, signal);
73
74 } while (digit->Next());
75 }
76}