1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Authors: Svein Lindal <slindal@fys.uio.no > *
6 * for The ALICE HLT Project. *
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 **************************************************************************/
17 /// @file AliHLTEveBase.cxx
18 /// @author Svein Lindal <slindal@fys.uio.no>
19 /// @brief Base class for the HLT eve display detector elements
22 #include "AliHLTEveBase.h"
23 #include "AliHLTHOMERBlockDesc.h"
24 //#include "TCollection.h"
25 #include "AliEveHOMERManager.h"
27 #include "TEveWindow.h"
28 #include "TEveManager.h"
29 #include "TEveBrowser.h"
33 ClassImp(AliHLTEveBase);
35 AliHLTEveBase::AliHLTEveBase() :
43 AliHLTEveBase::~AliHLTEveBase()
56 TCanvas * AliHLTEveBase::CreateCanvas(TString tabTitle, TString canvasTitle ) {
57 //See header file for documentation
59 TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(fEventManager->GetEveManager()->GetBrowser()->GetTabRight());
60 slot->StartEmbedding();
61 TCanvas * canvas = new TCanvas(canvasTitle.Data(),canvasTitle.Data(), 600, 400);
62 slot->StopEmbedding(tabTitle.Data());
67 void AliHLTEveBase::AddHistogramsToCanvas(AliHLTHOMERBlockDesc * block, TCanvas * canvas, Int_t &cdCount ) {
68 //See header file for documentation
70 if ( ! block->GetClassName().CompareTo("TObjArray")) {
71 TIter next((TObjArray*)(block->GetTObject()));
74 while (( object = (TObject*) next())) {
75 TH2F* histo = dynamic_cast<TH2F*>(object);
77 canvas->cd(++cdCount);
80 TH1F* hist = dynamic_cast<TH1F*>(object);
82 canvas->cd(++cdCount);
85 cout <<"AliHLTEveCaloBase::AddHistogramsTocCanvas: Histogram neither TH1F nor TH2F"<<endl;
91 else if ( ! block->GetClassName().CompareTo("TH1F")) {
93 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
100 else if ( ! block->GetClassName().CompareTo("TH2F")) {
101 TH2F *histo = reinterpret_cast<TH2F*>(block->GetTObject());