]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/EVE/AliHLTEveEmcal.cxx
Divided calorimter cluster and digits pointsets into two separate container
[u/mrichter/AliRoot.git] / HLT / EVE / AliHLTEveEmcal.cxx
CommitLineData
33791895 1/**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Primary Authors: Svein Lindal <slindal@fys.uio.no > *
6 * for The ALICE HLT Project. *
7 * *
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 **************************************************************************/
16
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>
21
22#include "AliHLTEveEmcal.h"
23#include "AliHLTHOMERBlockDesc.h"
24#include "TCanvas.h"
25#include "AliHLTEveBase.h"
26#include "TEveBoxSet.h"
27#include "AliPHOSGeometry.h"
28#include "TVector3.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"
35#include "TGeoNode.h"
36#include "AliEMCALGeoUtils.h"
37
38ClassImp(AliHLTEveEmcal)
39
40AliHLTEveEmcal::AliHLTEveEmcal() :
41AliHLTEveCalo(12, "EMCAL"),
42fGeoUtils(NULL)
43{
44 //Constructor
45 fGeoUtils = new AliEMCALGeoUtils("EMCAL_COMPLETE","EMCAL");
46
47}
48
49
50AliHLTEveEmcal::~AliHLTEveEmcal()
51{
52 //Destructor, not implemented
53}
54
55TEveElementList * AliHLTEveEmcal::CreateElementList() {
56
57 TGeoNode * gEMCALNode = fEventManager->GetGeoManager()->GetTopVolume()->FindNode("XEN1_1");
58
59 fElementList = new TEveElementList("EMCAL Cells");
60 fElementList->SetTitle("Tooltip");
61
62 //gStyle->SetPalette(1, 0);
63 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
64 pal->SetLimits(0, 15);
65
9374a7f9 66 fBoxSetDigits = new TEveBoxSet[fNModules];
67 fBoxSetClusters = new TEveBoxSet[fNModules];
33791895 68
69 for (Int_t sm=0; sm<fNModules; ++sm) {
70
9374a7f9 71 //Digits box set
72 fBoxSetDigits[sm].SetTitle(Form("Clusters Module %d", sm));
73 fBoxSetDigits[sm].SetName(Form("Clusters Module %d", sm));
74 fBoxSetDigits[sm].SetOwnIds(kTRUE);
33791895 75
9374a7f9 76 fBoxSetDigits[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
77 fBoxSetDigits[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
78 fBoxSetDigits[sm].SetPalette(pal);
33791895 79
9374a7f9 80 fElementList->AddElement(&fBoxSetDigits[sm]);
81
82 //Clusters
83 fBoxSetClusters[sm].SetTitle(Form("Clusters Module %d", sm));
84 fBoxSetClusters[sm].SetName(Form("Clusters Module %d", sm));
85 fBoxSetClusters[sm].SetOwnIds(kTRUE);
86
87 fBoxSetClusters[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
88 fBoxSetClusters[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
89 fBoxSetClusters[sm].SetPalette(pal);
90
91 fElementList->AddElement(&fBoxSetClusters[sm]);
92
33791895 93
94 }
95
96 return fElementList;
97}
98
99void AliHLTEveEmcal::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
db76648f 100 //See header file for documentation
33791895 101
9374a7f9 102 fBoxSetClusters[module].AddBox(15, pos[1], pos[2], energy*20, 6.1, 6.1);
103 fBoxSetClusters[module].DigitValue(static_cast<Int_t>(energy));
104
33791895 105}
106
107void AliHLTEveEmcal::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
db76648f 108 //See header file for documentation
33791895 109 Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fX, fZ);
110 Double_t posX, posY, posZ;
111 if(fGeoUtils->RelPosCellInSModule(absid, posX, posY, posZ)) {
112
113 cout << posX << " " << posY << " " << posZ << endl;
9374a7f9 114 fBoxSetDigits[module].AddBox(15, posY, posZ, energy*5, 6.1, 6.1);
115 fBoxSetDigits[module].DigitValue(static_cast<Int_t>(energy));
33791895 116 } else {
db76648f 117 cout <<"AliHLTEveEmcal::AddClusters: fail"<<endl;
33791895 118 }
119}