void SWTrack::updateEvent(AMSEventR *event) { rEvent = event; int mf0 = TrTrackR::DefaultFitID; int mfit[NPAR] = { mf0, mf0 | TrTrackR::kFitLayer8, mf0 | TrTrackR::kFitLayer9, mf0 | TrTrackR::kFitLayer8 | TrTrackR::kFitLayer9 }; for (int i = 0; i < NLAY; i++) lyrSta[i] = 0; for (int i = 0; i < NPAR; i++) fitPar[i] = 0; TrTrackR *trk; for (int t = tID; t >= 0; t--) { trk = rEvent->pTrTrack(t); if (trk) { tID = t; break; } } if (!trk) return; for (int i = 0; i < NPAR; i++) if (trk->ParExists(mfit[i])) fitPar[i] = mfit[i]; if (fID < 0 || !trk->ParExists(mfit[fID])) { for (int i = 0; i < NPAR; i++) if (trk->ParExists(mfit[i])) { fID = i; break; } } if (fID < 0) return; for (int i = 0; i < trk->GetNhits(); i++) { TrRecHitR *hit = trk->GetHit(i); int ily = hit->GetLayer()-1; if (hit->OnlyY()) lyrSta[ily] = LSTA_HITY; else lyrSta[ily] = LSTA_HITT; } for (int i = 0; i < NLAY; i++) { if (lyrSta[i] == 0) { AMSPoint pnt; AMSDir dir; trk->Interpolate(TkDBc::Head->GetZlayer(i+1), pnt, dir); TkSens sens(pnt, 0); lyrSta[i] = sens.GetLadTkID(); } } }
bool minimumbiasTRACKER(AMSEventR *pev,int fit) { //chiedo che esista almeno un fit sui layer interni bool minimum_bias = false; if (pev->nTrTrack()<=0) return false; for(int i=0;i<pev->nTrTrack();i++) { TrTrackR* track = pev->pTrTrack(i); if (!track) continue; if(track->IsFake()) continue; Int_t fitID = track->iTrTrackPar(1, fit, 1); if (fitID < 0 || !track->ParExists(fitID)) continue; Double_t rgt = fabs(track->GetRigidity (fitID)); Double_t csq = track->GetNormChisqY(fitID); if (rgt == 0 || csq < 0) continue; /*Int_t span = TrTrackSelection::GetSpanFlags(track) & 0xff; if (! (span & TrTrackSelection::kMaxInt)) continue;*/ minimum_bias=true; } return minimum_bias; }
QString &InfoText::TrackInfo(AMSEventR *event, int itrk) { static QString str; str = ""; if (!event) return str; TrTrackR *trk = event->pTrTrack(itrk); if (!trk) return str; int id1 = TrTrackR::kChoutko; int id2 = TrTrackR::kChoutko+TrTrackR::kMultScat; if (!trk->ParExists(id1)) id1 = TrTrackR::kLinear; if (!trk->ParExists(id2)) id2 = id1; if (!trk->ParExists(id1)) return str; int fpat[8]; for (int i = 0; i < 8; i++) fpat[i] = 0; for (int i = 0; i < trk->GetNhits(); i++) { TrRecHitR *hit = trk->GetHit(i); int ily = hit->GetLayer()-1; if (hit->OnlyY()) fpat[ily] = 1; else fpat[ily] = 2; } TString spat; for (int i = 0; i < 8; i++) { if (fpat[i] == 0) spat += "_"; if (fpat[i] == 1) spat += "Y"; if (fpat[i] == 2) spat += "O"; } str += Form("Track[%d]\n", itrk); str += Form(" nHit: %d\n", trk->GetNhits()); str += Form(" nHitXY: %d\n", trk->GetNhitsXY()); str += Form(" Pattern: %d [%s]\n", trk->GetPattern(), spat.Data()); str += "\n"; str += Form(" Rigidity (noMS): %.2f\n", trk->GetRigidity(id1)); str += Form(" Rigidity (Fast): %.2f\n", trk->GetRigidity(id2)); str += Form(" errRinv (Fast): %.2f\n", trk->GetErrRinv (id2)); str += "\n"; str += Form(" Chi2Fast: %.2f\n", trk->GetChisq (id2)); str += Form(" Chi2X/Ndf: %.2f/%d\n", trk->GetChisqX (id2), trk->GetNdofX (id2)); str += Form(" Chi2Y/Ndf: %.2f/%d\n", trk->GetChisqY (id2), trk->GetNdofY (id2)); str += "\n"; str += Form(" P0: (%.2f, %.2f, %.2f)\n", trk->GetP0x(id2), trk->GetP0y(id2), trk->GetP0z(id2)); str += Form(" th/ph: (%.1f, %.1f)\n", trk->GetTheta(id2)*TMath::RadToDeg(), trk->GetPhi (id2)*TMath::RadToDeg()); for (int i = 0; i < trk->GetNhits(); i++) { TrRecHitR *hit = trk->GetHit(i); if (!hit) continue; int lay = hit->GetLayer(); str += Form("\nHit[%d]\n ", i); str += hit->Info(i); str += Form("Residual: %.4f %.4f\n", trk->GetResidualO(lay).x(), trk->GetResidualO(lay).y()); } return str; }