From: cvetan Date: Fri, 16 May 2008 21:06:31 +0000 (+0000) Subject: 1. Correction for the previous commit - in order to visualise the esd data, the call... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=14dd053ca08f23c008ce37f3637ed63fb398e36a 1. Correction for the previous commit - in order to visualise the esd data, the call to AliEVE should be placed before the reset of the esd object i.e. inside RunEvent(). 2. The calls to AliEVE are put in separate methods. 3. esd_tracks.C macro is added to alieve_online.C one. --- diff --git a/EVE/macros/alieve_online.C b/EVE/macros/alieve_online.C index 0670cc35f56..ce4d9038228 100644 --- a/EVE/macros/alieve_online.C +++ b/EVE/macros/alieve_online.C @@ -12,4 +12,5 @@ void alieve_online() gROOT->Macro("tpc_raw.C"); gROOT->Macro("tpc_clusters.C"); gROOT->Macro("acorde_raw.C"); + gROOT->Macro("esd_tracks.C"); } diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 9e3bfc5665f..c7cdb2c1b61 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -268,7 +268,8 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, ftreeOld(NULL), fhlttreeOld(NULL), ftVertexer(NULL), - fIsNewRunLoader(kFALSE) + fIsNewRunLoader(kFALSE), + fRunAliEVE(kFALSE) { // create reconstruction object with default parameters @@ -355,7 +356,8 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : ftreeOld(NULL), fhlttreeOld(NULL), ftVertexer(NULL), - fIsNewRunLoader(rec.fIsNewRunLoader) + fIsNewRunLoader(rec.fIsNewRunLoader), + fRunAliEVE(kFALSE) { // copy constructor @@ -643,32 +645,12 @@ Bool_t AliReconstruction::Run(const char* input) if (!InitRun(input)) return kFALSE; - Bool_t runAliEVE = kFALSE; - if (strcmp(gProgName,"alieve") == 0) runAliEVE = kTRUE; - - if (runAliEVE) { - TString macroStr; - macroStr.Form("%s/EVE/macros/alieve_online.C",gSystem->ExpandPathName("$ALICE_ROOT")); - AliInfo(Form("Loading AliEVE macro: %s",macroStr.Data())); - if (gROOT->LoadMacro(macroStr.Data()) != 0) - runAliEVE = kFALSE; - else - gROOT->ProcessLine("if (!gAliEveEvent) {gAliEveEvent = new AliEveEventManager();gAliEveEvent->SetAutoLoad(kTRUE);gAliEveEvent->AddNewEventCommand(\"alieve_online()\");gEve->AddEvent(gAliEveEvent);};"); - } - //******* The loop over events Int_t iEvent = 0; while ((iEvent < fRunLoader->GetNumberOfEvents()) || (fRawReader && fRawReader->NextEvent())) { if (!RunEvent(iEvent)) return kFALSE; iEvent++; - - if (runAliEVE) { - AliInfo("Running AliEVE..."); - gROOT->ProcessLine(Form("gAliEveEvent->SetEvent((AliRunLoader*)%p,(AliRawReader*)%p,(AliESDEvent*)%p);",fRunLoader,fRawReader,fesd)); - gROOT->ProcessLine("gAliEveEvent->StartStopAutoLoadTimer();"); - gSystem->Run(); - } } if (!FinishRun()) return kFALSE; @@ -894,6 +876,9 @@ Bool_t AliReconstruction::InitRun(const char* input) if(fStopOnError) {CleanUp(ffile, ffileOld); return kFALSE;} } + if (strcmp(gProgName,"alieve") == 0) + fRunAliEVE = InitAliEVE(); + return kTRUE; } @@ -1179,6 +1164,9 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent) // write HLT ESD fhlttree->Fill(); + // call AliEVE + if (fRunAliEVE) RunAliEVE(); + if (fCheckPointLevel > 0) WriteESD(fesd, "final"); fesd->Reset(); fhltesd->Reset(); @@ -2604,3 +2592,39 @@ Bool_t AliReconstruction::InitPlaneEff() { AliWarning(Form("Implementation of this method not yet done !! Method return kTRUE")); return kTRUE; } + +//_____________________________________________________________________________ +Bool_t AliReconstruction::InitAliEVE() +{ + // This method should be called only in case + // AliReconstruction is run + // within the alieve environment. + // It will initialize AliEVE in a way + // so that it can visualize event processed + // by AliReconstruction. + // The return flag shows whenever the + // AliEVE initialization was successful or not. + + TString macroStr; + macroStr.Form("%s/EVE/macros/alieve_online.C",gSystem->ExpandPathName("$ALICE_ROOT")); + AliInfo(Form("Loading AliEVE macro: %s",macroStr.Data())); + if (gROOT->LoadMacro(macroStr.Data()) != 0) return kFALSE; + + gROOT->ProcessLine("if (!gAliEveEvent) {gAliEveEvent = new AliEveEventManager();gAliEveEvent->SetAutoLoad(kTRUE);gAliEveEvent->AddNewEventCommand(\"alieve_online()\");gEve->AddEvent(gAliEveEvent);};"); + + return kTRUE; +} + +//_____________________________________________________________________________ +void AliReconstruction::RunAliEVE() +{ + // Runs AliEVE visualisation of + // the current event. + // Should be executed only after + // successful initialization of AliEVE. + + AliInfo("Running AliEVE..."); + gROOT->ProcessLine(Form("gAliEveEvent->SetEvent((AliRunLoader*)%p,(AliRawReader*)%p,(AliESDEvent*)%p);",fRunLoader,fRawReader,fesd)); + gROOT->ProcessLine("gAliEveEvent->StartStopAutoLoadTimer();"); + gSystem->Run(); +} diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index f3f71d62654..9b2e33dd397 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -169,6 +169,9 @@ private: Bool_t FinishPlaneEff(); //ultimate tasks related to Plane Eff. evaluation Bool_t InitPlaneEff(); // initialize what is needed for Plane Eff. evaluation + Bool_t InitAliEVE(); + void RunAliEVE(); + //*** Global reconstruction flags ******************* Bool_t fUniformField; // uniform field tracking flag Bool_t fRunVertexFinder; // run the vertex finder @@ -253,6 +256,7 @@ private: TTree* fhlttreeOld; //! Pointer to the previous HLT ESD tree AliVertexerTracks* ftVertexer; //! Pointer to the vertexer based on ESD tracks Bool_t fIsNewRunLoader; // galice.root created from scratch (real raw data case) + Bool_t fRunAliEVE; // Run AliEVE or not ClassDef(AliReconstruction, 23) // class for running the reconstruction };