* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+
+/* $Id$ */
+
//_________________________________________________________________________
// An analysis task to check the FMD data in simulated data
//
//*-- Hans Hjersing Dalsgaard
//////////////////////////////////////////////////////////////////////////////
+#include <TCanvas.h>
#include <TChain.h>
+#include <TF1.h>
#include <TFile.h>
-#include <TCanvas.h>
#include <TH1D.h>
-#include <TF1.h>
+#include <TROOT.h>
+#include <TString.h>
#include "AliFMDQATask.h"
#include "AliESD.h"
}
//______________________________________________________________________________
-void AliFMDQATask::Init(const Option_t*)
+void AliFMDQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliFMDQATask::CreateOutputObjects()
+{
// create histograms
+
+ OpenFile(0) ;
+
fhFMD1i = new TH1D("FMD1i", "FMD1i", 100, -0.5, 3);
fhFMD2i = new TH1D("FMD2i", "FMD2i", 100, -0.5, 3);
fhFMD2o = new TH1D("FMD2o", "FMD2o", 100, -0.5, 3);
AliInfo(Form("%s ----> Processing event # %lld", currentFile->GetName(), entry)) ;
// ************************ FMD *************************************
-
- AliESDFMD * fmd = fESD->GetFMDData() ;
-
- fmd->CheckNeedUShort(currentFile);
-
+ AliESDFMD * fmd = fESD->GetFMDData() ;
+ if ( ! fmd ) {
+ AliError("No FMD found in ESD") ;
+ return ;
+ }
+ fmd->CheckNeedUShort(currentFile);
Int_t nFMD1 = 0, nFMD2i = 0, nFMD2o = 0, nFMD3i = 0, nFMD3o = 0 ;
UShort_t detector = 1 ;
{
// Processing when the event loop is ended
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ if ( ! fOutputContainer )
+ return ;
+
+ fhFMD1i = (TH1D*)fOutputContainer->At(0);
+ fhFMD2i = (TH1D*)fOutputContainer->At(1);
+ fhFMD2o = (TH1D*)fOutputContainer->At(2);
+ fhFMD3i = (TH1D*)fOutputContainer->At(3);
+ fhFMD3o = (TH1D*)fOutputContainer->At(4);
+
TCanvas * cFMD1 = new TCanvas("cFMD1", "FMD ESD Test", 400, 10, 600, 700);
cFMD1->Divide(3, 2) ;