From 42ea93f075503609bf78f434fde3ec86f0c31ff5 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Wed, 5 Sep 2018 13:56:37 -0400 Subject: [PATCH] Fixup GetParent stuff in THcDriftChamber --- src/THcDriftChamber.cxx | 17 ++++++++--------- src/THcDriftChamber.h | 2 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx index df5b801..18a880b 100644 --- a/src/THcDriftChamber.cxx +++ b/src/THcDriftChamber.cxx @@ -156,14 +156,13 @@ Int_t THcDriftChamber::ReadDatabase( const TDatime& date ) fStubMaxXPDiff = 999.; // gHcParms->LoadParmValues((DBRequest*)&list,prefix); // Get parameters parent knows about - THcDC* fParent; - fParent = (THcDC*) GetParent(); - fMinHits = fParent->GetMinHits(fChamberNum); - fMaxHits = fParent->GetMaxHits(fChamberNum); - fMinCombos = fParent->GetMinCombos(fChamberNum); - fFixPropagationCorrection = fParent->GetFixPropagationCorrectionFlag(); - - fSpacePointCriterion = fParent->GetSpacePointCriterion(fChamberNum); + fParent = GetParent(); + fMinHits = static_cast<THcDC*>(fParent)->GetMinHits(fChamberNum); + fMaxHits = static_cast<THcDC*>(fParent)->GetMaxHits(fChamberNum); + fMinCombos = static_cast<THcDC*>(fParent)->GetMinCombos(fChamberNum); + fFixPropagationCorrection = static_cast<THcDC*>(fParent)->GetFixPropagationCorrectionFlag(); + + fSpacePointCriterion = static_cast<THcDC*>(fParent)->GetSpacePointCriterion(fChamberNum); fMaxDist = TMath::Sqrt(fSpacePointCriterion/2.0); // For easy space points if (fhdebugflagpr) cout << " cham = " << fChamberNum << " Set yplane num " << YPlaneNum << " "<< YPlanePNum << endl; @@ -983,7 +982,7 @@ void THcDriftChamber::CorrectHitTimes() Int_t readvert = plane->GetReadoutTB(); //+x is up and +y is beam right! - double alpha = fParent->GetAlphaAngle(pln); + double alpha = static_cast<THcDC*>(fParent)->GetAlphaAngle(pln); double xc = posn*TMath::Sin(alpha); double yc = posn*TMath::Cos(alpha); diff --git a/src/THcDriftChamber.h b/src/THcDriftChamber.h index ede4dc8..91f102d 100644 --- a/src/THcDriftChamber.h +++ b/src/THcDriftChamber.h @@ -137,6 +137,8 @@ protected: Double_t* stubcoef[4]; std::map<int,TMatrixD*> fAA3Inv; + THaDetectorBase* fParent; + ClassDef(THcDriftChamber,0) // A single drift chamber }; -- GitLab