1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // Using AliHFEpidQA and AliHFEMCpidQA
20 // Matus Kalisky <matus.kalisky@cern.ch>
21 // Markus Heide <mheide@uni-muenster.de>
22 // Markus Fasel <M.Fasel@gsi.de>
27 #include "AliAnalysisManager.h"
28 #include "AliMCEventHandler.h"
30 #include "AliAnalysisTaskHFEpidQA.h"
31 #include "AliHFEpidQA.h"
32 #include "AliESDEvent.h"
33 #include "AliMCEvent.h"
35 ClassImp(AliAnalysisTaskHFEpidQA)
37 AliAnalysisTaskHFEpidQA::AliAnalysisTaskHFEpidQA():
38 AliAnalysisTaskSE("pidQAtask")
44 // Default Constructor
46 DefineOutput(1, TList::Class());
49 AliAnalysisTaskHFEpidQA::AliAnalysisTaskHFEpidQA(const Char_t *name):
50 AliAnalysisTaskSE(name)
56 // Default Constructor
58 DefineOutput(1, TList::Class());
61 AliAnalysisTaskHFEpidQA::~AliAnalysisTaskHFEpidQA(){
65 if(fPIDqa) delete fPIDqa;
66 if(fOutput) delete fOutput;
69 void AliAnalysisTaskHFEpidQA::UserCreateOutputObjects(){
76 // Counter for number of events
77 fOutput->Add((fEvents = new TH1I("nEvents", "NumberOfEvents", 1, 1, 2)));
79 fPIDqa = new AliHFEpidQA;
80 if(HasV0pidQA()) fPIDqa->SetV0pidQA();
81 if(HasRecalculateTRDpid()) fPIDqa->SetRecalculateTRDpid();
84 TList *tmp = fPIDqa->GetOutput();
85 tmp->SetName("PIDqa");
88 tmp = fPIDqa->GetV0pidQA();
89 tmp->SetName("V0pidQA");
93 tmp = fPIDqa->GetV0pidMC();
95 tmp->SetName("V0pidMC");
101 Bool_t AliAnalysisTaskHFEpidQA::UserNotify(){
104 //printf(" -D Current File Name: %s \n", CurrentFileName());
105 return AliAnalysisTask::Notify();
109 void AliAnalysisTaskHFEpidQA::UserExec(Option_t *){
113 AliMCEventHandler* mcHandler = (dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()));
115 if(fMCEvent && !mcHandler ) return;
116 if(fMCEvent && !mcHandler->InitOk() ) return;
117 if(fMCEvent && !mcHandler->TreeK() ) return;
118 if(fMCEvent && !mcHandler->TreeTR() ) return;
119 if(fMCEvent) fPIDqa->SetMCEvent(fMCEvent);
120 fPIDqa->SetRun((dynamic_cast<AliESDEvent*>(fInputEvent))->GetRunNumber());
121 fPIDqa->SetT0((dynamic_cast<AliESDEvent*>(fInputEvent))->GetT0());
122 fPIDqa->Process(fInputEvent);
124 PostData(1, fOutput);
127 void AliAnalysisTaskHFEpidQA::Terminate(Option_t *){
129 // Do Post Processing