]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/EVE/AliHLTEveEmcal.cxx
- adding the use of the histogram merger
[u/mrichter/AliRoot.git] / HLT / EVE / AliHLTEveEmcal.cxx
index 141d03b1ed4c887d661d9d0f8c81a15e63d223f4..0f28ff90d1e65754f778f104d5113e194f82951e 100644 (file)
@@ -24,9 +24,8 @@
 #include "TCanvas.h"
 #include "AliHLTEveBase.h"
 #include "TEveBoxSet.h"
-#include "AliPHOSGeometry.h"
 #include "TVector3.h"
-#include "AliEveHOMERManager.h"
+#include "AliEveHLTEventManager.h"
 #include "TEveManager.h"
 #include "AliHLTCaloDigitDataStruct.h"
 #include "AliHLTCaloClusterDataStruct.h"
 #include "TEveTrans.h"
 #include "TGeoNode.h"
 #include "AliEMCALGeoUtils.h"
+#include "TGeoManager.h"
+
+#include "TEveGeoShapeExtract.h"
+#include "TEveGeoNode.h"
 
 ClassImp(AliHLTEveEmcal)
 
@@ -43,6 +46,7 @@ fGeoUtils(NULL)
 {
   //Constructor
   fGeoUtils = new AliEMCALGeoUtils("EMCAL_COMPLETE","EMCAL");
+  CreateElementList();
 
 }
 
@@ -52,12 +56,9 @@ AliHLTEveEmcal::~AliHLTEveEmcal()
   //Destructor, not implemented
 }
 
-TEveElementList * AliHLTEveEmcal::CreateElementList() {
+void AliHLTEveEmcal::CreateElementList() {
   
-  TGeoNode * gEMCALNode = fEventManager->GetGeoManager()->GetTopVolume()->FindNode("XEN1_1");
-
-  fElementList = new TEveElementList("EMCAL Digits / Clusters");
-  fElementList->SetTitle("Tooltip");
+  TGeoNode * gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
   
   //gStyle->SetPalette(1, 0);
   TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
@@ -77,7 +78,7 @@ TEveElementList * AliHLTEveEmcal::CreateElementList() {
     fBoxSetDigits[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
     fBoxSetDigits[sm].SetPalette(pal);
     
-    fElementList->AddElement(&fBoxSetDigits[sm]);
+    AddElement(&fBoxSetDigits[sm]);
  
     //Clusters
     fBoxSetClusters[sm].SetTitle(Form("Clusters Module %d", sm));
@@ -85,36 +86,44 @@ TEveElementList * AliHLTEveEmcal::CreateElementList() {
     fBoxSetClusters[sm].SetOwnIds(kTRUE);
     
     fBoxSetClusters[sm].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
-    //    fBoxSetClusters[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
+    fBoxSetClusters[sm].RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
     fBoxSetClusters[sm].SetPalette(pal);
     
-    fElementList->AddElement(&fBoxSetClusters[sm]);
+    AddElement(&fBoxSetClusters[sm]);
 
 
   }
-  
-  return fElementList;
 }
 
 void AliHLTEveEmcal::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
   //See header file for documentation
 
-  fBoxSetClusters[module].AddBox(pos[0], pos[1], pos[2], 6.1, 200*energy, 6.1);
+  TVector3 vec(pos);
+  Int_t absId = -1;
+  fGeoUtils->GetAbsCellIdFromEtaPhi(vec.Eta(), vec.Phi(), absId);
+  
+  TVector3 localVec;
+  fGeoUtils->RelPosCellInSModule(absId, localVec);
+  fBoxSetClusters[module].AddBox(15, localVec[0],  localVec[2], energy, 6.0, 6.0);
   fBoxSetClusters[module].DigitValue(static_cast<Int_t>(energy));
 
-  cout << "Cluster " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
+  //cout << "Cluster " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
 
 
 }
 
 void AliHLTEveEmcal::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
   //See header file for documentation
-  Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fZ, fX);
+  //Float_t x = (fX - 24)* 6.0;                
+  //Float_t z = (fZ - 48) * 6.0;
+       
+  Int_t absid = fGeoUtils->GetAbsCellIdFromCellIndexes(module, fX, fZ);
   Double_t posX, posY, posZ;
   if(fGeoUtils->RelPosCellInSModule(absid, posX, posY, posZ)) {
     
     cout << "digits " << posX << "  " << posY << "  " << posZ << endl;
-    fBoxSetDigits[module].AddBox(15, posY, posZ, energy*100, 6.1, 6.1);
+    fBoxSetDigits[module].AddBox(15, posY, posZ, energy*10, 6.0, 6.0);
+
     fBoxSetDigits[module].DigitValue(static_cast<Int_t>(energy));
   } else  {
     cout <<"AliHLTEveEmcal::AddClusters:  fail"<<endl;