]>
Commit | Line | Data |
---|---|---|
621688e4 | 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 | //============================================================================= | |
621688e4 | 21 | #include "AliUnicorAnalGlobal.h" |
22 | #include "AliUnicorAnalSingle.h" | |
23 | #include "AliUnicorAnalCorrel.h" | |
24 | #include "AliUnicorAnalPtfluc.h" | |
c6fc7f72 | 25 | #include "AliUnicorAnalHighpt.h" |
621688e4 | 26 | #include "AliUnicorEventAliceESD.h" |
61e4657c | 27 | #include "AliESDEvent.h" |
621688e4 | 28 | #include "AliAnalysisTaskUnicor.h" |
29 | ||
30 | ClassImp(AliAnalysisTaskUnicor) | |
31 | ||
32 | //============================================================================= | |
33 | AliAnalysisTaskUnicor::AliAnalysisTaskUnicor(const char *name) : | |
34 | AliAnalysisTaskSE(name), | |
35 | fEv0(0), | |
36 | fOutputList(0) | |
37 | { | |
38 | // constructor | |
39 | ||
40 | fEv0 = new AliUnicorEventAliceESD(); // needed for eta ranges only | |
41 | DefineOutput(1, TList::Class()); | |
42 | } | |
43 | //============================================================================= | |
44 | void AliAnalysisTaskUnicor::UserCreateOutputObjects() | |
45 | { | |
46 | // executed once on each worker | |
47 | ||
48 | fOutputList = new TList(); | |
a645633a | 49 | fOutputList->SetOwner(); |
621688e4 | 50 | fOutputList->Add(new AliUnicorAnalGlobal("dag")); |
51 | fOutputList->Add(new AliUnicorAnalSingle("all",fEv0->Etamin(),fEv0->Etamax(),0)); | |
52 | fOutputList->Add(new AliUnicorAnalSingle("pim",fEv0->Etamin(),fEv0->Etamax(),-211)); | |
53 | fOutputList->Add(new AliUnicorAnalSingle("pip",fEv0->Etamin(),fEv0->Etamax(), 211)); | |
28eee19b | 54 | AliUnicorAnalCorrel::AnalysisFrame frame = AliUnicorAnalCorrel::kLCMS; |
61e4657c | 55 | fOutputList->Add(new AliUnicorAnalCorrel("cnn",fEv0->Etamin(),fEv0->Etamax(),-211,-211, frame)); |
56 | fOutputList->Add(new AliUnicorAnalCorrel("cpp",fEv0->Etamin(),fEv0->Etamax(), 211, 211, frame)); | |
57 | fOutputList->Add(new AliUnicorAnalCorrel("cnp",fEv0->Etamin(),fEv0->Etamax(),-211, 211, frame)); | |
621688e4 | 58 | fOutputList->Add(new AliUnicorAnalPtfluc("ptf",0,0)); |
c6fc7f72 | 59 | fOutputList->Add(new AliUnicorAnalHighpt("hpt",fEv0->Etamin(),fEv0->Etamax(),0,0)); |
621688e4 | 60 | } |
61 | //============================================================================= | |
62 | void AliAnalysisTaskUnicor::UserExec(Option_t */*option*/) | |
63 | { | |
64 | // process one event | |
65 | ||
66 | fEv0->SetESD(((AliESDEvent*) InputEvent())); | |
67 | if (!fEv0->Good()) return; | |
68 | ((AliUnicorAnalGlobal *) fOutputList->At(0))->Process(fEv0); | |
69 | ((AliUnicorAnalSingle *) fOutputList->At(1))->Process(fEv0); | |
70 | ((AliUnicorAnalSingle *) fOutputList->At(2))->Process(fEv0); | |
71 | ((AliUnicorAnalSingle *) fOutputList->At(3))->Process(fEv0); | |
72 | ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(0,fEv0,fEv0,0); | |
73 | ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(2,fEv0,fEv0,TMath::DegToRad()*180); | |
74 | ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(0,fEv0,fEv0,0); | |
75 | ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(2,fEv0,fEv0,TMath::DegToRad()*180); | |
76d78859 | 76 | ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(0,fEv0,fEv0,0); |
77 | ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(2,fEv0,fEv0,TMath::DegToRad()*180); | |
78 | ((AliUnicorAnalPtfluc *) fOutputList->At(7))->Process(0,fEv0,fEv0); | |
79 | ((AliUnicorAnalHighpt *) fOutputList->At(8))->Process(fEv0,fEv0); | |
621688e4 | 80 | PostData(1, fOutputList); |
81 | } | |
82 | //============================================================================= | |
83 | void AliAnalysisTaskUnicor::Terminate(Option_t */*option*/) | |
84 | { | |
85 | // terminate | |
c6fc7f72 | 86 | |
87 | printf("terminate \n"); | |
88 | TList *outputlist = (TList*) GetOutputData(1); | |
89 | int n = outputlist->GetEntries(); | |
90 | if (n) ((AliUnicorAnal *) outputlist->At(0))->Save("unicor-result.root","recreate"); | |
91 | for (int i=1; i<n; i++) ((AliUnicorAnal *) outputlist->At(i))->Save("unicor-result.root"); | |
621688e4 | 92 | } |
93 | //============================================================================= |