+ // do the correction with the event mixing directly!
+ if(correctWithMixed){
+
+ if(hMixed[0] && hMixed[1] && hMixed[2] && hMixed[3]){
+
+ // scale that EM is 1 at 0 for Deta
+ // in the region 0-10degree (one 1/2 sector) for Dphi
+ if(iAnalysisType==6){
+ hMixed[0]->Scale(1./(Double_t)hMixed[0]->Integral(hMixed[0]->FindBin(0),hMixed[0]->FindBin(10))*(Double_t)(hMixed[0]->FindBin(10)-hMixed[0]->FindBin(0)+1));
+ hMixed[2]->Scale(1./(Double_t)hMixed[2]->Integral(hMixed[2]->FindBin(0),hMixed[2]->FindBin(10))*(Double_t)(hMixed[0]->FindBin(10)-hMixed[0]->FindBin(0)+1));
+ hMixed[3]->Scale(1./(Double_t)hMixed[3]->Integral(hMixed[3]->FindBin(0),hMixed[3]->FindBin(10))*(Double_t)(hMixed[0]->FindBin(10)-hMixed[0]->FindBin(0)+1));
+ }
+ else{
+ hMixed[0]->Scale(1./(Double_t)hMixed[0]->GetBinContent(1));
+ hMixed[2]->Scale(1./(Double_t)hMixed[2]->GetBinContent(1));
+ hMixed[3]->Scale(1./(Double_t)hMixed[3]->GetBinContent(1));
+ }
+
+ // scale to average efficiency in the pt region (0.3-1.5) and |eta| < 0.8
+ // by multiplying the average single particle efficiencies from HIJING
+ Double_t normPMC = 0.847546;
+ Double_t normNMC = 0.83827;
+ hMixed[0]->Scale(normNMC*normPMC);
+ hMixed[2]->Scale(normNMC*normNMC);
+ hMixed[3]->Scale(normPMC*normPMC);
+
+ // divide by event mixing
+ hTemp1->Divide(hMixed[0]);
+ hTemp2->Divide(hMixed[0]);
+ hTemp3->Divide(hMixed[2]);
+ hTemp4->Divide(hMixed[3]);
+
+ // scale also single histograms with average efficiency
+ hTemp5->Scale(1./normNMC);
+ hTemp6->Scale(1./normPMC);
+
+ }
+ else{
+ AliError("Correction with EventMixing requested, but not all Histograms there!");
+ return NULL;
+ }
+ }