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 PHOS class for the HLT EVE display
21 #include "AliHLTEvePhos.h"
22 #include "AliHLTHOMERBlockDesc.h"
24 #include "TEveBoxSet.h"
25 #include "AliPHOSGeoUtils.h"
26 #include "AliPHOSGeometry.h"
28 #include "AliEveHOMERManager.h"
29 #include "TEveManager.h"
30 #include "AliHLTCaloDigitDataStruct.h"
31 #include "AliHLTCaloClusterDataStruct.h"
32 #include "AliHLTCaloClusterReader.h"
33 #include "TEveTrans.h"
35 ClassImp(AliHLTEvePhos)
37 AliHLTEvePhos::AliHLTEvePhos() :
38 AliHLTEveCalo(5, "PHOS"),
42 fGeoUtils = new AliPHOSGeoUtils("PHOS", "noCPV");
45 AliHLTEvePhos::~AliHLTEvePhos()
54 TEveElementList * AliHLTEvePhos::CreateElementList() {
55 //See header file for documentation
57 TEveElementList * elementList = new TEveElementList("PHOS ");
58 fBoxSetClusters = new TEveBoxSet[fNModules];
59 fBoxSetDigits = new TEveBoxSet[fNModules];
61 AliPHOSGeometry * geo = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
67 for(int im = 0; im < fNModules; im++) {
69 TEveRGBAPalette* pal = new TEveRGBAPalette(0,512);
70 pal->SetLimits(-1, 6);
72 //Create clusters box set
73 fBoxSetClusters[im].SetTitle(Form("Clusters Module %d", im));
74 fBoxSetClusters[im].SetName(Form("Clusters Module %d", im));
75 fBoxSetClusters[im].SetPalette(pal);
76 fBoxSetClusters[im].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
77 fBoxSetClusters[im].SetOwnIds(kTRUE);
80 geo->GetModuleCenter(center, "CPV", im+1);
81 angle = geo->GetPHOSAngle(im+1)*TMath::Pi()/180;
83 fBoxSetClusters[im].RefitPlex();
84 TEveTrans& t = fBoxSetClusters[im].RefMainTrans();
85 t.SetupRotation(1, 2, angle );
86 t.SetPos(center.X(), center.Y(), center.Z());
88 elementList->AddElement(&fBoxSetClusters[im]);
91 //Create digits box set
92 fBoxSetDigits[im].SetTitle(Form("Digits Module %d", im));
93 fBoxSetDigits[im].SetName(Form("Digits Module %d", im));
94 fBoxSetDigits[im].SetPalette(pal);
95 fBoxSetDigits[im].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
96 fBoxSetDigits[im].SetOwnIds(kTRUE);
99 geo->GetModuleCenter(center, "CPV", im+1);
100 angle = geo->GetPHOSAngle(im+1)*TMath::Pi()/180;
102 fBoxSetDigits[im].RefitPlex();
103 TEveTrans& t2 = fBoxSetDigits[im].RefMainTrans();
104 t2.SetupRotation(1, 2, angle );
105 t2.SetPos(center.X(), center.Y(), center.Z());
107 elementList->AddElement(&fBoxSetDigits[im]);
115 void AliHLTEvePhos::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
116 //See header file for documentation
117 Float_t x = (fX - 32)* 2.2;
118 Float_t z = (fZ - 28) * 2.2;
119 fBoxSetDigits[4-module].AddBox(x, 0, z, 2.2, energy*20, 2.2);
120 fBoxSetDigits[4-module].DigitValue(static_cast<Int_t>(energy));
124 void AliHLTEvePhos::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
126 TVector3 localVector;
127 TVector3 globalVector(pos);
129 fGeoUtils->Global2Local(localVector, globalVector, 5-module);
131 //See header file for documentation
132 fBoxSetClusters[4-module].AddBox(localVector.X(), -70, localVector.Z(), 2.2, -energy*20, 2.2);
133 fBoxSetClusters[4-module].DigitValue(static_cast<Int_t>(energy));