1 /*************************************************************************
2 * Copyright(c) 1998-2048, 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 **************************************************************************/
16 //Author: Dariusz Miskowiec 2007
18 //=============================================================================
19 // unicor analysis task
20 //=============================================================================
21 #include "AliUnicorAnalGlobal.h"
22 #include "AliUnicorAnalSingle.h"
23 #include "AliUnicorAnalCorrel.h"
24 #include "AliUnicorAnalPtfluc.h"
25 #include "AliUnicorAnalHighpt.h"
26 #include "AliUnicorEventAliceESD.h"
27 #include "AliESDEvent.h"
28 #include "AliAnalysisTaskUnicor.h"
30 ClassImp(AliAnalysisTaskUnicor)
32 //=============================================================================
33 AliAnalysisTaskUnicor::AliAnalysisTaskUnicor(const char *name) :
34 AliAnalysisTaskSE(name),
40 fEv0 = new AliUnicorEventAliceESD(); // needed for eta ranges only
41 DefineOutput(1, TList::Class());
43 //=============================================================================
44 void AliAnalysisTaskUnicor::UserCreateOutputObjects()
46 // executed once on each worker
48 fOutputList = new TList();
49 fOutputList->SetOwner();
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));
54 AliUnicorAnalCorrel::AnalysisFrame frame = AliUnicorAnalCorrel::kLCMS;
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));
58 fOutputList->Add(new AliUnicorAnalPtfluc("ptf",0,0));
59 fOutputList->Add(new AliUnicorAnalHighpt("hpt",fEv0->Etamin(),fEv0->Etamax(),0,0));
61 //=============================================================================
62 void AliAnalysisTaskUnicor::UserExec(Option_t */*option*/)
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);
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);
80 PostData(1, fOutputList);
82 //=============================================================================
83 void AliAnalysisTaskUnicor::Terminate(Option_t */*option*/)
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");
93 //=============================================================================