]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliAnalysisTaskHFEpidQA.cxx
Update of the HFE package
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFEpidQA.cxx
CommitLineData
70da6c5a 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15//
16// Task for PID QA
17// Using AliHFEpidQA and AliHFEMCpidQA
18//
19// Authors
20// Matus Kalisky <matus.kalisky@cern.ch>
21// Markus Heide <mheide@uni-muenster.de>
22// Markus Fasel <M.Fasel@gsi.de>
23//
24#include <TH1I.h>
25#include <TList.h>
26
27#include "AliAnalysisTaskHFEpidQA.h"
28#include "AliHFEpidQA.h"
29#include "AliESDEvent.h"
30#include "AliMCEvent.h"
31
32ClassImp(AliAnalysisTaskHFEpidQA)
33
34AliAnalysisTaskHFEpidQA::AliAnalysisTaskHFEpidQA():
35 AliAnalysisTaskSE("pidQAtask")
36 , fPIDqa(NULL)
37 , fOutput(NULL)
38 , fEvents(NULL)
39{
40 //
41 // Default Constructor
42 //
43 DefineOutput(1, TList::Class());
44}
45
46AliAnalysisTaskHFEpidQA::AliAnalysisTaskHFEpidQA(const Char_t *name):
47 AliAnalysisTaskSE(name)
48 , fPIDqa(NULL)
49 , fOutput(NULL)
50 , fEvents(NULL)
51{
52 //
53 // Default Constructor
54 //
55 DefineOutput(1, TList::Class());
56}
57
58AliAnalysisTaskHFEpidQA::~AliAnalysisTaskHFEpidQA(){
59 //
60 // Destructor
61 //
62 if(fPIDqa) delete fPIDqa;
63 if(fOutput) delete fOutput;
64}
65
66void AliAnalysisTaskHFEpidQA::UserCreateOutputObjects(){
67 //
68 // Create the output
69 // Initialize PID QA
70 //
71 fOutput = new TList;
72
73 // Counter for number of events
74 fOutput->Add((fEvents = new TH1I("nEvents", "NumberOfEvents", 1, 1, 2)));
75
76 fPIDqa = new AliHFEpidQA;
77 if(HasV0pidQA()) fPIDqa->SetV0pidQA();
78 if(HasRecalculateTRDpid()) fPIDqa->SetRecalculateTRDpid();
79 fPIDqa->Init();
80
81 TList *tmp = fPIDqa->GetOutput();
82 tmp->SetName("PIDqa");
83 fOutput->Add(tmp);
84 if(HasV0pidQA()){
85 tmp = fPIDqa->GetV0pidQA();
86 tmp->SetName("V0pidQA");
87 fOutput->Add(tmp);
88 }
89 tmp = 0x0;
90 tmp = fPIDqa->GetV0pidMC();
91 if(tmp){
92 tmp->SetName("V0pidMC");
93 fOutput->Add(tmp);
94 }
95
96}
97
98void AliAnalysisTaskHFEpidQA::UserExec(Option_t *){
99 //
100 // Event Loop
101 //
102 if(fMCEvent) fPIDqa->SetMCEvent(fMCEvent);
103 fPIDqa->SetRun((dynamic_cast<AliESDEvent*>(fInputEvent))->GetRunNumber());
104 fPIDqa->SetT0((dynamic_cast<AliESDEvent*>(fInputEvent))->GetT0());
105 fPIDqa->Process(fInputEvent);
106 fEvents->Fill(1.1);
107 PostData(1, fOutput);
108}
109
110void AliAnalysisTaskHFEpidQA::Terminate(Option_t *){
111 //
112 // Do Post Processing
113 //
114}
115