Analysis now deriving from AliAnalysisTaskSE. The subtasks are still there but now...
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Dec 2008 09:32:27 +0000 (09:32 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Dec 2008 09:32:27 +0000 (09:32 +0000)
18 files changed:
FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h
FMD/analysis/AliFMDAnalysisTaskDensity.cxx
FMD/analysis/AliFMDAnalysisTaskDensity.h
FMD/analysis/AliFMDAnalysisTaskDndeta.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskDndeta.h [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskESDReader.cxx
FMD/analysis/AliFMDAnalysisTaskESDReader.h
FMD/analysis/AliFMDAnalysisTaskSE.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskSE.h [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskSharing.cxx
FMD/analysis/AliFMDAnalysisTaskSharing.h
FMD/analysis/FMDanalysisLinkDef.h
FMD/analysis/RunAliEnFMDAnalysis.C
FMD/analysis/RunAliEnFMDAnalysisSE.C [new file with mode: 0644]
FMD/analysis/RunLocalFMDAnalysis.C
FMD/analysis/RunLocalFMDAnalysisSE.C [new file with mode: 0644]
FMD/libFMDanalysis.pkg

index 805680e..06cf897 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliAODHandler.h"
 #include "AliMCEventHandler.h"
 #include "AliStack.h"
+#include "AliLog.h"
 #include "AliESDVertex.h"
 #include "TMath.h"
 #include "AliFMDAnaParameters.h"
@@ -26,27 +27,38 @@ ClassImp(AliFMDAnalysisTaskBackgroundCorrection)
 AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection()
 : fDebug(0),
   fOutputList(0),
+  fInputList(0),
   fArray(0),
   fInputArray(0),
   fVertexString(0x0),
-  fNevents()
+  fNevents(),
+  fStandalone(kTRUE),
+  fOutputVertexString(0)
 {
   // Default constructor
   DefineInput (0, TList::Class());
   DefineOutput(0, TList::Class());
+  DefineOutput(1, TObjString::Class());
 }
 //_____________________________________________________________________
-AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection(const char* name):
+AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection(const char* name, Bool_t SE):
     AliAnalysisTask(name, "Density"),
     fDebug(0),
-    fOutputList(),
+    fOutputList(0),
+    fInputList(0),
     fArray(),
     fInputArray(0),
     fVertexString(0x0),
-    fNevents()
+    fNevents(),
+    fStandalone(kTRUE),
+    fOutputVertexString(0)
 {
-  DefineInput (0, TList::Class());
-  DefineOutput(0, TList::Class());
+  fStandalone = SE;
+  if(fStandalone) {
+    DefineInput (0, TList::Class());
+    DefineOutput(0, TList::Class());
+    DefineOutput(1, TObjString::Class());
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects()
@@ -56,6 +68,11 @@ void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects()
   fArray.SetName("FMD");
   fArray.SetOwner();
   
+  if(!fOutputList)
+    fOutputList = new TList();
+  fOutputList->SetName("BackgroundCorrectedPerEvent");
+  
+  
   TH2F* hMult = 0;
   
   Int_t nVtxbins = pars->GetNvtxBins();
@@ -82,38 +99,58 @@ void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects()
                              hBg->GetXaxis()->GetXmax(),
                              nSec, 0, 2*TMath::Pi());
            hMult->Sumw2();
-           fOutputList.Add(hMult);
+           fOutputList->Add(hMult);
            vtxArray->AddAtAndExpand(hMult,i);
            
          }
        } 
     }
   
-  fNevents.SetBins(nVtxbins,0,nVtxbins);
-  fNevents.SetName("nEvents");
-  fOutputList.Add(&fNevents);
-   
+  if(fStandalone) {
+    fOutputVertexString = new TObjString();
+  }
+  fOutputList->Add(fOutputVertexString);
+  
   
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskBackgroundCorrection::ConnectInputData(Option_t */*option*/)
 {
-
-  TList* list = (TList*)GetInputData(0);
-  fInputArray = (TObjArray*)list->At(0);
-  fVertexString = (TObjString*)list->At(1);
+  if(fStandalone) {
+    fInputList   = (TList*)GetInputData(0);
+    
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
 {
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   
+  fInputArray   = (TObjArray*)fInputList->At(0);
+  fVertexString = (TObjString*)fInputList->At(1);
+  
+  
   Int_t vtxbin   = fVertexString->GetString().Atoi();
+  fOutputVertexString->SetString(Form("%d",vtxbin));
   
   //fNevents.operator[](vtxbin)++;
-  
   fNevents.Fill(vtxbin);
   
+  //Reset everything
+  for(UShort_t det=1;det<=3;det++) {
+    TObjArray* detArray = (TObjArray*)fArray.At(det);
+    Int_t nRings = (det==1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nRings; ir++) {
+      TObjArray* vtxArray = (TObjArray*)detArray->At(ir);
+      
+      TH2F* hMult   = (TH2F*)vtxArray->At(vtxbin); 
+      hMult->Reset();
+    }
+    
+  }
+  
+  
+  
   for(UShort_t det=1;det<=3;det++) {
     TObjArray* detInputArray = (TObjArray*)fInputArray->At(det);
     TObjArray* detArray = (TObjArray*)fArray.At(det);
@@ -123,9 +160,11 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
       TObjArray* vtxInputArray = (TObjArray*)detInputArray->At(ir);
       TObjArray* vtxArray = (TObjArray*)detArray->At(ir);
       TH2F* hMultTotal = (TH2F*)vtxArray->At(vtxbin);
-      TH2F* hMult      = (TH2F*)vtxInputArray->At(vtxbin);
+      TH2F* hMultInput = (TH2F*)vtxInputArray->At(vtxbin);
       TH2F* hBg        = pars->GetBackgroundCorrection(det, ringChar, vtxbin);
-      TH2F* hTmp       = (TH2F*)hMult->Clone("hMult_from_event");
+      
+      TH2F* hTmp       = (TH2F*)hMultInput->Clone("hMult_from_event");
+            
       hTmp->Divide(hTmp,hBg,1,1,"B");
       
       hMultTotal->Add(hTmp);
@@ -133,8 +172,10 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
       
     }
   }
-  
-  PostData(0, &fOutputList); 
+  if(fStandalone) {
+    PostData(0, fOutputList); 
+    PostData(1, fOutputVertexString);
+  }
   
 }
 //_____________________________________________________________________
index 8d7cd37..8c1e4e4 100644 (file)
@@ -15,15 +15,18 @@ class AliFMDAnalysisTaskBackgroundCorrection : public AliAnalysisTask
 {
  public:
     AliFMDAnalysisTaskBackgroundCorrection();
-    AliFMDAnalysisTaskBackgroundCorrection(const char* name);
+    AliFMDAnalysisTaskBackgroundCorrection(const char* name, Bool_t SE = kTRUE);
     virtual ~AliFMDAnalysisTaskBackgroundCorrection() {;}
  AliFMDAnalysisTaskBackgroundCorrection(const AliFMDAnalysisTaskBackgroundCorrection& o) : AliAnalysisTask(),
       fDebug(o.fDebug),
-      fOutputList(),
+      fOutputList(0),
+      fInputList(0),
       fArray(o.fArray),
       fInputArray(o.fInputArray),
       fVertexString(o.fVertexString),
-      fNevents(o.fNevents)  {}
+      fNevents(o.fNevents),
+      fStandalone(o.fStandalone), 
+      fOutputVertexString(o.fOutputVertexString) {}
     AliFMDAnalysisTaskBackgroundCorrection& operator=(const AliFMDAnalysisTaskBackgroundCorrection&) { return *this; }
     // Implementation of interface methods
     virtual void ConnectInputData(Option_t *option = "");
@@ -33,14 +36,21 @@ class AliFMDAnalysisTaskBackgroundCorrection : public AliAnalysisTask
     virtual void Exec(Option_t *option);
     virtual void Terminate(Option_t *option);
     virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-    
+    void SetInputList(TList* inputList) {fInputList = inputList;}
+    void SetOutputVertex(TObjString* vtxString) {fOutputVertexString = vtxString;}
+    //void SetInputVtx(TObjString* vtxString) {fVertexString = vtxString;}
+    void SetOutputList(TList* outputList) {fOutputList = outputList;}
+        
  private:
     Int_t         fDebug;        //  Debug flag
-    TList         fOutputList;
+    TList*        fOutputList;
+    TList*        fInputList;
     TObjArray     fArray;
     TObjArray*    fInputArray;
     TObjString*   fVertexString;
     TH1I          fNevents;
+    Bool_t        fStandalone;
+    TObjString*   fOutputVertexString;
     ClassDef(AliFMDAnalysisTaskBackgroundCorrection, 0); // Analysis task for FMD analysis
 };
  
index 1f8473e..47631f4 100644 (file)
@@ -29,23 +29,32 @@ AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity()
   fOutputList(),
   fArray(),
   fESD(0x0),
-  fVertexString()
+  fVertexString(),
+  fVertex(0),
+  fStandalone(kTRUE)
 {
   // Default constructor
-  DefineInput (0, AliESDEvent::Class());
+  DefineInput (0, AliESDFMD::Class());
+  DefineInput (1, AliESDVertex::Class());
   DefineOutput(0,TList::Class());
 }
 //_____________________________________________________________________
-AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity(const char* name):
+AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity(const char* name, Bool_t SE):
     AliAnalysisTask(name, "Density"),
     fDebug(0),
-    fOutputList(),
+    fOutputList(0),
     fArray(),
     fESD(0x0),
-    fVertexString()
+    fVertexString(),
+    fVertex(0),
+    fStandalone(kTRUE)
 {
-  DefineInput (0, AliESDEvent::Class());
-  DefineOutput(0, TList::Class());
+  fStandalone = SE;
+  if(fStandalone) {
+    DefineInput (0, AliESDFMD::Class());
+    DefineInput (1, AliESDVertex::Class());
+    DefineOutput(0, TList::Class());
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskDensity::CreateOutputObjects()
@@ -54,6 +63,9 @@ void AliFMDAnalysisTaskDensity::CreateOutputObjects()
   
   fArray.SetName("FMD");
   fArray.SetOwner();
+  if(!fOutputList)
+    fOutputList = new TList();
+  fOutputList->SetName("density_list");
   
   TH2F* hMult = 0;
   
@@ -87,15 +99,18 @@ void AliFMDAnalysisTaskDensity::CreateOutputObjects()
        } 
     }
   
-  fOutputList.Add(&fArray);
-  fOutputList.Add(&fVertexString);
+  fOutputList->Add(&fArray);
+  fOutputList->Add(&fVertexString);
+  
   
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskDensity::ConnectInputData(Option_t */*option*/)
 {
-
-  fESD = (AliESDEvent*)GetInputData(0);
+  if(fStandalone) {
+    fESD    = (AliESDFMD*)GetInputData(0);
+    fVertex = (AliESDVertex*)GetInputData(1);
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
@@ -103,10 +118,10 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   AliFMDGeometry* geo       = AliFMDGeometry::Instance();
   
-  AliESDFMD*   fmd = fESD->GetFMDData();
+  //AliESDFMD*   fmd = fESD->GetFMDData();
   
   Double_t vertex[3];
-  fESD->GetPrimaryVertexSPD()->GetXYZ(vertex);
+  fVertex->GetXYZ(vertex);
   // Z Vtx cut
   if( TMath::Abs(vertex[2]) > pars->GetVtxCutZ()) 
     return;
@@ -142,9 +157,9 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
       UShort_t nstr = (ir == 0 ? 512 : 256);
       for(UShort_t sec =0; sec < nsec;  sec++)  {
        for(UShort_t strip = 0; strip < nstr; strip++) {
-         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
-         if(mult<1) continue;
-         Float_t eta = fmd->Eta(det,ring,sec,strip);
+         Float_t mult = fESD->Multiplicity(det,ring,sec,strip);
+         if(mult < 1 || mult == AliESDFMD::kInvalidMult) continue;
+         Float_t eta = fESD->Eta(det,ring,sec,strip);
          Double_t x,y,z;
          geo->Detector2XYZ(det,ring,sec,strip,x,y,z);
          Float_t phi = TMath::ATan2(y,x);
@@ -158,7 +173,9 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
        
   
   }
-  PostData(0, &fOutputList); 
+  if(fStandalone) {
+    PostData(0, fOutputList); 
+  }
   
 }
 //_____________________________________________________________________
index e056bd9..92b53cc 100644 (file)
@@ -8,9 +8,10 @@
 
 #include "TObjArray.h"
 #include "AliESDFMD.h"
-#include "AliESDEvent.h"
+#include "AliESDVertex.h"
 #include "TObjString.h"
 #include "TTree.h"
+
 class AliESDEvent;
 class TChain;
 class AliAODEvent;
@@ -21,14 +22,16 @@ class AliFMDAnalysisTaskDensity : public AliAnalysisTask
 {
  public:
     AliFMDAnalysisTaskDensity();
-    AliFMDAnalysisTaskDensity(const char* name);
+    AliFMDAnalysisTaskDensity(const char* name, Bool_t SE = kTRUE);
     virtual ~AliFMDAnalysisTaskDensity() {;}
  AliFMDAnalysisTaskDensity(const AliFMDAnalysisTaskDensity& o) : AliAnalysisTask(),
       fDebug(o.fDebug),
       fOutputList(),
       fArray(o.fArray),
       fESD(o.fESD),
-      fVertexString(o.fVertexString) {}
+      fVertexString(o.fVertexString),
+      fVertex(o.fVertex),
+      fStandalone(o.fStandalone) {}
     AliFMDAnalysisTaskDensity& operator=(const AliFMDAnalysisTaskDensity&) { return *this; }
     // Implementation of interface methods
     virtual void ConnectInputData(Option_t *option);
@@ -39,12 +42,17 @@ class AliFMDAnalysisTaskDensity : public AliAnalysisTask
     virtual void Terminate(Option_t */*option*/) {}
     virtual void SetDebugLevel(Int_t level) {fDebug = level;}
     
+    void SetOutputList(TList* outlist) {fOutputList = outlist;}
+    void SetInputESDFMD(AliESDFMD* esdfmd) {fESD = esdfmd;}
+    void SetInputVertex(AliESDVertex* vertex) {fVertex = vertex;}
  private:
     Int_t         fDebug;        //  Debug flag
-    TList         fOutputList;
+    TList*        fOutputList;
     TObjArray     fArray;
-    AliESDEvent*  fESD;
+    AliESDFMD*    fESD;
     TObjString    fVertexString;
+    AliESDVertex* fVertex;
+    Bool_t        fStandalone;
     ClassDef(AliFMDAnalysisTaskDensity, 0); // Analysis task for FMD analysis
 };
  
diff --git a/FMD/analysis/AliFMDAnalysisTaskDndeta.cxx b/FMD/analysis/AliFMDAnalysisTaskDndeta.cxx
new file mode 100644 (file)
index 0000000..7f3a292
--- /dev/null
@@ -0,0 +1,175 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+#include <iostream>
+#include "TH2F.h"
+#include "AliFMDAnalysisTaskDndeta.h"
+#include "AliAnalysisManager.h"
+#include "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliStack.h"
+#include "AliLog.h"
+#include "AliESDVertex.h"
+#include "TMath.h"
+#include "AliFMDAnaParameters.h"
+#include "AliFMDGeometry.h"
+
+ClassImp(AliFMDAnalysisTaskDndeta)
+
+
+AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta()
+: fDebug(0),
+  fOutputList(0),
+  fInputList(0),
+  fArray(0),
+  fInputArray(0),
+  fVertexString(0x0),
+  fNevents(),
+  fStandalone(kTRUE)
+{
+  // Default constructor
+  DefineInput (0, TList::Class());
+  DefineOutput(0, TList::Class());
+}
+//_____________________________________________________________________
+AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta(const char* name, Bool_t SE):
+    AliAnalysisTask(name, "Density"),
+    fDebug(0),
+    fOutputList(0),
+    fInputList(0),
+    fArray(),
+    fInputArray(0),
+    fVertexString(0x0),
+    fNevents(),
+    fStandalone(kTRUE)
+{
+  fStandalone = SE;
+  if(fStandalone) {
+    DefineInput (0, TList::Class());
+    DefineInput(1, TObjString::Class());
+    DefineOutput(0, TList::Class());
+    
+  }
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDndeta::CreateOutputObjects()
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  fArray.SetName("FMD");
+  fArray.SetOwner();
+  
+  if(!fOutputList)
+    fOutputList = new TList();
+  fOutputList->SetName("BackgroundCorrected");
+  
+  
+  TH2F* hMult = 0;
+  
+  Int_t nVtxbins = pars->GetNvtxBins();
+  
+  for(Int_t det =1; det<=3;det++)
+    {
+      TObjArray* detArray = new TObjArray();
+      detArray->SetName(Form("FMD%d",det));
+      fArray.AddAtAndExpand(detArray,det);
+      Int_t nRings = (det==1 ? 1 : 2);
+      for(Int_t ring = 0;ring<nRings;ring++)
+       {
+         Char_t ringChar = (ring == 0 ? 'I' : 'O');
+         Int_t  nSec     = (ring == 0 ? 20 : 40);
+         
+         TObjArray* vtxArray = new TObjArray();
+         vtxArray->SetName(Form("FMD%d%c",det,ringChar));
+         detArray->AddAtAndExpand(vtxArray,ring);
+         for(Int_t i = 0; i< nVtxbins; i++) {
+           TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i);
+           hMult  = new TH2F(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),
+                             hBg->GetNbinsX(),
+                             hBg->GetXaxis()->GetXmin(),
+                             hBg->GetXaxis()->GetXmax(),
+                             nSec, 0, 2*TMath::Pi());
+           hMult->Sumw2();
+           fOutputList->Add(hMult);
+           vtxArray->AddAtAndExpand(hMult,i);
+           
+         }
+       } 
+    }
+  
+  fNevents.SetBins(nVtxbins,0,nVtxbins);
+  fNevents.SetName("nEvents");
+  fOutputList->Add(&fNevents);
+   
+  
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDndeta::ConnectInputData(Option_t */*option*/)
+{
+  if(fStandalone) {
+    fInputList   = (TList*)GetInputData(0);
+    fVertexString = (TObjString*)GetInputData(1);
+  }
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDndeta::Exec(Option_t */*option*/)
+{
+  Int_t vtxbin   = fVertexString->GetString().Atoi();
+  fNevents.Fill(vtxbin);
+  
+  for(UShort_t det=1;det<=3;det++) {
+    //TObjArray* detInputArray = (TObjArray*)fInputArray->At(det);
+    TObjArray* detArray = (TObjArray*)fArray.At(det);
+    Int_t nRings = (det==1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nRings; ir++) {
+      Char_t ringChar = (ir == 0 ? 'I' : 'O');
+      //TObjArray* vtxInputArray = (TObjArray*)detInputArray->At(ir);
+      TObjArray* vtxArray = (TObjArray*)detArray->At(ir);
+      TH2F* hMultTotal = (TH2F*)vtxArray->At(vtxbin);
+      
+      
+      TH2F* hMultInput = (TH2F*)fInputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
+      // std::cout<<hMultInput->GetEntries()<<std::endl;
+      hMultTotal->Add(hMultInput);
+      
+      
+    }
+  }
+  if(fStandalone) {
+    PostData(0, fOutputList); 
+  }
+  
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
+  
+  /*
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  Int_t nVtxbins = pars->GetNvtxBins();
+  
+  for(UShort_t det=1;det<=3;det++) {
+    TObjArray* detArray = (TObjArray*)fArray.At(det);
+    Int_t nRings = (det==1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nRings; ir++) {
+      TObjArray* vtxArray = (TObjArray*)detArray->At(ir);
+      for(Int_t i =0; i<nVtxbins; i++) {
+       TH2F* hMultTotal = (TH2F*)vtxArray->At(i);
+       if(fNevents.At(i))
+         hMultTotal->Scale(1/(Float_t)fNevents.At(i));
+      }
+    }
+  }
+  */
+}
+//_____________________________________________________________________
+//
+//
+// EOF
diff --git a/FMD/analysis/AliFMDAnalysisTaskDndeta.h b/FMD/analysis/AliFMDAnalysisTaskDndeta.h
new file mode 100644 (file)
index 0000000..7c604a2
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIFMDANALYSISTASKDNDETA_H
+#define ALIFMDANALYSISTASKDNDETA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+#include "AliAnalysisTask.h"
+
+#include "TObjArray.h"
+#include "TObjString.h"
+#include "TArrayI.h"
+#include "TH1I.h"
+
+class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
+{
+ public:
+    AliFMDAnalysisTaskDndeta();
+    AliFMDAnalysisTaskDndeta(const char* name, Bool_t SE = kTRUE);
+    virtual ~AliFMDAnalysisTaskDndeta() {;}
+ AliFMDAnalysisTaskDndeta(const AliFMDAnalysisTaskDndeta& o) : AliAnalysisTask(),
+      fDebug(o.fDebug),
+      fOutputList(0),
+      fInputList(0),
+      fArray(o.fArray),
+      fInputArray(o.fInputArray),
+      fVertexString(o.fVertexString),
+      fNevents(o.fNevents),
+      fStandalone(o.fStandalone) {}
+    AliFMDAnalysisTaskDndeta& operator=(const AliFMDAnalysisTaskDndeta&) { return *this; }
+    // Implementation of interface methods
+    virtual void ConnectInputData(Option_t *option = "");
+    virtual void CreateOutputObjects();
+    virtual void Init() {}
+    virtual void LocalInit() {Init();}
+    virtual void Exec(Option_t *option);
+    virtual void Terminate(Option_t *option);
+    virtual void SetDebugLevel(Int_t level) {fDebug = level;}
+    void SetInputList(TList* inputList) {fInputList = inputList;}
+    void SetInputVertex(TObjString* vtxString) {fVertexString = vtxString;}
+    void SetOutputList(TList* outputList) {fOutputList = outputList;}
+    TList* GetOutputList() {return fOutputList;}
+ private:
+    Int_t         fDebug;        //  Debug flag
+    TList*        fOutputList;
+    TList*        fInputList;
+    TObjArray     fArray;
+    TObjArray*    fInputArray;
+    TObjString*   fVertexString;
+    TH1I          fNevents;
+    Bool_t        fStandalone;
+    ClassDef(AliFMDAnalysisTaskDndeta, 0); // Analysis task for FMD analysis
+};
+#endif
index 294da70..60df085 100644 (file)
@@ -30,6 +30,7 @@ AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader()
   // Default constructor
   DefineInput (0, TTree::Class());
   DefineOutput(0, AliESDEvent::Class());
 }
 //_____________________________________________________________________
 AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader(const char* name):
@@ -41,6 +42,7 @@ AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader(const char* name):
 {
   DefineInput (0, TTree::Class());
   DefineOutput(0, AliESDEvent::Class());
 }
 
 //_____________________________________________________________________
@@ -55,8 +57,8 @@ void AliFMDAnalysisTaskESDReader::ConnectInputData(Option_t */*option*/)
 
 void AliFMDAnalysisTaskESDReader::Exec(Option_t */*option*/)
 {
+  //  std::cout<<fOutputESD<<std::endl;
   fOutputESD = fESD;
-    
   PostData(0, fOutputESD); 
   
 }
index 7129194..bb0ebad 100644 (file)
@@ -9,6 +9,7 @@
 #include "TObjString.h"
 #include "AliESDFMD.h"
 #include "TTree.h"
+#include "AliESDVertex.h"
 class AliESDEvent;
 class TChain;
 class AliAODEvent;
diff --git a/FMD/analysis/AliFMDAnalysisTaskSE.cxx b/FMD/analysis/AliFMDAnalysisTaskSE.cxx
new file mode 100644 (file)
index 0000000..6586266
--- /dev/null
@@ -0,0 +1,95 @@
+#include "AliFMDAnalysisTaskSE.h"
+#include "AliESDEvent.h"
+#include "iostream"
+#include "AliESDFMD.h"
+
+ClassImp(AliFMDAnalysisTaskSE)
+
+//_____________________________________________________________________
+AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE():
+AliAnalysisTaskSE(),
+  fListOfHistos(0),
+  fSharing("Sharing",kFALSE),
+  fDensity("Density",kFALSE),
+  fBackground("BackgroundCorrected",kFALSE),
+  fDndeta("dNdeta",kFALSE)
+{
+  // Default constructor
+}
+//_____________________________________________________________________
+AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name):
+  AliAnalysisTaskSE(name),
+  fListOfHistos(0),
+  fSharing("Sharing",kFALSE),
+  fDensity("Density",kFALSE),
+  fBackground("BackgroundCorrected",kFALSE),
+  fDndeta("dNdeta",kFALSE)
+{
+  // Default constructor
+  DefineOutput(1, TList::Class());
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
+{
+// Create the output container
+//
+  fListOfHistos = new TList();
+  
+  AliESDFMD* fmd = new AliESDFMD();
+  AliESDVertex* vertex = new AliESDVertex();
+  
+  TObjString* vtxString1 = new TObjString();
+  
+  TList* densitylist = new TList();
+  
+  TList* bgcorlist = new TList();
+  
+  fSharing.SetFMDData(fmd);
+  fSharing.SetVertex(vertex);
+  
+  fDensity.SetOutputList(densitylist);
+  fDensity.SetInputESDFMD(fmd) ;
+  fDensity.SetInputVertex(vertex);
+  
+  fBackground.SetInputList(densitylist);
+  fBackground.SetOutputList(bgcorlist);
+  fBackground.SetOutputVertex(vtxString1);
+  
+  fDndeta.SetInputVertex(vtxString1);
+  fDndeta.SetInputList(bgcorlist); 
+  fDndeta.SetOutputList(fListOfHistos); 
+  
+  fSharing.CreateOutputObjects();
+  fDensity.CreateOutputObjects();
+  fBackground.CreateOutputObjects();
+  fDndeta.CreateOutputObjects();
+  
+  
+  
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSE::Init()
+{
+  std::cout<<"Init"<<std::endl;
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/)
+{
+  // Execute analysis for current event
+  //
+  AliESDEvent* fESD = (AliESDEvent*)InputEvent();
+  fSharing.SetInputESD(fESD);
+  
+  fSharing.Exec("");
+  fDensity.Exec("");
+  fBackground.Exec("");  
+  fDndeta.Exec("");
+  //fListOfHistos = fBackground.GetOutputList();
+  
+  PostData(1, fListOfHistos);
+}
+
+//_____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/analysis/AliFMDAnalysisTaskSE.h b/FMD/analysis/AliFMDAnalysisTaskSE.h
new file mode 100644 (file)
index 0000000..765aa9e
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALIFMDANALYSISTASKSE_H
+#define ALIFMDANALYSISTASKSE_H
+
+#include "AliAnalysisTaskSE.h"
+#include "AliFMDAnalysisTaskSharing.h"
+#include "AliFMDAnalysisTaskDensity.h"
+#include "AliFMDAnalysisTaskBackgroundCorrection.h"
+#include "AliFMDAnalysisTaskDndeta.h"
+
+class AliFMDAnalysisTaskSE : public AliAnalysisTaskSE
+{
+ public:
+    AliFMDAnalysisTaskSE();
+    AliFMDAnalysisTaskSE(const char* name);
+    virtual ~AliFMDAnalysisTaskSE() {;}
+ AliFMDAnalysisTaskSE(const AliFMDAnalysisTaskSE& o) : AliAnalysisTaskSE(),
+      fListOfHistos(o.fListOfHistos),
+      fSharing(o.fSharing),
+      fDensity(o.fDensity),
+      fBackground(o.fBackground),
+      fDndeta(o.fDndeta){}
+    AliFMDAnalysisTaskSE& operator=(const AliFMDAnalysisTaskSE&) { return *this; }
+    
+    virtual void Init();
+    virtual void UserCreateOutputObjects();
+    virtual void UserExec(Option_t* /*option*/);
+    
+ private:
+    
+    TList* fListOfHistos;
+    AliFMDAnalysisTaskSharing              fSharing;
+    AliFMDAnalysisTaskDensity              fDensity;
+    AliFMDAnalysisTaskBackgroundCorrection fBackground;
+    AliFMDAnalysisTaskDndeta               fDndeta;
+    ClassDef(AliFMDAnalysisTaskSE, 1);
+
+};
+#endif
index 61b6958..edf3d33 100644 (file)
@@ -21,50 +21,84 @@ ClassImp(AliFMDAnalysisTaskSharing)
 AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing()
 : fDebug(0),
   fESD(0x0),
-  fOutputESD(),
   foutputESDFMD(),
   fSharedThis(kFALSE),
-  fSharedPrev(kFALSE)
+  fSharedPrev(kFALSE),
+  fDiagList(),
+  fStandalone(kTRUE),
+  fEsdVertex(0)
 {
   // Default constructor
   DefineInput (0, AliESDEvent::Class());
-  DefineOutput(0, AliESDEvent::Class());
+  DefineOutput(0, AliESDFMD::Class());
+  DefineOutput(1, AliESDVertex::Class());
+  DefineOutput(2, AliESDEvent::Class());
+  DefineOutput(3, TList::Class());
 }
 //_____________________________________________________________________
-AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name):
+AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, Bool_t SE):
     AliAnalysisTask(name, "AnalysisTaskFMD"),
     fDebug(0),
     fESD(0x0),
-    fOutputESD(),
     foutputESDFMD(),
     fSharedThis(kFALSE),
-    fSharedPrev(kFALSE)
-
+    fSharedPrev(kFALSE),
+    fDiagList(),
+    fStandalone(kTRUE),
+    fEsdVertex(0)
 {
-  DefineInput (0, AliESDEvent::Class());
-  DefineOutput(0, AliESDEvent::Class());
+  fStandalone = SE;
+  if(fStandalone) {
+    DefineInput (0, AliESDEvent::Class());
+    DefineOutput(0, AliESDFMD::Class());
+    DefineOutput(1, AliESDVertex::Class());
+    DefineOutput(2, AliESDEvent::Class());
+    DefineOutput(3, TList::Class());
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskSharing::CreateOutputObjects()
 {
-  fOutputESD.CreateStdContent();
+  if(!foutputESDFMD)
+    foutputESDFMD = new AliESDFMD();
+  
+  if(!fEsdVertex)
+    fEsdVertex    = new AliESDVertex();
+  //Diagnostics
+  fDiagList.SetName("Sharing diagnostics");
+  for(Int_t det = 1; det<=3; det++) {
+    Int_t nRings = (det==1 ? 1 : 2);
+    
+    for(Int_t iring = 0;iring<nRings; iring++) {
+      Char_t ringChar = (iring == 0 ? 'I' : 'O');
+      TH1F* hEdist        = new TH1F(Form("Edist_before_sharing_FMD%d%c", det, ringChar),
+                                    Form("Edist_before_sharing_FMD%d%c", det, ringChar),
+                                    200,0,5);
+      TH1F* hEdist_after  = new TH1F(Form("Edist_after_sharing_FMD%d%c", det, ringChar),
+                                    Form("Edist_after_sharing_FMD%d%c", det, ringChar),
+                                    200,0,5);
+      fDiagList.Add(hEdist);
+      fDiagList.Add(hEdist_after);
+
+    }
+  }
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskSharing::ConnectInputData(Option_t */*option*/)
 {
-  fESD = (AliESDEvent*)GetInputData(0);
+  if(fStandalone)
+    fESD = (AliESDEvent*)GetInputData(0);
 }
 //_____________________________________________________________________
 void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
 {
+  
   AliESD* old = fESD->GetAliESDOld();
   if (old) {
     fESD->CopyFromOldESD();
   }
   
-  foutputESDFMD.Clear();
-  
-  fOutputESD.SetPrimaryVertexSPD(fESD->GetPrimaryVertexSPD());
+  foutputESDFMD->Clear();
   
   AliESDFMD* fmd = fESD->GetFMDData();
   
@@ -76,14 +110,19 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
       Char_t   ring = (ir == 0 ? 'I' : 'O');
       UShort_t nsec = (ir == 0 ? 20  : 40);
       UShort_t nstr = (ir == 0 ? 512 : 256);
+      
+      TH1F* hEdist = (TH1F*)fDiagList.FindObject(Form("Edist_before_sharing_FMD%d%c",det,ring));
+      
       for(UShort_t sec =0; sec < nsec;  sec++) {
        fSharedThis      = kFALSE;
        fSharedPrev      = kFALSE;
        for(UShort_t strip = 0; strip < nstr; strip++) {
-         foutputESDFMD.SetMultiplicity(det,ring,sec,strip,0.);
+         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,0.);
          Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+
          if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
-                 
+         
+         hEdist->Fill(mult);
          Float_t Eprev = 0;
          Float_t Enext = 0;
          if(strip != 0)
@@ -94,17 +133,24 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
            Enext = fmd->Multiplicity(det,ring,sec,strip+1);
          
          Float_t nParticles = GetMultiplicityOfStrip(mult,Eprev,Enext,det,ring);
-         foutputESDFMD.SetMultiplicity(det,ring,sec,strip,nParticles);
-         foutputESDFMD.SetEta(det,ring,sec,strip,fmd->Eta(det,ring,sec,strip));
-                 
+         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,nParticles);
+         foutputESDFMD->SetEta(det,ring,sec,strip,fmd->Eta(det,ring,sec,strip));
+         
        }
       }
     }
   }
-  fOutputESD.SetFMDData(&foutputESDFMD);
-    
-  PostData(0, &fOutputESD); 
   
+  Double_t vertex[3];
+  fESD->GetPrimaryVertexSPD()->GetXYZ(vertex);
+  
+  fEsdVertex->SetXYZ(vertex);
+  if(fStandalone) {
+    PostData(0, foutputESDFMD); 
+    PostData(1, fEsdVertex); 
+    PostData(2, fESD); 
+    PostData(3, &fDiagList); 
+  }
 }
 //_____________________________________________________________________
 Float_t AliFMDAnalysisTaskSharing::GetMultiplicityOfStrip(Float_t mult,
@@ -145,8 +191,10 @@ Float_t AliFMDAnalysisTaskSharing::GetMultiplicityOfStrip(Float_t mult,
     Etotal += Enext;
     fSharedThis      = kTRUE;
   }
-  
+  TH1F* hEdist = (TH1F*)fDiagList.FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
+  hEdist->Fill(Etotal);
   if(Etotal > cutHigh ) {
+    
     nParticles = 1;
     fSharedPrev      = kTRUE;
   }
index d469aa1..b90b787 100644 (file)
 #include "AliESDEvent.h"
 class TChain;
 class AliAODEvent;
-
+class AliESDVertex;
 
 
 class AliFMDAnalysisTaskSharing : public AliAnalysisTask
 {
  public:
     AliFMDAnalysisTaskSharing();
-    AliFMDAnalysisTaskSharing(const char* name);
+    AliFMDAnalysisTaskSharing(const char* name, Bool_t SE = kTRUE);
     virtual ~AliFMDAnalysisTaskSharing() {;}
  AliFMDAnalysisTaskSharing(const AliFMDAnalysisTaskSharing& o) : AliAnalysisTask(),
       fDebug(o.fDebug),
       fESD(o.fESD),
-      fOutputESD(),
+      // fOutputESD(),
       foutputESDFMD(o.foutputESDFMD),
       fSharedThis(o.fSharedThis),
-      fSharedPrev(o.fSharedPrev) {}
+      fSharedPrev(o.fSharedPrev),
+      fDiagList(),
+      fStandalone(o.fStandalone),
+      fEsdVertex(o.fEsdVertex) {}
     AliFMDAnalysisTaskSharing& operator=(const AliFMDAnalysisTaskSharing&) { return *this; }
     
     // Implementation of interface methods
@@ -39,13 +42,19 @@ class AliFMDAnalysisTaskSharing : public AliAnalysisTask
     virtual void Terminate(Option_t* /* option*/) {}
     virtual void SetDebugLevel(Int_t level) {fDebug = level;}
     Float_t GetMultiplicityOfStrip(Float_t mult, Float_t Eprev, Float_t Enext, Int_t   det, Char_t  ring);
+    void SetFMDData(AliESDFMD* fmd) {foutputESDFMD = fmd;}
+    void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;}
+    void SetInputESD(AliESDEvent* esd) {fESD = esd;}
  private:
     Int_t         fDebug;        //  Debug flag
     AliESDEvent*  fESD;          //! ESD
-    AliESDEvent   fOutputESD;
-    AliESDFMD     foutputESDFMD;
+    // AliESDEvent   fOutputESD;
+    AliESDFMD*    foutputESDFMD;
     Bool_t        fSharedThis;
     Bool_t        fSharedPrev;
+    TList         fDiagList;
+    Bool_t        fStandalone;
+    AliESDVertex* fEsdVertex;
     ClassDef(AliFMDAnalysisTaskSharing, 0); // Analysis task for FMD analysis
 };
  
index acf12f6..f279985 100644 (file)
@@ -27,7 +27,8 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-
+#pragma link C++ class AliFMDAnalysisTaskSE+;
+#pragma link C++ class AliFMDAnalysisTaskDndeta+;
 #pragma link C++ class AliFMDAnaCalibBackgroundCorrection+;
 #pragma link C++ class AliFMDAnaCalibEnergyDistribution+;
 #pragma link C++ class AliFMDAnaParameters+;
index 82844c7..0fdff48 100644 (file)
@@ -3,6 +3,7 @@ void RunAliEnFMDAnalysis(const Char_t* collectionfile = "collection.xml",
                         const Char_t* outFile        = "fmd_analysis.root"){
   
   gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
   gSystem->Load("libFMDanalysis");
   
   AliCDBManager* cdb = AliCDBManager::Instance();
@@ -28,19 +29,32 @@ void RunAliEnFMDAnalysis(const Char_t* collectionfile = "collection.xml",
   mgr->AddTask(FMDana1); 
   mgr->AddTask(FMDana2);
   mgr->AddTask(FMDana3);
+
   AliAnalysisDataContainer* cin_esd = mgr->CreateContainer("esdTree",TTree::Class(),AliAnalysisManager::kInputContainer,"AliESDs.root");
-  
+  AliAnalysisDataContainer* cexchangevertex = mgr->CreateContainer("vertex",AliESDVertex::Class(),AliAnalysisManager::kExchangeContainer);
   AliAnalysisDataContainer* cexchange0 = mgr->CreateContainer("exchangeESDFMD0",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
-  AliAnalysisDataContainer* cexchange1 = mgr->CreateContainer("exchangeESDFMD1",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cdiag1 = mgr->CreateContainer("diagSharing1",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cdiag2 = mgr->CreateContainer("diagSharing2",TList::Class(),AliAnalysisManager::kOutputContainer,"edists.root");
+  AliAnalysisDataContainer* cexchange1 = mgr->CreateContainer("exchangeESDFMD1",AliESDFMD::Class(),AliAnalysisManager::kExchangeContainer);
   AliAnalysisDataContainer* cexchange2 = mgr->CreateContainer("listOfhists",TList::Class(),AliAnalysisManager::kExchangeContainer);
   AliAnalysisDataContainer* coutput = mgr->CreateContainer("BackgroundCorrected",TList::Class(),AliAnalysisManager::kOutputContainer,outFile);
   
   mgr->ConnectInput(FMDana0, 0 , cin_esd);   
-  mgr->ConnectOutput(FMDana0, 0 , cexchange0); 
+  mgr->ConnectOutput(FMDana0, 0 , cexchange0);
+   
   mgr->ConnectInput(FMDana1, 0 , cexchange0);   
-  mgr->ConnectOutput(FMDana1, 0 , cexchange1);   
+
+  mgr->ConnectOutput(FMDana1, 0 , cexchange1);  
+  mgr->ConnectOutput(FMDana1, 1 , cexchangevertex);   
+  mgr->ConnectOutput(FMDana1, 2 , cdiag1);
+  mgr->ConnectOutput(FMDana1, 3 , cdiag2);
+  
+  
   mgr->ConnectInput(FMDana2, 0 , cexchange1);   
+  mgr->ConnectInput(FMDana2, 1 , cexchangevertex);   
   mgr->ConnectOutput(FMDana2, 0 , cexchange2);
+
+  
   mgr->ConnectInput(FMDana3, 0 , cexchange2);   
   mgr->ConnectOutput(FMDana3, 0 , coutput);
   
diff --git a/FMD/analysis/RunAliEnFMDAnalysisSE.C b/FMD/analysis/RunAliEnFMDAnalysisSE.C
new file mode 100644 (file)
index 0000000..f4c0992
--- /dev/null
@@ -0,0 +1,87 @@
+void RunAliEnFMDAnalysisSE(const Char_t* collectionName="collection.xml", const Char_t* cdbPath="local://$ALICE_ROOT") {
+
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  gSystem->Load("libFMDanalysis");
+  
+  TGrid::Connect("alien://",0,0,"t"); 
+  TChain* chain = CreateChainSingle(collectionName);  
+  
+  if (!chain) return;
+  
+  //
+  // Make the analysis manager
+  AliAnalysisManager *mgr  = new AliAnalysisManager("Analysis Train", "A test setup for the analysis train");
+  // ESD input handler
+  AliESDInputHandler *esdHandler = new AliESDInputHandler();
+  mgr->SetInputEventHandler(esdHandler);
+
+  AliAODHandler* aodHandler   = new AliAODHandler();
+  mgr->SetOutputEventHandler(aodHandler);
+  aodHandler->SetOutputFileName("AliAODs.root");
+  
+  
+  AliAnalysisDataContainer *cin_esd = mgr->CreateContainer("cESD",TChain::Class(), 
+                                                          AliAnalysisManager::kInputContainer);
+  // Output AOD container. Pointer to AOD put here only by filter task.
+  // This container is managed by the AOD handler
+  AliAnalysisDataContainer *cout_aod = mgr->CreateContainer("cAOD", TTree::Class(),
+                                                           AliAnalysisManager::kOutputContainer, "default");
+  
+  AliFMDAnalysisTaskSE *fmdana = new AliFMDAnalysisTaskSE("FMDAnalysis");
+  mgr->AddTask(fmdana);
+  // Output histograms list for jet analysis                       
+  AliAnalysisDataContainer *cout_fmd = mgr->CreateContainer("BackgroundCorrected", 
+                                                           TList::Class(),
+                                                           AliAnalysisManager::kOutputContainer, "fmd_analysis.root");
+  // Dummy AOD output container for jet analysis (no client yet)
+  AliAnalysisDataContainer *c_aodfmd = mgr->CreateContainer("cAODfmd", 
+                                                           TTree::Class(),
+                                                           AliAnalysisManager::kExchangeContainer);
+  // Connect to data containers
+  mgr->ConnectInput  (fmdana,     0, cin_esd  );
+  mgr->ConnectOutput (fmdana,     0, c_aodfmd );
+  mgr->ConnectOutput (fmdana,     1, cout_fmd );
+       
+  
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage(cdbPath);
+  cdb->SetRun(0);
+  
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  pars->Init();
+  if (AliGeomManager::GetGeometry() == NULL)
+    AliGeomManager::LoadGeometry();
+  
+  AliFMDGeometry* geo = AliFMDGeometry::Instance();
+  geo->Init();
+  geo->InitTransformations();
+  
+  TStopwatch timer;
+  timer.Start();
+  if (mgr->InitAnalysis()) {
+    mgr->PrintStatus();
+    mgr->StartAnalysis("local",chain, 1000);
+  }   
+  timer.Stop();
+  timer.Print();
+}
+//______________________________________________________________________________
+TChain* CreateChainSingle(const char* xmlfile, const char *treeName="esdTree")
+{
+   printf("*******************************\n");
+   printf("*** Getting the ESD Chain   ***\n");
+   printf("*******************************\n");
+   TAlienCollection * myCollection  = TAlienCollection::Open(xmlfile);
+
+   if (!myCollection) {
+      ::Error("CreateChainSingle", "Cannot create an AliEn collection from %s", xmlfile) ;
+      return NULL ;
+  }
+
+  TChain* chain = new TChain(treeName);
+  myCollection->Reset() ;
+  while ( myCollection->Next() ) chain->Add(myCollection->GetTURL("")) ;
+  chain->ls();
+  return chain;
+}
index f5fc63d..45133cd 100644 (file)
@@ -25,7 +25,7 @@ void RunLocalFMDAnalysis(const Char_t* filename= "AliESDs.root",
   AliFMDAnalysisTaskSharing *FMDana1 = new AliFMDAnalysisTaskSharing("sharing");
   AliFMDAnalysisTaskDensity *FMDana2 = new AliFMDAnalysisTaskDensity("density");
   AliFMDAnalysisTaskBackgroundCorrection *FMDana3 = new AliFMDAnalysisTaskBackgroundCorrection("background");
-  
+  AliFMDAnalysisTaskDndeta *FMDana4 = new AliFMDAnalysisTaskDndeta("dNdeta");
   
   cout<<"Creating the manager"<<endl;
   AliAnalysisManager* mgr = new AliAnalysisManager("fmd_analysis","fmd_analysis");
@@ -33,29 +33,48 @@ void RunLocalFMDAnalysis(const Char_t* filename= "AliESDs.root",
   mgr->AddTask(FMDana1); 
   mgr->AddTask(FMDana2);
   mgr->AddTask(FMDana3);
-  
+  mgr->AddTask(FMDana4);
   
   
   AliAnalysisDataContainer* cin_esd = mgr->CreateContainer("esdTree",TTree::Class(),AliAnalysisManager::kInputContainer,"AliESDs.root");
+  AliAnalysisDataContainer* cexchangevertex = mgr->CreateContainer("esdvertex",AliESDVertex::Class(),AliAnalysisManager::kExchangeContainer);
   AliAnalysisDataContainer* cexchange0 = mgr->CreateContainer("exchangeESDFMD0",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
-  AliAnalysisDataContainer* cexchange1 = mgr->CreateContainer("exchangeESDFMD1",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cdiag1 = mgr->CreateContainer("diagSharing1",AliESDEvent::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cdiag2 = mgr->CreateContainer("diagSharing2",TList::Class(),AliAnalysisManager::kOutputContainer,"edists.root");
+  AliAnalysisDataContainer* cexchange1 = mgr->CreateContainer("exchangeESDFMD1",AliESDFMD::Class(),AliAnalysisManager::kExchangeContainer);
   AliAnalysisDataContainer* cexchange2 = mgr->CreateContainer("listOfhists",TList::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cvertex = mgr->CreateContainer("vertex",TObjString::Class(),AliAnalysisManager::kExchangeContainer);
+  AliAnalysisDataContainer* cexchange3 = mgr->CreateContainer("BackgroundCorrectedperevent",TList::Class(),AliAnalysisManager::kOutputContainer,"testOut.root");
   AliAnalysisDataContainer* coutput = mgr->CreateContainer("BackgroundCorrected",TList::Class(),AliAnalysisManager::kOutputContainer,outFile);
   
   mgr->ConnectInput(FMDana0, 0 , cin_esd);   
-  mgr->ConnectOutput(FMDana0, 0 , cexchange0); 
+  mgr->ConnectOutput(FMDana0, 0 , cexchange0);
+  
   mgr->ConnectInput(FMDana1, 0 , cexchange0);   
-  mgr->ConnectOutput(FMDana1, 0 , cexchange1);   
+
+  mgr->ConnectOutput(FMDana1, 0 , cexchange1);  
+  mgr->ConnectOutput(FMDana1, 1 , cexchangevertex);   
+  mgr->ConnectOutput(FMDana1, 2 , cdiag1);
+  mgr->ConnectOutput(FMDana1, 3 , cdiag2);
+  
+  
   mgr->ConnectInput(FMDana2, 0 , cexchange1);   
+  mgr->ConnectInput(FMDana2, 1 , cexchangevertex);   
   mgr->ConnectOutput(FMDana2, 0 , cexchange2);
+  
   mgr->ConnectInput(FMDana3, 0 , cexchange2);   
-  mgr->ConnectOutput(FMDana3, 0 , coutput);
+  mgr->ConnectOutput(FMDana3, 0 , cexchange3);
+  mgr->ConnectOutput(FMDana3, 1 , cvertex);
   
-  AliInputEventHandler* handler = new AliInputEventHandler();
+  mgr->ConnectInput(FMDana4, 0 , cexchange3);   
+  mgr->ConnectInput(FMDana4, 1 , cvertex);   
+  mgr->ConnectOutput(FMDana4, 0 , coutput);
+  
   TFile::Open(filename);
   TChain* chain = (TChain*)gFile->Get("esdTree");
-  handler->SetInputTree(chain);
-  mgr->SetInputEventHandler(handler);
+
+  
   mgr->InitAnalysis();
   mgr->PrintStatus();
   
diff --git a/FMD/analysis/RunLocalFMDAnalysisSE.C b/FMD/analysis/RunLocalFMDAnalysisSE.C
new file mode 100644 (file)
index 0000000..1120aa4
--- /dev/null
@@ -0,0 +1,89 @@
+void RunLocalFMDAnalysisSE(const Char_t* filename= "AliESDs.root", const Char_t* cdbPath="local://$ALICE_ROOT", const Char_t* outFile = "fmd_analysis.root") {
+
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  gSystem->Load("libFMDanalysis");
+  
+  //TGrid::Connect("alien://",0,0,"t"); 
+  //TChain* chain = CreateChainSingle(collectionName);  
+  TFile::Open(filename);
+  TChain* chain = (TChain*)gFile->Get("esdTree");
+  if (!chain) return;
+  
+  //
+  // Make the analysis manager
+  AliAnalysisManager *mgr  = new AliAnalysisManager("Analysis Train", "A test setup for the analysis train");
+  // ESD input handler
+  AliESDInputHandler *esdHandler = new AliESDInputHandler();
+  mgr->SetInputEventHandler(esdHandler);
+
+  AliAODHandler* aodHandler   = new AliAODHandler();
+  mgr->SetOutputEventHandler(aodHandler);
+  aodHandler->SetOutputFileName("AliAODs.root");
+  
+  
+  AliAnalysisDataContainer *cin_esd = mgr->CreateContainer("cESD",TChain::Class(), 
+                                                          AliAnalysisManager::kInputContainer);
+  // Output AOD container. Pointer to AOD put here only by filter task.
+  // This container is managed by the AOD handler
+  AliAnalysisDataContainer *cout_aod = mgr->CreateContainer("cAOD", TTree::Class(),
+                                                           AliAnalysisManager::kOutputContainer, "default");
+  
+  AliFMDAnalysisTaskSE *fmdana = new AliFMDAnalysisTaskSE("FMDAnalysis");
+  mgr->AddTask(fmdana);
+  // Output histograms list for jet analysis                       
+  AliAnalysisDataContainer *cout_fmd = mgr->CreateContainer("BackgroundCorrected", 
+                                                           TList::Class(),
+                                                           AliAnalysisManager::kOutputContainer, outFile);
+  // Dummy AOD output container for jet analysis (no client yet)
+  AliAnalysisDataContainer *c_aodfmd = mgr->CreateContainer("cAODfmd", 
+                                                           TTree::Class(),
+                                                           AliAnalysisManager::kExchangeContainer);
+  // Connect to data containers
+  mgr->ConnectInput  (fmdana,     0, cin_esd  );
+  mgr->ConnectOutput (fmdana,     0, c_aodfmd );
+  mgr->ConnectOutput (fmdana,     1, cout_fmd );
+       
+  
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage(cdbPath);
+  cdb->SetRun(0);
+  
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  pars->Init();
+  if (AliGeomManager::GetGeometry() == NULL)
+    AliGeomManager::LoadGeometry();
+  
+  AliFMDGeometry* geo = AliFMDGeometry::Instance();
+  geo->Init();
+  geo->InitTransformations();
+  
+  TStopwatch timer;
+  timer.Start();
+  if (mgr->InitAnalysis()) {
+    mgr->PrintStatus();
+    mgr->StartAnalysis("local",chain);
+  }   
+  timer.Stop();
+  timer.Print();
+}
+//______________________________________________________________________________
+TChain* CreateChainSingle(const char* xmlfile, const char *treeName="esdTree")
+{
+   printf("*******************************\n");
+   printf("*** Getting the ESD Chain   ***\n");
+   printf("*******************************\n");
+   TAlienCollection * myCollection  = TAlienCollection::Open(xmlfile);
+
+   if (!myCollection) {
+      ::Error("CreateChainSingle", "Cannot create an AliEn collection from %s", xmlfile) ;
+      return NULL ;
+  }
+
+  TChain* chain = new TChain(treeName);
+  myCollection->Reset() ;
+  while ( myCollection->Next() ) chain->Add(myCollection->GetTURL("")) ;
+  chain->ls();
+  return chain;
+}
index addbcbd..74308f8 100644 (file)
@@ -8,7 +8,9 @@ SRCS            =  analysis/AliFMDAnaParameters.cxx     \
                   analysis/AliFMDAnalysisTaskSharing.cxx       \
                   analysis/AliFMDAnalysisTaskDensity.cxx       \
                   analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx \
-                  analysis/AliFMDAnalysisTaskCollector.cxx    
+                  analysis/AliFMDAnalysisTaskCollector.cxx   \
+                  analysis/AliFMDAnalysisTaskDndeta.cxx         \
+                  analysis/AliFMDAnalysisTaskSE.cxx  
 
 
 HDRS           =  $(SRCS:.cxx=.h)