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 "AliEveHLTEventManager.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"
37 #include "TGeoManager.h"
39 #include "TEveGeoShapeExtract.h"
40 #include "TEveGeoNode.h"
42 ClassImp(AliHLTEveEmcal)
44 AliHLTEveEmcal::AliHLTEveEmcal() :
45 AliHLTEveCalo(12, "EMCAL"),
49 fGeoUtils = new AliEMCALGeoUtils("EMCAL_COMPLETE","EMCAL");
55 AliHLTEveEmcal::~AliHLTEveEmcal()
57 //Destructor, not implemented
60 void AliHLTEveEmcal::CreateElementList() {
63 //TEveGeoShapeExtract * shape = new TEveGeoShapeExtract();
64 TGeoNode * gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
65 //TEveGeoNode * eveNode = new TEveGeoNode(gEMCALNode);
66 //TEveGeoShapeExtract* juice = eveNode->DumpShapeTree(this, shape, kFALSE);
68 //eveNode->WriteExtract("out.root", kFALSE);
71 //gStyle->SetPalette(1, 0);
72 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
73 pal->SetLimits(0, 15);
75 fBoxSetDigits = new TEveBoxSet[fNModules];
76 fBoxSetClusters = new TEveBoxSet[fNModules];
78 for (Int_t sm=0; sm<fNModules; ++sm) {
81 fBoxSetDigits[sm].SetTitle(Form("Digits Module %d", sm));
82 fBoxSetDigits[sm].SetName(Form("Digits Module %d", sm));
83 fBoxSetDigits[sm].SetOwnIds(kTRUE);
85 fBoxSetDigits[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
86 fBoxSetDigits[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
87 fBoxSetDigits[sm].SetPalette(pal);
89 AddElement(&fBoxSetDigits[sm]);
92 fBoxSetClusters[sm].SetTitle(Form("Clusters Module %d", sm));
93 fBoxSetClusters[sm].SetName(Form("Clusters Module %d", sm));
94 fBoxSetClusters[sm].SetOwnIds(kTRUE);
96 fBoxSetClusters[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
97 // fBoxSetClusters[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
98 fBoxSetClusters[sm].SetPalette(pal);
100 AddElement(&fBoxSetClusters[sm]);
106 void AliHLTEveEmcal::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
107 //See header file for documentation
109 fBoxSetClusters[module].AddBox(pos[0], pos[1], pos[2], 6.1, 200*energy, 6.1);
110 fBoxSetClusters[module].DigitValue(static_cast<Int_t>(energy));
112 cout << "Cluster " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
117 void AliHLTEveEmcal::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
118 //See header file for documentation
119 Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fZ, fX);
120 Double_t posX, posY, posZ;
121 if(fGeoUtils->RelPosCellInSModule(absid, posX, posY, posZ)) {
123 cout << "digits " << posX << " " << posY << " " << posZ << endl;
124 fBoxSetDigits[module].AddBox(15, posY, posZ, energy*100, 6.1, 6.1);
125 fBoxSetDigits[module].DigitValue(static_cast<Int_t>(energy));
127 cout <<"AliHLTEveEmcal::AddClusters: fail"<<endl;