1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Authors: Svein Lindal <slindal@fys.uio.no > *
6 * for The ALICE HLT Project. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 /// @file AliHLTEvePhos.cxx
18 /// @author Svein Lindal <slindal@fys.uio.no>
19 /// @brief base class for the ITS elements in the HLT EVE display
21 #include "AliHLTEveITS.h"
22 #include "AliHLTHOMERBlockDesc.h"
24 #include "AliEveHLTEventManager.h"
25 #include "TEveManager.h"
28 #include "TEvePointSet.h"
29 #include "ITS/AliHLTITSClusterDataFormat.h"
30 #include "AliITSRecPoint.h"
33 ClassImp(AliHLTEveITS)
35 AliHLTEveITS::AliHLTEveITS(TString name) :
36 AliHLTEveBase(name.Data()),
45 AliHLTEveITS::~AliHLTEveITS()
53 void AliHLTEveITS::ProcessBlock(AliHLTHOMERBlockDesc * block) {
54 //See header file for documentation
56 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
58 fCanvas = CreateCanvas(Form("%s QA",fName.Data()), Form("%s QA", fName.Data()));
59 fCanvas->Divide(3, 3);
62 AddHistogramsToCanvas( block , fCanvas, fHistoCount);
65 else if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
67 fPointSet = CreatePointSet(fName);
68 AddElement(fPointSet);
70 ProcessClusters(block, fPointSet);
75 void AliHLTEveITS::UpdateElements() {
76 //See header file for documentation
77 if(fCanvas) fCanvas->Update();
78 if(fPointSet) fPointSet->ElementChanged();
81 void AliHLTEveITS::ResetElements() {
82 //See header file for documentation
84 if(fPointSet) fPointSet->Reset();
87 TEvePointSet * AliHLTEveITS::CreatePointSet(TString name) {
88 //See header file for documentation
89 TEvePointSet * ps = new TEvePointSet(name.Data());
94 void AliHLTEveITS::SetUpPointSet(TEvePointSet * ps ) {
95 //See header file for documentation
96 ps->SetMainColor(kBlack);
97 ps->SetMarkerStyle((Style_t)kFullDotMedium);
100 void AliHLTEveITS::ProcessClusters(AliHLTHOMERBlockDesc * block, TEvePointSet * cont ) {
101 //See header file for documentation
102 AliHLTITSClusterData *cd = reinterpret_cast<AliHLTITSClusterData*> (block->GetData());
103 UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
105 if ( cd->fSpacePointCnt != 0 ) {
106 for (UInt_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTITSSpacePointData)) {
107 AliHLTITSSpacePointData *sp = reinterpret_cast<AliHLTITSSpacePointData*> (data);
109 Int_t lab[4] = {0,0,0,0};
110 Float_t hit[6] = {0,0,0,0,0,0};
111 Int_t info[3] = {0,0,0};
113 lab[0] = sp->fTracks[0];
114 lab[1] = sp->fTracks[1];
115 lab[2] = sp->fTracks[2];
119 hit[2] = sp->fSigmaY2;
120 hit[3] = sp->fSigmaZ2;
122 hit[5] = sp->fSigmaYZ;
125 info[2] = sp->fLayer;
128 AliITSRecPoint recpoint(lab,hit,info);
129 recpoint.GetGlobalXYZ(xyz);
131 cont->SetNextPoint(xyz[0], xyz[1], xyz[2]);