The FMD analysis tasks. This is a first version and there is work to do
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Oct 2008 14:43:45 +0000 (14:43 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Oct 2008 14:43:45 +0000 (14:43 +0000)
FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskDensity.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskDensity.h [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskESDReader.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskESDReader.h [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskSharing.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnalysisTaskSharing.h [new file with mode: 0644]
FMD/analysis/FMDanalysisLinkDef.h
FMD/libFMDanalysis.pkg

diff --git a/FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx b/FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
new file mode 100644 (file)
index 0000000..54171c0
--- /dev/null
@@ -0,0 +1,143 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+#include <iostream>
+#include "TH2F.h"
+#include "AliFMDAnalysisTaskBackgroundCorrection.h"
+#include "AliAnalysisManager.h"
+#include "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliStack.h"
+#include "AliESDVertex.h"
+#include "TMath.h"
+#include "AliFMDAnaParameters.h"
+#include "AliFMDGeometry.h"
+
+ClassImp(AliFMDAnalysisTaskBackgroundCorrection)
+
+
+AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection()
+: fDebug(0),
+  fChain(0x0),
+  fOutputList(0),
+  fArray(0),
+  fInputArray(0)
+{
+  // Default constructor
+  DefineInput (0, TList::Class());
+  DefineOutput(0,TList::Class());
+}
+
+AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection(const char* name):
+    AliAnalysisTask(name, "Density"),
+    fDebug(0),
+    fChain(0x0),
+    fOutputList(0),
+    fArray(0),
+    fInputArray(0)
+{
+  DefineInput (0, TList::Class());
+  DefineOutput(0, TList::Class());
+}
+
+void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects()
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  fOutputList = new TList();
+  
+  fArray     = new TObjArray();
+  fArray->SetName("FMD");
+  fArray->SetOwner();
+  
+  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("mult_FMD%d%c_vtxbin%d",det,ringChar,i),Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),
+                             hBg->GetNbinsX(),
+                             hBg->GetXaxis()->GetXmin(),
+                             hBg->GetXaxis()->GetXmax(),
+                             nSec, 0, 2*TMath::Pi());
+           vtxArray->AddAtAndExpand(hMult,i);
+           
+         }
+       } 
+    }
+    
+  fOutputList->Add(fArray);
+   
+  
+}
+
+void AliFMDAnalysisTaskBackgroundCorrection::ConnectInputData(Option_t */*option*/)
+{
+
+  TList* list = (TList*)GetInputData(0);
+  fInputArray = (TObjArray*)list->At(0);
+    
+}
+
+void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  Int_t nVtxbins = pars->GetNvtxBins();
+  
+    
+  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);
+      for(Int_t i =0; i<nVtxbins; i++) {
+       TH2F* hMultTotal = (TH2F*)vtxArray->At(i);
+       TH2F* hMult      = (TH2F*)vtxInputArray->At(i);
+       TH2F* hBg        = pars->GetBackgroundCorrection(det, ringChar, i);
+       
+       TH2F* hTmp       = (TH2F*)hMult->Clone("hMult_from_event");
+       /*for(Int_t j=1; j<=hMult->GetNbinsX();j++) {
+         for(Int_t k=1; k<=hMult->GetNbinsY();k++) {
+           if(hBg->GetBinContent(j,k) != 0) {
+             // std::cout<<hMult->GetBinContent(j,k)<<"    "<<hBg->GetBinContent(j,k)<<std::endl;
+             hTmp->SetBinContent(j,k,hMult->GetBinContent(j,k)/hBg->GetBinContent(j,k));
+           }
+         }
+         }*/
+       hTmp->Divide(hTmp,hBg,1,1,"B");
+       
+       hMultTotal->Add(hTmp);
+       
+      }
+    }
+  }
+  
+  PostData(0, fOutputList); 
+  
+}
+
diff --git a/FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h b/FMD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h
new file mode 100644 (file)
index 0000000..60721bf
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIFMDANALYSISTASKBACKGROUNDCORRECTION_H
+#define ALIFMDANALYSISTASKBACKGROUNDCORRECTION_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 "AliESDFMD.h"
+class AliESDEvent;
+class TChain;
+class AliAODEvent;
+
+
+
+class AliFMDAnalysisTaskBackgroundCorrection : public AliAnalysisTask
+{
+ public:
+    AliFMDAnalysisTaskBackgroundCorrection();
+    AliFMDAnalysisTaskBackgroundCorrection(const char* name);
+    virtual ~AliFMDAnalysisTaskBackgroundCorrection() {;}
+    // 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;}
+    
+ private:
+    Int_t         fDebug;        //  Debug flag
+    TChain*       fChain;        //! chained files
+    TList*        fOutputList;
+    TObjArray*    fArray;
+    TObjArray*    fInputArray;
+    
+    ClassDef(AliFMDAnalysisTaskBackgroundCorrection, 0); // Analysis task for FMD analysis
+};
+#endif
diff --git a/FMD/analysis/AliFMDAnalysisTaskDensity.cxx b/FMD/analysis/AliFMDAnalysisTaskDensity.cxx
new file mode 100644 (file)
index 0000000..20ab662
--- /dev/null
@@ -0,0 +1,168 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+#include <iostream>
+#include "TAxis.h"
+#include "TH2F.h"
+#include "AliFMDAnalysisTaskDensity.h"
+#include "AliAnalysisManager.h"
+#include "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliStack.h"
+#include "AliESDVertex.h"
+#include "TMath.h"
+#include "AliFMDAnaParameters.h"
+#include "AliFMDGeometry.h"
+
+ClassImp(AliFMDAnalysisTaskDensity)
+
+//_____________________________________________________________________
+AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity()
+: fDebug(0),
+  fOutputList(0),
+  fArray(0),
+  fESD(0x0)
+{
+  // Default constructor
+  DefineInput (0, AliESDEvent::Class());
+  DefineOutput(0,TList::Class());
+}
+//_____________________________________________________________________
+AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity(const char* name):
+    AliAnalysisTask(name, "Density"),
+    fDebug(0),
+    fOutputList(0),
+    fArray(0),
+    fESD(0x0)
+{
+  DefineInput (0, AliESDEvent::Class());
+  DefineOutput(0, TList::Class());
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDensity::CreateOutputObjects()
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  fOutputList = new TList();
+  
+  fArray     = new TObjArray();
+  fArray->SetName("FMD");
+  fArray->SetOwner();
+  
+  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("FMD%d%c_vtxbin%d",det,ringChar,i),Form("FMD%d%c_vtxbin%d",det,ringChar,i),
+                             hBg->GetNbinsX(),
+                             hBg->GetXaxis()->GetXmin(),
+                             hBg->GetXaxis()->GetXmax(),
+                             nSec, 0, 2*TMath::Pi());
+           vtxArray->AddAtAndExpand(hMult,i);
+           
+         }
+       } 
+    }
+    
+  fOutputList->Add(fArray);
+   
+  
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDensity::ConnectInputData(Option_t */*option*/)
+{
+
+  fESD = (AliESDEvent*)GetInputData(0);
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  AliFMDGeometry* geo       = AliFMDGeometry::Instance();
+  
+  AliESDFMD*   fmd = fESD->GetFMDData();
+  
+  Int_t nVtxbins = pars->GetNvtxBins();
+  
+  Double_t vertex[3];
+  fESD->GetPrimaryVertexSPD()->GetXYZ(vertex);
+  
+  if( TMath::Abs(vertex[2]) > pars->GetVtxCutZ()) 
+    return;
+  Double_t delta = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
+  Double_t vertexBinDouble = (vertex[2] + pars->GetVtxCutZ()) / delta;
+  
+  Int_t vtxbin = (Int_t)vertexBinDouble;
+  
+  //Resetting 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* 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);
+      Char_t   ring = (ir == 0 ? 'I' : 'O');
+      UShort_t nsec = (ir == 0 ? 20  : 40);
+      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);
+         Double_t x,y,z;
+         geo->Detector2XYZ(det,ring,sec,strip,x,y,z);
+         Float_t phi = TMath::ATan2(y,x);
+         if(phi<0)
+           phi = phi+2*TMath::Pi();
+         hMult->Fill(eta,phi,mult);
+         
+       }
+      }
+    }
+       
+  
+  }
+  PostData(0, fOutputList); 
+  
+}
+//_____________________________________________________________________
+//
+//EOF
+//
diff --git a/FMD/analysis/AliFMDAnalysisTaskDensity.h b/FMD/analysis/AliFMDAnalysisTaskDensity.h
new file mode 100644 (file)
index 0000000..327b57b
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef ALIFMDANALYSISTASKDENSITY_H
+#define ALIFMDANALYSISTASKDENSITY_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 "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "TObjString.h"
+#include "TTree.h"
+class AliESDEvent;
+class TChain;
+class AliAODEvent;
+
+
+
+class AliFMDAnalysisTaskDensity : public AliAnalysisTask
+{
+ public:
+    AliFMDAnalysisTaskDensity();
+    AliFMDAnalysisTaskDensity(const char* name);
+    virtual ~AliFMDAnalysisTaskDensity() {;}
+    // 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;}
+    
+ private:
+    Int_t         fDebug;        //  Debug flag
+    TList*        fOutputList;
+    TObjArray*    fArray;
+    AliESDEvent*  fESD;
+    ClassDef(AliFMDAnalysisTaskDensity, 0); // Analysis task for FMD analysis
+};
+#endif
diff --git a/FMD/analysis/AliFMDAnalysisTaskESDReader.cxx b/FMD/analysis/AliFMDAnalysisTaskESDReader.cxx
new file mode 100644 (file)
index 0000000..294da70
--- /dev/null
@@ -0,0 +1,64 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+#include <iostream>
+
+#include "AliFMDAnalysisTaskESDReader.h"
+#include "AliAnalysisManager.h"
+#include "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliStack.h"
+#include "AliESDVertex.h"
+#include "AliFMDAnaParameters.h"
+
+ClassImp(AliFMDAnalysisTaskESDReader)
+
+//_____________________________________________________________________
+AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader()
+: fDebug(0),
+  fChain(0x0),
+  fESD(0x0),
+  fOutputESD(0x0)
+{
+  // Default constructor
+  DefineInput (0, TTree::Class());
+  DefineOutput(0, AliESDEvent::Class());
+}
+//_____________________________________________________________________
+AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader(const char* name):
+    AliAnalysisTask(name, "AnalysisTaskFMD"),
+    fDebug(0),
+    fChain(0x0),
+    fESD(0x0),
+    fOutputESD(0x0)
+{
+  DefineInput (0, TTree::Class());
+  DefineOutput(0, AliESDEvent::Class());
+}
+
+//_____________________________________________________________________
+void AliFMDAnalysisTaskESDReader::ConnectInputData(Option_t */*option*/)
+{
+  fChain = (TChain*)GetInputData(0);
+  fESD = new AliESDEvent();
+  fESD->ReadFromTree(fChain);
+  
+}
+//_____________________________________________________________________
+
+void AliFMDAnalysisTaskESDReader::Exec(Option_t */*option*/)
+{
+  fOutputESD = fESD;
+    
+  PostData(0, fOutputESD); 
+  
+}
+//_____________________________________________________________________
+
diff --git a/FMD/analysis/AliFMDAnalysisTaskESDReader.h b/FMD/analysis/AliFMDAnalysisTaskESDReader.h
new file mode 100644 (file)
index 0000000..a5351c9
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIFMDANALYSISTASKESDREADER_H
+#define ALIFMDANALYSISTASKESDREADER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+#include "AliAnalysisTask.h"
+#include "TH1F.h"
+#include "TObjString.h"
+#include "AliESDFMD.h"
+#include "TTree.h"
+class AliESDEvent;
+class TChain;
+class AliAODEvent;
+
+
+
+class AliFMDAnalysisTaskESDReader : public AliAnalysisTask
+{
+ public:
+    AliFMDAnalysisTaskESDReader();
+    AliFMDAnalysisTaskESDReader(const char* name);
+    virtual ~AliFMDAnalysisTaskESDReader() {;}
+    // 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;}
+    
+ private:
+    Int_t         fDebug;        //  Debug flag
+    TChain*       fChain;        //! chained files
+    AliESDEvent*  fESD;          //! ESD
+    AliESDEvent*  fOutputESD;
+    
+    ClassDef(AliFMDAnalysisTaskESDReader, 0); // Analysis task for FMD analysis
+};
+#endif
diff --git a/FMD/analysis/AliFMDAnalysisTaskSharing.cxx b/FMD/analysis/AliFMDAnalysisTaskSharing.cxx
new file mode 100644 (file)
index 0000000..1f37cad
--- /dev/null
@@ -0,0 +1,110 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+#include <iostream>
+
+#include "AliFMDAnalysisTaskSharing.h"
+#include "AliAnalysisManager.h"
+#include "AliESDFMD.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliStack.h"
+#include "AliESDVertex.h"
+#include "AliFMDAnaParameters.h"
+
+ClassImp(AliFMDAnalysisTaskSharing)
+
+//_____________________________________________________________________
+AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing()
+: fDebug(0),
+  fESD(0x0),
+  fOutputESD(0x0),
+  foutputESDFMD(0x0)
+{
+  // Default constructor
+  DefineInput (0, AliESDEvent::Class());
+  DefineOutput(0, AliESDEvent::Class());
+}
+//_____________________________________________________________________
+AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name):
+    AliAnalysisTask(name, "AnalysisTaskFMD"),
+    fDebug(0),
+    fESD(0x0),
+    fOutputESD(0x0),
+    foutputESDFMD(0x0)
+{
+  DefineInput (0, AliESDEvent::Class());
+  DefineOutput(0, AliESDEvent::Class());
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSharing::CreateOutputObjects()
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  AliESDFMD* outputESDFMD      = 0; 
+  Int_t nvtxbins = pars->GetNvtxBins();
+  
+  fOutputESD    = new AliESDEvent();
+  fOutputESD->CreateStdContent();
+  
+  foutputESDFMD = new AliESDFMD();
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSharing::ConnectInputData(Option_t */*option*/)
+{
+  fESD = (AliESDEvent*)GetInputData(0);
+}
+//_____________________________________________________________________
+void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
+{
+  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+  
+  AliESD* old = fESD->GetAliESDOld();
+  if (old) {
+    fESD->CopyFromOldESD();
+  }
+  
+  foutputESDFMD->Clear();
+  
+  fOutputESD->SetPrimaryVertexSPD(fESD->GetPrimaryVertexSPD());
+  
+  AliESDFMD* fmd = fESD->GetFMDData();
+  
+  if (!fmd) return;
+  
+  for(UShort_t det=1;det<=3;det++) {
+    Int_t nRings = (det==1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nRings; ir++) {
+      Char_t   ring = (ir == 0 ? 'I' : 'O');
+      UShort_t nsec = (ir == 0 ? 20  : 40);
+      UShort_t nstr = (ir == 0 ? 512 : 256);
+      for(UShort_t sec =0; sec < nsec;  sec++)  {
+       for(UShort_t strip = 0; strip < nstr; strip++) {
+         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,0.);
+         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+         if(mult == AliESDFMD::kInvalidMult) continue;
+         //Sharing algorithm goes here
+         if(mult < 0.75) continue;
+         
+         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,1.);
+         foutputESDFMD->SetEta(det,ring,sec,strip,fmd->Eta(det,ring,sec,strip));
+         
+       }
+      }
+    }
+  }
+  fOutputESD->SetFMDData(foutputESDFMD);
+    
+  PostData(0, fOutputESD); 
+  
+}
+//_____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/analysis/AliFMDAnalysisTaskSharing.h b/FMD/analysis/AliFMDAnalysisTaskSharing.h
new file mode 100644 (file)
index 0000000..475c124
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIFMDANALYSISTASKSHARING_H
+#define ALIFMDANALYSISTASKSHARING_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+#include "AliAnalysisTask.h"
+#include "TH1F.h"
+#include "TObjString.h"
+#include "AliESDFMD.h"
+#include "TTree.h"
+class AliESDEvent;
+class TChain;
+class AliAODEvent;
+
+
+
+class AliFMDAnalysisTaskSharing : public AliAnalysisTask
+{
+ public:
+    AliFMDAnalysisTaskSharing();
+    AliFMDAnalysisTaskSharing(const char* name);
+    virtual ~AliFMDAnalysisTaskSharing() {;}
+    // 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;}
+    
+ private:
+    Int_t         fDebug;        //  Debug flag
+    AliESDEvent*  fESD;          //! ESD
+    AliESDEvent*  fOutputESD;
+    AliESDFMD*    foutputESDFMD;
+    ClassDef(AliFMDAnalysisTaskSharing, 0); // Analysis task for FMD analysis
+};
+#endif
index ef2bd41..1c94398 100644 (file)
 
 
 #pragma link C++ class AliFMDAnaParameters+;
+#pragma link C++ class AliFMDAnalysisTaskESDReader+;
+#pragma link C++ class AliFMDAnalysisTaskSharing+;
+#pragma link C++ class AliFMDAnalysisTaskDensity+;
+#pragma link C++ class AliFMDAnalysisTaskBackgroundCorrection+;
 #else
 # error Not for compilation 
 #endif
index 41f1bf1..26f6a9e 100644 (file)
@@ -1,11 +1,16 @@
 #-*- Mode: Makefile -*-
 #
 
-SRCS           =  analysis/AliFMDAnaParameters.cxx             
+SRCS           =  analysis/AliFMDAnaParameters.cxx     \
+                  analysis/AliFMDAnalysisTaskESDReader.cxx     \
+                  analysis/AliFMDAnalysisTaskSharing.cxx       \
+                  analysis/AliFMDAnalysisTaskDensity.cxx       \
+                  analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
 
 #                 AliFMDAltroIO.cxx            
 
 HDRS           =  $(SRCS:.cxx=.h) 
+EINCLUDE       := ANALYSIS
 
 DHDR           := analysis/FMDanalysisLinkDef.h