4 #include <TInterpreter.h>
10 #include "AliFMDAnalysisTaskSharing.h"
11 #include "AliAnalysisManager.h"
12 #include "AliESDFMD.h"
13 #include "AliMCEventHandler.h"
15 #include "AliESDVertex.h"
16 #include "AliFMDAnaParameters.h"
18 ClassImp(AliFMDAnalysisTaskSharing)
20 //_____________________________________________________________________
21 AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing()
29 // Default constructor
30 DefineInput (0, AliESDEvent::Class());
31 DefineOutput(0, AliESDEvent::Class());
33 //_____________________________________________________________________
34 AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name):
35 AliAnalysisTask(name, "AnalysisTaskFMD"),
44 DefineInput (0, AliESDEvent::Class());
45 DefineOutput(0, AliESDEvent::Class());
47 //_____________________________________________________________________
48 void AliFMDAnalysisTaskSharing::CreateOutputObjects()
50 fOutputESD.CreateStdContent();
52 //_____________________________________________________________________
53 void AliFMDAnalysisTaskSharing::ConnectInputData(Option_t */*option*/)
55 fESD = (AliESDEvent*)GetInputData(0);
57 //_____________________________________________________________________
58 void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
60 AliESD* old = fESD->GetAliESDOld();
62 fESD->CopyFromOldESD();
65 foutputESDFMD.Clear();
67 fOutputESD.SetPrimaryVertexSPD(fESD->GetPrimaryVertexSPD());
69 AliESDFMD* fmd = fESD->GetFMDData();
73 for(UShort_t det=1;det<=3;det++) {
74 Int_t nRings = (det==1 ? 1 : 2);
75 for (UShort_t ir = 0; ir < nRings; ir++) {
76 Char_t ring = (ir == 0 ? 'I' : 'O');
77 UShort_t nsec = (ir == 0 ? 20 : 40);
78 UShort_t nstr = (ir == 0 ? 512 : 256);
79 for(UShort_t sec =0; sec < nsec; sec++) {
82 for(UShort_t strip = 0; strip < nstr; strip++) {
83 foutputESDFMD.SetMultiplicity(det,ring,sec,strip,0.);
84 Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
85 if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
90 if(fmd->Multiplicity(det,ring,sec,strip-1) != AliESDFMD::kInvalidMult)
91 Eprev = fmd->Multiplicity(det,ring,sec,strip-1);
93 if(fmd->Multiplicity(det,ring,sec,strip+1) != AliESDFMD::kInvalidMult)
94 Enext = fmd->Multiplicity(det,ring,sec,strip+1);
96 Float_t nParticles = GetMultiplicityOfStrip(mult,Eprev,Enext,det,ring);
97 foutputESDFMD.SetMultiplicity(det,ring,sec,strip,nParticles);
98 foutputESDFMD.SetEta(det,ring,sec,strip,fmd->Eta(det,ring,sec,strip));
104 fOutputESD.SetFMDData(&foutputESDFMD);
106 PostData(0, &fOutputESD);
109 //_____________________________________________________________________
110 Float_t AliFMDAnalysisTaskSharing::GetMultiplicityOfStrip(Float_t mult,
115 AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
116 Float_t nParticles = 0;
117 Float_t cutLow = 0.2;
118 Float_t cutHigh = pars->GetMPV(det,ring) - 2*pars->GetSigma(det,ring);
119 Float_t Etotal = mult;
121 if(mult > 3*pars->GetMPV(det,ring) &&
122 (Enext > 3*pars->GetMPV(det,ring) || (Enext > 3*pars->GetMPV(det,ring))))
125 if(mult > 5*pars->GetMPV(det,ring))
129 fSharedThis = kFALSE;
134 if(Etotal < 0.33*pars->GetMPV(det,ring)) {
135 fSharedThis = kFALSE;
136 fSharedPrev = kFALSE;
140 if(Eprev > cutLow && Eprev < cutHigh && !fSharedPrev ) {
144 if(Enext > cutLow && Enext < cutHigh ) {
149 if(Etotal > cutHigh ) {
154 fSharedThis = kFALSE;
155 fSharedPrev = kFALSE;
161 //_____________________________________________________________________