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 EMCAL class for the HLT EVE display
20 // Author: Svein Lindal <slindal@fys.uio.no>
22 #include "AliHLTEveEmcal.h"
23 #include "AliHLTHOMERBlockDesc.h"
25 #include "AliHLTEveBase.h"
26 #include "TEveBoxSet.h"
27 #include "AliPHOSGeometry.h"
29 #include "AliEveHOMERManager.h"
30 #include "TEveManager.h"
31 #include "AliHLTCaloDigitDataStruct.h"
32 #include "AliHLTCaloClusterDataStruct.h"
33 #include "AliHLTCaloClusterReader.h"
34 #include "TEveTrans.h"
36 #include "AliEMCALGeoUtils.h"
38 ClassImp(AliHLTEveEmcal)
40 AliHLTEveEmcal::AliHLTEveEmcal() :
41 AliHLTEveCalo(12, "EMCAL"),
45 fGeoUtils = new AliEMCALGeoUtils("EMCAL_COMPLETE","EMCAL");
50 AliHLTEveEmcal::~AliHLTEveEmcal()
52 //Destructor, not implemented
55 TEveElementList * AliHLTEveEmcal::CreateElementList() {
57 TGeoNode * gEMCALNode = fEventManager->GetGeoManager()->GetTopVolume()->FindNode("XEN1_1");
59 fElementList = new TEveElementList("EMCAL Cells");
60 fElementList->SetTitle("Tooltip");
62 //gStyle->SetPalette(1, 0);
63 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
64 pal->SetLimits(0, 15);
66 fBoxSet = new TEveBoxSet[fNModules];
68 for (Int_t sm=0; sm<fNModules; ++sm) {
70 fBoxSet[sm].SetTitle(Form("Clusters Module %d", sm));
71 fBoxSet[sm].SetName(Form("Clusters Module %d", sm));
72 fBoxSet[sm].SetOwnIds(kTRUE);
74 fBoxSet[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
75 fBoxSet[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
76 fBoxSet[sm].SetPalette(pal);
78 fElementList->AddElement(&fBoxSet[sm]);
85 void AliHLTEveEmcal::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
86 //See header file for documentation
88 fBoxSet[module].AddBox(15, pos[1], pos[2], energy*20, 6.1, 6.1);
89 fBoxSet[module].DigitValue(static_cast<Int_t>(energy));
92 void AliHLTEveEmcal::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
93 //See header file for documentation
94 Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fX, fZ);
95 Double_t posX, posY, posZ;
96 if(fGeoUtils->RelPosCellInSModule(absid, posX, posY, posZ)) {
98 cout << posX << " " << posY << " " << posZ << endl;
99 fBoxSet[module].AddBox(15, posY, posZ, energy*5, 6.1, 6.1);
100 fBoxSet[module].DigitValue(static_cast<Int_t>(energy));
102 cout <<"AliHLTEveEmcal::AddClusters: fail"<<endl;