+//-*- Mode: C++ -*-
+
// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 *
// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
+// Author: 2010 Svein Lindal <slindal@fys.uio.no> *
// for The ALICE HLT Project. *
+
+
/** @file AliEveHOMERManager.cxx
- @author Jochen Thaeder
+ @author Jochen Thaeder, Svein Lindal <slindal@fys.uio.no>
@date
- @brief Manger for HOMER in offline
+ @brief Manager for HOMER online
*/
#if __GNUC__>= 3
using namespace std;
#endif
-#include "AliEveHOMERManager.h"
+#include "unistd.h"
+#include "TEveManager.h"
+#include "TTimer.h"
+#include "TEveScene.h"
+#include "TEveProjectionManager.h"
+#include "TEveBrowser.h"
+#include "TGLViewer.h"
+#include "TEveViewer.h"
-#define use_aliroot
-#define use_root
-#define ROWHOUGHPARAMS
-#define use_reconstruction
-#define use_newio
-#define ROOTVERSION "unchecked"
-#define ALIROOTVERSION "unchecked"
-#define __ROOT__
-#define USE_ALILOG
-#define LINUX
-// -- -- -- -- -- -- --
-#include "AliHLTHOMERLibManager.h"
-#include "AliHLTHOMERSourceDesc.h"
+#include "AliEveHOMERManager.h"
#include "AliHLTHOMERBlockDesc.h"
-// -- -- -- -- -- -- --
-#include "AliEveHOMERSource.h"
-// -- -- -- -- -- -- --
-#include "TString.h"
-#include <TApplication.h>
-#include "Riostream.h"
-#include "TXMLAttr.h"
-#include "TCollection.h"
-#include "TList.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-// -- -- -- -- -- -- --
-#include "AliLog.h"
-#include "AliTPCCalibPedestal.h"
-#include "AliTPCCalibPulser.h"
-#include "AliTPCCalibCE.h"
-#include "AliTPCPreprocessorOnline.h"
-#include "AliTPCCalROC.h"
-
-//______________________________________________________________________________
-//
-// Manage connections to HLT data-sources.
+#include "AliHLTHOMERManager.h"
+#include "AliHLTTriggerDecision.h"
+#include "AliHLTEvePhos.h"
+#include "AliHLTEveEmcal.h"
+#include "AliHLTEveTPC.h"
+#include "AliHLTEveHLT.h"
+#include "AliHLTEveITS.h"
+#include "AliHLTEveISPD.h"
+#include "AliHLTEveISSD.h"
+#include "AliHLTEveISDD.h"
+#include "AliHLTEveTRD.h"
+#include "AliHLTEveMuon.h"
+#include "AliHLTEveAny.h"
+#include "AliEveHOMERSourceList.h"
+
+//#include "TTimer.h"
ClassImp(AliEveHOMERManager)
-
+
/*
* ---------------------------------------------------------------------------------
* Constructor / Destructor
* ---------------------------------------------------------------------------------
*/
-
+
//##################################################################################
-AliEveHOMERManager::AliEveHOMERManager( TString xmlFile ) :
- TEveElementList("AliEveHOMERManager"),
- fLibManager(new AliHLTHOMERLibManager),
- fXMLFile(xmlFile),
- fXMLParser(NULL),
- fRootNode(NULL),
- fSourceList(NULL),
- fReader(NULL),
- fRealm("GPN"),
- fBlockList(NULL),
- fNBlks(0),
- fEventID(0),
- fCurrentBlk(0),
- fConnected(kFALSE),
- fStateHasChanged(kTRUE),
+AliEveHOMERManager::AliEveHOMERManager() :
+TEveElementList("Homer Manager"),
+ AliHLTHOMERManager(),
fSrcList(NULL),
- fTPCPre(NULL) {
- // This Class should handle the communication
- // from the HLT to AliEVE. The HLT sends data via
- // the HOMER interface on several TCP ports of nodes
- // in the CERN GPN and DCS network.
- // All this communication is hidden from the user.
- //
- // Right now, a xml file ( SCC1 ) is used to get the
- // configuration, this will/ has to change to a proxy
- // running on dedicated nodes.
-}
-
-//##################################################################################
-AliEveHOMERManager::~AliEveHOMERManager() {
- // The destructor
-
- if ( fLibManager ) {
- if ( fReader )
- fLibManager->DeleteReader(fReader);
- delete fLibManager;
- fLibManager = NULL;
- fReader = NULL;
- }
-
- if ( fXMLParser )
- delete fXMLParser;
- fXMLParser = NULL;
-
- if ( fSourceList != NULL )
- delete fSourceList;
- fSourceList = NULL;
+ fRetryCount(1000),
+ fRetrySleeptime(15),
+ fGeoManager(NULL),
+ fEveManager(NULL),
+ fRPhiManager(NULL),
+ fRhoZManager(NULL),
+ fRPhiEventScene(NULL),
+ fRhoZEventScene(NULL),
+ fRhoZViewer(NULL),
+ fRPhiViewer(NULL),
+ fTimer(NULL),
+// fSourceListTimer(NULL),
+ fPhosElement(NULL),
+ fEmcalElement(NULL),
+ fTPCElement(NULL),
+ fHLTElement(NULL),
+ fITSElement(NULL),
+ fISPDElement(NULL),
+ fISSDElement(NULL),
+ fISDDElement(NULL),
+ fTRDElement(NULL),
+ fMuonElement(NULL),
+ fAnyElement(NULL),
+ fEventLoopStarted(kFALSE),
+ fCenterProjectionsAtPrimaryVertex(kFALSE),
+ fShowBarrel(kTRUE),
+ fShowMuon(kFALSE)
+{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+ fTimer = new TTimer();
+ fTimer->Connect("Timeout()", "AliEveHOMERManager", this, "NextHOMEREvent()" );
- if ( fBlockList != NULL )
- delete fBlockList;
- fBlockList = NULL;
+ //fSourceListTimer = new TTimer();
- if ( fSrcList != NULL )
- delete fSrcList;
- fSrcList = NULL;
+ fPhosElement = new AliHLTEvePhos();
+ fPhosElement->SetEventManager(this);
+
+ fEmcalElement = new AliHLTEveEmcal();
+ fEmcalElement->SetEventManager(this);
+
+ fTPCElement = new AliHLTEveTPC();
+ fTPCElement->SetEventManager(this);
+
+ fHLTElement = new AliHLTEveHLT();
+ fHLTElement->SetEventManager(this);
+
+ fITSElement = new AliHLTEveITS();
+ fITSElement->SetEventManager(this);
- if ( fTPCPre != NULL )
- delete fTPCPre;
- fTPCPre = NULL;
-}
+ fISPDElement = new AliHLTEveISPD();
+ fISPDElement->SetEventManager(this);
-/*
- * ---------------------------------------------------------------------------------
- * Source Handling
- * ---------------------------------------------------------------------------------
- */
+ fISDDElement = new AliHLTEveISDD();
+ fISDDElement->SetEventManager(this);
-//##################################################################################
-Int_t AliEveHOMERManager::CreateHOMERSourcesList() {
- // Create Sources List from HOMER-Proxy
+ fISSDElement = new AliHLTEveISSD();
+ fISSDElement->SetEventManager(this);
- // -- Initialize XML parser
- if ( fXMLParser != NULL )
- delete fXMLParser;
- fXMLParser = NULL;
+ fTRDElement = new AliHLTEveTRD();
+ fTRDElement->SetEventManager(this);
- fXMLParser = new TDOMParser();
- fXMLParser->SetValidate( kFALSE );
+}
- Int_t iResult = fXMLParser->ParseFile( fXMLFile );
- if ( iResult < 0 ) {
- iResult = 1;
- AliError( Form("Parsing file with error: %s", fXMLParser->GetParseCodeMessage( fXMLParser->GetParseCode() )) );
- return iResult;
- }
+//##################################################################################
+AliEveHOMERManager::~AliEveHOMERManager() {
+ // see header file for class documentation
- // -- Initialize sources list
DestroyElements();
- if ( fSourceList != NULL )
- delete fSourceList;
- fSourceList = NULL;
+ DestroyDetectorElements();
- fSourceList = new TList();
- fSourceList->SetOwner( kTRUE );
+}
- // -- Set ROOT node
- fRootNode = fXMLParser->GetXMLDocument()->GetRootNode();
- TXMLNode * node = NULL;
- TXMLNode * prevNode = fRootNode->GetChildren();
- // -- Loop over all nodes
- while ( ( node = prevNode->GetNextNode() ) ) {
- prevNode = node;
+void AliEveHOMERManager::DestroyDetectorElements(){
+ //See header file for documentation
+ if (fSrcList)
+ delete fSrcList;
+ fSrcList = NULL;
- // -- Find only "Process" nodes, otherwise continue to next node
- if ( strcmp( node->GetNodeName(), "Proc" ) != 0 )
- continue;
+ if (fPhosElement)
+ delete fPhosElement;
+ fPhosElement = NULL;
- // -- Get Attributes of current node
- TList *attrList = node->GetAttributes();
- TXMLAttr *attr = 0;
- TIter next(attrList);
+ if(fEmcalElement)
+ delete fEmcalElement;
+ fEmcalElement = NULL;
- while ( ( attr = (TXMLAttr*)next() ) ) {
+ if(fTPCElement)
+ delete fTPCElement;
+ fTPCElement = NULL;
- // -- Find "ID" attribute, otherwise continue to next attribute
- if ( strcmp( attr->GetName(), "ID" ) != 0 )
- continue;
+ if(fHLTElement)
+ delete fHLTElement;
+ fHLTElement = NULL;
- TString nodeId( attr->GetValue() );
+ if(fITSElement)
+ delete fITSElement;
+ fITSElement = NULL;
- // -- Find only TDS processes
- TObjArray * nodeIdTok = nodeId.Tokenize("_");
+ if(fISSDElement)
+ delete fISSDElement;
+ fISSDElement = NULL;
- for ( Int_t ii=0 ; ii < nodeIdTok->GetEntries() ; ii++ ) {
- if ( ! ( (TObjString*) nodeIdTok->At(ii) )->GetString().CompareTo("TDS") ) {
- iResult = GetTDSAttributes( node->GetChildren() );
- if ( iResult ) {
- AliError( Form("Error processing TDS process : %s", nodeId.Data()) );
- }
- }
- }
- } // while ( ( attr = (TXMLAttr*)next() ) ) {
+ if(fISDDElement)
+ delete fISDDElement;
+ fISDDElement = NULL;
- } // while ( ( node = prevNode->GetNextNode() ) ) {
+ if(fISPDElement)
+ delete fISPDElement;
+ fISPDElement = NULL;
- // -- New SourceList has been created --> All Sources are new --> State has changed
- fStateHasChanged = kTRUE;
+ if(fTRDElement)
+ delete fTRDElement;
+ fTRDElement = NULL;
- if ( iResult ) {
- AliWarning( Form("There have been errors, while creating the sources list.") );
- }
- else {
- AliInfo( Form("New sources list created.") );
+ if(fMuonElement)
+ delete fMuonElement;
+ fMuonElement = NULL;
- if ( fSrcList )
- delete fSrcList;
-
- // -- Create new AliEVE sources list
- fSrcList = new AliEveHOMERSourceList("HOMER Sources");
- fSrcList->SetManager(this);
-
- AddElement(fSrcList);
- fSrcList->CreateByType();
- }
-
- return iResult;
-}
-
-//##################################################################################
-void AliEveHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
- // Set state of a source
- // * param source Pointer to AliHLTHOMERSourceDesc object.
- // * param state New (selected/not selected) state.
+ if(fAnyElement)
+ delete fAnyElement;
+ fAnyElement = NULL;
- if ( source->IsSelected() != state ) {
- source->SetState( state );
- fStateHasChanged = kTRUE;
- }
- return;
}
-//##################################################################################
-Int_t AliEveHOMERManager::GetTDSAttributes( TXMLNode * xmlNode ) {
- // Get Information out of a TDS process in XML file
- // * param xmlNode Pointer to childs of TDS node
- // * return 0 on sucess, > 0 on errorsee header file for class documentation
-
- Int_t iResult = 0;
-
- TXMLNode * attrNode = NULL;
- TXMLNode * prevNode = xmlNode;
-
- TString xmlHostname = 0;
- TString xmlPort = 0;
-
- TString hostname = 0;
- Int_t port = 0;
-
- // -- Get hostname and port from TDS node out of XML
- while ( ( attrNode = prevNode->GetNextNode() ) ) {
- prevNode = attrNode;
-
- // -- Get port out of the commandline
- if ( strcmp( attrNode->GetNodeName(), "Cmd" ) == 0 ) {
- TString cmd( attrNode->GetText() );
-
- TObjArray * cmdTok = cmd.Tokenize(" ");
- xmlPort = ((TObjString*) cmdTok->At(2))->GetString();
- }
- // -- Get hostname
- else if ( strcmp( attrNode->GetNodeName(), "Node" ) == 0 )
- xmlHostname = attrNode->GetText();
-
- } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
-
- // -- Resolve hostname and port information
- iResult = ResolveHostPortInformation ( xmlHostname, xmlPort, hostname, port );
- if ( iResult == 1 ) {
- AliError( Form("Error resolving hostname : %s", xmlHostname.Data()) );
- return iResult;
- }
- else if ( iResult == 2 ) {AliInfo( Form("Connection established") );
- AliError( Form("Error resolving port : %s", xmlPort.Data()) );
- return iResult;
- }
-
- // -- Reset loop to TDS node
- prevNode = xmlNode;
-
- // -- Get Sources out of XML, resolve sources, add to sources List
- while ( ( attrNode = prevNode->GetNextNode() ) ) {
- prevNode = attrNode;
- // Find only "Parent" tags, otherwise continue to next tag
- if ( strcmp( attrNode->GetNodeName(), "Parent" ) != 0 )
- continue;
- TString xmlParent = attrNode->GetText();
-
- AliHLTHOMERSourceDesc * source = new AliHLTHOMERSourceDesc( hostname, port );
-
- if ( ResolveSourceInformation( xmlParent, source ) ) {
- iResult = 3;
- AliError( Form("Error resolving source : %s", xmlParent.Data()) );
-
- delete source;
- }
- else {
- fSourceList->Add( source );
- AliInfo( Form("New Source added : %s", xmlParent.Data()) );
- }
-
- } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
-
- return iResult;
-}
+/*
+ * ---------------------------------------------------------------------------------
+ * Source Handling
+ * ---------------------------------------------------------------------------------
+ */
//##################################################################################
-Int_t AliEveHOMERManager::ResolveHostPortInformation ( TString xmlHostname, TString xmlPort, TString &hostname, Int_t &port ) {
- // Resolve Information of hostname and port for source which has to be used by HOMER
- // ( due to port mapping inside the HLT )
- // * param xmlHostname Hostname out of the XML
- // * param xmlPort Port out of the XML
- // * param hostname Return of the hostname
- // * param port Return of the port
- // * return 0 on sucess, 1 if hostname couldn't be resolved, 2 if port couldn't be resolved,
-
- Int_t iResult = 1;
- TString nodeName = 0;
- TXMLNode * node = NULL;
- TXMLNode * prevNode = fRootNode->GetChildren();
-
- // *** Resolve hostname
-
- while ( ( node = prevNode->GetNextNode() ) && iResult == 1 ) {
- prevNode = node;
-
- // -- Find only "Node" nodes, otherwise continue
- if ( strcmp( node->GetNodeName(), "Node" ) != 0 )
- continue;
-
- // -- Get Attributes of current node
- TList *attrList = node->GetAttributes();
- TXMLAttr *attr = 0;
- TIter next(attrList);
-
- TString nodeId = 0;
-
- // Get "nodeID" and "nodeName" of this "Node" node
- while ( ( attr = (TXMLAttr*)next() ) ) {
- if ( strcmp( attr->GetName(), "ID" ) == 0 )
- nodeId = attr->GetValue();
- else if ( strcmp( attr->GetName(), "hostname" ) == 0 )
- nodeName = attr->GetValue();
- }
-
- // -- if this is not the correct nodeID continue
- if ( nodeId != xmlHostname )
- continue;
-
- // -- Set hostname
- if ( ! fRealm.CompareTo( "ACR" ) )
- hostname = "alihlt-dcs0.cern.ch";
- else if ( ! fRealm.CompareTo( "GPN" ) )
- hostname = "alihlt-vobox0.cern.ch";
- else
- hostname = nodeName;
+Int_t AliEveHOMERManager::CreateEveSourcesList() {
+ // see header file for class documentation
- iResult = 0;
+ DestroyElements();
- break;
- } // while ( ( node = prevNode->GetNextNode() ) ) {
+ Int_t iResult = CreateSourcesList();
- if ( iResult ) {
- AliError( Form("Error resolving hostname : %s", xmlHostname.Data()) );
+ // fStateHasChanged = kTRUE;
+
+ HLTDebug(Form("iResult XXX %d", iResult));
+ if ( iResult )
return iResult;
- }
- // *** Resolve port
- if ( xmlPort.IsDigit() ) {
-
- if ( nodeName.CompareTo("feptriggerdet") ==0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 58140;
- } else if ( xmlPort.CompareTo("49153") == 0 ){
- port = 58141;
- }
- } else if ( nodeName.CompareTo("fepfmdaccorde") == 0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 58144;
- } else if ( xmlPort.CompareTo("49153") == 0 ){
- port = 58145;
- }
- } else if ( nodeName.CompareTo("feptpcao15") == 0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 50340;
- } else if ( xmlPort.CompareTo("49153") == 0 ){
- port = 50341;
- }
- } else if ( nodeName.CompareTo("fepphos2") == 0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 58656;
- } else if ( xmlPort.CompareTo("58656") == 0 ){
- port = 58656;
- }
- } else if ( nodeName.CompareTo("fepphos3") == 0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 58660;
- } else if ( xmlPort.CompareTo("58660") == 0 ){
- port = 58660;
- }
- } else if ( nodeName.CompareTo("fepphos4") == 0 ){
- if ( xmlPort.CompareTo("49152") == 0 ){
- port = 58664;
- } else if ( xmlPort.CompareTo("58664") == 0 ){
- port = 58664;
- }
- } else if ( nodeName.CompareTo("alihlt-vobox0") == 0 ){
- port = xmlPort.Atoi();
- }
- }
- else {
- AliError( Form("Error resolving port : %s", xmlPort.Data()) );
- iResult = 2;
- }
-
- // *** Summary
-
- if ( !iResult ) {
- AliInfo( Form("%s:%i resolved out of %s:%s", hostname.Data(), port, xmlHostname.Data(), xmlPort.Data()) );
- }
-
- return iResult;
-}
-
-//##################################################################################
-Int_t AliEveHOMERManager::ResolveSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc *source ) {
- // Resolve information of source
- // * param xmlParent ParentString out of the XML
- // * param source Return the filled AliHLTHOMERSourceDesc object
- // * return 0 on sucess, 1 on errorsee header file for class documentation
-
- Int_t iResult = 0;
-
- if ( ! xmlParent.Contains( "_" ) ) {
- AliError( Form("Source %s could not be resolved", xmlParent.Data() ) );
- iResult = 1;
-
- return iResult;
+ HLTDebug(Form("iResult %d", iResult));
+ if (fSrcList) {
+ HLTInfo(Form("delete source list", iResult));
+ DestroyElements();
+ //delete fSrcList;
+ fSrcList = NULL;
+ //fSrcList->Clear();
+ HLTInfo(Form("cleared source list", iResult));
}
- TObjArray * parentTokens = xmlParent.Tokenize("_");
- Int_t nEntries = parentTokens->GetEntries();
-
- TString detector = ((TObjString*) parentTokens->At(0) )->GetString();
- TString subDetector = "";
- TString subSubDetector = "";
- TString dataType = "";
- ULong_t specification = 0;
-
- TString name = ((TObjString*) parentTokens->At(1) )->GetString();
- TString objName = "";
-
- if ( nEntries == 3 )
- subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
- else if ( nEntries == 4 ) {
- subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
- subSubDetector = ((TObjString*) parentTokens->At(3) )->GetString();
- }
-
- // -- Corecct TPC subdetector, because in we have somtimes "A","C"
- if ( ! detector.CompareTo("TPC") ) {
- if ( subDetector.BeginsWith('A') ) {
- subDetector.Remove( TString::kLeading, 'A' );
- }
- else if ( subDetector.BeginsWith('C') ) {
- subDetector.Remove( TString::kLeading, 'C' );
- Int_t tmp = subDetector.Atoi() + 18;
- subDetector = "";
- subDetector += tmp;
- }
- }
-
- // -- Correct for MUON
- if ( ! detector.CompareTo("DIMU") ) {
- detector = "MUON";
+ // -- Create new AliEVE sources list
+ if(!fSrcList){
+ HLTInfo(Form("no source list", iResult));
+ fSrcList = new AliEveHOMERSourceList("HLT Sources");
+ fSrcList->SetManager(this);
- if ( ! subDetector.CompareTo("TRG") )
- subDetector = "1";
- else if ( ! subDetector.CompareTo("TRK") )
- subDetector = "2";
+ AddElement(fSrcList);
}
- // -- Remove Leading '0' in sub detector and subsubdetector
- subDetector.Remove( TString::kLeading, '0' );
- subSubDetector.Remove( TString::kLeading, '0' );
+ //HLTInfo(Form("createbytype", iResult));
+ fSrcList->CreateByDet();
+
+ HLTDebug(Form("Done createing source list %d", iResult));
- // -- Set Object Names
- // **** General ****
- if ( name == "RP" || name == "FP" || name == "Relay" ) {
- objName = "";
- dataType = "DDL_RAW";
- specification = 0;
- }
- // **** TPC ****
- else if ( detector == "TPC" ) {
-
- if ( name == "CalibPedestal" ) {
- objName = "AliTPCCalibPedestal";
- dataType = "HIS_CAL";
- specification = 0;
- }
- else if ( name == "CalibPulser" ) {
- objName = "AliTPCCalibPulser";
- dataType = "HIS_CAL";
- specification = 0;
- }
- else if ( name == "CF" || name == "RelayCF" ) {
- objName = "AliHLTTPCClusterDataFormat";
- dataType = "CLUSTERS";
- specification = 0;
- }
- else if ( name == "ESDConv" ) {
- objName = "TTree";
- dataType = "ESD_TREE";
- specification = 0;
- }
- else if ( name == "KryptonCF" ) {
- objName = "TObjArray";
- dataType = "KRPTHIST";
- specification = 0;
- }
- else {
- // not defined yet ...
- AliError( Form("Parent Process not defined yet : %s .", name.Data()) );
- iResult = 1;
- }
-
- } // if ( detector == "TPC" ) {
-
- // **** TRD ****
- else if ( detector == "TRD" ) {
-
- if ( name == "foo" ) {
- objName = "bar";
- dataType = "FOO_BAR";
- specification = 0;
- }
- } // else if ( detector == "TRD" ) {
-
- // **** PHOS ****
- else if ( detector == "PHOS" ) {
-
- } // else if ( detector == "PHOS" ) {
-
- // **** DIMU ****
- else if ( detector == "MUON" ) {
- Int_t UpdateSourcesFromSourcesList( );
- } // else if ( detector == "MUON" ) {
-
- // -- Fill object
- source->SetSourceName( name, objName );
- source->SetSourceType( specification, dataType );
- source->SetDetectors( detector, subDetector, subSubDetector );
-
- // AliInfo( Form("Set Source %s , Type %s, ClassName %s .", name.Data(), dataType.Data(), objName.Data()) );
- // AliInfo( Form(" Detector %s , SubDetector : %s, SubSubDetector %s .",
- // detector.Data(), subDetector.Data(), subSubDetector.Data()) );
-
return iResult;
}
-/*
- * ---------------------------------------------------------------------------------
- * Connection Handling
- * ---------------------------------------------------------------------------------
- */
-
//##################################################################################
-Int_t AliEveHOMERManager::ConnectHOMER(){
- // Connect to HOMER sources, out of Readout List, which gets created when state has changed
- // * return 0 on sucess, "HOMER" errors on error
-
+Int_t AliEveHOMERManager::CreateEveSourcesListLoop() {
+ // see header file for class documentation
Int_t iResult = 0;
- fStateHasChanged = fSrcList->GetSelectedSources();
+ for ( Int_t retry = 0; retry < fRetryCount ; retry++ ) {
- // -- Check if already connected and state has not changed
- if ( fStateHasChanged == kFALSE && IsConnected() ) {
- AliInfo( Form("No need for reconnection.") );
- return iResult;
- }
+ iResult = CreateEveSourcesList();
- // -- If already connected, disconnect before connect
- if ( IsConnected() )
- DisconnectHOMER();
-
- // *** Create the Readoutlist
-
- UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
- const char ** sourceHostnames = new const char* [fSourceList->GetEntries()];
- UInt_t sourceCount = 0;
-
- CreateReadoutList( sourceHostnames, sourcePorts, sourceCount );
-
- if ( sourceCount == 0 ) {
- AliError(Form("No sources selected, aborting.") );
- return iResult;
- }
-
- // *** Connect to data sources
-
- if ( !fReader ) {
- if ( fLibManager )
- fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
- }
-
- iResult = fReader->GetConnectionStatus();
-
- if ( iResult ) {
- // -- Connection failed
-
- UInt_t ndx = fReader->GetErrorConnectionNdx();
-
- if ( ndx < sourceCount ) {
- AliError( Form("Error : Error establishing connection to TCP source %s:%hu: %s (%d)",
- sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult) );
+ if (!iResult) {
+ HLTInfo("Source list successfully created.");
+ break;
}
- else {
- AliError( Form("Error : Error establishing connection to unknown source with index %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
+ else if (iResult == 1) {
+ HLTWarning( Form("Couldn't find active services, sleeping %d s before making attempt %d out of %d", fRetrySleeptime, retry, fRetryCount) ) ;
+ }
+ else if (iResult == 2) {
+ HLTWarning( Form("Services List empty, sleeping %d s before making new attempt.", fRetrySleeptime) ) ;
}
+ else {
+ HLTError( Form("Other problem ... \n") );
+ return iResult;
+ }
- if ( fReader )
- fLibManager->DeleteReader( fReader );
- fReader = NULL;
-
- }
- else {
- // -- Connection ok - set reader
- fConnected = kTRUE;
+ //fSourceListTimer->Start(fRetrySleeptime, kFALSE);
+ sleep(fRetrySleeptime);
- AliInfo( Form("Connection established") );
}
- delete[] sourceHostnames;
- delete[] sourcePorts;
-
-
- // -- Get next event
- if ( ! iResult )
- NextEvent();
-
+ if ( iResult ) {
+ HLTWarning( Form("Couldn't find active services.") );
+ return iResult;
+ }
+
return iResult;
}
//##################################################################################
-void AliEveHOMERManager::DisconnectHOMER(){
- // Disconnect from HOMER sources
-
- if ( ! IsConnected() )
- return;
-
- if ( fReader )
- fLibManager->DeleteReader( fReader );
- fReader = NULL;
+Int_t AliEveHOMERManager::ConnectEVEtoHOMER( TString detector ) {
+ // see header file for class documentation
- fStateHasChanged = kTRUE;
- fConnected = kFALSE;
-
- AliInfo( Form("Connection closed") );
-
- return;
+ HLTInfo("");
+ fStateHasChanged = fSrcList->GetSelectedSources();
+ HLTInfo(Form("has state changed % d", fStateHasChanged));
+ return ConnectHOMER(detector);
}
-//##################################################################################
-Int_t AliEveHOMERManager::ReconnectHOMER(){
- // Reconnect from HOMER sources
- // * return 0 on sucess, "ConnectHOMER()" errors on error
+//##################################################################################
+Int_t AliEveHOMERManager::ReConnectHOMER( TString /*detector*/ ){
+ // see header file for class documentation
+
Int_t iResult = 0;
- if ( IsConnected() )
- DisconnectHOMER();
-
- iResult = ConnectHOMER();
+ DisconnectHOMER();
+ iResult = CreateEveSourcesListLoop();
+ HLTInfo("Created new source list, reconnect to HOMER");
+ iResult = ConnectEVEtoHOMER();
if ( iResult ) {
- AliError( Form("Error connecting.") );
+ HLTError(Form("Error reconnecting."));
}
return iResult;
}
-//##################################################################################
-void AliEveHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts, UInt_t &sourceCount ){
- // Create a readout list for Hostname and ports
- // * param socurceHostnames Array of selected hostnames
- // * param socurcePorts Array of selected ports
- // * param socurceCount Number of selected hostname:port
-
- AliHLTHOMERSourceDesc * source= NULL;
-
- // -- Read all sources and check if they should be read out
- TIter next( fSourceList );
- while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- if ( ! source->IsSelected() )
- continue;
-
- Bool_t exists = kFALSE;
-
- // -- Loop over existing entries and check if entry is already in readout list
- for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
- if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() ) && sourcePorts[ii] == source->GetPort() ) {
- exists = kTRUE;
- break;
- }
- }
-
- // -- Add new entires to readout list
- if ( ! exists ) {
- sourcePorts[sourceCount] = source->GetPort();
- sourceHostnames[sourceCount] = source->GetHostname().Data();
- sourceCount++;
- }
-
- } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- fStateHasChanged = kFALSE;
-
- return;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Event Handling
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-Int_t AliEveHOMERManager::NextEvent(){
- // Loads the next Event, after being connected
- // * return 0 on sucess, "HOMER" errors on error
-
+//_____________________________________________________________________________________
+Int_t AliEveHOMERManager::NextHOMEREvent() {
+ //See header file for documentation
Int_t iResult = 0;
- if ( !fReader || ! IsConnected() ) {
- AliWarning( Form( "Not connected yet." ) );
- return 1;
- }
-
- // -- Read next event data and error handling for HOMER (error codes and empty blocks)
- while( 1 ) {
- iResult = fReader->ReadNextEvent( 20000000 /*timeout in us*/);
-
- if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("Error, No Connection to source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- fConnected = kFALSE;
- return 2;
- }
- else if ( iResult == 110 ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("Timout occured, reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- fConnected = kFALSE;
- return 3;
- }
- else if ( iResult == 56) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("Retry: Error reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- fConnected = kFALSE;
- continue;
- }
- else if ( iResult ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("General Error reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- fConnected = kFALSE;
- return 2;
- }
- else {
- break;
- }
- } // while( 1 ) {
-
- if ( iResult )
- return iResult;
- // -- Get blockCnt and eventID
- fNBlks = (ULong_t) fReader->GetBlockCnt();
- fEventID = (ULong64_t) fReader->GetEventID();
- fCurrentBlk = 0;
-
- AliInfo( Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks) );
-
-#if 0
-
- // Loop for Debug only
- for ( ULong_t i = 0; i < fNBlks; i++ ) {
- Char_t tmp1[9], tmp2[5];
- memset( tmp1, 0, 9 );
- memset( tmp2, 0, 5 );
- void *tmp11 = tmp1;
- ULong64_t* tmp12 = (ULong64_t*)tmp11;
- *tmp12 = fReader->GetBlockDataType( i );
- void *tmp21 = tmp2;
- ULong_t* tmp22 = (ULong_t*)tmp21;
- *tmp22 = fReader->GetBlockDataOrigin( i );
- AliInfo( Form("Block %lu length: %lu - type: %s - origin: %s",
- i, fReader->GetBlockDataLength( i ), tmp1, tmp2) );
- } // end for ( ULong_t i = 0; i < fNBlks; i++ ) {
-
-#endif
-
- // -- Create BlockList
- AliInfo( Form("Create Block List") );
- iResult = CreateBlockList();
-
- return iResult;
+
+ if ( NextEvent() ) {
+
+ HLTInfo("Failed getting next event, trying to reconnect");
+ iResult = ReConnectHOMER();
+ return NextHOMEREvent();
+ }
+
+ return ProcessEvent();
+
}
-//##################################################################################
-Int_t AliEveHOMERManager::CreateBlockList() {
- // Create a TList of blocks, which have been readout
-
- Int_t iResult = 0;
-
- // -- Initialize block list
- if ( fBlockList != NULL )
- delete fBlockList;
- fBlockList = NULL;
-
- fBlockList = new TList();
- fBlockList->SetOwner( kTRUE );
- void* iter = GetFirstBlk();
+//______________________________________________________________________________________________
+Int_t AliEveHOMERManager::ProcessEvent() {
- // -- Fill block list
- while ( iter != NULL ){
-
- // -- Create new block
- AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc( GetBlk(), GetBlkSize(), GetBlkOrigin(),
- GetBlkType(), GetBlkSpecification() );
+ //We have a new event, reset display items (need to check if there really is anything interesting in event before resetting. ie not just histos)
+ ResetDisplay();
+
- // -- Check sources list if block is requested
- if ( CheckIfRequested( block ) )
- fBlockList->Add( block );
- else {
- delete block;
- block = NULL;
- }
- iter = GetNextBlk();
+ AliHLTHOMERBlockDesc * block = NULL;
- } // while ( iter != NULL ){
- return iResult;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * BlockHandling
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-void* AliEveHOMERManager::GetBlk( Int_t ndx ) {
- // Get pointer to current block in current event
- // * param ndx Block index
- // * return returns pointer to blk, NULL if no block present
+ //Process the SYNCED block list
+ if ( GetBlockList() == NULL) {
+ printf ("onlineDisplay: No regular BlockList ... \n");
+ cout << endl;
+ //return -1;
- void* data = NULL;
-
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- }
- else {
- if ( ( ndx ) < (Int_t) fNBlks )
- data = (void*) fReader->GetBlockData( ndx );
- }
-
- return data;
-}
-
-//##################################################################################
-ULong_t AliEveHOMERManager::GetBlkSize( Int_t ndx ) {
- // Get size of block ndx
- // * param ndx Block index
- // * return returns pointer to blk, 0 if no block present
+ } else {
+
+ if (GetBlockList()->IsEmpty() ) {
+ printf ("onlineDisplay: No Sync Blocks in list ... \n");
+ cout<<endl;
+ //return;
+ }
- ULong_t length = 0;
-
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- }
- else {
- if ( ( ndx ) < (Int_t) fNBlks )
- length = (ULong_t) fReader->GetBlockDataLength( ndx );
- }
-
- return length;
-}
-
-//##################################################################################
-TString AliEveHOMERManager::GetBlkOrigin( Int_t ndx ) {
- // Get origin of block ndx
- // * param ndx Block index
- // * return origin of block
-
- TString origin = "";
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return origin;
- }
-
- // -- Check block index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return origin;
+
+ TIter next(GetBlockList());
+ while ((block = (AliHLTHOMERBlockDesc*)next())) {
+ ProcessBlock(block);
+
+ }
}
- // -- Get origin
- union{
- UInt_t data;
- Char_t array[4];
- } reverseOrigin;
- reverseOrigin.data = (UInt_t) fReader->GetBlockDataOrigin( ndx );
+ //Read out histograms and elements from detectors outside physics 1 partition
+ TIter anext(GetAsyncBlockList());
- // -- Reverse the order
- for (Int_t ii = 3; ii >= 0; ii-- )
- if ( reverseOrigin.array[ii] != ' ')
- origin.Append( reverseOrigin.array[ii] );
-
- return origin;
-}
-
-//##################################################################################
-TString AliEveHOMERManager:: GetBlkType( Int_t ndx ) {
- // Get type of block ndx
- // * param ndx Block index
- // * return type of block
-
- TString type = "";
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return type;
+ while ( (block = (AliHLTHOMERBlockDesc*)anext()) ) {
+ ProcessBlock(block);
}
+
+ UpdateDisplay();
- // -- Check blockk index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return type;
- }
-
- // -- Get type
- union{
- ULong64_t data;
- Char_t array[8];
- } reverseType;
-
- reverseType.data = (ULong64_t) fReader->GetBlockDataType( ndx );
-
- // -- Reverse the order
- for (Int_t ii = 7; ii >= 0; ii-- )
- if ( reverseType.array[ii] != ' ')
- type.Append( reverseType.array[ii] );
+ return 0;
- return type;
}
-//##################################################################################
-ULong_t AliEveHOMERManager:: GetBlkSpecification( Int_t ndx ) {
- // Get specification of block ndx
- // * param ndx Block index
- // * return specification of block
-
- ULong_t spec = 0;
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return spec;
+void AliEveHOMERManager::UpdateDisplay() {
+ //See header file for documentation
+ fPhosElement->UpdateElements();
+ fEmcalElement->UpdateElements();
+ fTPCElement->UpdateElements();
+ fHLTElement->UpdateElements();
+ fITSElement->UpdateElements();
+ fISSDElement->UpdateElements();
+ fISDDElement->UpdateElements();
+ fISPDElement->UpdateElements();
+ fTRDElement->UpdateElements();
+ if(fAnyElement) fAnyElement->UpdateElements();
+ if(fMuonElement) fMuonElement->UpdateElements();
+
+
+ // -- Set EventID in Window Title
+ TString winTitle("Eve Main Window -- Event ID : ");
+ winTitle += Form("0x%016X ", GetEventID() );
+ GetEveManager()->GetBrowser()->SetWindowName(winTitle);
+
+ //==============================================================================
+ // -- Import global scene into projection scenes
+ //==============================================================================
+
+ // XXX Primary vertex ... to be retrieved from the ESD
+ Double_t x[3] = { 0, 0, 0 };
+
+ TEveElement* top = GetEveManager()->GetCurrentEvent();
+
+ if (fRPhiManager && top) {
+ fRPhiEventScene->DestroyElements();
+ if (fCenterProjectionsAtPrimaryVertex)
+ fRPhiManager->SetCenter(x[0], x[1], x[2]);
+ fRPhiManager->ImportElements(top, fRPhiEventScene);
}
-
- // -- Check blockk index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return spec;
+
+ if (fRhoZManager && top) {
+ fRhoZEventScene->DestroyElements();
+ if (fCenterProjectionsAtPrimaryVertex)
+ fRhoZManager->SetCenter(x[0], x[1], x[2]);
+ fRhoZManager->ImportElements(top, fRhoZEventScene);
}
- spec = (ULong_t) fReader->GetBlockDataSpec( ndx );
-
- return spec;
-}
-
-//##################################################################################
-Bool_t AliEveHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
- // Checks if current Block should was requested
- // * return returns kTRUE, if block should was requested
-
- Bool_t requested = kFALSE;
- AliHLTHOMERSourceDesc * source= NULL;
+ //Redraw the display
+ GetEveManager()->Redraw3D(0,1); // (0, 1)
+ GetEveManager()->EnableRedraw();
- // -- Read all sources and check if they should be read out
- TIter next( fSourceList );
- while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- if ( ! source->IsSelected() )
- continue;
-
- if ( source->GetDetector().CompareTo( block->GetDetector() ) )
- continue;
-
- if ( source->GetDataType().CompareTo( block->GetDataType() ) )
- continue;
-
- if ( ! block->HasSubDetectorRange() ) {
-
- if ( source->GetSubDetector().Atoi() != block->GetSubDetector().Atoi() )
- continue;
-
- if ( ! block->HasSubSubDetectorRange() ) {
-
- if ( source->GetSubSubDetector().Atoi() != block->GetSubSubDetector().Atoi() )
- continue;
-
- } // if ( ! block->HasSubSubDetectorRange ) {
- } // if ( ! block->HasSubDetectorRange ) {
-
- requested = kTRUE;
-
- } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- if ( requested) {
- AliInfo( Form("Block requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
- block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
- }
- else
- AliInfo( Form("Block NOT requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(), block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
-
- return requested;
}
-/*
- * ---------------------------------------------------------------------------------
- * Test Realm ....
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-void AliEveHOMERManager::DumpTPCCalib(TString objectName, Bool_t dumpToFile) {
- // Still under testing ...
-
- if ( fTPCPre != NULL )
- delete fTPCPre;
-
- fTPCPre = new AliTPCPreprocessorOnline();
-
- TList* blockList = GetBlockList();
-
- AliHLTHOMERBlockDesc *desc = 0;
+void AliEveHOMERManager::ProcessBlock(AliHLTHOMERBlockDesc * block) {
+ //See header file for documentation
+
+#if 0//DEBUG
+ printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+ printf( "Detector : %s\n", block->GetDetector().Data() );
+ printf( "Datatype : %s\n", block->GetDataType().Data() );
+ if (block->IsTObject() )
+ printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
+ printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
+#endif
- TIter next(blockList);
- while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
- if ( ! desc->IsTObject() )
- continue;
+ if(fShowBarrel) {
- Int_t sectorTPC = 0;
+ if ( ! block->GetDetector().CompareTo("PHOS") )
+ fPhosElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("EMCA") )
+ fEmcalElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("TPC") )
+ fTPCElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("HLT") )
+ fHLTElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ITS") )
+ fITSElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISDD") )
+ fISDDElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISPD") )
+ fISPDElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("ISSD") )
+ fISSDElement->ProcessBlock(block);
- if ( desc->GetSubSubDetector().Atoi() <= 1 ) {
- sectorTPC = desc->GetSubDetector().Atoi();
- }
- else {
- sectorTPC = 36 + desc->GetSubDetector().Atoi();
+ else if ( ! block->GetDetector().CompareTo("TRD") )
+ fTRDElement->ProcessBlock(block);
+
+ else if ( ! block->GetDetector().CompareTo("MUON") ) {
+ //Do Nothing
+
+
+ } else {
+ if(!fAnyElement) {
+ fAnyElement = new AliHLTEveAny();
+ fAnyElement->SetEventManager(this);
+ }
+ fAnyElement->ProcessBlock(block);
}
+
+ }
- if ( ! objectName.CompareTo( desc->GetClassName() ) ){
-
- //
- // AliTPCCalibPedestal
- //
-
- if ( ! objectName.CompareTo( "AliTPCCalibPedestal" ) ) {
- AliTPCCalROC* calROC = NULL;
-
- AliTPCCalibPedestal * cal = (AliTPCCalibPedestal*) desc->GetTObject();
- if ( cal == NULL ) {
- cout << "error 1" << endl;
- continue;
- }
-
- cal->Analyse();
-
- calROC = cal->GetCalRocRMS(sectorTPC);
- if ( calROC == NULL ) {
- cout << "error 2" << endl;
- continue;
- }
-
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocPedestal(sectorTPC);
- if ( calROC == NULL ) {
- cout << "error 3" << endl;
- continue;
- }
-
-
- calROC->SetName(Form("Pedestal_ROC%d", sectorTPC));
- cout << "added" << endl;
- fTPCPre->AddComponent((TObject*) calROC );
+
+ if(fShowMuon) {
+ if ( ! block->GetDetector().CompareTo("MUON") ) {
+ if(!fMuonElement) {
+ fMuonElement = new AliHLTEveMuon();
+ fMuonElement->SetEventManager(this);
}
+ fMuonElement->ProcessBlock(block);
+ }
+ }
- //
- // AliTPCCalibPulser
- //
- /*
- else if ( ! objectName.CompareTo( "AliTPCCalibPulser" ) ) {
- AliTPCCalROC* calROC = NULL;
-
- AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
+}
- cal->Analyse();
+void AliEveHOMERManager::ResetDisplay () {
+ //See header file for documentation
- calROC = cal->GetCalRocT0(sectorTPC);
- calROC->SetName(Form("T0_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+ if(fPhosElement)
+ fPhosElement->ResetElements();
+
+ if(fEmcalElement)
+ fEmcalElement->ResetElements();
+
+ if(fTPCElement)
+ fTPCElement->ResetElements();
+
+ if(fHLTElement)
+ fHLTElement->ResetElements();
+
+ if(fITSElement)
+ fITSElement->ResetElements();
+
+ if(fISPDElement)
+ fISPDElement->ResetElements();
+
+ if(fISDDElement)
+ fISDDElement->ResetElements();
+
+ if(fISSDElement)
+ fISSDElement->ResetElements();
- calROC = cal->GetCalRocQ(sectorTPC);
- calROC->SetName(Form("Q_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+ if (fTRDElement)
+ fTRDElement->ResetElements();
- calROC = cal->GetCalRocRMS(sectorTPC);
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+ if(fAnyElement)
+ fAnyElement->ResetElements();
- calROC = cal->GetCalRocOutliers(sectorTPC);
- calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
- }
+ if(fMuonElement)
+ fMuonElement->ResetElements();
-*/
- //
- // AliTPCCalibCE
- //
- /*
- else if ( ! objectName.CompareTo( "AliTPCCalibCE" ) ) {
- AliTPCCalROC* calROC = NULL;
+}
- AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
- cal->Analyse();
+void AliEveHOMERManager::PrintScreens() {
+ //See header file for documentation
- calROC = cal->GetCalRocT0(sectorTPC);
- calROC->SetName(Form("T0_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+ fEveManager->GetDefaultGLViewer()->SavePicture("3D.gif");
+ fRhoZViewer->GetGLViewer()->SavePicture("RhoZ.gif");
+ fRPhiViewer->GetGLViewer()->SavePicture("RPhi.gif");
- calROC = cal->GetCalRocQ(sectorTPC);
- calROC->SetName(Form("Q_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+}
- calROC = cal->GetCalRocRMS(sectorTPC);
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
+void AliEveHOMERManager::StartLoop() {
+ //See header file for documentation
+ //fTimer->SetCommand("NextEvent()", "AliEveHOMERManager", this);
+ SetEventLoopStarted(kTRUE);
+ fTimer->Start(3000);
+}
- calROC = cal->GetCalRocOutliers(sectorTPC);
- calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
- }
- */
- } // if ( ! objectName.CompareTo( desc->GetClassName() ) ) {
+void AliEveHOMERManager::StopLoop() {
+ //See header file for documentation
+ fTimer->Stop();
+ SetEventLoopStarted(kFALSE);
+}
- } // while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
+// void AliEveHOMERManager::TimeOut(Int_t sec) {
+
+// TTimer t(sec*1000, kFALSE);
- if ( dumpToFile ) {
+// cout << "Start timer for " << sec << " seconds" << endl;
- fTPCPre->DumpToFile("pedestals.root");
- cout << "DUMP" << endl;
- }
+// while (!t.CheckTimer(gSystem->Now()))
+// gSystem->Sleep(100); // 100 ms sleep
+// cout << "Timed out." << endl;
-}
+// }