<commit_before>#include "TEveManager.h"
#include "TEveScene.h"
#include "TEveProjectionManager.h"
#include "TEveBrowser.h"
#include "TGLViewer.h"
#include "TEveViewer.h"
#include "TEveEventManager.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 "AliHLTEveMultCorr.h"
#include "AliHLTEveAny.h"

#include "AliEveHLTEventManager.h"
#include "AliEveHOMERManager.h"
#include "AliEveEventBuffer.h"

#include "TList.h"
#include "TTimer.h"

#include "TThread.h"

ClassImp(AliEveHLTEventManager);

AliEveHLTEventManager::AliEveHLTEventManager() : 
  TEveElementList("Event Manager"),
  fGeoManager(NULL),
  fEveManager(NULL),
  fRPhiManager(NULL),
  fRhoZManager(NULL),
  fRPhiEventScene(NULL),
  fRhoZEventScene(NULL),
  fRhoZViewer(NULL),
  fRPhiViewer(NULL),
  fTimer(NULL),
  fPhosElement(NULL), 
  fEmcalElement(NULL), 
  fTPCElement(NULL),
  fHLTElement(NULL),
  fITSElement(NULL),
  fISPDElement(NULL),
  fISSDElement(NULL),
  fISDDElement(NULL),
  fTRDElement(NULL),
  fMuonElement(NULL),
  fMultCorrElement(NULL),
  fAnyElement(NULL),
  fEventLoopStarted(kFALSE),
  fCenterProjectionsAtPrimaryVertex(kFALSE),
  fShowBarrel(kTRUE),
  fShowMuon(kFALSE), 
  fRunNumber(-1),
  fEventId(-1)
{
  // 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()", "AliEveHLTEventManager", this, "NextEvent()" );

}
 
AliEveHLTEventManager::~AliEveHLTEventManager() {
  
  //DestroyElements();
  //DestroyDetectorElements();  
  
}


void AliEveHLTEventManager::DestroyDetectorElements(){
  //See header file for documentation

  if (fPhosElement)
    delete fPhosElement;
  fPhosElement = NULL;

  if(fEmcalElement)
    delete fEmcalElement;
  fEmcalElement = NULL;

  if(fTPCElement)
    delete fTPCElement;
  fTPCElement = NULL;

  if(fHLTElement)
    delete fHLTElement;
  fHLTElement = NULL;

  if(fITSElement)
    delete fITSElement;
  fITSElement = NULL;

  if(fISSDElement)
    delete fISSDElement;
  fISSDElement = NULL;

  if(fISDDElement)
    delete fISDDElement;
  fISDDElement = NULL;

  if(fISPDElement)
    delete fISPDElement;
  fISPDElement = NULL;

  if(fTRDElement)
    delete fTRDElement;
  fTRDElement = NULL;

  if(fMuonElement)
    delete fMuonElement;
  fMuonElement = NULL;

  if(fMultCorrElement)
    delete fMultCorrElement;
  fMultCorrElement = NULL;
 
  if(fAnyElement)
    delete fAnyElement;
  fAnyElement = NULL;
  

}

///_______________________________________________________________________________________
void AliEveHLTEventManager::ConnectEventBuffer() {
  GetEventBuffer()->ConnectToSource();
}


///___________________________________________________________________________________________
void AliEveHLTEventManager::StartBufferMonitor() { 
  AliEveEventBuffer * buffer = GetEventBuffer();
  buffer->StartBufferMonitor();
}

//______________________________________________________________________________________________
Int_t AliEveHLTEventManager::ProcessEvent(AliESDEvent * event) {

  //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)

  gEve->DisableRedraw();

  // -- Set EventID in Window Title  
  TString winTitle("Eve Main Window");
  SetRunNumber(event->GetRunNumber());
  SetEventId(GetEventBuffer()->GetEventId());
  winTitle += Form("-- Run Number: %d", GetRunNumber()); 
  winTitle += Form("-- Event ID : 0x%016lX ", GetEventId() );
  GetEveManager()->GetBrowser()->SetWindowName(winTitle);


  
  cout << "reset()"<<endl;
  
  cout << "process()"<<endl;
  if(!fHLTElement) {
    fHLTElement = new AliHLTEveHLT();
    fHLTElement->SetEventManager(this);
    gEve->AddElement(fHLTElement);<commit_msg>Set run number correctly<commit_after>#include "TEveManager.h"
#include "TEveScene.h"
#include "TEveProjectionManager.h"
#include "TEveBrowser.h"
#include "TGLViewer.h"
#include "TEveViewer.h"
#include "TEveEventManager.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 "AliHLTEveMultCorr.h"
#include "AliHLTEveAny.h"

#include "AliEveHLTEventManager.h"
#include "AliEveHOMERManager.h"
#include "AliEveEventBuffer.h"

#include "TList.h"
#include "TTimer.h"

#include "TThread.h"

ClassImp(AliEveHLTEventManager);

AliEveHLTEventManager::AliEveHLTEventManager() : 
  TEveElementList("Event Manager"),
  fGeoManager(NULL),
  fEveManager(NULL),
  fRPhiManager(NULL),
  fRhoZManager(NULL),
  fRPhiEventScene(NULL),
  fRhoZEventScene(NULL),
  fRhoZViewer(NULL),
  fRPhiViewer(NULL),
  fTimer(NULL),
  fPhosElement(NULL), 
  fEmcalElement(NULL), 
  fTPCElement(NULL),
  fHLTElement(NULL),
  fITSElement(NULL),
  fISPDElement(NULL),
  fISSDElement(NULL),
  fISDDElement(NULL),
  fTRDElement(NULL),
  fMuonElement(NULL),
  fMultCorrElement(NULL),
  fAnyElement(NULL),
  fEventLoopStarted(kFALSE),
  fCenterProjectionsAtPrimaryVertex(kFALSE),
  fShowBarrel(kTRUE),
  fShowMuon(kFALSE), 
  fRunNumber(666),
  fEventId(-1)
{
  // 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()", "AliEveHLTEventManager", this, "NextEvent()" );

}
 
AliEveHLTEventManager::~AliEveHLTEventManager() {
  
  //DestroyElements();
  //DestroyDetectorElements();  
  
}


void AliEveHLTEventManager::DestroyDetectorElements(){
  //See header file for documentation

  if (fPhosElement)
    delete fPhosElement;
  fPhosElement = NULL;

  if(fEmcalElement)
    delete fEmcalElement;
  fEmcalElement = NULL;

  if(fTPCElement)
    delete fTPCElement;
  fTPCElement = NULL;

  if(fHLTElement)
    delete fHLTElement;
  fHLTElement = NULL;

  if(fITSElement)
    delete fITSElement;
  fITSElement = NULL;

  if(fISSDElement)
    delete fISSDElement;
  fISSDElement = NULL;

  if(fISDDElement)
    delete fISDDElement;
  fISDDElement = NULL;

  if(fISPDElement)
    delete fISPDElement;
  fISPDElement = NULL;

  if(fTRDElement)
    delete fTRDElement;
  fTRDElement = NULL;

  if(fMuonElement)
    delete fMuonElement;
  fMuonElement = NULL;

  if(fMultCorrElement)
    delete fMultCorrElement;
  fMultCorrElement = NULL;
 
  if(fAnyElement)
    delete fAnyElement;
  fAnyElement = NULL;
  

}

///_______________________________________________________________________________________
void AliEveHLTEventManager::ConnectEventBuffer() {
  GetEventBuffer()->ConnectToSource();
}


///___________________________________________________________________________________________
void AliEveHLTEventManager::StartBufferMonitor() { 
  AliEveEventBuffer * buffer = GetEventBuffer();
  buffer->StartBufferMonitor();
}

//______________________________________________________________________________________________
Int_t AliEveHLTEventManager::ProcessEvent(AliESDEvent * event) {

  //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)

  gEve->DisableRedraw();

  event->GetStdContent();
  // -- Set EventID in Window Title  
  TString winTitle("Eve Main Window");
  SetRunNumber(event->GetRunNumber());
  SetEventId(GetEventBuffer()->GetEventId());
  winTitle += Form("-- Run Number: %d", GetRunNumber()); 
  winTitle += Form("-- Event ID : 0x%016lX ", GetEventId() );
  GetEveManager()->GetBrowser()->SetWindowName(winTitle);


  
  cout << "reset()"<<endl;
  
  cout << "process()"<<endl;
  if(!fHLTElement) {
    fHLTElement = new AliHLTEveHLT();
    fHLTElement->SetEventManager(this);
    gEve->AddElement(fHLTElement);
{'fraction_non_alphanumeric': 0.11977233358079684, 'fraction_numerical': 0.0017322444939371442, 'mean_word_length': 5.174942704354469, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4023571', 'n_tokens_mistral': 2916, 'n_tokens_neox': 2823, 'n_words': 497}