]>
Commit | Line | Data |
---|---|---|
915dabe1 | 1 | class TTree; |
2 | ||
3 | namespace Alieve { | |
4 | class TPCData; | |
5 | } | |
6 | ||
7 | Alieve::TPCData* x = 0; | |
8 | TTree* tree = 0; | |
9 | ||
10 | void tpc_digi_test() | |
11 | { | |
12 | gROOT->Macro("alieve_loadlibs.C"); | |
13 | gSystem->Load("libAlieve"); | |
14 | ||
15 | TFile* f = new TFile("coctail_1k/TPC.Digits.root"); | |
16 | tree = (TTree*) gDirectory->Get("Event0/TreeD"); | |
17 | ||
18 | x = new Alieve::TPCData; | |
19 | // x->SetSectorBlockSize(8192); | |
20 | // x->SetLoadThreshold(5); | |
21 | x->CreateAllSectors(); | |
22 | x->LoadDigits(tree, kFALSE); | |
23 | gStyle->SetPalette(1, 0); | |
24 | ||
25 | Alieve::TPCSector2D* s = new Alieve::TPCSector2D(); | |
26 | s->SetDataSource(x); | |
27 | s->SetMainColor(36); | |
28 | gReve->AddRenderElement(s); | |
29 | gReve->DrawRenderElement(s); | |
30 | } | |
31 | ||
32 | ||
33 | void tpc_digi_pad_dump(Int_t s, Int_t r, Int_t p) | |
34 | { | |
35 | if(r >= Alieve::TPCSectorData::GetInnSeg().fNRows) { | |
36 | r -= Alieve::TPCSectorData::GetInnSeg().fNRows; | |
37 | s += 36; | |
38 | } | |
39 | ||
40 | AliSimDigits *digit = 0; | |
41 | tree->GetBranch("Segment")->SetAddress(&digit); | |
42 | ||
43 | Int_t sbr = (Int_t) tree->GetEntries(); | |
44 | for (Int_t ent=0; ent<sbr; ent++) { | |
45 | tree->GetEntry(ent); | |
46 | Int_t sector, row; | |
47 | Alieve::TPCSectorData::GetParam().AdjustSectorRow(digit->GetID(), sector, row); | |
48 | ||
49 | if(sector != s || row != r) | |
50 | continue; | |
51 | ||
52 | printf("Entry = %d, ID = %d, Sec = %d, Row = %d\n", | |
53 | ent, digit->GetID(), sector, row); | |
54 | ||
55 | Int_t pad; | |
56 | Short_t time, signal; | |
57 | digit->First(); | |
58 | do { | |
59 | pad = digit->CurrentColumn(); | |
60 | time = digit->CurrentRow(); | |
61 | signal = digit->CurrentDigit(); | |
62 | ||
63 | if(p == pad) | |
64 | printf("%d %d\n", time, signal); | |
65 | ||
66 | } while (digit->Next()); | |
67 | } | |
68 | } |