From 38aefcea488dbbba1b14398ac9d9ff76e08b50c9 Mon Sep 17 00:00:00 2001 From: cvetan Date: Thu, 24 Sep 2009 13:02:50 +0000 Subject: [PATCH] Cleaning up the EMCAL digits macro and adding it to the online event display (C&M) --- EVE/alice-macros/emcal_digits.C | 54 ++++++++++++++++++++++++--------- EVE/macros/alieve_online.C | 3 ++ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/EVE/alice-macros/emcal_digits.C b/EVE/alice-macros/emcal_digits.C index 836bced5b04..09b6439ef69 100644 --- a/EVE/alice-macros/emcal_digits.C +++ b/EVE/alice-macros/emcal_digits.C @@ -6,34 +6,52 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ +#ifndef __CINT__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#endif void emcal_digits() { AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); - rl->LoadgAlice(); - AliEMCAL * emcal = (AliEMCAL*) rl->GetAliRun()->GetDetector("EMCAL"); - AliEMCALGeometry * geom = emcal->GetGeometry(); - rl->LoadDigits("EMCAL"); TTree* dt = rl->GetTreeD("EMCAL", kFALSE); + if (!dt) return; + + AliEveEventManager::AssertGeometry(); - gGeoManager = gEve->GetDefaultGeometry(); TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("XEN1_1"); TGeoBBox* bbbox = (TGeoBBox*) node->GetDaughter(0) ->GetVolume()->GetShape(); - bbbox->Dump(); TGeoBBox* sbbox = (TGeoBBox*) node->GetDaughter(10)->GetVolume()->GetShape(); - sbbox->Dump(); TEveElementList* l = new TEveElementList("EMCAL"); l->SetTitle("Tooltip"); gEve->AddElement(l); TEveFrameBox* frame_big = new TEveFrameBox(); + frame_big->SetFrameColorRGBA(200,200,0,50); frame_big->SetAABoxCenterHalfSize(0, 0, 0, bbbox->GetDX(), bbbox->GetDY(), bbbox->GetDZ()); TEveFrameBox* frame_sml = new TEveFrameBox(); + frame_sml->SetFrameColorRGBA(200,200,0,50); frame_sml->SetAABoxCenterHalfSize(0, 0, 0, sbbox->GetDX(), sbbox->GetDY(), sbbox->GetDZ()); gStyle->SetPalette(1, 0); @@ -42,6 +60,10 @@ void emcal_digits() TEveQuadSet* smodules[12]; + + AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance(); + if (!geom) geom = AliEMCALGeometry::GetInstance("",""); + for (Int_t sm=0; sm<12; ++sm) { TEveQuadSet* q = new TEveQuadSet(Form("SM %d", sm+1)); @@ -65,7 +87,6 @@ void emcal_digits() Int_t nEnt = digits->GetEntriesFast(); AliEMCALDigit * dig; - Int_t iEvent = -1 ; Float_t amp = -1 ; Float_t time = -1 ; Int_t id = -1 ; @@ -86,7 +107,7 @@ void emcal_digits() amp = dig->GetAmp(); //amplitude in cell (digit) time = dig->GetTime();//time of creation of digit after collision - cout<<"Cell ID "<GetCellIndex(id,iSupMod,iTower,iIphi,iIeta); @@ -95,22 +116,25 @@ void emcal_digits() iIphi, iIeta,iphi,ieta); //Gives label of cell in eta-phi position per each supermodule - cout<< "SModule "<RelPosCellInSModule(id, x, y, z); - cout << x <<" "<< y <<" "<< z <AddQuad(y, z); - q->QuadValue(amp); - q->QuadId(dig); + q->QuadValue(TMath::Nint(amp)); + q->QuadId(new AliEMCALDigit(*dig)); } else { - cout<<"Digit pointer 0x0"<UnloadDigits("EMCAL"); + + for (Int_t sm = 0; sm < 12; ++sm) { smodules[iSupMod]->RefitPlex(); diff --git a/EVE/macros/alieve_online.C b/EVE/macros/alieve_online.C index d14912f94fb..781b0748b9a 100644 --- a/EVE/macros/alieve_online.C +++ b/EVE/macros/alieve_online.C @@ -38,6 +38,7 @@ void alieve_online_init() gROOT->LoadMacro("tpc_clusters.C++"); gROOT->LoadMacro("tof_clusters.C++"); gROOT->LoadMacro("hmpid_clusters.C++"); + gROOT->LoadMacro("emcal_digits.C++"); gROOT->LoadMacro("acorde_raw.C"); gROOT->LoadMacro("its_raw.C"); @@ -161,6 +162,8 @@ void alieve_online_on_new_event() if (AliEveEventManager::HasRawReader()) vzero_raw(); + emcal_digits(); + primary_vertex(); esd_tracks(); -- 2.39.3