+
+ /*
+ // Do hadron correction
+ // In principle, the best thing to do as particles which
+ // eta,phi (at vertex) correspond to EMCal dead zone can deposit energy
+ // in the calorimeter as well as particles with eta,phi (at vertex)
+ // outside the EMCal acceptance
+ cout << "Hadronic correction for all tracks goes here" << endl;
+
+ // For the moment I apply MIP correction if p >= 0.5 GeV/c
+ if (fApplyMIPCorrection != 0 && p3.Mag() >= 0.5)
+ {
+ ((AliJetHadronCorrectionv1*)fHadCorr)->SetGeometry("EMCAL_COMPLETEV1",1.);
+
+ Double_t etaOut = 0.;
+ Double_t phiOut = 0.;
+ Int_t towerID2 = 0;
+ Float_t unitEnergy = 0.;
+ ((AliJetHadronCorrectionv1*)fHadCorr)->TrackPositionEMCal(track,etaOut,phiOut);
+
+ // One has to make sure that the track hits the calorimeter
+ // We can then correct on average for these particles
+ if((etaOut >= fEtaMin && etaOut <= fEtaMax) &&
+ (phiOut >= fPhiMin && phiOut <= fPhiMax))// &&
+ {
+ Int_t towerID = 0;
+ Int_t towerID2 = 0;
+ fGeom->GetAbsCellIdFromEtaPhi(etaOut,phiOut,towerID2);
+ if(towerID2==-1) continue;
+
+ AliJetUnitArray *uArray = (AliJetUnitArray*)fUnitArray->At(towerID2);
+ unitEnergy = uArray->GetUnitEnergy();
+ Bool_t ok = kFALSE;
+ Bool_t ref = kFALSE;
+ if(unitEnergy==0.){
+ nTracksEmcal++;
+ ok=kTRUE;
+ ref=kTRUE;
+ }
+
+ Double_t hCEnergy = (Double_t)fHadCorr->GetEnergy(p3.Mag(), (Double_t)eta,0);
+ unitEnergy -= hCEnergy*TMath::Sin(2.0*TMath::ATan(TMath::Exp(-eta)));
+
+ // The energy in this unitarray can be negative
+ // If the Digits are then filled, make sure the energy sum
+ // is positive. If not, put the value to zero in AliJetAODUnitArrayEMCalDigit.
+ // If they are not filled, put this value to zero
+ uArray->SetUnitEnergy(unitEnergy);
+
+ if(uArray->GetUnitEnergy()!=0. && ref){
+ if(!fProcId){
+ new(fRefArray) TRefArray(TProcessID::GetProcessWithUID(uArray));
+ fProcId = kTRUE;
+ }
+ fRefArray->Add(uArray);
+ }
+ }
+ else cout << "Track out of EMCal acceptance" << endl;
+
+ } //end Hadron Correction loop
+ */
+