//_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HForwardCandFinderPar // // Container class for VectorFinder hit finder parameters // ///////////////////////////////////////////////////////////// #include "hforwardcandfinderpar.h" #include "hparamlist.h" #include "TBuffer.h" #include ClassImp(HForwardCandFinderPar) HForwardCandFinderPar::HForwardCandFinderPar(const Char_t *name, const Char_t *title, const Char_t *context) : HParCond(name, title, context) { fDriftRadiusPars.Set(dt_pars_num); clear(); } void HForwardCandFinderPar::clear() { // Clear the container nMaxAllowedHits = 0.0f; fStsTimeWindowL = 0.0f; fStsTimeWindowU = 0.0f; fFRpcTimeWindowL = 0.0f; fFRpcTimeWindowU = 0.0f; fCutX = 0.0f; fCutY = 0.0f; fLRCutChi2 = 0.0f; fHRCutChi2 = 0.0f; fTanCut = 0.0f; fLRErrU = 0.0f; fHRErrU = 0.0f; fFRpcMatchDist = 0.0f; nMaxBest = 0; nPass = 0; fDriftRadiusPars = 0.0f; } void HForwardCandFinderPar::putParams(HParamList *l) { // Add the parameters to the list for writing if (!l) return; l->add("nMaxAllowedHits", nMaxAllowedHits); l->add("fStsTimeWindowL", fStsTimeWindowL); l->add("fStsTimeWindowU", fStsTimeWindowU); l->add("fFRpcTimeWindowL", fFRpcTimeWindowL); l->add("fFRpcTimeWindowU", fFRpcTimeWindowU); l->add("fCutX", fCutX); l->add("fCutY", fCutY); l->add("fLRCutChi2", fLRCutChi2); l->add("fHRCutChi2", fHRCutChi2); l->add("fTanCut", fTanCut); l->add("fLRErrU", fLRErrU); l->add("fHRErrU", fHRErrU); l->add("fFRpcMatchDist", fFRpcMatchDist); l->add("nMaxBest", nMaxBest); l->add("nPass", nPass); l->add("fDriftRadiusPars", fDriftRadiusPars); } Bool_t HForwardCandFinderPar::getParams(HParamList *l) { // Get the parameters from the list (read from input) if (!l) return kFALSE; if (!l->fill("nMaxAllowedHits", &nMaxAllowedHits)) return kFALSE; if (!l->fill("fStsTimeWindowL", &fStsTimeWindowL)) return kFALSE; if (!l->fill("fStsTimeWindowU", &fStsTimeWindowU)) return kFALSE; if (!l->fill("fFRpcTimeWindowL", &fFRpcTimeWindowL)) return kFALSE; if (!l->fill("fFRpcTimeWindowU", &fFRpcTimeWindowU)) return kFALSE; if (!l->fill("fCutX", &fCutX)) return kFALSE; if (!l->fill("fCutY", &fCutY)) return kFALSE; if (!l->fill("fLRCutChi2", &fLRCutChi2)) return kFALSE; if (!l->fill("fHRCutChi2", &fHRCutChi2)) return kFALSE; if (!l->fill("fTanCut", &fTanCut)) return kFALSE; if (!l->fill("fLRErrU", &fLRErrU)) return kFALSE; if (!l->fill("fHRErrU", &fHRErrU)) return kFALSE; if (!l->fill("fFRpcMatchDist", &fFRpcMatchDist)) return kFALSE; if (!l->fill("nMaxBest", &nMaxBest)) return kFALSE; if (!l->fill("nPass", &nPass)) return kFALSE; if (!l->fill("fDriftRadiusPars", &fDriftRadiusPars)) return kFALSE; return kTRUE; } void HForwardCandFinderPar::setDriftRadiusPar(Int_t idx, Float_t p) { if (idx >= 0 and idx < dt_pars_num) fDriftRadiusPars[idx] = p; else throw std::out_of_range("invalid index"); } Float_t HForwardCandFinderPar::getDriftRadiusPar(Int_t idx) const { if (idx >= 0 and idx < dt_pars_num) return fDriftRadiusPars[idx]; else throw std::out_of_range("invalid index"); } void HForwardCandFinderPar::Streamer(TBuffer &R__b) { // Stream an object of class HForwardCandFinderPar. UInt_t R__s, R__c; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } HParCond::Streamer(R__b); R__b >> nMaxAllowedHits; R__b >> fStsTimeWindowL; R__b >> fStsTimeWindowU; if(R__v > 1) { R__b >> fFRpcTimeWindowL; R__b >> fFRpcTimeWindowU; } else { Float_t fMatchRtmp,fMatchCrosstmp; R__b >> fMatchRtmp; R__b >> fMatchCrosstmp; fFRpcTimeWindowL = fMatchRtmp; fFRpcTimeWindowU = fMatchCrosstmp; } R__b >> fCutX; R__b >> fCutY; R__b >> fLRCutChi2; R__b >> fHRCutChi2; if(R__v == 1) { // fTxyCut removed in v2 Float_t fTxyCuttmp; R__b >> fTxyCuttmp; } R__b >> fTanCut; R__b >> fLRErrU; R__b >> fHRErrU; R__b >> fFRpcMatchDist; R__b >> nMaxBest; R__b >> nPass; fDriftRadiusPars.Streamer(R__b); R__b.CheckByteCount(R__s, R__c, HForwardCandFinderPar::IsA()); } else { R__c = R__b.WriteVersion(HForwardCandFinderPar::IsA(), kTRUE); HParCond::Streamer(R__b); R__b << nMaxAllowedHits; R__b << fStsTimeWindowL; R__b << fStsTimeWindowU; R__b << fFRpcTimeWindowL; R__b << fFRpcTimeWindowU; R__b << fCutX; R__b << fCutY; R__b << fLRCutChi2; R__b << fHRCutChi2; R__b << fTanCut; R__b << fLRErrU; R__b << fHRErrU; R__b << fFRpcMatchDist; R__b << nMaxBest; R__b << nPass; fDriftRadiusPars.Streamer(R__b); R__b.SetByteCount(R__c, kTRUE); } }