]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1) Added "Makefile support": LinkDef + pkg file, made header files compliant
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 May 2006 09:14:47 +0000 (09:14 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 May 2006 09:14:47 +0000 (09:14 +0000)
2) Added AliSelector base class which loads esd and header branch, functions to retrieve Kinematics + RunLoader (this may cause trouble when run with PROOF, discussion on this needed)
3) Added Selector which creates dNdEtaEfficiency map (in dNdEtaCorrection)

PWG0/AliSelector.cxx [new file with mode: 0644]
PWG0/AliSelector.h [new file with mode: 0644]
PWG0/CreateESDChain.C [new file with mode: 0644]
PWG0/PWG0baseLinkDef.h [new file with mode: 0644]
PWG0/dNdEta/AlidNdEtaEffSelector.cxx [new file with mode: 0644]
PWG0/dNdEta/AlidNdEtaEffSelector.h [new file with mode: 0644]
PWG0/dNdEta/dNdEtaAnalysis.h
PWG0/dNdEta/dNdEtaCorrection.h
PWG0/dNdEta/makeCorrection2.C [new file with mode: 0644]
PWG0/esdTrackCuts/ESDtrackQualityCuts.h
PWG0/libPWG0base.pkg [new file with mode: 0644]

diff --git a/PWG0/AliSelector.cxx b/PWG0/AliSelector.cxx
new file mode 100644 (file)
index 0000000..508614a
--- /dev/null
@@ -0,0 +1,291 @@
+// The class definition in esdV0.h has been generated automatically
+// by the ROOT utility TTree::MakeSelector(). This class is derived
+// from the ROOT class TSelector. For more information on the TSelector
+// framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual.
+
+// The following methods are defined in this file:
+//    Begin():        called everytime a loop on the tree starts,
+//                    a convenient place to create your histograms.
+//    SlaveBegin():   called after Begin(), when on PROOF called only on the
+//                    slave servers.
+//    Process():      called for each event, in this function you decide what
+//                    to read and fill your histograms.
+//    SlaveTerminate: called at the end of the loop on the tree, when on PROOF
+//                    called only on the slave servers.
+//    Terminate():    called at the end of the loop on the tree,
+//                    a convenient place to draw/fit your histograms.
+//
+// To use this file, try the following session on your Tree T:
+//
+// Root > T->Process("AliSelector.C")
+// Root > T->Process("AliSelector.C","some options")
+// Root > T->Process("AliSelector.C+")
+//
+
+#include "AliSelector.h"
+#include <TStyle.h>
+#include <TSystem.h>
+#include <TCanvas.h>
+#include <TRegexp.h>
+
+#include <TFriendElement.h>
+
+#include <iostream>
+using namespace std;
+
+ClassImp(AliSelector)
+
+AliSelector::AliSelector(TTree *) :
+  TSelector(),
+  fChain(0),
+  fESD(0),
+  fHeader(0),
+  fRunLoader(0),
+  fKineFile(0)
+{
+  // Constructor. Initialization of pointers
+}
+
+AliSelector::~AliSelector()
+{
+  // Remove all pointers
+
+  // histograms are in the output list and deleted when the output
+  // list is deleted by the TSelector dtor
+}
+
+void AliSelector::Begin(TTree *)
+{
+  // The Begin() function is called at the start of the query.
+  // When running with PROOF Begin() is only called on the client.
+  // The tree argument is deprecated (on PROOF 0 is passed).
+
+  //TString option = GetOption();
+}
+
+void AliSelector::SlaveBegin(TTree * tree)
+{
+  // The SlaveBegin() function is called after the Begin() function.
+  // When running with PROOF SlaveBegin() is called on each slave server.
+  // The tree argument is deprecated (on PROOF 0 is passed).
+
+  Init(tree);
+
+  printf("=======SLAVEBEGIN========\n");
+  gSystem->Exec("hostname");
+  gSystem->Exec("date");
+  TFile *f = fChain->GetCurrentFile();
+  printf("%s\n",f->GetName());
+
+  TString option = GetOption();
+}
+
+void AliSelector::Init(TTree *tree)
+{
+  // The Init() function is called when the selector needs to initialize
+  // a new tree or chain. Typically here the branch addresses of the tree
+  // will be set. It is normaly not necessary to make changes to the
+  // generated code, but the routine can be extended by the user if needed.
+  // Init() will be called many times when running with PROOF.
+
+  printf("=========Init==========\n");
+
+  // Set branch addresses
+  if (tree == 0)
+  {
+    printf("ERROR: tree argument is 0.\n");
+    return;
+  }
+
+  fChain = dynamic_cast<TChain*> (tree);
+  if (fChain == 0)
+  {
+    printf("ERROR: tree argument could not be casted to TChain.\n");
+    return;
+  }
+
+  fChain->SetBranchAddress("ESD", &fESD);
+  if (fESD != 0)
+    printf("INFO: Found ESD branch in chain.\n");
+
+  fChain->SetBranchAddress("Header", &fHeader);
+  if (fHeader != 0)
+    printf("INFO: Found event header branch in chain.\n");
+
+}
+
+Bool_t AliSelector::Notify()
+{
+  // The Notify() function is called when a new file is opened. This
+  // can be either for a new TTree in a TChain or when when a new TTree
+  // is started when using PROOF. Typically here the branch pointers
+  // will be retrieved. It is normaly not necessary to make changes
+  // to the generated code, but the routine can be extended by the
+  // user if needed.
+
+  printf("=========NOTIFY==========\n");
+  gSystem->Exec("hostname");
+  gSystem->Exec("date");
+  TFile *f = fChain->GetCurrentFile();
+  TString fileName(f->GetName());
+  printf("%s\n",fileName.Data());
+
+  DeleteKinematicsFile();
+  DeleteRunLoader();
+
+  return kTRUE;
+}
+
+Bool_t AliSelector::Process(Long64_t entry)
+{
+  // The Process() function is called for each entry in the tree (or possibly
+  // keyed object in the case of PROOF) to be processed. The entry argument
+  // specifies which entry in the currently loaded tree is to be processed.
+  // It can be passed to either TTree::GetEntry() or TBranch::GetEntry()
+  // to read either all or the required parts of the data. When processing
+  // keyed objects with PROOF, the object is already loaded and is available
+  // via the fObject pointer.
+  //
+  // This function should contain the "body" of the analysis. It can contain
+  // simple or elaborate selection criteria, run algorithms on the data
+  // of the event and typically fill histograms.
+
+  // WARNING when a selector is used with a TChain, you must use
+  //  the pointer to the current TTree to call GetEntry(entry).
+  //  The entry is always the local entry number in the current tree.
+  //  Assuming that fChain is the pointer to the TChain being processed,
+  //  use fChain->GetTree()->GetEntry(entry).
+
+  printf("=========PROCESS========== Entry %lld\n", entry);
+
+  if (!fChain)
+  {
+    printf("ERROR: fChain is 0.\n");
+    return kFALSE;
+  }
+
+  fChain->GetTree()->GetEntry(entry);
+
+  if (fESD)
+    printf("ESD: We have %d tracks.\n", fESD->GetNumberOfTracks());
+
+  if (fHeader)
+    printf("Header: We have %d primaries.\n", fHeader->GetNprimary());
+
+  TTree* kinematics = GetKinematics();
+  if (kinematics)
+    printf("Kinematics from folder: We have %lld particles.\n", kinematics->GetEntries());
+
+  printf("\n");
+
+  return kTRUE;
+}
+
+void AliSelector::SlaveTerminate()
+{
+  // The SlaveTerminate() function is called after all entries or objects
+  // have been processed. When running with PROOF SlaveTerminate() is called
+  // on each slave server.
+
+  DeleteKinematicsFile();
+  DeleteRunLoader();
+}
+
+void AliSelector::Terminate()
+{
+  // The Terminate() function is the last function to be called during
+  // a query. It always runs on the client, it can be used to present
+  // the results graphically or save the results to file.
+
+  printf("=========TERMINATE==========\n");
+}
+
+TTree* AliSelector::GetKinematics()
+{
+  if (!fKineFile)
+  {
+    if (!fChain->GetCurrentFile())
+      return 0;
+
+    TString fileName(fChain->GetCurrentFile()->GetName());
+    fileName.ReplaceAll("AliESDs", "Kinematics");
+
+    fKineFile = TFile::Open(fileName);
+    if (!fKineFile)
+      return 0;
+  }
+
+  return dynamic_cast<TTree*> (fKineFile->Get(Form("Event%d/TreeK", fChain->GetTree()->GetReadEntry())));
+
+  /* this is if we want to get it from a TChain
+
+  define it in the header:
+
+    TChain*          fKineChain;
+
+  this creates the chain:
+
+    TChain* chainKine = new TChain("TreeK");
+    for (Int_t i=0; i<20; ++i)
+      chainKine->Add(Form("test/Kinematics.root/Event%d/TreeK", i));
+    for (Int_t i=0; i<20; ++i)
+      chainKine->Add(Form("test2/Kinematics.root/Event%d/TreeK", i));
+
+    <mainChain>->GetUserInfo()->Add(chainKine);
+
+  we retrieve it in init:
+
+    fKineChain = dynamic_cast<TChain*> (fChain->GetUserInfo()->FindObject("TreeK"));
+
+  and use it in process:
+
+    if (fKineChain)
+    {
+      Long64_t entryK = fKineChain->GetTreeOffset()[fChain->GetChainEntryNumber(entry)];
+      cout << "Entry in fKineChain: " << entryK << endl;
+      fKineChain->LoadTree(entryK);
+      TTree* kineTree = fKineChain->GetTree();
+
+      printf("Kinematics from tree friend: We have %lld particles.\n", kineTree->GetEntries());
+    }
+  */
+}
+
+void AliSelector::DeleteKinematicsFile()
+{
+  if (fKineFile)
+  {
+    fKineFile->Close();
+    delete fKineFile;
+    fKineFile = 0;
+  }
+}
+
+AliRun* AliSelector::GetAliRun()
+{
+  if (!fRunLoader)
+  {
+    if (!fChain->GetCurrentFile())
+      return 0;
+
+    TString fileName(fChain->GetCurrentFile()->GetName());
+    fileName.ReplaceAll("AliESDs", "galice");
+
+    fRunLoader = AliRunLoader::Open(fileName);
+    if (!fRunLoader)
+      return 0;
+
+    fRunLoader->LoadgAlice();
+  }
+
+  return fRunLoader->GetAliRun();
+}
+
+void AliSelector::DeleteRunLoader()
+{
+  if (fRunLoader)
+  {
+    fRunLoader->Delete();
+    fRunLoader = 0;
+  }
+}
diff --git a/PWG0/AliSelector.h b/PWG0/AliSelector.h
new file mode 100644 (file)
index 0000000..97b2f5d
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef ALISELECTOR_H
+#define ALISELECTOR_H
+
+#include <TFile.h>
+#include <TSelector.h>
+#include <TChain.h>
+
+#include <AliESD.h>
+#include <AliHeader.h>
+#include <AliRun.h>
+#include <AliRunLoader.h>
+
+class AliSelector : public TSelector {
+  public:
+    AliSelector(TTree *tree=0);
+    virtual ~AliSelector();
+
+    virtual Int_t   Version() const {return 1;}
+    virtual void    Begin(TTree *tree);
+    virtual void    SlaveBegin(TTree *tree);
+    virtual void    Init(TTree *tree);
+    virtual Bool_t  Notify();
+    virtual Bool_t  Process(Long64_t entry);
+    virtual void    SlaveTerminate();
+    virtual void    Terminate();
+
+ protected:
+    TTree*  GetKinematics();
+    AliRun* GetAliRun();
+
+    TChain          *fChain;   //! pointer to the analyzed TTree or TChain
+
+    AliESD*          fESD;
+    AliHeader*       fHeader;
+
+    AliRunLoader* fRunLoader;
+
+ private:
+  void DeleteKinematicsFile();
+  void DeleteRunLoader();
+
+  TFile*           fKineFile;
+
+  ClassDef(AliSelector,0);
+};
+
+#endif
diff --git a/PWG0/CreateESDChain.C b/PWG0/CreateESDChain.C
new file mode 100644 (file)
index 0000000..297da8f
--- /dev/null
@@ -0,0 +1,38 @@
+TChain* CreateESDChain(const char* aDataDir, Bool_t aAddHeader = kTRUE)
+{
+  if (!aDataDir)
+    return 0;
+
+  TChain* chain = new TChain("esdTree");
+  TChain* chaingAlice = 0;
+
+  if (aAddHeader != kFALSE)
+    chaingAlice = new TChain("TE");
+
+  TString execDir(gSystem->pwd());
+  TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
+  TList* dirList            = baseDir->GetListOfFiles();
+  Int_t nDirs               = dirList->GetEntries();
+  gSystem->cd(execDir);
+
+  for (Int_t iDir=0; iDir<nDirs; ++iDir)
+  {
+    TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
+    if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
+      continue;
+
+    TString presentDirName(aDataDir);
+    presentDirName += "/";
+    presentDirName += presentDir->GetName();
+
+    chain->Add(presentDirName + "/AliESDs.root/esdTree");
+
+    if (aAddHeader != kFALSE)
+      chaingAlice->Add(presentDirName + "/galice.root/TE");
+  }
+
+  if (aAddHeader != kFALSE)
+    chain->AddFriend(chaingAlice);
+
+  return chain;
+}
diff --git a/PWG0/PWG0baseLinkDef.h b/PWG0/PWG0baseLinkDef.h
new file mode 100644 (file)
index 0000000..2b696ee
--- /dev/null
@@ -0,0 +1,19 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class AliSelector+;
+
+#pragma link C++ class AlidNdEtaEffSelector+;
+#pragma link C++ class dNdEtaAnalysis+;
+#pragma link C++ class dNdEtaCorrection+;
+
+#pragma link C++ class ESDtrackQualityCuts+;
+
+#endif
\ No newline at end of file
diff --git a/PWG0/dNdEta/AlidNdEtaEffSelector.cxx b/PWG0/dNdEta/AlidNdEtaEffSelector.cxx
new file mode 100644 (file)
index 0000000..ec71ece
--- /dev/null
@@ -0,0 +1,270 @@
+#include "AlidNdEtaEffSelector.h"
+
+#include <TStyle.h>
+#include <TSystem.h>
+#include <TCanvas.h>
+#include <TParticle.h>
+#include <TParticlePDG.h>
+
+#include <AliLog.h>
+#include <../PYTHIA6/AliGenPythiaEventHeader.h>
+#include <../TPC/AliTPCtrack.h>
+#include <AliTracker.h>
+
+#include <iostream>
+using namespace std;
+
+ClassImp(AlidNdEtaEffSelector)
+
+AlidNdEtaEffSelector::AlidNdEtaEffSelector(TTree *) :
+  AliSelector(),
+  fEsdTrackCuts(0),
+  fdNdEtaCorrection(0)
+{
+  // Constructor. Initialization of pointers
+}
+
+AlidNdEtaEffSelector::~AlidNdEtaEffSelector()
+{
+  // Remove all pointers
+
+  // histograms are in the output list and deleted when the output
+  // list is deleted by the TSelector dtor
+}
+
+void AlidNdEtaEffSelector::Begin(TTree * tree)
+{
+  // The Begin() function is called at the start of the query.
+  // When running with PROOF Begin() is only called on the client.
+  // The tree argument is deprecated (on PROOF 0 is passed).
+
+  AliSelector::Begin(tree);
+
+  fdNdEtaCorrection = new dNdEtaCorrection();
+}
+
+void AlidNdEtaEffSelector::SlaveBegin(TTree * tree)
+{
+  // The SlaveBegin() function is called after the Begin() function.
+  // When running with PROOF SlaveBegin() is called on each slave server.
+  // The tree argument is deprecated (on PROOF 0 is passed).
+
+  AliSelector::SlaveBegin(tree);
+
+  fEsdTrackCuts = new ESDtrackQualityCuts();
+  fEsdTrackCuts->DefineHistograms(1);
+
+  fEsdTrackCuts->SetMinNClustersTPC(50);
+  fEsdTrackCuts->SetMaxChi2PerClusterTPC(3.5);
+  fEsdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
+  fEsdTrackCuts->SetRequireTPCRefit(kTRUE);
+
+  fEsdTrackCuts->SetMinNsigmaToVertex(3);
+  fEsdTrackCuts->SetAcceptKingDaughters(kFALSE);
+
+  AliLog::SetClassDebugLevel("ESDtrackQualityCuts",1);
+}
+
+Bool_t AlidNdEtaEffSelector::Notify()
+{
+  // The Notify() function is called when a new file is opened. This
+  // can be either for a new TTree in a TChain or when when a new TTree
+  // is started when using PROOF. Typically here the branch pointers
+  // will be retrieved. It is normaly not necessary to make changes
+  // to the generated code, but the routine can be extended by the
+  // user if needed.
+
+  if (AliSelector::Notify() == kFALSE)
+    return kFALSE;
+
+  // ########################################################
+  // Magnetic field
+  AliTracker::SetFieldMap(GetAliRun()->Field(), kTRUE); // kTRUE means uniform magnetic field
+
+  return kTRUE;
+}
+
+Bool_t AlidNdEtaEffSelector::IsPrimary(const TParticle* aParticle, Int_t aTotalPrimaries)
+{
+  // if the particle has a daughter primary, we do not want to count it
+  if (aParticle->GetFirstDaughter() != -1 && aParticle->GetFirstDaughter() < aTotalPrimaries)
+    return kFALSE;
+
+  Int_t pdgCode = TMath::Abs(aParticle->GetPdgCode());
+
+  // skip quarks and gluon
+  if (pdgCode > 10 && pdgCode != 21)
+    return kTRUE;
+
+  return kFALSE;
+}
+
+Bool_t AlidNdEtaEffSelector::Process(Long64_t entry)
+{
+  // The Process() function is called for each entry in the tree (or possibly
+  // keyed object in the case of PROOF) to be processed. The entry argument
+  // specifies which entry in the currently loaded tree is to be processed.
+  // It can be passed to either TTree::GetEntry() or TBranch::GetEntry()
+  // to read either all or the required parts of the data. When processing
+  // keyed objects with PROOF, the object is already loaded and is available
+  // via the fObject pointer.
+  //
+  // This function should contain the "body" of the analysis. It can contain
+  // simple or elaborate selection criteria, run algorithms on the data
+  // of the event and typically fill histograms.
+
+  // WARNING when a selector is used with a TChain, you must use
+  //  the pointer to the current TTree to call GetEntry(entry).
+  //  The entry is always the local entry number in the current tree.
+  //  Assuming that fChain is the pointer to the TChain being processed,
+  //  use fChain->GetTree()->GetEntry(entry).
+
+  if (AliSelector::Process(entry) == kFALSE)
+    return kFALSE;
+
+  if (!fESD || !fHeader)
+    return kFALSE;
+
+  // ########################################################
+  // get the EDS vertex
+  const AliESDVertex* vtxESD = fESD->GetVertex();
+
+  Double_t vtx[3];
+  Double_t vtx_res[3];
+  vtxESD->GetXYZ(vtx);
+
+  vtx_res[0] = vtxESD->GetXRes();
+  vtx_res[1] = vtxESD->GetYRes();
+  vtx_res[2] = vtxESD->GetZRes();
+
+  // the vertex should be reconstructed
+  if (strcmp(vtxESD->GetName(),"default")==0)
+    return kTRUE;
+
+  // the resolution should be reasonable???
+  if (vtx_res[2]==0 || vtx_res[2]>0.1)
+    return kTRUE;
+
+  // ########################################################
+  // get the MC vertex
+  AliGenPythiaEventHeader* genHeader = (AliGenPythiaEventHeader*) fHeader->GenEventHeader();
+
+  TArrayF vtxMC(3);
+  genHeader->PrimaryVertex(vtxMC);
+  vtx[0] = vtxMC[0];
+  vtx[1] = vtxMC[1];
+  vtx[2] = vtxMC[2];
+
+  // ########################################################
+  // loop over mc particles
+  TTree* particleTree = GetKinematics();
+  TParticle* particle = 0;
+  particleTree->SetBranchAddress("Particles", &particle);
+
+  Int_t nPrim  = fHeader->GetNprimary();
+  Int_t nTotal = fHeader->GetNtrack();
+
+  for (Int_t i_mc = nTotal - nPrim; i_mc < nTotal; ++i_mc)
+  {
+    particleTree->GetEntry(i_mc);
+
+    if (!particle)
+      continue;
+
+    if (strcmp(particle->GetName(),"XXX") == 0)
+    {
+      printf("WARNING: There is a particle named XXX (%d).\n", i_mc);
+      continue;
+    }
+
+    TParticlePDG* pdgPart = particle->GetPDG();
+
+    if (strcmp(pdgPart->ParticleClass(),"Unknown") == 0)
+    {
+      printf("WARNING: There is a particle with an unknown particle class (%d pdg code %d).\n", i_mc, particle->GetPdgCode());
+      continue;
+    }
+
+    if (IsPrimary(particle, nPrim) == kFALSE)
+      continue;
+
+    if (pdgPart->Charge() == 0)
+      continue;
+
+    fdNdEtaCorrection->FillGene(vtx[2], particle->Eta());
+
+  }// end of mc particle
+
+  // ########################################################
+  // loop over esd tracks
+  Int_t nTracks = fESD->GetNumberOfTracks();
+  for (Int_t t=0; t<nTracks; t++)
+  {
+    AliESDtrack* esdTrack = fESD->GetTrack(t);
+
+    // cut the esd track?
+    if (!fEsdTrackCuts->AcceptTrack(esdTrack))
+      continue;
+
+    AliTPCtrack* tpcTrack = new AliTPCtrack(*esdTrack);
+    if (tpcTrack->GetAlpha()==0)
+    {
+      cout << " Warning esd track alpha = 0" << endl;
+      continue;
+    }
+
+    //Float_t theta = tpcTrack->Theta();
+    //Float_t eta   = -TMath::Log(TMath::Tan(theta/2.));
+
+    // using the eta of the mc particle
+    Int_t label = TMath::Abs(esdTrack->GetLabel());
+    if (label<0) 
+    {
+      cout << " cannot find corresponding mc part !!! " << label << endl;
+      continue;
+    }
+    particleTree->GetEntry(nTotal - nPrim + label);
+
+    fdNdEtaCorrection->FillMeas(vtx[2], particle->Eta());
+
+  } // end of track loop
+
+  return kTRUE;
+}
+
+void AlidNdEtaEffSelector::SlaveTerminate()
+{
+  // The SlaveTerminate() function is called after all entries or objects
+  // have been processed. When running with PROOF SlaveTerminate() is called
+  // on each slave server.
+
+  AliSelector::SlaveTerminate();
+
+  // Add the histograms to the output on each slave server
+  if (!fOutput)
+  {
+    printf("ERROR: Output list not initialized\n");
+    return;
+  }
+}
+
+void AlidNdEtaEffSelector::Terminate()
+{
+  // The Terminate() function is the last function to be called during
+  // a query. It always runs on the client, it can be used to present
+  // the results graphically or save the results to file.
+
+  AliSelector::Terminate();
+
+  fdNdEtaCorrection->Finish();
+
+  TFile* fout = new TFile("correction_map.root","RECREATE");
+
+  fEsdTrackCuts->SaveHistograms("esd_track_cuts");
+  fdNdEtaCorrection->SaveHistograms();
+
+  fout->Write();
+  fout->Close();
+
+  fdNdEtaCorrection->DrawHistograms();
+}
diff --git a/PWG0/dNdEta/AlidNdEtaEffSelector.h b/PWG0/dNdEta/AlidNdEtaEffSelector.h
new file mode 100644 (file)
index 0000000..b28e464
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef ALIDNDETAEFFSELECTOR_H
+#define ALIDNDETAEFFSELECTOR_H
+
+#include <TH2F.h>
+
+#include "../AliSelector.h"
+#include "../esdTrackCuts/ESDtrackQualityCuts.h"
+#include "dNdEtaCorrection.h"
+
+class TParticle;
+
+class AlidNdEtaEffSelector : public AliSelector {
+  public:
+    AlidNdEtaEffSelector(TTree *tree=0);
+    virtual ~AlidNdEtaEffSelector();
+
+    virtual void    Begin(TTree *tree);
+    virtual void    SlaveBegin(TTree *tree);
+    virtual Bool_t  Notify();
+    virtual Bool_t  Process(Long64_t entry);
+    virtual void    SlaveTerminate();
+    virtual void    Terminate();
+
+ protected:
+  Bool_t IsPrimary(const TParticle* aParticle, Int_t aTotalPrimaries);
+
+  ESDtrackQualityCuts* fEsdTrackCuts;
+  dNdEtaCorrection* fdNdEtaCorrection;
+
+ private:
+
+  ClassDef(AlidNdEtaEffSelector,0);
+};
+
+#endif
index 295f80278dbcb8b297ca63192c73ff6dc4fba73c..818ba196aba693176a22d281d21ca16b379782f5 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef DNDETANALYSIS_H
+#define DNDETANALYSIS_H
+
 // ------------------------------------------------------
 //
 // Class for dn/deta analysis
@@ -48,4 +51,4 @@ public:
   ClassDef(dNdEtaAnalysis,0)
 };
 
-
+#endif
index 73001d494f498748a04b3183e15501003372abd5..2091b85bdfedbe7e0d875b76b720e6975bb4cfc3 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef DNDETACORRECTION_H
+#define DNDETACORRECTION_H
+
 // ------------------------------------------------------
 //
 // Class to handle corrections for dN/dEta measurements
@@ -22,7 +25,7 @@
 #endif
 
 
-class dNdEtaCorrection : public TObject 
+class dNdEtaCorrection : public TObject
 {
 protected:
   
@@ -57,4 +60,4 @@ public:
   ClassDef(dNdEtaCorrection,0)
 };
 
-
+#endif
diff --git a/PWG0/dNdEta/makeCorrection2.C b/PWG0/dNdEta/makeCorrection2.C
new file mode 100644 (file)
index 0000000..c502418
--- /dev/null
@@ -0,0 +1,21 @@
+//
+// Script to make correction maps for dndeta measurements using the
+// dNdEtaCorrection class.
+//
+// implementation with TSelector
+//
+
+#include "../CreateESDChain.C"
+
+void makeCorrection2(Char_t* dataDir, Int_t nRuns=20)
+{
+  gSystem->Load("libPWG0base");
+
+  /*gSystem->Load("../esdTrackCuts/libESDtrackQuality.so");
+  gSystem->Load("libdNdEta.so");
+  gSystem->Load("../AliSelector_cxx.so");*/
+  //gSystem->Load("AlidNdEtaEffSelector_cxx.so");
+
+  TChain* chain = CreateESDChain(dataDir);
+  chain->Process("AlidNdEtaEffSelector.cxx+");
+}
index f93895aa483a719e2b3e499bc5de86971924655b..7d8daeb83bc4df303f1127f9e2e074ed1c393353 100644 (file)
@@ -1,4 +1,7 @@
-//**************************************************************** 
+#ifndef ESDTRACKQUALITYCUTS
+#define ESDTRACKQUALITYCUTS
+
+//****************************************************************
 //
 //  Class for handling of ESD track quality cuts
 //
@@ -114,3 +117,4 @@ public:
   ClassDef(ESDtrackQualityCuts,0)
 };
 
+#endif
diff --git a/PWG0/libPWG0base.pkg b/PWG0/libPWG0base.pkg
new file mode 100644 (file)
index 0000000..6e24177
--- /dev/null
@@ -0,0 +1,11 @@
+SRCS= AliSelector.cxx \
+      dNdEta/AlidNdEtaEffSelector.cxx \
+      dNdEta/dNdEtaAnalysis.cxx \
+      dNdEta/dNdEtaCorrection.cxx \
+      esdTrackCuts/ESDtrackQualityCuts.cxx
+
+HDRS= $(SRCS:.cxx=.h)
+
+DHDR= PWG0baseLinkDef.h
+
+EINCLUDE=