diff --git a/src/THcDriftChamber.cxx b/src/THcDriftChamber.cxx index df5b80103811384f2d3f81680f094c62d1d51496..18a880b3b7c4f48e750a2b297f3a2ed767c13cca 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 ede4dc8583f5ec235e681401743c4aa9ba2734ae..91f102dbda38f689b861ea00d7d47dae83555b94 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 };