Adding method to create chain from list of files (for PROOF) + correction in correspo...
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:16:02 +0000 (17:16 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 May 2006 17:16:02 +0000 (17:16 +0000)
Adapting include path dir to PWG0

PWG0/CreateESDChain.C
PWG0/PWG0baseLinkDef.h
PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx
PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx
PWG0/dNdEta/AlidNdEtaAnalysisSelector.h
PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx
PWG0/dNdEta/AlidNdEtaCorrectionSelector.h
PWG0/dNdEta/makeCorrection2.C
PWG0/dNdEta/testAnalysis2.C
PWG0/libPWG0base.pkg

index d572649afc57709f6a41cc952f651c4b37376de8..0524dc1b39fdd6f5f47f958d56e75899b19faf4e 100644 (file)
@@ -1,4 +1,4 @@
-TChain* CreateESDChain(const char* aDataDir, Int_t aRuns = 20, Bool_t aAddHeader = kTRUE)
+TChain* CreateESDChainFromDir(const char* aDataDir, Int_t aRuns = 20, Bool_t aAddHeader = kTRUE)
 {
   if (!aDataDir)
     return 0;
@@ -41,3 +41,53 @@ TChain* CreateESDChain(const char* aDataDir, Int_t aRuns = 20, Bool_t aAddHeader
 
   return chain;
 }
+
+TChain* CreateESDChainFromList(const char* listFile, Int_t aRuns = 20, Bool_t aAddHeader = kTRUE)
+{
+  if (!listFile)
+    return 0;
+
+  TChain* chain = new TChain("esdTree");
+  TChain* chaingAlice = 0;
+
+  if (aAddHeader != kFALSE)
+    chaingAlice = new TChain("TE");
+
+  // Open the input stream
+  ifstream in;
+  in.open(listFile);
+
+  Int_t count = 0;
+
+  // Read the input list of files and add them to the chain
+  TString esdfile;
+  while(in.good()) {
+    in >> esdfile;
+    if (!esdfile.Contains("root")) continue; // protection
+
+    if (count++ == aRuns)
+      break;
+
+      // add esd file
+    chain->Add(esdfile);
+
+      // add header
+    if (aAddHeader != kFALSE)
+    {
+      esdfile.ReplaceAll("AliESDs", "galice");
+      chaingAlice->Add(esdfile + "/TE");
+    }
+  }
+
+  in.close();
+
+  chain->Lookup();
+
+  if (aAddHeader != kFALSE)
+  {
+    chaingAlice->Lookup();
+    chain->AddFriend(chaingAlice);
+  }
+
+  return chain;
+}
index 15412de1893a303b279c57c7a43664579da7f094..dec411b15e27a8bf6a5411df14d51c9b739db12f 100644 (file)
@@ -7,8 +7,9 @@
 #pragma link off all globals;
 #pragma link off all classes;
 #pragma link off all functions;
+
 #pragma link C++ class AliSelector+;
+#pragma link C++ class AliSelectorRL+;
 
 #pragma link C++ class AlidNdEtaCorrectionSelector+;
 #pragma link C++ class AlidNdEtaAnalysisSelector+;
index f62fb3f8405eaae5c7e8fd268a44d8c2f88ab830..f2241a696ed081db549c1be21f5575466883b4e3 100644 (file)
@@ -9,10 +9,7 @@
 
 #include <AliLog.h>
 #include <AliGenEventHeader.h>
-#include <AliTracker.h>
 
-#include "../esdTrackCuts/AliESDtrackCuts.h"
-#include "dNdEtaCorrection.h"
 #include "dNdEtaAnalysis.h"
 
 ClassImp(AlidNdEtaAnalysisMCSelector)
index 6c4cf5e34c618fc5cc3835e41284bf84dfc83f6c..75076d08fa0ca8f39c811db52affa0045cd488ee 100644 (file)
@@ -7,9 +7,8 @@
 
 #include <AliLog.h>
 #include <AliGenEventHeader.h>
-#include <AliTracker.h>
 
-#include "../esdTrackCuts/AliESDtrackCuts.h"
+#include "esdTrackCuts/AliESDtrackCuts.h"
 #include "dNdEtaCorrection.h"
 #include "dNdEtaAnalysis.h"
 
index 7c527b89e22691f658b19ffa254621bef498eed2..52d3afd173e551b2dab93a8d16b79edc98b85e18 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ALIDNDETAANALYSISSELECTOR_H
 #define ALIDNDETAANALYSISSELECTOR_H
 
-#include "../AliSelector.h"
+#include "AliSelector.h"
 
 class AliESDtrackCuts;
 class dNdEtaCorrection;
index f4dce81850659d0b73b3165b5f886d3ad0f3ba11..373f4ffa05f923b275f07ea2ef978b819ea670fe 100644 (file)
@@ -10,7 +10,7 @@
 #include <AliGenEventHeader.h>
 #include <AliTracker.h>
 
-#include "../esdTrackCuts/AliESDtrackCuts.h"
+#include "esdTrackCuts/AliESDtrackCuts.h"
 #include "dNdEtaCorrection.h"
 
 ClassImp(AlidNdEtaCorrectionSelector)
index 3eba78c7b1e2f294f27dadd7ed4bbc4b04023cab..11f608650811f695afc462fafa2847ffd16f96f9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ALIDNDETACORRECTIONSELECTOR_H
 #define ALIDNDETACORRECTIONSELECTOR_H
 
-#include "../AliSelector.h"
+#include "AliSelector.h"
 
 class AliESDtrackCuts;
 class dNdEtaCorrection;
index 997c6b2d4b39103c679991f2d4687c4fc5448355..9fdc840834bc3b0b77a306b389ad61e707bdfe37 100644 (file)
@@ -10,8 +10,9 @@
 void makeCorrection2(Char_t* dataDir, Int_t nRuns=20)
 {
   gSystem->Load("libPWG0base");
+  gSystem->SetIncludePath("-I$ALICE_ROOT/PWG0");
 
-  TChain* chain = CreateESDChain(dataDir, nRuns);
+  TChain* chain = CreateESDChainFromDir(dataDir, nRuns);
 
   fEsdTrackCuts = new AliESDtrackCuts();
   fEsdTrackCuts->DefineHistograms(1);
index bf504e0dc24468cf0407e0f808f526a42aeb7b60..a01a379dd2ca627303b5ef49a5fa9c4079af97b6 100644 (file)
@@ -11,8 +11,9 @@
 testAnalysis2(Char_t* dataDir, Int_t nRuns=20, Bool_t aMC = kFALSE)
 {
   gSystem->Load("libPWG0base");
+  gSystem->SetIncludePath("-I$ALICE_ROOT/PWG0");
 
-  TChain* chain = CreateESDChain(dataDir, nRuns);
+  TChain* chain = CreateESDChainFromDir(dataDir, nRuns);
 
   // ########################################################
   // selection of esd tracks
@@ -37,7 +38,7 @@ testAnalysis2(Char_t* dataDir, Int_t nRuns=20, Bool_t aMC = kFALSE)
 
     chain->GetUserInfo()->Add(dNdEtaCorrection);
   }
-  
+
   TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisSelector" : "AlidNdEtaAnalysisMCSelector");
 
   AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
index ac1192cd0e4e05cce5ed8a60ea0b8d0ffe95db5e..0bc6f7e8de3eb64ca45595223d86e92b81163293 100644 (file)
@@ -1,4 +1,5 @@
 HDRS = AliSelector.h \
+       AliSelectorRL.h \
       dNdEta/AlidNdEtaCorrectionSelector.h \
       dNdEta/AlidNdEtaAnalysisSelector.h \
       dNdEta/AlidNdEtaAnalysisMCSelector.h \
@@ -9,6 +10,10 @@ HDRS = AliSelector.h \
 
 SRCS = $(HDRS:.h=.cxx)
 
+#PARBLACKLIST = dNdEta/AlidNdEtaCorrectionSelector.h \
+#      dNdEta/AlidNdEtaAnalysisSelector.h \
+#      dNdEta/AlidNdEtaAnalysisMCSelector.h
+
 DHDR= PWG0baseLinkDef.h
 
 EINCLUDE=