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 "AliMultiEventInputHandler.h"
22 #include "AliESDEvent.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"
31 ClassImp(AliAnalysisTaskUnicorME)
33 //=============================================================================
34 AliAnalysisTaskUnicorME::AliAnalysisTaskUnicorME(const char *name) :
35 AliAnalysisTaskME(name),
42 fEv0 = new AliUnicorEventAliceESD();
43 fEv1 = new AliUnicorEventAliceESD();
44 DefineOutput(1, TList::Class());
46 //=============================================================================
47 void AliAnalysisTaskUnicorME::UserCreateOutputObjects()
49 // executed once on each worker
51 fOutputList = new TList();
52 fOutputList->SetOwner();
53 fOutputList->Add(new AliUnicorAnalGlobal("dag"));
54 fOutputList->Add(new AliUnicorAnalSingle("all",fEv0->Etamin(),fEv0->Etamax(),0));
55 fOutputList->Add(new AliUnicorAnalSingle("pim",fEv0->Etamin(),fEv0->Etamax(),-211));
56 fOutputList->Add(new AliUnicorAnalSingle("pip",fEv0->Etamin(),fEv0->Etamax(), 211));
57 AliUnicorAnalCorrel::AnalysisFrame frame = AliUnicorAnalCorrel::kLCMS;
58 fOutputList->Add(new AliUnicorAnalCorrel("cnn",fEv0->Etamin(),fEv0->Etamax(),-211,-211, frame));
59 fOutputList->Add(new AliUnicorAnalCorrel("cpp",fEv0->Etamin(),fEv0->Etamax(), 211, 211, frame));
60 fOutputList->Add(new AliUnicorAnalCorrel("cnp",fEv0->Etamin(),fEv0->Etamax(),-211, 211, frame));
61 fOutputList->Add(new AliUnicorAnalPtfluc("ptf",0,0));
62 fOutputList->Add(new AliUnicorAnalHighpt("hpt",fEv0->Etamin(),fEv0->Etamax(),0,0));
64 //=============================================================================
65 void AliAnalysisTaskUnicorME::UserExec(Option_t */*option*/)
67 // process one event pair
76 if (fInputHandler->GetBufferSize() < 2) return;
78 AliESDEvent *esd0 = dynamic_cast<AliESDEvent*>(GetEvent(0));
79 AliESDEvent *esd1 = dynamic_cast<AliESDEvent*>(GetEvent(1));
83 // if (esd0->GetEventType() != 7) return; // physics event
85 if (!fEv0->Good()) return;
87 ((AliUnicorAnalGlobal *) fOutputList->At(0))->Process(fEv0);
88 ((AliUnicorAnalSingle *) fOutputList->At(1))->Process(fEv0);
89 ((AliUnicorAnalSingle *) fOutputList->At(2))->Process(fEv0);
90 ((AliUnicorAnalSingle *) fOutputList->At(3))->Process(fEv0);
91 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(0,fEv0,fEv0,0);
92 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
93 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(0,fEv0,fEv0,0);
94 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
95 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(0,fEv0,fEv0,0);
96 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(2,fEv0,fEv0,TMath::DegToRad()*180);
97 ((AliUnicorAnalPtfluc *) fOutputList->At(7))->Process(0,fEv0,fEv0);
98 ((AliUnicorAnalHighpt *) fOutputList->At(8))->Process(fEv0,fEv0);
101 // if (esd1->GetEventType() != 7) return; // physics event
102 printf("esd0 nr %3d mult %3d esd1 nr %3d mult %3d\n",
103 esd0->GetEventNumberInFile(), esd0->GetNumberOfTracks(),
104 esd1->GetEventNumberInFile(), esd1->GetNumberOfTracks());
106 if (!fEv1->Good()) return;
107 ((AliUnicorAnalCorrel *) fOutputList->At(4))->Process(1,fEv0,fEv1,0);
108 ((AliUnicorAnalCorrel *) fOutputList->At(5))->Process(1,fEv0,fEv1,0);
109 ((AliUnicorAnalCorrel *) fOutputList->At(6))->Process(1,fEv0,fEv1,0);
110 ((AliUnicorAnalPtfluc *) fOutputList->At(7))->Process(1,fEv0,fEv1);
111 ((AliUnicorAnalHighpt *) fOutputList->At(8))->Process(fEv0,fEv1);
113 printf("counts: %6d %6d %6d %6d\n",nic0,nic1,nic2,nic3);
114 PostData(1, fOutputList);
116 //=============================================================================
117 void AliAnalysisTaskUnicorME::Terminate(Option_t */*option*/)
121 printf("terminate \n");
122 TList *outputlist = (TList*) GetOutputData(1);
123 int n = outputlist->GetEntries();
124 if (n) ((AliUnicorAnal *) outputlist->At(0))->Save("unicor-result.root","recreate");
125 for (int i=1; i<n; i++) ((AliUnicorAnal *) outputlist->At(i))->Save("unicor-result.root");
127 //=============================================================================