Added storage of energy spectra from analysis when running SE task
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jul 2009 20:33:33 +0000 (20:33 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jul 2009 20:33:33 +0000 (20:33 +0000)
FMD/analysis/AliFMDAnalysisTaskSE.cxx
FMD/analysis/AliFMDAnalysisTaskSharing.cxx
FMD/analysis/AliFMDAnalysisTaskSharing.h

index ed56565..6f884e2 100644 (file)
@@ -48,7 +48,8 @@ void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
   
   fSharing.SetFMDData(fmd);
   fSharing.SetVertex(vertex);
-  
+  fSharing.SetOutputList(fListOfHistos);
+
   fDensity.SetOutputList(densitylist);
   fDensity.SetInputESDFMD(fmd) ;
   fDensity.SetInputVertex(vertex);
index 16ac3fc..56e8595 100644 (file)
@@ -30,7 +30,7 @@ AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing()
   fNstrips(0),
   fSharedThis(kFALSE),
   fSharedPrev(kFALSE),
-  fDiagList(),
+  fDiagList(0),
   fStandalone(kTRUE),
   fEsdVertex(0),
   fStatus(kTRUE)
@@ -52,7 +52,7 @@ AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, Bool_t SE
     fNstrips(0),
     fSharedThis(kFALSE),
     fSharedPrev(kFALSE),
-    fDiagList(),
+    fDiagList(0),
     fStandalone(kTRUE),
     fEsdVertex(0),
     fStatus(kTRUE)
@@ -75,7 +75,10 @@ void AliFMDAnalysisTaskSharing::CreateOutputObjects()
   if(!fEsdVertex)
     fEsdVertex    = new AliESDVertex();
   //Diagnostics
-  fDiagList.SetName("Sharing diagnostics");
+  if(!fDiagList)
+    fDiagList = new TList();
+  
+  fDiagList->SetName("Sharing diagnostics");
   for(Int_t det = 1; det<=3; det++) {
     Int_t nRings = (det==1 ? 1 : 2);
     
@@ -92,9 +95,9 @@ void AliFMDAnalysisTaskSharing::CreateOutputObjects()
       TH1F* hNstripsHit    = new TH1F(Form("N_strips_hit_FMD%d%c",det,ringChar),
                                     Form("N_strips_hit_FMD%d%c",det,ringChar),
                                     25,0,25);
-      fDiagList.Add(hEdist);
-      fDiagList.Add(hEdist_after);
-      fDiagList.Add(hNstripsHit);
+      fDiagList->Add(hEdist);
+      fDiagList->Add(hEdist_after);
+      fDiagList->Add(hNstripsHit);
 
     }
   }
@@ -130,10 +133,9 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
   const AliMultiplicity* testmult = fESD->GetMultiplicity();
   
   Int_t nTrackLets = testmult->GetNumberOfTracklets();
-  
   if(nTrackLets < 1000) foutputESDFMD->SetUniqueID(kTRUE);
   else foutputESDFMD->SetUniqueID(kFALSE);
-  
+
   AliESDFMD* fmd = fESD->GetFMDData();
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   if (!fmd) return;
@@ -145,7 +147,7 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
       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));
+      TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_before_sharing_FMD%d%c",det,ring));
       
       for(UShort_t sec =0; sec < nsec;  sec++) {
        fSharedThis      = kFALSE;
@@ -197,7 +199,7 @@ void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
     PostData(0, foutputESDFMD); 
     PostData(1, fEsdVertex); 
     PostData(2, fESD); 
-    PostData(3, &fDiagList); 
+    PostData(3, fDiagList); 
   }
 }
 //_____________________________________________________________________
@@ -307,7 +309,7 @@ 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));
+  TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
   hEdist->Fill(Etotal);
   
   Etotal = Etotal*TMath::Cos(Eta2Theta(eta));
index 3a6e6bb..87e42f4 100644 (file)
@@ -47,6 +47,7 @@ class AliFMDAnalysisTaskSharing : public AliAnalysisTask
     Float_t GetMultiplicityOfStrip(Float_t mult, Float_t eta, Float_t Eprev, Float_t Enext, UShort_t   det, Char_t  ring, UShort_t sec, UShort_t strip);
     void GetVertex(Double_t* vertexXYZ) ;
     void SetFMDData(AliESDFMD* fmd) {foutputESDFMD = fmd;}
+    void SetOutputList(TList* outlist) {fDiagList = outlist;}
     void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;}
     void SetInputESD(AliESDEvent* esd) {fESD = esd;}
     Bool_t GetEventStatus() {return fStatus;}
@@ -61,7 +62,7 @@ class AliFMDAnalysisTaskSharing : public AliAnalysisTask
     Int_t         fNstrips;
     Bool_t        fSharedThis;
     Bool_t        fSharedPrev;
-    TList         fDiagList;
+    TList*        fDiagList;
     Bool_t        fStandalone;
     AliESDVertex* fEsdVertex;
     Bool_t        fStatus;