// $Id: AliHLTTPCCAGlobalPerformance.cxx,v 1.11 2010/08/18 20:46:09 ikulakov Exp $ // ************************************************************************** // 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. * // * // Developed by: Igor Kulakov * // Maksym Zyzak * // * // 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. * // * //*************************************************************************** #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE #include "AliHLTTPCCounters.h" #include "AliHLTTPCCAPerformance.h" #include "AliHLTTPCCATrackPerformanceBase.h" #include "AliHLTTPCCAGlobalPerformance.h" #include "AliHLTTPCCAGBHit.h" #include "AliHLTTPCCAMCTrack.h" #ifndef HLTCA_STANDALONE #include "AliHLTTPCCAMCPoint.h" #endif #include "AliHLTTPCCAGBTrack.h" #include "AliHLTTPCCAGBTracker.h" #include "AliHLTTPCCADisplay.h" #ifdef DRAW #define DRAW_GLOBALPERF #endif #ifdef DRAW_GLOBALPERF #include "AliHLTTPCCADisplay.h" #include "AliHLTTPCCAPerformance.h" #endif #include "TMath.h" #include "TROOT.h" #include "Riostream.h" #include "TFile.h" #include "TH1.h" #include "TH2.h" #include "TProfile.h" #include "TStyle.h" void AliHLTTPCCAGlobalPerformance::SetNewEvent(const AliHLTTPCCAGBTracker * const tracker, AliHLTResizableArray *hitLabels, AliHLTResizableArray *mcTracks, AliHLTResizableArray *localMCPoints) { AliHLTTPCCATrackPerformanceBase::SetNewEvent(tracker, hitLabels, mcTracks, localMCPoints); nRecoTracks = fTracker->NTracks(); } // void AliHLTTPCCAGlobalPerformance::SetNewEvent void AliHLTTPCCAGlobalPerformance::CheckMCTracks() { for ( int imc = 0; imc < nMCTracks; imc++ ) (*fMCTracks)[imc].SetNHits( 0 ); for ( int ih = 0; ih < (*fHitLabels).Size(); ih++ ) { // TODO: do we need to calculate consequtive hits?? const AliHLTTPCCAHitLabel &l = (*fHitLabels)[ih]; if ( l.fLab[0] >= 0 ) (*fMCTracks)[l.fLab[0]].SetNHits( (*fMCTracks)[l.fLab[0]].NHits() + 1 ); if ( l.fLab[1] >= 0 ) (*fMCTracks)[l.fLab[1]].SetNHits( (*fMCTracks)[l.fLab[1]].NHits() + 1 ); if ( l.fLab[2] >= 0 ) (*fMCTracks)[l.fLab[2]].SetNHits( (*fMCTracks)[l.fLab[2]].NHits() + 1 ); } mcData.resize(nMCTracks); for ( int imc = 0; imc < nMCTracks; imc++ ) { AliHLTTPCCAMCTrack &mc = (*fMCTracks)[imc]; AliHLTTPCCAPerformanceMCTrackData &mcTrackData = mcData[imc]; mc.SetSet( 0 ); mc.SetNReconstructed( 0 ); mc.SetNTurns( 1 ); if ( ( mc.NHitRows() >= PParameters::MinimumHitsForMCTrack ) && #ifndef DRIFT_TUBES // ( mc.NHits() == mc.NHitRows() ) && #else ( mc.NHitContRows() >= PParameters::MinimumHitsForMCTrack ) && ( mc.NMCContRows() >= PParameters::MinimumMCPointsForMCTrack ) && #endif // ( mc.NMCPoints() >= PParameters::MinimumMCPointsForMCTrack ) && ( mc.NMCRows() >= PParameters::MinimumMCPointsForMCTrack ) ) mcTrackData.SetAsReconstructable(); // sets of tracks 0-OutSet, 1-ExtraSet, 2-RefSet, 3-ExtraSecSet, 4-ExtraPrimSet, 5-RefSecSet, 6-RefPrimSet, 7-LongRefPrimSet if ( mc.P() >= PParameters::ExtraThreshold ) { if ( mc.P() >= PParameters::RefThreshold ) { mc.SetSet( 2 ); mcTrackData.SetSet( 2 ); if ( mc.MotherId() != -1 ) { mc.SetSet( 5 ); mcTrackData.SetSet( 5 ); } else { mc.SetSet( 6 ); mcTrackData.SetSet( 6 ); if ( mc.NHits() == fTracker->NStations() ) { mc.SetSet( 7 ); mcTrackData.SetSet( 7 ); } } } else{ mc.SetSet( 1 ); mcTrackData.SetSet( 1 ); if ( mc.MotherId() != -1 ) { mc.SetSet( 3 ); mcTrackData.SetSet( 3 ); } else { mc.SetSet( 4 ); mcTrackData.SetSet( 4 ); } } } } // for iMC } // void AliHLTTPCCAGlobalPerformance::CheckMCTracks() void AliHLTTPCCAGlobalPerformance::MatchTracks() { recoData.resize(nRecoTracks); for ( int itr = 0; itr < nRecoTracks; itr++ ) { int traLabels = -1; double traPurity = 0; const AliHLTTPCCAGBTrack &tCA = fTracker->Track( itr ); const int nhits = tCA.NHits(); int *lb = new int[nhits*3]; int nla = 0; for ( int ihit = 0; ihit < nhits; ihit++ ) { const int index = fTracker->TrackHit( tCA.FirstHitRef() + ihit ); const AliHLTTPCCAHitLabel &l = (*fHitLabels)[fTracker->Hit( 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 labmax = -1, labcur = -1, lmax = 0, lcurr = 0; for ( int i = 0; i < nla; i++ ) { if ( lb[i] != labcur ) { if ( labcur >= 0 && lmax < lcurr ) { lmax = lcurr; labmax = labcur; } labcur = lb[i]; lcurr = 0; } lcurr++; } if ( labcur >= 0 && lmax < lcurr ) { lmax = lcurr; labmax = labcur; } lmax = 0; for ( int ihit = 0; ihit < nhits; ihit++ ) { const int index = fTracker->TrackHit( tCA.FirstHitRef() + ihit ); const AliHLTTPCCAHitLabel &l = (*fHitLabels)[fTracker->Hit( index ).ID()]; if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax ) lmax++; } traLabels = labmax; traPurity = ( ( nhits > 0 ) ? double( lmax ) / double( nhits ) : 0 ); if ( lb ) delete[] lb; recoData[itr].SetMCTrack(traLabels, traPurity, nhits); if ( recoData[itr].IsReco(PParameters::MinTrackPurity, PParameters::MinimumHitsForRecoTrack) ) mcData[traLabels].AddReconstructed(itr); } // for iReco } // void AliHLTTPCCAGlobalPerformance::MatchTracks() void AliHLTTPCCAGlobalPerformance::EfficiencyPerformance( ) { for ( int iRTr = 0; iRTr < nRecoTracks; iRTr++ ) { if ( recoData[iRTr].IsGhost(PParameters::MinTrackPurity) ) fEff.ghosts++; } for ( int iMCTr = 0; iMCTr < nMCTracks; iMCTr++ ) { AliHLTTPCCAPerformanceMCTrackData &mc = mcData[iMCTr]; if ( !mc.IsReconstructable() ) continue; const bool reco = mc.IsReconstructed(); const int nclones = mc.GetNClones(); bool killed = 0; // isn't used double ratio_length = 0; double ratio_fakes = 0; const vector& rTIds = mc.RecoTrackIds(); if (reco){ double mc_length = (*fMCTracks)[iMCTr].NMCRows(); for (unsigned int irt = 0; irt < rTIds.size(); irt++) { AliHLTTPCCAPerformanceRecoTrackData& rd = recoData[rTIds[irt]]; ratio_length += static_cast( rd.NHits() )*rd.GetPurity() / mc_length; ratio_fakes += 1 - rd.GetPurity(); } } if ( mc.GetSet() == 0){ // rest, out track fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "rest"); } else{ // good fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "total"); switch( mc.GetSet() ){ case 1: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "extra"); break; case 2: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref"); break; case 3: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "extra"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "extra_sec"); break; case 4: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "extra"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "extra_prim"); break; case 5: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref_sec"); break; case 6: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref_prim"); break; break; ///?????? case 7: fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref_prim"); fEff.Inc(reco, killed, ratio_length, ratio_fakes, nclones, "ref_prim_long"); break; } } } // for iMCTr AliHLTTPCCATrackPerformanceBase::EfficiencyPerformance(); } // void AliHLTTPCCAGlobalPerformance::EfficiencyPerformance( ) void AliHLTTPCCAGlobalPerformance::FillHistos() { AliHLTTPCCATrackPerformanceBase::FillHistos(); const int NMCTracks = (*fMCTracks).Size(); vector mcTrackNRecoHits; vector nHitsVsRow; vector nMCPointsVsRow; const int Multiplicity = (*fMCTracks).Size(); mcTrackNRecoHits.resize(NMCTracks, 0); nHitsVsRow.resize(fTracker->NStations()); nMCPointsVsRow.resize(fTracker->NStations()); for(int iH=0; iH < fTracker->NHits(); iH++){ const AliHLTTPCCAGBHit &hit = fTracker->Hit( iH ); nHitsVsRow[hit.IRow()]++; const AliHLTTPCCAHitLabel &l = (*fHitLabels)[hit.ID()]; if ( l.fLab[0] >= 0 ) mcTrackNRecoHits[l.fLab[0]]++; if ( l.fLab[1] >= 0 ) mcTrackNRecoHits[l.fLab[1]]++; if ( l.fLab[2] >= 0 ) mcTrackNRecoHits[l.fLab[2]]++; } for(int i=0; i < NMCTracks; i++){ AliHLTTPCCAMCTrack &mcT = (*fMCTracks)[i]; GetHisto("mcTrackNRecoHits")->Fill( mcTrackNRecoHits[i] ); GetHisto("nMCPointsVsMCMom")->Fill( mcT.P(), mcT.NMCPoints() ); if ( mcT.NMCPoints() > 0 ) { double mcEx = mcT.Px(); double mcEy = mcT.Py(); double mcEz = mcT.Pz(); double mcEt = TMath::Sqrt( mcEx * mcEx + mcEy * mcEy ); const double dZdS = mcEz/mcEt; GetHisto("nHitsOverNMCPointsVsMCMom")->Fill( mcT.P(), float(mcTrackNRecoHits[i])/float(mcT.NMCPoints()) ); GetHisto("nHitsOverNMCPointsVsMCDzDs")->Fill( dZdS, float(mcTrackNRecoHits[i])/float(mcT.NMCPoints()) ); } } for(int i=0; i < (*fLocalMCPoints).Size(); i++){ nMCPointsVsRow[(*fLocalMCPoints)[i].IRow()]++; } for(int i=0; i < fTracker->NStations(); i++){ if ( nMCPointsVsRow[i] > 0 ) { GetHisto("nHitsOverNMCPointsVsRow")->Fill( i, float(nHitsVsRow[i])/float(nMCPointsVsRow[i]) ); GetHisto("nHitsOverNMCPointsVsNMCTracks")->Fill( Multiplicity, float(nHitsVsRow[i])/float(nMCPointsVsRow[i]) ); } } for(int iRTr=0; iRTr < nRecoTracks; iRTr++){ // TODO: make common AliHLTTPCCAPerformanceRecoTrackData &recoD = recoData[iRTr]; const AliHLTTPCCAGBTrack &recoTr = fTracker->Track( iRTr ); // TODO: make common AliHLTTPCCAMCTrack &mcTr = (*fMCTracks)[ recoD.GetMCTrackId() ]; // if ( mcTr.MotherId() == -1 ) continue; // if ( (*fMCTracks)[mcTr.MotherId()].PDG() != 310 ) continue; // if ( mcTr.NHits() != fTracker->NStations() ) continue; // if ( abs(mcTr.Pt()) < 1 ) continue; // if ( abs(mcTr.DzDs()) < 0.5 ) continue; #ifdef USE_CA_FIT // use 3 iterational fit, which ends on inner station // AliHLTTPCCATrackParam param = recoTr.OuterParam(); AliHLTTPCCATrackParam param = recoTr.InnerParam(); #else AliHLTTPCCATrackParam param = recoTr.InnerParam(); // AliHLTTPCCATrackParam param = recoTr.OuterParam(); #endif #if !defined(PANDA_FTS) double RecoPt = 1. / fabs(param.QPt()); double RecoMom = RecoPt * sqrt(1. + param.DzDs()*param.DzDs()); #endif // fNVsMom->Fill( param.Y()); // fLengthVsMom->Fill( param.Y(), t.NHits()); double prob = param.Chi2() != -1 ? TMath::Prob( param.Chi2(), param.NDF() ) : -1; GetHisto("purity")->Fill( recoData[iRTr].GetPurity() ); if ( recoD.IsGhost(PParameters::MinTrackPurity) ) { #if !defined(PANDA_FTS) GetHisto("ghostsRMom")->Fill( RecoMom ); GetHisto("ghostsRPt")->Fill( RecoPt ); GetHisto("ghostsMCPt")->Fill( mcTr.Pt() ); GetHisto("ghostsLengthAndRMom")->Fill( recoTr.NHits(), RecoMom ); #endif GetHisto("ghostsLength")->Fill( recoTr.NHits() ); GetHisto("ghostsMCMom")->Fill( mcTr.P() ); GetHisto("ghostsLengthAndMCMom")->Fill( recoTr.NHits(), mcTr.P() ); GetHisto("ghostsChi2")->Fill( param.Chi2() ); GetHisto("ghostsProb")->Fill( prob ); } else { #if !defined(PANDA_FTS) GetHisto("recosRMom")->Fill( RecoMom ); GetHisto("recosRPt")->Fill( RecoPt ); GetHisto("recosMCPt")->Fill( mcTr.Pt() ); GetHisto("recosLengthAndRMom")->Fill( recoTr.NHits() , RecoMom ); #endif GetHisto("recosLength")->Fill( recoTr.NHits() ); GetHisto("recosMCMom")->Fill( mcTr.P() ); GetHisto("recosLengthAndMCMom")->Fill( recoTr.NHits() , mcTr.P() ); GetHisto("recosChi2")->Fill( param.Chi2() ); GetHisto("recosProb")->Fill( prob ); if ( abs(mcTr.P()) > PParameters::RefThreshold ) GetHisto("recosRefProb")->Fill( prob ); if( mcTr.P() > 0.5 ) GetHisto("nHitsRecoTOverNHitsMCT")->Fill( float(recoTr.NHits()) / mcTrackNRecoHits[recoD.GetMCTrackId()] ); } } // global tracker performance { for ( int itr = 0; itr < nRecoTracks; itr++ ) { const int iMC = recoData[itr].GetMCTrackId(); if ( recoData[itr].IsGhost(PParameters::MinTrackPurity) ) continue; AliHLTTPCCAMCTrack &mc = (*fMCTracks)[iMC]; // if ( mc.MotherId() == -1 ) continue; // if ( (*fMCTracks)[mc.MotherId()].PDG() != 310 ) continue; // if ( mc.NHits() != fTracker->NStations() ) continue; #ifdef PANDA_FTS if ( abs(mc.P()) < 1 ) continue; #endif // if ( abs(mc.DzDs()) < 0.5 ) continue; int nFirstMC = mc.FirstMCPointID(); int nMCPoints = mc.NMCPoints(); AliHLTTPCCALocalMCPoint *points = &((*fLocalMCPoints).Data()[nFirstMC]); const AliHLTTPCCAGBTrack &t = fTracker->Track( itr ); #ifdef USE_CA_FIT AliHLTTPCCATrackParam p = t.OuterParam(); // AliHLTTPCCATrackParam p = t.InnerParam(); #else // AliHLTTPCCATrackParam p = t.OuterParam(); AliHLTTPCCATrackParam p = t.InnerParam(); #endif if( !p.IsValid() ) continue; int nHits = t.NHits(); if(nHits < 3) continue; // int nHits = t.NHits(); // std::cout << "hits:" << std::endl; // for(int iH=0; iHHit( fTracker->TrackHit(t.FirstHitRef() + iH) ).X() << " " << // fTracker->Hit( fTracker->TrackHit(t.FirstHitRef() + iH) ).Y() << " " << // fTracker->Hit( fTracker->TrackHit(t.FirstHitRef() + iH) ).Z() << " " << std::endl; // std::cout << "MCPoints:" << std::endl; // for(int iMCPoint=0; iMCPoint 0.5) continue; #else if(fabs(x0PLoc - p.X0()) > 2.f) continue; #endif // find hit double x1HLoc = -1e10, x2HLoc = -1e10; for(int iH=0; iHTrackHits()[ith]; const AliHLTTPCCAGBHit& hit = fTracker->Hit( ih ); float x0tmp, x1tmp, x2tmp; AliHLTTPCCAParameters::GlobalToCALocal( hit.X(), hit.Y(), hit.Z(), p.Angle(), x0tmp, x1tmp, x2tmp ); #ifdef DRIFT_TUBES if(fabs(x0tmp - p.X0()) > 0.5) continue; #else if(fabs(x0tmp - p.X0()) > 2.f) continue; #endif x1HLoc = x1tmp; x2HLoc = x2tmp; } // if(fabs(p.Y() - yLoc)<2 && fabs(p.Z() - points[iMCPoint].Z())<2) #ifdef DRIFT_TUBES if(fabs(x1HLoc - x1PLoc)<2) #else if(fabs(x1HLoc - x1PLoc)<2 && fabs(x2HLoc - x2PLoc)<2) #endif MCindex = iMCPoint; } if(MCindex == -1) { continue; } // track resolutions while ( true ) { const AliHLTTPCCALocalMCPoint& point = points[MCindex]; float mcX0, mcX1, mcX2; AliHLTTPCCAParameters::GlobalToCALocal( point.X(), point.Y(), point.Z(), p.Angle(), mcX0, mcX1, mcX2 ); float mcPX0, mcPX1, mcPX2; AliHLTTPCCAParameters::GlobalToCALocal( point.Px(), point.Py(), point.Pz(), p.Angle(), mcPX0, mcPX1, mcPX2 ); const double bz = fTracker->GetParameters().cBz(); if ( !p.TransportToX0( mcX0, bz ) ) break; #if 0//def PANDA_STT double mcSinPhi = mcEx1 / mcEt; double mcDzDs = mcEz / mcEt; double mcQPt = mcQP / mcEt; #else // double mcX2 = point.Z(); double mcQP = point.QP(); double mcEx0 = mcPX0*TMath::Abs(mcQP); double mcEx1 = mcPX1*TMath::Abs(mcQP); double mcEx2 = mcPX2*TMath::Abs(mcQP); #ifdef PANDA_FTS if ( TMath::Abs( mcEx0 ) < 1.e-7 ) break; double mcTx1 = mcEx1/mcEx0; double mcTx2 = mcEx2/mcEx0; double mcP = 1. / TMath::Abs( mcQP ); if ( mcP < 0.010 ) break; #else double mcEt = TMath::Sqrt( mcEx0 * mcEx0 + mcEx1 * mcEx1 ); if ( TMath::Abs( mcEt ) < 1.e-4 ) break; double mcSinPhi = mcEx1 / mcEt; double mcDzDs = mcEx2 / mcEt; double mcQPt = mcQP / mcEt; if ( TMath::Abs( mcQPt ) < 1.e-6 ) break; double mcPt = 1. / TMath::Abs( mcQPt ); bool dirOk = 1; if( (mcX0 > 0) && (mcEx0 < 0) ) dirOk =0; if( (mcX0 < 0) && (mcEx0 > 0) ) dirOk =0; if ( p.CosPhi()*mcEx0 < 0 ) { // change direction // if(!dirOk) { mcSinPhi = -mcSinPhi; mcDzDs = -mcDzDs; mcQPt = -mcQPt; } if ( mcPt < 0.010 ) break; #endif #endif // 0 GetHisto("resX1")->Fill( p.X1() - mcX1 ); if ( p.Err2X1() > 0 ) GetHisto("pullX1")->Fill( ( p.X1() - mcX1 ) / TMath::Sqrt( p.Err2X1() ) ); GetHisto("resX2")->Fill( p.X2() - mcX2 ); if ( p.Err2X2() > 0 ) GetHisto("pullX2")->Fill( ( p.X2() - mcX2 ) / TMath::Sqrt( p.Err2X2() ) ); #ifdef PANDA_FTS // double qP = -p.QP(); // TODO: undestand why double qP = p.QP(); // TODO: undestand why GetHisto("resTx1")->Fill( p.Tx1() - mcTx1 ); GetHisto("resTx2")->Fill( p.Tx2() - mcTx2 ); if(CAMath::Abs(qP) > 1.e-7){ GetHisto("resP")->Fill( (qP - mcQP)/mcQP ); } if ( p.Err2Tx1() > 0 ) GetHisto("pullTx1")->Fill( ( p.Tx1() - mcTx1 ) / TMath::Sqrt( p.Err2Tx1() ) ); if ( p.Err2Tx2() > 0 ) GetHisto("pullTx2")->Fill( ( p.Tx2() - mcTx2 ) / TMath::Sqrt( p.Err2Tx2() ) ); if(CAMath::Abs(qP) > 1.e-7 && p.Err2QP() > 0 ) GetHisto("pullQP")->Fill( (qP - mcQP)/TMath::Sqrt(p.Err2QP()) ); #else // PANDA_FTS double qPt = p.QPt(); GetHisto("resSinPhi")->Fill( p.SinPhi() - mcSinPhi ); GetHisto("resDzDs")->Fill( p.DzDs() - mcDzDs ); if(CAMath::Abs(qPt) > 1.e-7){ GetHisto("resPt")->Fill( (qPt - mcQPt)/mcQPt ); GetHisto("resPtVsP")->Fill( TMath::Abs(mcQP), (1.f/qPt - 1.f/mcQPt)*mcQPt ); GetHisto("resPVsP")->Fill( TMath::Abs(mcQP), (TMath::Abs(1.f/p.QP()) - TMath::Abs(1.f/mcQP))*TMath::Abs(mcQP) ); // cout << setprecision(5) << qPt << " " << mcQPt << " " << TMath::Sqrt(p.Err2QPt()) << endl; } if ( p.Err2SinPhi() > 0 ) GetHisto("pullSinPhi")->Fill( ( p.SinPhi() - mcSinPhi ) / TMath::Sqrt( p.Err2SinPhi() ) ); if ( p.Err2DzDs() > 0 ) GetHisto("pullDzDs")->Fill( ( p.DzDs() - mcDzDs ) / TMath::Sqrt( p.Err2DzDs() ) ); if(CAMath::Abs(qPt) > 1.e-7 && p.Err2QPt()>0 ) GetHisto("pullQPt")->Fill( (qPt - mcQPt)/TMath::Sqrt(p.Err2QPt()) ); #endif // PANDA_FTS break; } } } // hits pulls { // TODO const int nHits = fTracker->NHits(); for ( int ih = 0; ih < nHits; ih++ ) { const AliHLTTPCCAGBHit &hit = fTracker->Hit( ih ); float x0HLoc, x1HLoc, x2HLoc; AliHLTTPCCAParameters::GlobalToCALocal( hit.X(), hit.Y(), hit.Z(), hit.Angle(), x0HLoc, x1HLoc, x2HLoc ); const int iMCP = AliHLTTPCCAPerformance::Instance().GetMCPoint(hit); if (iMCP == -1) continue; const AliHLTTPCCALocalMCPoint& point = fLocalMCPoints->Data()[iMCP]; float x0PLoc, x1PLoc, x2PLoc; AliHLTTPCCAParameters::GlobalToCALocal( point.X(), point.Y(), point.Z(), hit.Angle(), x0PLoc, x1PLoc, x2PLoc ); float px0PLoc, px1PLoc, px2PLoc; AliHLTTPCCAParameters::GlobalToCALocal( point.Px(), point.Py(), point.Pz(), hit.Angle(), px0PLoc, px1PLoc, px2PLoc ); const float t1 = px1PLoc/px0PLoc, t2 = px2PLoc/px0PLoc; x1PLoc += t1*( x0HLoc - x0PLoc ); x2PLoc += t2*( x0HLoc - x0PLoc ); x0PLoc = x0HLoc; GetHisto("resXHit")->Fill( x0HLoc - x0PLoc ); GetHisto("resYHit")->Fill( x1HLoc - x1PLoc ); GetHisto("resZHit")->Fill( x2HLoc - x2PLoc ); GetHisto("resXHitVsZ")->Fill( hit.Z(), x0HLoc - x0PLoc ); GetHisto("resYHitVsZ")->Fill( hit.Z(), x1HLoc - x1PLoc ); GetHisto("resZHitVsZ")->Fill( hit.Z(), x2HLoc - x2PLoc ); GetHisto("resXHitVsX")->Fill( hit.X(), x0HLoc - x0PLoc ); GetHisto("resYHitVsX")->Fill( hit.X(), x1HLoc - x1PLoc ); GetHisto("resZHitVsX")->Fill( hit.X(), x2HLoc - x2PLoc ); GetHisto("xMCPoint")->Fill( point.X() ); GetHisto("rMCPoint")->Fill( sqrt(point.Y()*point.Y() + point.X()*point.X()) ); // get errors // GetHisto("pullXHit")->Fill( hit.X() - point.X() ); GetHisto("pullYHit")->Fill( (x1HLoc - x1PLoc)/sqrt(hit.Err2X1()) ); GetHisto("pullZHit")->Fill( (x2HLoc - x2PLoc)/sqrt(hit.Err2X2()) ); #ifdef DRIFT_TUBES const float dist = hit.DistanceFromWireToPoint( point.X(), point.Y(), point.Z() ); GetHisto("resRHit")->Fill( hit.R() - dist ); GetHisto("pullRHit")->Fill( (hit.R() - dist)/sqrt(hit.Err2R()) ); #endif } } } // void AliHLTTPCCAGlobalPerformance::FillHistos() void AliHLTTPCCAGlobalPerformance::Draw() { #ifdef DRAW_GLOBALPERF // AliHLTTPCCAPerformance::Instance().Init(); AliHLTTPCCAPerformance& gbPerfo = AliHLTTPCCAPerformance::Instance(); AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance(); // disp.SetGB( gbPerfo.GetTracker() ); disp.ClearView(); disp.SetTPC( fTracker->GetParameters() ); //disp.DrawTPC(); disp.DrawGBHits( *gbPerfo.GetTracker(), kGreen+2, 0.1 ); for ( int imc = 0; imc < nMCTracks; imc++ ) { AliHLTTPCCAPerformanceMCTrackData &mc = mcData[imc]; bool doDraw = true; #if !(defined(PANDA_STT) || defined(PANDA_FTS)) //doDraw &= (mc.GetSet() == 7); // long ref prim doDraw &= (*fMCTracks)[imc].P() > 1; //doDraw &= mc.IsReconstructable(); // doDraw &= mc.IsReconstructed(); if ( doDraw ) disp.DrawMCTrack( imc, kRed+2, 0 ); #else doDraw &= mc.IsReconstructable(); if ( doDraw ) disp.DrawMCTrack( imc, kRed+2, 0 ); #endif } cout << "NRecoTracks = " << nRecoTracks << endl; for( int iT = 0; iT < nRecoTracks; ++iT ) { AliHLTTPCCAPerformanceRecoTrackData &r = recoData[iT]; const bool IsGhost = r.IsGhost(PParameters::MinTrackPurity); if ( IsGhost ) { const int imc = r.GetMCTrackId(); AliHLTTPCCAPerformanceMCTrackData &mc = mcData[imc]; UNUSED_PARAM1(mc); bool doDraw = true; #if !(defined(PANDA_STT) || defined(PANDA_FTS)) //doDraw &= (mc.GetSet() == 7); // long ref prim //doDraw &= (*fMCTracks)[imc].P() > 1; //doDraw &= mc.IsReconstructable(); if ( doDraw ) disp.DrawRecoTrack( iT, kGreen+1, 0 ); #else //doDraw &= (mc.GetSet() == 7); // long ref prim //doDraw &= (*fMCTracks)[imc].P() > 1; //doDraw &= mc.IsReconstructable(); if ( doDraw ) disp.DrawRecoTrack( iT, kGreen+1, 0 ); #endif //disp.Ask(); } else { const int imc = r.GetMCTrackId(); AliHLTTPCCAPerformanceMCTrackData &mc = mcData[imc]; UNUSED_PARAM1(mc); bool doDraw = true; //doDraw &= (mc.GetSet() == 7); // long ref prim #if !(defined(PANDA_STT) || defined(PANDA_FTS)) doDraw &= (*fMCTracks)[imc].P() > 1; //doDraw &= mc.IsReconstructable(); // doDraw &= mc.IsReconstructed(); if ( doDraw ) disp.DrawRecoTrack( iT, kBlue+1, 0 ); #else doDraw &= (*fMCTracks)[imc].P() > 1; //doDraw &= mc.IsReconstructable(); // doDraw &= mc.IsReconstructed(); if ( doDraw ) disp.DrawRecoTrack( iT, kBlue+1, 0 ); #endif } } disp.SaveCanvasToFile( "DrawGlobalPerformance.pdf" ); disp.Ask(); #endif // DRAW_GLOBALPERF } // void AliHLTTPCCAGlobalPerformance::Draw() #endif //DO_TPCCATRACKER_EFF_PERFORMANCE