]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1. Correction for the previous commit - in order to visualise the esd data, the call...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 May 2008 21:06:31 +0000 (21:06 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 May 2008 21:06:31 +0000 (21:06 +0000)
EVE/macros/alieve_online.C
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h

index 0670cc35f56a84db0f093d6098f8d4ae01025070..ce4d9038228867aaf346c0d3c796d1ea3366f5bc 100644 (file)
@@ -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");
 }
index 9e3bfc5665f00275c04dab59a56b768ff4777b87..c7cdb2c1b61b5b55502c12b742a8996223c646d4 100644 (file)
@@ -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();
+}
index f3f71d6265459895d54014ba254731cd0fcdb7a6..9b2e33dd397aabe734195124594df51c372ba1c6 100644 (file)
@@ -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
 };