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 "AliEveHOMERManager.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) :
43 AliHLTEveITS::~AliHLTEveITS()
51 void AliHLTEveITS::ProcessBlock(AliHLTHOMERBlockDesc * block) {
52 //See header file for documentation
54 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
56 fCanvas = CreateCanvas(Form("%s QA",fName.Data()), Form("%s QA", fName.Data()));
57 fCanvas->Divide(3, 2);
59 AddHistogramsToCanvas( block , fCanvas, fHistoCount);
62 else if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
64 fPointSet = CreatePointSet(fName);
65 fEventManager->GetEveManager()->AddElement(fPointSet);
67 ProcessClusters(block, fPointSet);
72 void AliHLTEveITS::UpdateElements() {
73 //See header file for documentation
74 if(fCanvas) fCanvas->Update();
75 if(fPointSet) fPointSet->ElementChanged();
78 void AliHLTEveITS::ResetElements() {
79 //See header file for documentation
81 if(fPointSet) fPointSet->Reset();
84 TEvePointSet * AliHLTEveITS::CreatePointSet(TString name) {
85 //See header file for documentation
86 TEvePointSet * ps = new TEvePointSet(name.Data());
91 void AliHLTEveITS::SetUpPointSet(TEvePointSet * ps ) {
92 //See header file for documentation
93 ps->SetMainColor(kBlack);
94 ps->SetMarkerStyle((Style_t)kFullDotMedium);
97 void AliHLTEveITS::ProcessClusters(AliHLTHOMERBlockDesc * block, TEvePointSet * cont ) {
98 //See header file for documentation
99 AliHLTITSClusterData *cd = reinterpret_cast<AliHLTITSClusterData*> (block->GetData());
100 UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
102 if ( cd->fSpacePointCnt != 0 ) {
103 for (UInt_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTITSSpacePointData)) {
104 AliHLTITSSpacePointData *sp = reinterpret_cast<AliHLTITSSpacePointData*> (data);
106 Int_t lab[4] = {0,0,0,0};
107 Float_t hit[6] = {0,0,0,0,0,0};
108 Int_t info[3] = {0,0,0};
110 lab[0] = sp->fTracks[0];
111 lab[1] = sp->fTracks[1];
112 lab[2] = sp->fTracks[2];
116 hit[2] = sp->fSigmaY2;
117 hit[3] = sp->fSigmaZ2;
119 hit[5] = sp->fSigmaYZ;
122 info[2] = sp->fLayer;
125 AliITSRecPoint recpoint(lab,hit,info);
126 recpoint.GetGlobalXYZ(xyz);
128 cont->SetNextPoint(xyz[0], xyz[1], xyz[2]);