]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/UNICOR/AliAnalysisTaskUnicorME.cxx
Update of the ITS PID response (F.Prino, M.Chojnacki, E.Biolcati)
[u/mrichter/AliRoot.git] / PWG2 / UNICOR / AliAnalysisTaskUnicorME.cxx
CommitLineData
b9c558f4 1/*************************************************************************
2* Copyright(c) 1998-2048, 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//Author: Dariusz Miskowiec 2007
17
18//=============================================================================
19// unicor analysis task
20//=============================================================================
21#include "AliMultiEventInputHandler.h"
22#include "AliESDHeader.h"
23#include "AliUnicorAnalGlobal.h"
24#include "AliUnicorAnalSingle.h"
25#include "AliUnicorAnalCorrel.h"
26#include "AliUnicorAnalPtfluc.h"
27#include "AliUnicorAnalHighpt.h"
28#include "AliUnicorEventAliceESD.h"
29#include "AliAnalysisTaskUnicorME.h"
30
31ClassImp(AliAnalysisTaskUnicorME)
32
33//=============================================================================
34AliAnalysisTaskUnicorME::AliAnalysisTaskUnicorME(const char *name) :
35 AliAnalysisTaskME(name),
36 fEv0(0),
37 fEv1(0),
38 fOutputList(0)
39{
40 // constructor
41
42 fEv0 = new AliUnicorEventAliceESD();
43 fEv1 = new AliUnicorEventAliceESD();
44 DefineOutput(1, TList::Class());
45}
46//=============================================================================
47void AliAnalysisTaskUnicorME::UserCreateOutputObjects()
48{
49 // executed once on each worker
50
51 fOutputList = new TList();
52 fOutputList->Add(new AliUnicorAnalGlobal("dag"));
53 fOutputList->Add(new AliUnicorAnalSingle("all",fEv0->Etamin(),fEv0->Etamax(),0));
54 fOutputList->Add(new AliUnicorAnalSingle("pim",fEv0->Etamin(),fEv0->Etamax(),-211));
55 fOutputList->Add(new AliUnicorAnalSingle("pip",fEv0->Etamin(),fEv0->Etamax(), 211));
56 fOutputList->Add(new AliUnicorAnalCorrel("cnn",fEv0->Etamin(),fEv0->Etamax(),-211,-211));
57 fOutputList->Add(new AliUnicorAnalCorrel("cpp",fEv0->Etamin(),fEv0->Etamax(), 211, 211));
58 fOutputList->Add(new AliUnicorAnalCorrel("cnp",fEv0->Etamin(),fEv0->Etamax(),-211, 211));
59 fOutputList->Add(new AliUnicorAnalPtfluc("ptf",0,0));
60 fOutputList->Add(new AliUnicorAnalHighpt("hpt",fEv0->Etamin(),fEv0->Etamax(),0,0));
61}
62//=============================================================================
63void AliAnalysisTaskUnicorME::UserExec(Option_t */*option*/)
64{
65 // process one event
66
67 if (fInputHandler->GetBufferSize() < 2) return;
68 AliESDEvent *esd0 = dynamic_cast<AliESDEvent*>(GetEvent(0));
69 AliESDEvent *esd1 = dynamic_cast<AliESDEvent*>(GetEvent(1));
70 if (!esd0) return;
71 if (!esd1) return;
72 if (!esd0->GetNumberOfTracks()) return;
73 if (!esd1->GetNumberOfTracks()) return;
74
75 printf("esd0 nr %3d mult %3d esd1 nr %3d mult %3d\n",
76 esd0->GetEventNumberInFile(), esd0->GetNumberOfTracks(),
77 esd1->GetEventNumberInFile(), esd1->GetNumberOfTracks());
78
79 fEv0->SetESD(esd0);
80 fEv1->SetESD(esd1);
81
82 if (!fEv0->Good()) return;
83 ((AliUnicorAnalGlobal *) fOutputList->At(0))->Process(fEv0);
84 ((AliUnicorAnalSingle *) fOutputList->At(1))->Process(fEv0);
85 ((AliUnicorAnalSingle *) fOutputList->At(2))->Process(fEv0);
86 ((AliUnicorAnalSingle *) fOutputList->At(3))->Process(fEv0);
87 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(0,fEv0,fEv0,0);
88 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
89 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(0,fEv0,fEv0,0);
90 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
91 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(0,fEv0,fEv0,0);
92 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
93 ((AliUnicorAnalPtfluc *) fOutputList->At(7))->Process(0,fEv0,fEv0);
94 ((AliUnicorAnalHighpt *) fOutputList->At(8))->Process(fEv0,fEv0);
95
96 if (!fEv1->Good()) return;
97 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(1,fEv0,fEv1,0);
98 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(1,fEv0,fEv1,0);
99 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(1,fEv0,fEv1,0);
100 ((AliUnicorAnalPtfluc *) fOutputList->At(7))->Process(1,fEv0,fEv1);
101 ((AliUnicorAnalHighpt *) fOutputList->At(8))->Process(fEv0,fEv1);
102
103 PostData(1, fOutputList);
104}
105//=============================================================================
106void AliAnalysisTaskUnicorME::Terminate(Option_t */*option*/)
107{
108 // terminate
109
110 printf("terminate \n");
111 TList *outputlist = (TList*) GetOutputData(1);
112 int n = outputlist->GetEntries();
113 if (n) ((AliUnicorAnal *) outputlist->At(0))->Save("unicor-result.root","recreate");
114 for (int i=1; i<n; i++) ((AliUnicorAnal *) outputlist->At(i))->Save("unicor-result.root");
115}
116//=============================================================================