coverity fix for 18249
[u/mrichter/AliRoot.git] / EVE / alice-macros / hmpid_digits.C
CommitLineData
391fa967 1void hmpid_digits()
2{
3 const Char_t *name[]={ "HMPID0", "HMPID1", "HMPID2", "HMPID3",
4 "HMPID4", "HMPID5", "HMPID6" };
5
6 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
7 rl->LoadDigits("HMPID");
8
9 TTree *dTree = rl->GetTreeD("HMPID", kFALSE);
10 if (!dTree) return 0;
11
12 TEveElementList* list = new TEveElementList("HMPID Digits");
13 gEve->AddElement(list);
14
15 gStyle->SetPalette(1, 0);
16
17 TEveRGBAPalette *pal = new TEveRGBAPalette(0, 3000);
18 pal->SetMax(1000);
19 TEveFrameBox *box = new TEveFrameBox();
20 box->SetAAQuadXY(0, 0, 0, 144, 121);
21 box->SetFrameColor(kGray);
22
23 TClonesArray* digits = new TClonesArray("AliHMPIDDigit");
24 for (Int_t iCh = 0; iCh < 7; ++iCh)
25 {
26 TBranch *br = dTree->GetBranch(name[iCh]);
27 br->SetAddress(&digits);
28 br->GetEntry(0);
29
30 TEveQuadSet* q = new TEveQuadSet(Form("Chamber %d", iCh));
31 q->SetOwnIds(kTRUE);
32 q->SetPalette(pal);
33 q->SetFrame(box);
34 q->SetAntiFlick(kTRUE);
35 q->SetPickable(kTRUE);
36
37 q->Reset(TEveQuadSet::kQT_RectangleXYFixedDimZ, kFALSE, 64);
38 q->SetDefCoord(0);
39 q->SetDefHeight(0.84f);
40 q->SetDefWidth(0.8f);
41
42 for(Int_t iDig = 0; iDig < digits->GetEntriesFast(); ++iDig)
43 {
44 AliHMPIDDigit *pDig = (AliHMPIDDigit*) digits->At(iDig);
45
46 q->AddQuad(pDig->PadChX()*0.8f, pDig->PadChY()*0.84f);
47 q->QuadValue(TMath::Nint(pDig->Q()));
48 q->QuadId(new AliHMPIDDigit(*pDig));
49 }
50
51 q->RefitPlex();
52
53 TGeoHMatrix mat;
54 AliHMPIDv3::IdealPosition(iCh, &mat);
55 q->RefMainTrans().SetFrom(mat);
56 q->RefMainTrans().Move3LF(-0.5f*144, -0.5f*121, 0);
57
58 list->AddElement(q);
59 }
60
61 delete digits;
62 rl->UnloadDigits("HMPID");
63
64 gEve->Redraw3D();
65}