#include "TPrincipal.h"
#include "TFile.h"
#include "TSystem.h"
-#include "TVector3.h"
// --- AliRoot header files ---
//#include "AliLog.h"
fPPhoton(0),
fPPi0(0),
fParameters(0),
- fVtx(0.),
+ fVtx(0.,0.,0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPhoton(0),
fPPi0(0),
fParameters(0),
- fVtx(0.),
+ fVtx(0.,0.,0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPhoton(0),
fPPi0(0),
fParameters(0),
- fVtx(0.),
+ fVtx(0.,0.,0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fERecWeight ->SetParameters(fERecWeightPar[0],fERecWeightPar[1] ,fERecWeightPar[2] ,fERecWeightPar[3]) ;
- for (Int_t i =0; i< AliPID::kSPECIESN ; i++)
+ for (Int_t i =0; i< AliPID::kSPECIESCN ; i++)
fInitPID[i] = 1.;
}
return param;
}
-//____________________________________________________________________________
-Float_t AliPHOSPIDv1::GetCalibratedEnergy(Float_t e) const
-{
-// It calibrates Energy depending on the recpoint energy.
-// The energy of the reconstructed cluster is corrected with
-// the formula A + B* E + C* E^2, whose parameters where obtained
-// through the study of the reconstructed energy distribution of
-// monoenergetic photons.
-
- Float_t p[]={0.,0.,0.};
- for (Int_t i=0; i<3; i++) p[i] = GetParameterCalibration(i);
- Float_t enerec = p[0] + p[1]*e + p[2]*e*e;
- return enerec ;
-
-}
-
//____________________________________________________________________________
Float_t AliPHOSPIDv1::GetParameterCpv2Emc(Int_t i, TString axis) const
{
return par;
}
-
-
-//DP____________________________________________________________________________
-//Float_t AliPHOSPIDv1::GetDistance(AliPHOSEmcRecPoint * emc,AliPHOSCpvRecPoint * cpv, Option_t * axis)const
-//{
-// // Calculates the distance between the EMC RecPoint and the PPSD RecPoint
-//
-// const AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ;
-// TVector3 vecEmc ;
-// TVector3 vecCpv ;
-// if(cpv){
-// emc->GetLocalPosition(vecEmc) ;
-// cpv->GetLocalPosition(vecCpv) ;
-//
-// if(emc->GetPHOSMod() == cpv->GetPHOSMod()){
-// // Correct to difference in CPV and EMC position due to different distance to center.
-// // we assume, that particle moves from center
-// Float_t dCPV = geom->GetIPtoOuterCoverDistance();
-// Float_t dEMC = geom->GetIPtoCrystalSurface() ;
-// dEMC = dEMC / dCPV ;
-// vecCpv = dEMC * vecCpv - vecEmc ;
-// if (axis == "X") return vecCpv.X();
-// if (axis == "Y") return vecCpv.Y();
-// if (axis == "Z") return vecCpv.Z();
-// if (axis == "R") return vecCpv.Mag();
-// }
-// return 100000000 ;
-// }
-// return 100000000 ;
-//}
//____________________________________________________________________________
Int_t AliPHOSPIDv1::GetCPVBit(AliPHOSTrackSegment * ts, Int_t effPur, Float_t e) const
{
TMath::Exp(-TMath::Power(e-GetParameterPhotonBoundary(1),2)/2.0/
TMath::Power(GetParameterPhotonBoundary(2),2)) +
GetParameterPhotonBoundary(3);
- AliDebug(1, Form("GetHardPhotonBit","E=%f, m2x=%f, boundary=%f",
- e,m2x,m2xBoundary));
+ AliDebug(1, Form("E=%f, m2x=%f, boundary=%f", e,m2x,m2xBoundary));
if (m2x < m2xBoundary)
return 1;// A hard photon
else
{
// construct the PID weight from a Bayesian Method
- const Int_t kSPECIES = AliPID::kSPECIESN ;
+ const Int_t kSPECIES = AliPID::kSPECIESCN ;
Int_t nparticles = fRecParticles->GetEntriesFast() ;
Double_t * sw [kSPECIES] ;
//Info("MakePID","Begin MakePID");
- for (Int_t i =0; i< kSPECIES; i++){
- stof[i] = new Double_t[nparticles] ;
+ for (Int_t i =0; i< kSPECIES; i++){
+ stof[i] = new Double_t[nparticles] ;
sdp [i] = new Double_t[nparticles] ;
scpv[i] = new Double_t[nparticles] ;
sw [i] = new Double_t[nparticles] ;
//// track = ts->GetTrackIndex() ; //TPC tracks ?
if (!emc) {
- AliFatal(Form("-> emc(%d) = %d", ts->GetEmcIndex(), emc )) ;
+ AliFatal(Form("-> emc(%d)", ts->GetEmcIndex())) ;
}
// Info("MakePID", "TOF");
Float_t en = emc->GetEnergy();
Double_t time = emc->GetTime() ;
- // cout<<">>>>>>>Energy "<<en<<"Time "<<time<<endl;
+ // cout<<">>>>>>>Energy "<<en<<"Time "<<time<<endl;
// now get the signals probability
// s(pid) in the Bayesian formulation
+
+ //Initialize anused species
+ for(Int_t iii=0; iii<kSPECIES; iii++)stof[iii][index]=0. ;
stof[AliPID::kPhoton][index] = 1.;
stof[AliPID::kElectron][index] = 1.;
//DP: still to be done
//dispersion is not well defined if the cluster is only in few crystals
+ //Initialize anused species
+ for(Int_t iii=0; iii<kSPECIES; iii++)sdp[iii][index]=0. ;
sdp[AliPID::kPhoton][index] = 1. ;
sdp[AliPID::kElectron][index] = 1. ;
}
// else
// cout<<">>>>>>>>>>>CHARGED>>>>>>>>>>>"<<endl;
+ //Initialize anused species
+ for(Int_t iii=0; iii<kSPECIES; iii++)scpv[iii][index]=0. ;
scpv[AliPID::kPion][index] = pcpvcharged ;
scpv[AliPID::kKaon][index] = pcpvcharged ;
}
//Weight to apply to hadrons due to energy reconstruction
+ //Initialize anused species
+ for(Int_t iii=0; iii<kSPECIES; iii++)sw[iii][index]=1. ;
Float_t weight = fERecWeight ->Eval(en) ;
// Choose the cluster energy range
if (!emc) {
- AliFatal(Form("-> emc(%d) = %d", ts->GetEmcIndex(), emc )) ;
+ AliFatal(Form("-> emc(%d)", ts->GetEmcIndex())) ;
}
Float_t e = emc->GetEnergy() ;
- Float_t lambda[2] ;
+ Float_t lambda[2]={0.,0.} ;
emc->GetElipsAxis(lambda) ;
if((lambda[0]>0.01) && (lambda[1]>0.01)){
rp->SetPIDBit(14) ;
//Set momentum, energy and other parameters
- Float_t encal = GetCalibratedEnergy(e);
TVector3 dir = GetMomentumDirection(emc,cpv) ;
- dir.SetMag(encal) ;
- rp->SetMomentum(dir.X(),dir.Y(),dir.Z(),encal) ;
+ dir.SetMag(e) ;
+ rp->SetMomentum(dir.X(),dir.Y(),dir.Z(),e) ;
rp->SetCalcMass(0);
rp->Name(); //If photon sets the particle pdg name to gamma
rp->SetProductionVertex(fVtx.X(),fVtx.Y(),fVtx.Z(),0);
rp->SetLastDaughter(-1);
rp->SetPolarisation(0,0,0);
//Set the position in global coordinate system from the RecPoint
- AliPHOSTrackSegment * ts = static_cast<AliPHOSTrackSegment *>(fTrackSegments->At(rp->GetPHOSTSIndex()));
- AliPHOSEmcRecPoint * erp = static_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(ts->GetEmcIndex()));
+ AliPHOSTrackSegment * ts1 = static_cast<AliPHOSTrackSegment *>(fTrackSegments->At(rp->GetPHOSTSIndex()));
+ AliPHOSEmcRecPoint * erp = static_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(ts1->GetEmcIndex()));
TVector3 pos ;
fGeom->GetGlobalPHOS(erp, pos) ;
rp->SetPos(pos);
&(*fParameters)(i,0), &(*fParameters)(i,1),
&(*fParameters)(i,2), &(*fParameters)(i,3));
i++;
- AliDebug(1, Form("SetParameters", "line %d: %s",i,string));
+ AliDebug(1, Form("Line %d: %s",i,string));
}
fclose(fd);
}
//_______________________________________________________________________
void AliPHOSPIDv1::SetInitPID(const Double_t *p) {
// Sets values for the initial population of each particle type
- for (Int_t i=0; i<AliPID::kSPECIESN; i++) fInitPID[i] = p[i];
+ for (Int_t i=0; i<AliPID::kSPECIESCN; i++) fInitPID[i] = p[i];
}
//_______________________________________________________________________
void AliPHOSPIDv1::GetInitPID(Double_t *p) const {
// Gets values for the initial population of each particle type
- for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i] = fInitPID[i];
+ for (Int_t i=0; i<AliPID::kSPECIESCN; i++) p[i] = fInitPID[i];
}