// $Id$ //*************************************************************************** // This file is property of and copyright by the ALICE HLT Project * // ALICE Experiment at CERN, All rights reserved. * // * // Primary Authors: Sergey Gorbunov * // Ivan Kisel * // for The ALICE HLT Project. * // * // Permission to use, copy, modify and distribute this software and its * // documentation strictly for non-commercial purposes is hereby granted * // without fee, provided that the above copyright notice appears in all * // copies and that both the copyright notice and this permission notice * // appear in the supporting documentation. The authors make no claims * // about the suitability of this software for any purpose. It is * // provided "as is" without express or implied warranty. * //*************************************************************************** #include "AliHLTTPCCAPerformance.h" #include "AliHLTTPCCAGBHit.h" #include "AliHLTTPCCAMCTrack.h" #include "AliHLTTPCCAMCPoint.h" #include "AliHLTTPCCAOutTrack.h" #include "AliHLTTPCCAGBTrack.h" #include "AliHLTTPCCAGBTracker.h" #include "AliHLTTPCCATracker.h" #include "TMath.h" #include "TROOT.h" #include "TFile.h" #include "TH1.h" #include "TH2.h" #include "TProfile.h" AliHLTTPCCAPerformance::AliHLTTPCCAPerformance() : fTracker(0), fHitLabels(0), fNHits(0), fMCTracks(0), fNMCTracks(0), fMCPoints(0), fNMCPoints(0), fDoClusterPulls(0), fStatNEvents(0), fStatNRecTot(0), fStatNRecOut(0), fStatNGhost(0), fStatNMCAll(0), fStatNRecAll(0), fStatNClonesAll(0), fStatNMCRef(0), fStatNRecRef(0), fStatNClonesRef(0), fStatGBNRecTot(0), fStatGBNRecOut(0), fStatGBNGhost(0), fStatGBNMCAll(0), fStatGBNRecAll(0), fStatGBNClonesAll(0), fStatGBNMCRef(0), fStatGBNRecRef(0), fStatGBNClonesRef(0), fHistoDir(0), fhResY(0), fhResZ(0), fhResSinPhi(0), fhResDzDs(0), fhResPt(0), fhPullY(0), fhPullZ(0), fhPullSinPhi(0), fhPullDzDs(0), fhPullQPt(0), fhHitErrY(0), fhHitErrZ(0), fhHitResY(0), fhHitResZ(0), fhHitPullY(0), fhHitPullZ(0), fhHitResY1(0), fhHitResZ1(0), fhHitPullY1(0), fhHitPullZ1(0), fhCellPurity(0), fhCellNHits(0), fhCellPurityVsN(0), fhCellPurityVsPt(0), fhEffVsP(0), fhGBEffVsP(0), fhNeighQuality(0), fhNeighEff(0), fhNeighQualityVsPt(0), fhNeighEffVsPt(0), fhNeighDy(0), fhNeighDz(0), fhNeighChi(0), fhNeighDyVsPt(0), fhNeighDzVsPt(0), fhNeighChiVsPt(0), fhNeighNCombVsArea(0) { //* constructor } AliHLTTPCCAPerformance::AliHLTTPCCAPerformance(const AliHLTTPCCAPerformance&) : fTracker(0), fHitLabels(0), fNHits(0), fMCTracks(0), fNMCTracks(0), fMCPoints(0), fNMCPoints(0), fDoClusterPulls(0), fStatNEvents(0), fStatNRecTot(0), fStatNRecOut(0), fStatNGhost(0), fStatNMCAll(0), fStatNRecAll(0), fStatNClonesAll(0), fStatNMCRef(0), fStatNRecRef(0), fStatNClonesRef(0), fStatGBNRecTot(0), fStatGBNRecOut(0), fStatGBNGhost(0), fStatGBNMCAll(0), fStatGBNRecAll(0), fStatGBNClonesAll(0), fStatGBNMCRef(0), fStatGBNRecRef(0), fStatGBNClonesRef(0), fHistoDir(0), fhResY(0), fhResZ(0), fhResSinPhi(0), fhResDzDs(0), fhResPt(0), fhPullY(0), fhPullZ(0), fhPullSinPhi(0), fhPullDzDs(0), fhPullQPt(0), fhHitErrY(0), fhHitErrZ(0), fhHitResY(0), fhHitResZ(0), fhHitPullY(0), fhHitPullZ(0), fhHitResY1(0), fhHitResZ1(0), fhHitPullY1(0), fhHitPullZ1(0), fhCellPurity(0), fhCellNHits(0), fhCellPurityVsN(0), fhCellPurityVsPt(0), fhEffVsP(0), fhGBEffVsP(0), fhNeighQuality(0), fhNeighEff(0), fhNeighQualityVsPt(0), fhNeighEffVsPt(0), fhNeighDy(0), fhNeighDz(0), fhNeighChi(0), fhNeighDyVsPt(0), fhNeighDzVsPt(0), fhNeighChiVsPt(0), fhNeighNCombVsArea(0) { //* dummy } AliHLTTPCCAPerformance &AliHLTTPCCAPerformance::operator=(const AliHLTTPCCAPerformance&) { //* dummy return *this; } AliHLTTPCCAPerformance::~AliHLTTPCCAPerformance() { //* destructor StartEvent(); } void AliHLTTPCCAPerformance::SetTracker( AliHLTTPCCAGBTracker *Tracker ) { //* set pointer to HLT CA Global tracker fTracker = Tracker; } void AliHLTTPCCAPerformance::StartEvent() { //* clean up arrays if( !fHistoDir ) CreateHistos(); if( fHitLabels ) delete[] fHitLabels; fHitLabels = 0; fNHits = 0; if( fMCTracks ) delete[] fMCTracks; fMCTracks = 0; fNMCTracks = 0; if( fMCPoints ) delete[] fMCPoints; fMCPoints = 0; fNMCPoints = 0; } void AliHLTTPCCAPerformance::SetNHits( Int_t NHits ) { //* set number of hits if( fHitLabels ) delete[] fHitLabels; fHitLabels = 0; fHitLabels = new AliHLTTPCCAHitLabel[ NHits ]; fNHits = NHits; } void AliHLTTPCCAPerformance::SetNMCTracks( Int_t NMCTracks ) { //* set number of MC tracks if( fMCTracks ) delete[] fMCTracks; fMCTracks = 0; fMCTracks = new AliHLTTPCCAMCTrack[ NMCTracks ]; fNMCTracks = NMCTracks; } void AliHLTTPCCAPerformance::SetNMCPoints( Int_t NMCPoints ) { //* set number of MC points if( fMCPoints ) delete[] fMCPoints; fMCPoints = 0; fMCPoints = new AliHLTTPCCAMCPoint[ NMCPoints ]; fNMCPoints = 0; } void AliHLTTPCCAPerformance::ReadHitLabel( Int_t HitID, Int_t lab0, Int_t lab1, Int_t lab2 ) { //* read the hit labels AliHLTTPCCAHitLabel hit; hit.fLab[0] = lab0; hit.fLab[1] = lab1; hit.fLab[2] = lab2; fHitLabels[HitID] = hit; } void AliHLTTPCCAPerformance::ReadMCTrack( Int_t index, const TParticle *part ) { //* read mc track to the local array fMCTracks[index] = AliHLTTPCCAMCTrack(part); } void AliHLTTPCCAPerformance::ReadMCTPCTrack( Int_t index, Float_t X, Float_t Y, Float_t Z, Float_t Px, Float_t Py, Float_t Pz ) { //* read mc track parameters at TPC fMCTracks[index].SetTPCPar(X,Y,Z,Px,Py,Pz); } void AliHLTTPCCAPerformance::ReadMCPoint( Int_t TrackID, Float_t X, Float_t Y, Float_t Z, Float_t Time, Int_t iSlice ) { //* read mc point to the local array AliHLTTPCCAMCPoint &p = fMCPoints[fNMCPoints]; p.TrackID() = TrackID; p.X() = X; p.Y() = Y; p.Z() = Z; p.Time() = Time; p.ISlice() = iSlice; fTracker->Slices()[iSlice].Param().Global2Slice( X, Y, Z, &p.Sx(), &p.Sy(), &p.Sz() ); if( X*X + Y*Y>10.) fNMCPoints++; } void AliHLTTPCCAPerformance::CreateHistos() { //* create performance histogramms TDirectory *curdir = gDirectory; fHistoDir = gROOT->mkdir("HLTTPCCATrackerPerformance"); fHistoDir->cd(); gDirectory->mkdir("Neighbours"); gDirectory->cd("Neighbours"); fhNeighQuality = new TProfile("NeighQuality", "Neighbours Quality vs row", 160, 0., 160.); fhNeighEff = new TProfile("NeighEff", "Neighbours Efficiency vs row", 160, 0., 160.); fhNeighQualityVsPt = new TProfile("NeighQualityVsPt", "Neighbours Quality vs Pt", 100, 0., 5.); fhNeighEffVsPt = new TProfile("NeighEffVsPt", "Neighbours Efficiency vs Pt", 100, 0., 5.); fhNeighDy = new TH1D("NeighDy","Neighbours dy",100,-10,10); fhNeighDz = new TH1D("NeighDz","Neighbours dz",100,-10,10); fhNeighChi = new TH1D("NeighChi","Neighbours chi",100,0,20); fhNeighDyVsPt = new TH2D("NeighDyVsPt","NeighDyVsPt", 100,0,5, 100, -20,20); fhNeighDzVsPt = new TH2D("NeighDzVsPt","NeighDzVsPt", 100,0,5, 100, -20,20); fhNeighChiVsPt = new TH2D("NeighChiVsPt","NeighChiVsPt", 100,0,5, 100, 0,40); fhNeighNCombVsArea = new TH2D("NeighNCombVsArea","NeighNCombVsArea", 15,0,3, 40, 0,40); gDirectory->cd(".."); gDirectory->mkdir("TrackFit"); gDirectory->cd("TrackFit"); fhResY = new TH1D("resY", "track Y resoltion [cm]", 30, -.5, .5); fhResZ = new TH1D("resZ", "track Z resoltion [cm]", 30, -.5, .5); fhResSinPhi = new TH1D("resSinPhi", "track SinPhi resoltion ", 30, -.03, .03); fhResDzDs = new TH1D("resDzDs", "track DzDs resoltion ", 30, -.01, .01); fhResPt = new TH1D("resPt", "track telative Pt resoltion", 30, -.2, .2); fhPullY = new TH1D("pullY", "track Y pull", 30, -10., 10.); fhPullZ = new TH1D("pullZ", "track Z pull", 30, -10., 10.); fhPullSinPhi = new TH1D("pullSinPhi", "track SinPhi pull", 30, -10., 10.); fhPullDzDs = new TH1D("pullDzDs", "track DzDs pull", 30, -10., 10.); fhPullQPt = new TH1D("pullQPt", "track Q/Pt pull", 30, -10., 10.); gDirectory->cd(".."); fhEffVsP = new TProfile("EffVsP", "Eff vs P", 100, 0., 5.); fhGBEffVsP = new TProfile("GBEffVsP", "Global tracker: Eff vs P", 100, 0., 5.); gDirectory->mkdir("Clusters"); gDirectory->cd("Clusters"); fhHitResY = new TH1D("resHitY", "Y cluster resoltion [cm]", 100, -2., 2.); fhHitResZ = new TH1D("resHitZ", "Z cluster resoltion [cm]", 100, -2., 2.); fhHitPullY = new TH1D("pullHitY", "Y cluster pull", 50, -10., 10.); fhHitPullZ = new TH1D("pullHitZ", "Z cluster pull", 50, -10., 10.); fhHitResY1 = new TH1D("resHitY1", "Y cluster resoltion [cm]", 100, -2., 2.); fhHitResZ1 = new TH1D("resHitZ1", "Z cluster resoltion [cm]", 100, -2., 2.); fhHitPullY1 = new TH1D("pullHitY1", "Y cluster pull", 50, -10., 10.); fhHitPullZ1 = new TH1D("pullHitZ1", "Z cluster pull", 50, -10., 10.); fhHitErrY = new TH1D("HitErrY", "Y cluster error [cm]", 100, 0., 1.); fhHitErrZ = new TH1D("HitErrZ", "Z cluster error [cm]", 100, 0., 1.); gDirectory->cd(".."); gDirectory->mkdir("Cells"); gDirectory->cd("Cells"); fhCellPurity = new TH1D("CellPurity", "Cell Purity", 100, -0.1, 1.1); fhCellNHits = new TH1D("CellNHits", "Cell NHits", 40, 0., 40.); fhCellPurityVsN = new TProfile("CellPurityVsN", "Cell purity Vs N hits", 40, 2., 42.); fhCellPurityVsPt = new TProfile("CellPurityVsPt", "Cell purity Vs Pt", 100, 0., 5.); gDirectory->cd(".."); curdir->cd(); } void AliHLTTPCCAPerformance::WriteDir2Current( TObject *obj ) { //* recursive function to copy the directory 'obj' to the current one if( !obj->IsFolder() ) obj->Write(); else{ TDirectory *cur = gDirectory; TDirectory *sub = cur->mkdir(obj->GetName()); sub->cd(); TList *listSub = ((TDirectory*)obj)->GetList(); TIter it(listSub); while( TObject *obj1=it() ) WriteDir2Current(obj1); cur->cd(); } } void AliHLTTPCCAPerformance::WriteHistos() { //* write histograms to the file TDirectory *curr = gDirectory; // Open output file and write histograms TFile* outfile = new TFile("HLTTPCCATrackerPerformance.root","RECREATE"); outfile->cd(); WriteDir2Current(fHistoDir); outfile->Close(); curr->cd(); } void AliHLTTPCCAPerformance::SlicePerformance( Int_t iSlice, Bool_t PrintFlag ) { //* calculate slice tracker performance if( !fTracker ) return; Int_t nRecTot = 0, nGhost=0, nRecOut=0; Int_t nMCAll = 0, nRecAll=0, nClonesAll=0; Int_t nMCRef = 0, nRecRef=0, nClonesRef=0; AliHLTTPCCATracker &slice = fTracker->Slices()[iSlice]; Int_t firstSliceHit = 0; for( ; firstSliceHitNHits(); firstSliceHit++){ if( fTracker->Hits()[firstSliceHit].ISlice()==iSlice ) break; } Int_t endSliceHit = firstSliceHit; for( ; endSliceHitNHits(); endSliceHit++){ if( fTracker->Hits()[endSliceHit].ISlice()!=iSlice ) break; } { // Efficiency and quality of found neighbours #ifdef XXX for( Int_t iRow=1; iRowHits()[h.ID()].ID()]; if( l.fLab[0] <0 || l.fLab[1]>=0 ) continue; nHitsRow[l.fLab[0]][i]++; } } for( Int_t it=0; itHits()[h.ID()].ID()]; AliHLTTPCCAHitLabel &lP = fHitLabels[fTracker->Hits()[hP.ID()].ID()]; AliHLTTPCCAHitLabel &lN = fHitLabels[fTracker->Hits()[hN.ID()].ID()]; Bool_t found = ( l.fLab[0]>=0 && lP.fLab[0]==l.fLab[0] && lN.fLab[0]==l.fLab[0] ); if( found ) foundRow[l.fLab[0]] = 1; Bool_t isGhost = 1; for( Int_t il=0; il<3; il++ ){ if( l.fLab[il]<0 ) continue; Bool_t okP=0, okN=0; for( Int_t jl=0; jl<3; jl++ ){ if( lP.fLab[jl]==l.fLab[il] ) okP = 1; if( lN.fLab[jl]==l.fLab[il] ) okN = 1; } if( okP && okN ) isGhost = 0; } fhNeighQuality->Fill(iRow, !isGhost ); if( l.fLab[0]>=0 ) fhNeighQualityVsPt->Fill(fMCTracks[l.fLab[0]].Pt(), !isGhost ); } for (Int_t imc=0; imc0.2 ) fhNeighEff->Fill(iRow, foundRow[imc] ); fhNeighEffVsPt->Fill( fMCTracks[imc].Pt(), foundRow[imc] ); } } #endif } // efficiency and quality of found neighbours if(0){ // Local efficiency of found neighbours #ifdef XXX for( Int_t iRow=1; iRowHits()[index].ID()]; //cout<=0 ) lb[nla++]= l.fLab[0]; if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1]; if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2]; } sort( lb, lb+nla ); Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0; for( Int_t i=0; i=0 && lmax=0 && lmaxHits()[index].ID()]; if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax ) lmax++; } traLabels[itr] = labmax; traPurity[itr] = ( (nhits>0) ?double(lmax)/double(nhits) :0 ); //cout<<"perf track "<=fNMCTracks){ nGhost++; continue; } AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]]; mc.NReconstructed()++; if( mc.Set()== 0 ) nRecOut++; else{ if( mc.NReconstructed()==1 ) nRecAll++; else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++; if( mc.Set()==2 ){ if( mc.NReconstructed()==1 ) nRecRef++; else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++; } } } for (Int_t ipart=0; ipart0 ) fhEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0)); } if( traLabels ) delete[] traLabels; if( traPurity ) delete[] traPurity; fStatNRecTot += nRecTot; fStatNRecOut += nRecOut; fStatNGhost += nGhost; fStatNMCAll += nMCAll; fStatNRecAll += nRecAll; fStatNClonesAll += nClonesAll; fStatNMCRef += nMCRef; fStatNRecRef += nRecRef; fStatNClonesRef += nClonesRef; if( nMCAll ==0 ) return; if( PrintFlag ){ cout<<"Performance for slice "<0 ) ? nRecTot :1; Double_t dMCAll = (nMCAll>0 ) ? nMCAll :1; Double_t dMCRef = (nMCRef>0 ) ? nMCRef :1; Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1; Double_t dRecAll = (nRecAll+nClonesAll>0 ) ? nRecAll+nClonesAll :1; Double_t dRecRef = (nRecRef+nClonesRef>0 ) ? nRecRef+nClonesRef :1; Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1; cout<<" EffRef = "; if( nMCRef>0 ) cout<NSlices(); islice++){ SlicePerformance(islice,0); } // global tracker performance { if( !fTracker ) return; Int_t nRecTot = 0, nGhost=0, nRecOut=0; Int_t nMCAll = 0, nRecAll=0, nClonesAll=0; Int_t nMCRef = 0, nRecRef=0, nClonesRef=0; // Select reconstructable MC tracks { for (Int_t imc=0; imc=0 ) fMCTracks[l.fLab[0]].NHits()++; if( l.fLab[1]>=0 ) fMCTracks[l.fLab[1]].NHits()++; if( l.fLab[2]>=0 ) fMCTracks[l.fLab[2]].NHits()++; } for (Int_t imc=0; imc= 50 && mc.P()>=.05 ){ mc.Set() = 1; nMCAll++; if( mc.P()>=1. ){ mc.Set() = 2; nMCRef++; } } } } Int_t traN = fTracker->NTracks(); Int_t *traLabels = 0; Double_t *traPurity = 0; traLabels = new Int_t[traN]; traPurity = new Double_t[traN]; { for (Int_t itr=0; itrTracks()[itr]; Int_t nhits = tCA.NHits(); Int_t *lb = new Int_t[nhits*3]; Int_t nla=0; for( Int_t ihit=0; ihitTrackHits()[tCA.FirstHitRef()+ihit]; AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()]; if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0]; if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1]; if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2]; } sort( lb, lb+nla ); Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0; for( Int_t i=0; i=0 && lmax=0 && lmaxTrackHits()[tCA.FirstHitRef()+ihit]; AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()]; if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax ) lmax++; } traLabels[itr] = labmax; traPurity[itr] = ( (nhits>0) ?double(lmax)/double(nhits) :0 ); if( lb ) delete[] lb; } } nRecTot+= traN; for(Int_t itr=0; itr=fNMCTracks){ nGhost++; continue; } AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]]; mc.NReconstructed()++; if( mc.Set()== 0 ) nRecOut++; else{ if( mc.NReconstructed()==1 ) nRecAll++; else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++; if( mc.Set()==2 ){ if( mc.NReconstructed()==1 ) nRecRef++; else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++; } } // track resolutions while( TMath::Abs(mc.TPCPar()[0]) + TMath::Abs(mc.TPCPar()[1])>1 ){ if( traPurity[itr]<.90 ) break; AliHLTTPCCAGBTrack &t = fTracker->Tracks()[itr]; AliHLTTPCCATrackParam p = t.Param(); Double_t cosA = TMath::Cos( t.Alpha() ); Double_t sinA = TMath::Sin( t.Alpha() ); Double_t mcX = mc.TPCPar()[0]*cosA + mc.TPCPar()[1]*sinA; Double_t mcY = -mc.TPCPar()[0]*sinA + mc.TPCPar()[1]*cosA; Double_t mcZ = mc.TPCPar()[2]; Double_t mcEx = mc.TPCPar()[3]*cosA + mc.TPCPar()[4]*sinA; Double_t mcEy = -mc.TPCPar()[3]*sinA + mc.TPCPar()[4]*cosA; Double_t mcEz = mc.TPCPar()[5]; Double_t mcEt = TMath::Sqrt(mcEx*mcEx + mcEy*mcEy); if( TMath::Abs(mcEt)<1.e-4 ) break; Double_t mcSinPhi = mcEy / mcEt; Double_t mcDzDs = mcEz / mcEt; Double_t mcQPt = mc.TPCPar()[6]/ mcEt; if( TMath::Abs(mcQPt)<1.e-4 ) break; Double_t mcPt = 1./TMath::Abs(mcQPt); if( mcPt<1. ) break; if( t.NHits() < 50 ) break; Double_t bz = fTracker->Slices()[0].Param().Bz(); if( !p.TransportToXWithMaterial( mcX, bz ) ) break; if( p.GetCosPhi()*mcEx < 0 ){ // change direction mcSinPhi = -mcSinPhi; mcDzDs = -mcDzDs; mcQPt = -mcQPt; } const Double_t kCLight = 0.000299792458; Double_t k2QPt = 100; if( TMath::Abs(bz)>1.e-4 ) k2QPt= 1./(bz*kCLight); Double_t qPt = p.GetKappa()*k2QPt; Double_t pt = 100; if( TMath::Abs(qPt) >1.e-4 ) pt = 1./TMath::Abs(qPt); fhResY->Fill( p.GetY() - mcY ); fhResZ->Fill( p.GetZ() - mcZ ); fhResSinPhi->Fill( p.GetSinPhi() - mcSinPhi ); fhResDzDs->Fill( p.GetDzDs() - mcDzDs ); fhResPt->Fill( ( pt - mcPt )/mcPt ); if( p.GetErr2Y()>0 ) fhPullY->Fill( (p.GetY() - mcY)/TMath::Sqrt(p.GetErr2Y()) ); if( p.GetErr2Z()>0 ) fhPullZ->Fill( (p.GetZ() - mcZ)/TMath::Sqrt(p.GetErr2Z()) ); if( p.GetErr2SinPhi()>0 ) fhPullSinPhi->Fill( (p.GetSinPhi() - mcSinPhi)/TMath::Sqrt(p.GetErr2SinPhi()) ); if( p.GetErr2DzDs()>0 ) fhPullDzDs->Fill( (p.DzDs() - mcDzDs)/TMath::Sqrt(p.GetErr2DzDs()) ); if( p.GetErr2Kappa()>0 ) fhPullQPt->Fill( (qPt - mcQPt)/TMath::Sqrt(p.GetErr2Kappa()*k2QPt*k2QPt) ); break; } } for (Int_t ipart=0; ipart0 ) fhGBEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0)); } if( traLabels ) delete[] traLabels; if( traPurity ) delete[] traPurity; fStatGBNRecTot += nRecTot; fStatGBNRecOut += nRecOut; fStatGBNGhost += nGhost; fStatGBNMCAll += nMCAll; fStatGBNRecAll += nRecAll; fStatGBNClonesAll += nClonesAll; fStatGBNMCRef += nMCRef; fStatGBNRecRef += nRecRef; fStatGBNClonesRef += nClonesRef; } // distribution of cluster errors { Int_t nHits = fTracker->NHits(); for( Int_t ih=0; ihHits()[ih]; fhHitErrY->Fill(hit.ErrY()); fhHitErrZ->Fill(hit.ErrZ()); } } // cluster pulls if( fDoClusterPulls && fNMCPoints>0 ) { { for (Int_t ipart=0; ipartHits()[ih]; AliHLTTPCCAHitLabel &l = fHitLabels[ih]; if( l.fLab[0]<0 || l.fLab[0]>=fNMCTracks || l.fLab[1]>=0 || l.fLab[2]>=0 ) continue; Int_t lab = l.fLab[0]; AliHLTTPCCAMCTrack &track = fMCTracks[lab]; //if( track.Pt()<1. ) continue; Int_t ip1=-1, ip2=-1; Double_t d1 = 1.e20, d2=1.e20; for( Int_t ip=0; ip1.e-8 && TMath::Abs(p1.Sx()-hit.X())<2. && TMath::Abs(p2.Sx()-hit.X())<2. ){ Double_t sx = hit.X(); Double_t sy = p1.Sy() + dy/dx*(sx-p1.Sx()); Double_t sz = p1.Sz() + dz/dx*(sx-p1.Sx()); Float_t errY, errZ; { AliHLTTPCCATrackParam t; t.Z() = sz; t.SinPhi() = dy/TMath::Sqrt(dx*dx+dy*dy); t.CosPhi() = dx/TMath::Sqrt(dx*dx+dy*dy); t.DzDs() = dz/TMath::Sqrt(dx*dx+dy*dy); fTracker->GetErrors2(hit,t,errY, errZ ); errY = TMath::Sqrt(errY); errZ = TMath::Sqrt(errZ); } fhHitResY->Fill((hit.Y()-sy)); fhHitResZ->Fill((hit.Z()-sz)); fhHitPullY->Fill((hit.Y()-sy)/errY); fhHitPullZ->Fill((hit.Z()-sz)/errZ); if( track.Pt()>=1. ){ fhHitResY1->Fill((hit.Y()-sy)); fhHitResZ1->Fill((hit.Z()-sz)); fhHitPullY1->Fill((hit.Y()-sy)/errY); fhHitPullZ1->Fill((hit.Z()-sz)/errZ); } } } } { cout<<"\nSlice tracker performance: \n"<0 ) ? fStatNRecTot :1; Double_t dMCAll = (fStatNMCAll>0 ) ? fStatNMCAll :1; Double_t dMCRef = (fStatNMCRef>0 ) ? fStatNMCRef :1; Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1; Double_t dRecAll = (fStatNRecAll+fStatNClonesAll>0 ) ? fStatNRecAll+fStatNClonesAll :1; Double_t dRecRef = (fStatNRecRef+fStatNClonesRef>0 ) ? fStatNRecRef+fStatNClonesRef :1; Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1; cout<<" EffRef = "<< fStatNRecRef/dMCRef <<", CloneRef = " << fStatNClonesRef/dRecRef <StatTime(2)/fTracker->StatNEvents()*1.e3<<" " <StatTime(3)/fTracker->StatNEvents()*1.e3<<" " <StatTime(4)/fTracker->StatNEvents()*1.e3<<" " <StatTime(5)/fTracker->StatNEvents()*1.e3<<" " <StatTime(6)/fTracker->StatNEvents()*1.e3<<" " <StatTime(7)/fTracker->StatNEvents()*1.e3<<" " <StatTime(8)/fTracker->StatNEvents()*1.e3<<" " <<" msec/event "<0 ) ? fStatGBNRecTot :1; Double_t dMCAll = (fStatGBNMCAll>0 ) ? fStatGBNMCAll :1; Double_t dMCRef = (fStatGBNMCRef>0 ) ? fStatGBNMCRef :1; Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1; Double_t dRecAll = (fStatGBNRecAll+fStatGBNClonesAll>0 ) ? fStatGBNRecAll+fStatGBNClonesAll :1; Double_t dRecRef = (fStatGBNRecRef+fStatGBNClonesRef>0 ) ? fStatGBNRecRef+fStatGBNClonesRef :1; Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1; cout<<" EffRef = "<< fStatGBNRecRef/dMCRef <<", CloneRef = " << fStatGBNClonesRef/dRecRef <StatTime(0)/fTracker->StatNEvents()*1.e3<<": " <StatTime(1)/fTracker->StatNEvents()*1.e3<<" " <StatTime(2)/fTracker->StatNEvents()*1.e3<<" " <StatTime(3)/fTracker->StatNEvents()*1.e3<<" " <StatTime(4)/fTracker->StatNEvents()*1.e3<<" " <StatTime(5)/fTracker->StatNEvents()*1.e3<<"[" <StatTime(6)/fTracker->StatNEvents()*1.e3<<"/" <StatTime(7)/fTracker->StatNEvents()*1.e3<<"] " <StatTime(8)/fTracker->StatNEvents()*1.e3 <<" msec/event "<StatTime(9)/fTracker->StatNEvents()*1.e3<<": " <StatTime(10)/fTracker->StatNEvents()*1.e3<<", " <StatTime(11)/fTracker->StatNEvents()*1.e3<<", " <StatTime(12)/fTracker->StatNEvents()*1.e3<<" " <<" msec/event "<>fNMCTracks; fMCTracks = new AliHLTTPCCAMCTrack[fNMCTracks]; for( Int_t it=0; it>j; in>> t.PDG(); for( Int_t i=0; i<7; i++ ) in>>t.Par()[i]; for( Int_t i=0; i<7; i++ ) in>>t.TPCPar()[i]; in>> t.P(); in>> t.Pt(); in>> t.NHits(); in>> t.NMCPoints(); in>> t.FirstMCPointID(); in>> t.NReconstructed(); in>> t.Set(); in>> t.NTurns(); } in>>fNHits; fHitLabels = new AliHLTTPCCAHitLabel[fNHits]; for( Int_t ih=0; ih>l.fLab[0]>>l.fLab[1]>>l.fLab[2]; } } void AliHLTTPCCAPerformance::ReadMCPoints( istream &in ) { // read mc points from the file if( fMCPoints ) delete[] fMCPoints; fMCPoints = 0; fNMCPoints = 0; in>>fNMCPoints; fMCPoints = new AliHLTTPCCAMCPoint[fNMCPoints]; for( Int_t ip=0; ip> p.X(); in>> p.Y(); in>> p.Z(); in>> p.Sx(); in>> p.Sy(); in>> p.Sz(); in>> p.Time(); in>> p.ISlice(); in>> p.TrackID(); } }