+//______________________________________________
+void AliEMCALPID::RunPID(AliESDEvent *esd)
+{
+ //
+ // Make the PID for all the EMCAL clusters containedin the ESDs File
+ // but just gamma/PiO/Hadron
+ //
+ // trivial check against NULL object passed
+
+ if (esd == 0x0) {
+ AliInfo("NULL ESD object passed !!" );
+ return ;
+ }
+
+ Int_t nClusters = esd->GetNumberOfCaloClusters();
+ Int_t firstCluster = 0;
+ Double_t energy, lambda0;
+ for (Int_t iCluster = firstCluster; iCluster < (nClusters + firstCluster); iCluster++) {
+
+ AliESDCaloCluster *clust = esd->GetCaloCluster(iCluster);
+ if (!clust->IsEMCAL()) continue ;
+
+ energy = clust->E();
+ lambda0 = clust->GetM02();
+ // verify cluster type
+ Int_t clusterType= clust->GetClusterType();
+ if (clusterType == AliESDCaloCluster::kEMCALClusterv1 && lambda0 != 0 && energy < 1000) {
+
+ // reject clusters with lambda0 = 0
+
+
+ ComputePID(energy, lambda0);
+
+
+ if (fPrintInfo) {
+ AliInfo("___________________________________________________");
+ AliInfo(Form( "Particle Energy = %f",energy));
+ AliInfo(Form( "Particle Lambda0 of the particle = %f", lambda0) );
+ AliInfo("PIDWeight of the particle :" );
+ AliInfo(Form( " GAMMA : %f",fPID[0] ));
+ AliInfo(Form( " PiZero : %f",fPID[1] ));
+ AliInfo(Form( " HADRON : %f", fPID[2] ));
+ AliInfo("_________________________________________");
+ AliInfo(Form( " kElectron : %f", fPIDFinal[0]) );
+ AliInfo(Form( " kMuon : %f", fPIDFinal[1] ));
+ AliInfo(Form( " kPion : %f", fPIDFinal[2] ));
+ AliInfo(Form( " kKaon : %f", fPIDFinal[3] ));
+ AliInfo(Form( " kProton : %f", fPIDFinal[4] ));
+ AliInfo(Form( " kPhoton : %f", fPIDFinal[5] ));
+ AliInfo(Form( " kPi0 : %f", fPIDFinal[6] ));
+ AliInfo(Form( " kNeutron : %f", fPIDFinal[7] ));
+ AliInfo(Form( " kKaon0 : %f", fPIDFinal[8] ));
+ AliInfo(Form( " kEleCon : %f", fPIDFinal[9] ));
+ AliInfo(Form( " kUnknown : %f", fPIDFinal[10] ));
+ AliInfo("___________________________________________________");
+ }
+
+ if(fReconstructor){ // In case it is called during reconstruction.
+ // cout << "############# Fill ESDs with PIDWeight ##########" << endl;
+ clust->SetPid(fPIDFinal);}
+ } // end if (clusterType...)
+ } // end for (iCluster...)