]>
Commit | Line | Data |
---|---|---|
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" | |
33791895 | 27 | #include "TVector3.h" |
fd2adb88 | 28 | #include "AliEveHLTEventManager.h" |
33791895 | 29 | #include "TEveManager.h" |
30 | #include "AliHLTCaloDigitDataStruct.h" | |
31 | #include "AliHLTCaloClusterDataStruct.h" | |
32 | #include "AliHLTCaloClusterReader.h" | |
33 | #include "TEveTrans.h" | |
34 | #include "TGeoNode.h" | |
9ee6e399 | 35 | //#include "AliEMCALGeoUtils.h" |
36 | #include "AliEMCALGeometry.h" | |
fd2adb88 | 37 | #include "TGeoManager.h" |
38 | ||
39 | #include "TEveGeoShapeExtract.h" | |
40 | #include "TEveGeoNode.h" | |
33791895 | 41 | |
42 | ClassImp(AliHLTEveEmcal) | |
43 | ||
44 | AliHLTEveEmcal::AliHLTEveEmcal() : | |
45 | AliHLTEveCalo(12, "EMCAL"), | |
46 | fGeoUtils(NULL) | |
47 | { | |
48 | //Constructor | |
9ee6e399 | 49 | // fGeoUtils = new AliEMCALGeoUtils("EMCAL_COMPLETE","EMCAL"); |
50 | fGeoUtils = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1"); | |
51 | //fGeoUtils = new AliEMCALGeometry("EMCAL_COMPLETEV1","EMCAL"); | |
fd2adb88 | 52 | CreateElementList(); |
33791895 | 53 | |
54 | } | |
55 | ||
56 | ||
57 | AliHLTEveEmcal::~AliHLTEveEmcal() | |
58 | { | |
59 | //Destructor, not implemented | |
60 | } | |
61 | ||
fd2adb88 | 62 | void AliHLTEveEmcal::CreateElementList() { |
33791895 | 63 | |
fd2adb88 | 64 | TGeoNode * gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1"); |
33791895 | 65 | |
66 | //gStyle->SetPalette(1, 0); | |
67 | TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512); | |
68 | pal->SetLimits(0, 15); | |
69 | ||
9374a7f9 | 70 | fBoxSetDigits = new TEveBoxSet[fNModules]; |
71 | fBoxSetClusters = new TEveBoxSet[fNModules]; | |
33791895 | 72 | |
73 | for (Int_t sm=0; sm<fNModules; ++sm) { | |
74 | ||
9374a7f9 | 75 | //Digits box set |
bc1a13f1 | 76 | fBoxSetDigits[sm].SetTitle(Form("Digits Module %d", sm)); |
77 | fBoxSetDigits[sm].SetName(Form("Digits Module %d", sm)); | |
9374a7f9 | 78 | fBoxSetDigits[sm].SetOwnIds(kTRUE); |
33791895 | 79 | |
9374a7f9 | 80 | fBoxSetDigits[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); |
81 | fBoxSetDigits[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix()); | |
82 | fBoxSetDigits[sm].SetPalette(pal); | |
33791895 | 83 | |
fd2adb88 | 84 | AddElement(&fBoxSetDigits[sm]); |
9374a7f9 | 85 | |
86 | //Clusters | |
87 | fBoxSetClusters[sm].SetTitle(Form("Clusters Module %d", sm)); | |
88 | fBoxSetClusters[sm].SetName(Form("Clusters Module %d", sm)); | |
89 | fBoxSetClusters[sm].SetOwnIds(kTRUE); | |
90 | ||
91 | fBoxSetClusters[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64); | |
4f8a42b8 | 92 | fBoxSetClusters[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix()); |
9374a7f9 | 93 | fBoxSetClusters[sm].SetPalette(pal); |
94 | ||
fd2adb88 | 95 | AddElement(&fBoxSetClusters[sm]); |
9374a7f9 | 96 | |
33791895 | 97 | |
98 | } | |
33791895 | 99 | } |
100 | ||
101 | void AliHLTEveEmcal::AddClusters(Float_t * pos, Int_t module, Float_t energy) { | |
db76648f | 102 | //See header file for documentation |
33791895 | 103 | |
4f8a42b8 | 104 | TVector3 vec(pos); |
105 | Int_t absId = -1; | |
106 | fGeoUtils->GetAbsCellIdFromEtaPhi(vec.Eta(), vec.Phi(), absId); | |
107 | ||
108 | TVector3 localVec; | |
109 | fGeoUtils->RelPosCellInSModule(absId, localVec); | |
110 | fBoxSetClusters[module].AddBox(15, localVec[0], localVec[2], energy, 6.0, 6.0); | |
9374a7f9 | 111 | fBoxSetClusters[module].DigitValue(static_cast<Int_t>(energy)); |
112 | ||
fd7a3071 | 113 | //cout << "Cluster " << pos[0] << " " << pos[1] << " " << pos[2] << endl; |
479a34f1 | 114 | |
115 | ||
33791895 | 116 | } |
117 | ||
118 | void AliHLTEveEmcal::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) { | |
db76648f | 119 | //See header file for documentation |
223c3ddd | 120 | //Float_t x = (fX - 24)* 6.0; |
121 | //Float_t z = (fZ - 48) * 6.0; | |
122 | ||
123 | Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fX, fZ); | |
33791895 | 124 | Double_t posX, posY, posZ; |
125 | if(fGeoUtils->RelPosCellInSModule(absid, posX, posY, posZ)) { | |
126 | ||
d0cbdfc0 | 127 | //cout << "digits " << posX << " " << posY << " " << posZ << endl; |
223c3ddd | 128 | fBoxSetDigits[module].AddBox(15, posY, posZ, energy*10, 6.0, 6.0); |
129 | ||
9374a7f9 | 130 | fBoxSetDigits[module].DigitValue(static_cast<Int_t>(energy)); |
33791895 | 131 | } else { |
db76648f | 132 | cout <<"AliHLTEveEmcal::AddClusters: fail"<<endl; |
33791895 | 133 | } |
134 | } |