]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/EVE/AliHLTEvePhos.cxx
- fixing use of centrality class
[u/mrichter/AliRoot.git] / HLT / EVE / AliHLTEvePhos.cxx
index 1b3d6cd029b381dc94e0b21125f74d592085532d..cd7d9757b02895883f10929a1d1131c0f0db113c 100644 (file)
@@ -25,7 +25,7 @@
 #include "AliPHOSGeoUtils.h"
 #include "AliPHOSGeometry.h"
 #include "TVector3.h"
-#include "AliEveHOMERManager.h"
+#include "AliEveHLTEventManager.h"
 #include "TEveManager.h"
 #include "AliHLTCaloDigitDataStruct.h"
 #include "AliHLTCaloClusterDataStruct.h"
@@ -40,6 +40,8 @@ fGeoUtils(NULL)
 {
   // Constructor.
   fGeoUtils = new AliPHOSGeoUtils("PHOS", "noCPV");
+  CreateElementList();
+
 }
 
 AliHLTEvePhos::~AliHLTEvePhos()
@@ -50,12 +52,11 @@ AliHLTEvePhos::~AliHLTEvePhos()
   fGeoUtils = NULL;
 }
 
-
-TEveElementList * AliHLTEvePhos::CreateElementList() {
+void AliHLTEvePhos::CreateElementList() {
   //See header file for documentation
 
-  TEveElementList * elementList  = new TEveElementList("PHOS ");
-  fBoxSet = new TEveBoxSet[fNModules];
+  fBoxSetClusters = new TEveBoxSet[fNModules];
+  fBoxSetDigits = new TEveBoxSet[fNModules];
 
   AliPHOSGeometry * geo = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
   
@@ -66,49 +67,103 @@ TEveElementList * AliHLTEvePhos::CreateElementList() {
   for(int im = 0; im < fNModules; im++) {
     
     TEveRGBAPalette* pal = new TEveRGBAPalette(0,512);
-    pal->SetLimits(-1, 6);
-    fBoxSet[im].SetTitle(Form("Clusters Module %d", im));
-    fBoxSet[im].SetName(Form("Clusters Module %d", im));
-    fBoxSet[im].SetPalette(pal);
-    fBoxSet[im].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
-    fBoxSet[im].SetOwnIds(kTRUE);
+    pal->SetLimits(-1, 45);
+
+    //Create clusters box set
+    fBoxSetClusters[im].SetTitle(Form("Clusters Module %d", im));
+    fBoxSetClusters[im].SetName(Form("Clusters Module %d", im));
+    fBoxSetClusters[im].SetPalette(pal);
+    fBoxSetClusters[im].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
+    fBoxSetClusters[im].SetOwnIds(kTRUE);
     
     
     geo->GetModuleCenter(center, "CPV", im+1);
     angle = geo->GetPHOSAngle(im+1)*TMath::Pi()/180;
     
-    fBoxSet[im].RefitPlex();
-    TEveTrans& t = fBoxSet[im].RefMainTrans();
+    fBoxSetClusters[im].RefitPlex();
+    TEveTrans& t = fBoxSetClusters[im].RefMainTrans();
     t.SetupRotation(1, 2, angle );
     t.SetPos(center.X(), center.Y(), center.Z());
     
-    elementList->AddElement(&fBoxSet[im]);
+    AddElement(&fBoxSetClusters[im]);
+
+
+    //Create digits box set
+    fBoxSetDigits[im].SetTitle(Form("Digits Module %d", im));
+    fBoxSetDigits[im].SetName(Form("Digits Module %d", im));
+    fBoxSetDigits[im].SetPalette(pal);
+    fBoxSetDigits[im].Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
+    fBoxSetDigits[im].SetOwnIds(kTRUE);
+    
+    
+    geo->GetModuleCenter(center, "CPV", im+1);
+    angle = geo->GetPHOSAngle(im+1)*TMath::Pi()/180;
+    
+    fBoxSetDigits[im].RefitPlex();
+    TEveTrans& t2 = fBoxSetDigits[im].RefMainTrans();
+    t2.SetupRotation(1, 2, angle );
+    t2.SetPos(center.X(), center.Y(), center.Z());
+    
+    AddElement(&fBoxSetDigits[im]);
+
+
   }
-  return elementList;
+
 }
 
 void AliHLTEvePhos::AddDigits(UShort_t fX, UShort_t fZ, Int_t module, Float_t energy) {
   //See header file for documentation
   Float_t x = (fX - 32)* 2.2;
   Float_t z = (fZ - 28) * 2.2;
-  fBoxSet[4-module].AddBox(x, 0, z, 2.2, energy*20, 2.2);
-  fBoxSet[4-module].DigitValue(static_cast<Int_t>(energy));
+  fBoxSetDigits[4-module].AddBox(x, 0, z, 2.2, energy*20, 2.2);
+  fBoxSetDigits[4-module].DigitValue(static_cast<Int_t>(energy));
 }
 
+void AliHLTEvePhos::ProcessESDCluster(AliESDCaloCluster * cluster) {
+  
+  Float_t pos[3];
+  cluster->GetPosition(pos);
+  TVector3 vec = TVector3(pos);
+  Float_t phi = vec.Phi() *180 / TMath::Pi();
+  if(phi < 0) phi += 360;
+
+  Int_t mid = 0;
+  if(phi > 320) return;
+  else if(phi > 300) mid = 4;
+  else if(phi > 280) mid = 3;
+  else if(phi > 260) mid = 2;
+  else return;
+  
+  Int_t nCells = cluster->GetNCells();
+  AddClusters(pos, mid, cluster->E(), nCells);
 
-void AliHLTEvePhos::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
+}
 
-  
+///____________________________________________________________________________________
+void AliHLTEvePhos::AddClusters(Float_t * pos, Int_t module, Float_t energy) {
 
   TVector3 localVector;
   TVector3 globalVector(pos);
 
+  fGeoUtils->Global2Local(localVector, globalVector, 5-module);
+
+ //See header file for documentation
+  fBoxSetClusters[4-module].AddBox(localVector.X(), 0, localVector.Z(), 2.2, energy*40, 2.2 );
+  fBoxSetClusters[4-module].DigitValue(static_cast<Int_t>(energy*10));
+}
+
+
+///_____________________________________________________________________________
+void AliHLTEvePhos::AddClusters(Float_t * pos, Int_t module, Float_t energy, Int_t nCells) {
+
+  TVector3 localVector;
+  TVector3 globalVector(pos);
 
   fGeoUtils->Global2Local(localVector, globalVector, 5-module);
-  
 
+  Float_t cf = 2.2*TMath::Sqrt(nCells);
  //See header file for documentation
-  fBoxSet[4-module].AddBox(localVector.X(), -70, localVector.Z(), 2.2, -energy*20, 2.2);
-  fBoxSet[4-module].DigitValue(static_cast<Int_t>(energy));
+  fBoxSetClusters[4-module].AddBox(localVector.X(), 0, localVector.Z(), cf, energy*40, cf );
+  fBoxSetClusters[4-module].DigitValue(static_cast<Int_t>(energy*10));
 }