ROOT logo
#include "hkalfiltertask.h"

// from ROOT
#include "TF1.h"
#include "TMath.h"
#include "TMatrixD.h"
#include "TRandom.h"

// from hydra
#include "hades.h"
#include "hcategory.h"
#include "hmdccal2parsim.h"
#include "hcategorymanager.h"
#include "hgeantkine.h"
#include "hgeantmdc.h"
#include "hmagnetpar.h"
#include "hmdcdef.h"
#include "hmdchit.h"
#include "hmdcseg.h"
#include "hmdcsegsim.h"
#include "hmdcsizescells.h"
#include "hmdctrackgdef.h"
#include "hmdctrkcand.h"
#include "hmdctrackgfieldpar.h"
#include "hmetamatch2.h"
#include "hphysicsconstants.h"
#include "hrpccluster.h"
#include "hrktrackB.h"
#include "hruntimedb.h"
#include "hsplinetrack.h"
#include "htofhit.h"

#include "rpcdef.h"
#include "tofdef.h"

//#include "hkaldaflrwire.h"
#include "hkaldafwire.h"
#include "hkaldafsinglewire.h"
#include "hkalfilt2d.h"
#include "hkalfiltwire.h"
#include "hkalhit.h"
#include "hkaltrack.h"
#include "hkaltrackstate.h"

#include <iostream>
using namespace std;

//_HADES_CLASS_DESCRIPTION
///////////////////////////////////////////////////////////////////////////////
// This class implements the track reconstruction using the Kalman filter.
//
//-----------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////

ClassImp(HKalFilterTask)

//  -----------------------------------
//  Implementation of protected methods
//  -----------------------------------

Bool_t HKalFilterTask::createKalSystem() {
    // Create a new kalsys object depending on the class variables
    // bWire, bDaf and bCompHits.
    // An existing kalsys object will be deleted.

    if(kalsys) {
        delete kalsys;
    }

    Int_t nLayersInMdc = 1;
    if(bWire) {
        nLayersInMdc = 6;
    }

    // Get magnetic field parameters if available.
    HMdcTrackGField *fMap = NULL;
    Float_t fieldFactor   = 0.F;

    // input object created during reinit().
    if(input) {
        HMagnetPar         *pMagnet = input->getMagnetPar();
        HMdcTrackGFieldPar *pField  = input->getGFieldPar();
        fieldFactor = pMagnet->getScalingFactor();
        if(pMagnet->getPolarity() < 0) {
            fieldFactor = - fieldFactor;
        }
        fMap = pField->getPointer();
    }

    kalsys = NULL;
    Int_t nMaxHitsPerTrack = 4 * nLayersInMdc;
    if(bWire) {
        if(bDaf) {
            if(bCompHits) {
                kalsys = new HKalDafWire(nMaxHitsPerTrack, measDim, stateDim, fMap, fieldFactor);
            } else {
                kalsys = new HKalDafSingleWire(nMaxHitsPerTrack, measDim, stateDim, fMap, fieldFactor);
            }
        } else {
            kalsys = new HKalFiltWire(nMaxHitsPerTrack, measDim, stateDim, fMap, fieldFactor);
        }
    } else { // segment hits
        if(bDaf) {
            Error("createKalSystem()", "Applying DAF on segment hits is not supported.");
        } else {
            // Filter reconstructed segment hits.
	    kalsys = new HKalFilt2d(nMaxHitsPerTrack, measDim, stateDim, fMap, fieldFactor);
        }
    }

    if(!kalsys) {
        Error("createKalSystem()", "Failed to create Kalman filter object.");
        return kFALSE;
    }
    return kTRUE;
}

void HKalFilterTask::fillData(HMetaMatch2* const pMetaMatch, const TObjArray &allhitsGeantMdc,
			      HMdcSeg* const inSeg, HMdcSeg* const outSeg) {
    // Fills categories with reconstruction results.
    // pMetaMatch: Meta match candidate. Index to Kalman filter is set.
    // allhitsGeantMdc:

#if kalDebug > 1
    cout<<"**** KalFilterTask: filling data ****"<<endl;
#endif

    Int_t iCatSiteFirst, iCatSiteLast = -1;
    if(bFillSites) fillDataSites(iCatSiteFirst, iCatSiteLast, allhitsGeantMdc);

    if(metaMatcher.getIsMatched()) {
        for(Int_t sys = 0; sys < 4; sys++) {
            for(Int_t tab = 0; tab < metaMatcher.getNmetaTabs(); tab++) {
                for(Int_t clstr = 0; clstr < metaMatcher.getClstrSize(sys); clstr++) {
                    const HKalMetaMatch& kalMatch = metaMatcher.getMatch(sys, tab, clstr);
                    if(kalMatch.isFilled()) {
                        Int_t iKalTrack = -1;
                        HKalTrack *pKalTrack = fillDataTrack(iKalTrack, pMetaMatch, iCatSiteFirst, iCatSiteLast, inSeg, outSeg, kalMatch);
                        switch (kalMatch.getSystem()) {
                        case 0:
                            pMetaMatch->setKalmanFilterIndRpcClst((UChar_t)tab, (Short_t)iKalTrack);
                            pKalTrack->setRpcClustInd(kalMatch.getIndex());
                            break;
                        case 1:
                            pMetaMatch->setKalmanFilterIndShowerHit((UChar_t)tab, (Short_t)iKalTrack);
                            pKalTrack->setShowerHitInd(kalMatch.getIndex());
                            break;
                        case 2:
                            switch(clstr) {
                            case 0:
                                pMetaMatch->setKalmanFilterIndTofHit1  ((UChar_t)tab, (Short_t)iKalTrack);
                                pKalTrack->setTofHitInd(kalMatch.getIndex());
                                break;
                            case 1:
                                pMetaMatch->setKalmanFilterIndTofHit2  ((UChar_t)tab, (Short_t)iKalTrack);
                                pKalTrack->setTofHitInd(kalMatch.getIndex());
                                break;
                            case 2:
                                pMetaMatch->setKalmanFilterIndTofClst  ((UChar_t)tab, (Short_t)iKalTrack);
                                pKalTrack->setTofClustInd(kalMatch.getIndex());
                                break;
                            }
                            break;
                        case 3:
                            pMetaMatch->setKalmanFilterIndEmcCluster((UChar_t)tab, (Short_t)iKalTrack);
                            pKalTrack->setEmcClustInd(kalMatch.getIndex());
                            break;
                        }
                    }
                }
            }
        }
    } else {
        HKalMetaMatch noMatch;
        Int_t iKalTrack = -1;
        fillDataTrack(iKalTrack, pMetaMatch, iCatSiteFirst, iCatSiteLast, inSeg, outSeg, noMatch);
        pMetaMatch->setKalmanFilterInd((Short_t)iKalTrack);
    }

    if(bSim && (kalsys->getNsites() > allhitsGeantMdc.GetEntries()) && bPrintWarn) {
        Warning("fillData()", "There are %i sites in the Kalman system, but only %i Geant hits.",
                kalsys->getNsites(), allhitsGeantMdc.GetEntries());
    }
}

HKalTrack* HKalFilterTask::fillDataTrack(Int_t &iKalTrack, HMetaMatch2* const pMetaMatch,
                                         Int_t iCatSiteFirst, Int_t iCatSiteLast,
                                         HMdcSeg* const inSeg, HMdcSeg* const outSeg,
					 const HKalMetaMatch &kalMatch) const {

    Kalman::kalFilterTypes filtType = Kalman::kFiltered;
    if(kalsys->getDoSmooth()) {
        filtType = Kalman::kSmoothed;
    }

    Int_t fromSite; //, toSite;  //unused
    if(kalsys->getDirection() == kIterForward) {
        fromSite = 0;
        //toSite   = kalsys->getNsites() - 1; //unused
    } else {
        fromSite = kalsys->getNsites() - 1;
        //toSite   = 0;                      //unused
    }

    HKalTrack *pKalTrack = NULL;
    iKalTrack = -1;

    if((pKalTrack = HCategoryManager::newObject(pKalTrack, fCatKalTrack, iKalTrack)) != 0 ) {

        pKalTrack->setIdxFirst(iCatSiteFirst);
        pKalTrack->setIdxLast(iCatSiteLast);

        //-------------------------
        // Fill HKalTrack.
	//-------------------------
        pKalTrack->setBetaInput  (kalsys->getBetaInput());
        pKalTrack->setChi2       (kalsys->getChi2());
        pKalTrack->setIsWireHit  (kalsys->getHitType() == Kalman::kWireHit);
        pKalTrack->setNdf        (kalsys->getNdf());
        pKalTrack->setTrackLength(kalsys->getTrackLength());

        Int_t pid = kalsys->getPid();
	pKalTrack->setPid(pid);

	const TVectorD& inisv = kalsys->getIniStateVec();
	pKalTrack->setXinput(inisv(Kalman::kIdxX0));
	pKalTrack->setYinput(inisv(Kalman::kIdxY0));
	pKalTrack->setTxInput(inisv(Kalman::kIdxTanPhi));
	pKalTrack->setTyInput(inisv(Kalman::kIdxTanTheta));
	Float_t iniqp = TMath::Abs(inisv(Kalman::kIdxQP));
        if(iniqp != 0.F) {
            pKalTrack->setMomInput(TMath::Abs(HPhysicsConstants::charge(pid) / iniqp));
        }

        // Fill HBaseTrack.
        Float_t qp = (kalsys->getSite(fromSite)->getStateParam(filtType, Kalman::kIdxQP));
        if(qp != 0.F) {
            pKalTrack->setP(TMath::Abs(HPhysicsConstants::charge(pid) / qp),
                        (kalsys->getSite(fromSite)->getStateCovMat(filtType))(Kalman::kIdxQP, Kalman::kIdxQP));
        }
        pKalTrack->setPolarity(TMath::Sign(1.F, qp));

        //? from kalman
        pKalTrack->setR    (inSeg->getR()     * TMath::RadToDeg(), inSeg->getErrR()     * TMath::RadToDeg());
        pKalTrack->setZ    (inSeg->getZ()     * TMath::RadToDeg(), inSeg->getErrZ()     * TMath::RadToDeg());
        pKalTrack->setTheta(inSeg->getTheta() * TMath::RadToDeg(), inSeg->getErrTheta() * TMath::RadToDeg());
        pKalTrack->setPhi  (inSeg->getPhi()   * TMath::RadToDeg(), inSeg->getErrPhi()   * TMath::RadToDeg());

        pKalTrack->setSector(kalsys->getSite(0)->getSector());

	Short_t splineTrackIndex = pMetaMatch->getSplineInd();
	if(splineTrackIndex >= 0) {
	    HSplineTrack *pSplineTrack = (HSplineTrack*)fCatSplineTrack->getObject(splineTrackIndex);
	    pKalTrack->setTarDist   (pSplineTrack->getTarDist());
	    pKalTrack->setIOMatching(pSplineTrack->getIOMatching());
	}

        if(kalMatch.isFilled()) {
            // Fill information from Meta detector.
            pKalTrack->setTofDist(kalsys->getTrackLength());

            pKalTrack->setBeta     (kalMatch.getBeta());
            pKalTrack->setMass2    (kalMatch.getMass2(), 0.F); //? Error = 0 as in HRKTrackBF2
            pKalTrack->setMetaEloss(kalMatch.getMetaEloss());
            pKalTrack->setTof      (kalMatch.getTof());

            //pKalTrack->setShowerHitInd(Short_t shower);

            //pKalTrack->setMetaHitInd(Short_t shower, Short_t tof)
            switch (kalMatch.getSystem()) {
            case 0:
                pKalTrack->setQualityRpc(kalMatch.getQuality());
                break;
            case 1:
                pKalTrack->setQualityShower(kalMatch.getQuality());
                break;
            case 2:
                pKalTrack->setQualityTof(kalMatch.getQuality());
                break;
            case 3:
                pKalTrack->setQualityEmc(kalMatch.getQuality());
                break;
            }

            Float_t xMetaHit, yMetaHit, zMetaHit, xMetaReco, yMetaReco, zMetaReco;
            kalMatch.getMetaHitLocal(xMetaHit, yMetaHit, zMetaHit);
            kalMatch.getMetaRecoLocal(xMetaReco, yMetaReco, zMetaReco);
            pKalTrack->setMETAdx(xMetaHit - xMetaReco);
            pKalTrack->setMETAdy(yMetaHit - yMetaReco);
            pKalTrack->setMETAdz(zMetaHit - zMetaReco);
        }
    } // filled track
    return pKalTrack;
}

void HKalFilterTask::fillDataSites(Int_t &iFirstSite, Int_t &iLastSite,
                                   const TObjArray &allhitsGeantMdc) {
    // Fills categories for measurement sites and hits with reconstruction results.
    // Storing these categories consumes large amounts of disk space and is mainly
    // intended for debugging purposes.
    //
    // Returns the indices for the first and last measurement site needed by the
    // main track category.
    //
    // output:
    // iFirstSite: index of first measurement site in catagory catKalSite.
    // iLastSite:  index of last measurement site in catagory catKalSite.
    //
    // input:
    // allhitsGeantMdc: Array with Geant hits in MDCs.

    iFirstSite = -1;
    iLastSite  = -1;

    Int_t pid = kalsys->getPid();

    for(Int_t iSite = 0; iSite < getNsites(); iSite++) {

        HKalTrackSite *trackSite = kalsys->getSite(iSite);
        if(!trackSite->getIsActive()) continue;

        // Find the Geant hit corresponding to a measurement site.
        // ---------
        HGeantMdc *jean = NULL;
        if(bSim) {
            if(kalsys->getNsites() <= allhitsGeantMdc.GetEntries()) {
                Int_t j = -1;
                Bool_t bGeantFound = kFALSE;
                while(!bGeantFound && j < (allhitsGeantMdc.GetEntries() - 1)) {
                    j++;
                    jean = (HGeantMdc*)allhitsGeantMdc.At(j);
                    if(jean->getSector() == trackSite->getSector() &&
                       jean->getModule() == trackSite->getModule() &&
                       (jean->getLayer() == trackSite->getLayer() || jean->getLayer() == 6)) { // Midplane in HGeant is 6.
                        bGeantFound = kTRUE;
                    }
                }
                if(!bGeantFound) {
                    if(bPrintWarn) {
                        Warning("writeOutput()", Form("Could not find a Geant hit belonging to measurement site %i.", iSite));
                    }
                    jean = NULL;
                }
            }
        }
        // ---------

        HKalSite *site  = NULL;
        Int_t     index = -1;
        if((site = HCategoryManager::newObject(site, fCatKalSite, index)) != 0 ) {

            if(iFirstSite < 0) iFirstSite = index;
            iLastSite = index;

            //-------------------------
            // Write data about the site.
            //-------------------------

            site->setSec           (trackSite->getSector());
            site->setMod           (trackSite->getModule());
            site->setLay           (trackSite->getLayer());
            site->setChi2          (trackSite->getChi2());
            site->setEnerLoss      (trackSite->getEnergyLoss());

            Double_t momFilt = trackSite->getStateParam(Kalman::kFiltered, Kalman::kIdxQP);
            if(momFilt != 0.F) {
                momFilt = HPhysicsConstants::charge(pid) / momFilt;
            }
            site->setMomFilt       ((Float_t)momFilt);
            Double_t momSmoo = trackSite->getStateParam(Kalman::kSmoothed, Kalman::kIdxQP);
            if(momSmoo != 0.F) {
                momSmoo = HPhysicsConstants::charge(pid) / momSmoo;
            }
	    site->setMomSmoo       ((Float_t)momSmoo);

	    Kalman::kalFilterTypes recoState = (kalsys->getDoSmooth()) ? Kalman::kSmoothed : Kalman::kFiltered;
            site->setTxReco(trackSite->getStateParam(recoState, Kalman::kIdxTanPhi));
	    site->setTyReco(trackSite->getStateParam(recoState, Kalman::kIdxTanTheta));

            const TMatrixD& C = trackSite->getState(recoState).getCovMat();
	    site->setCxxReco(C[Kalman::kIdxX0][Kalman::kIdxX0]);
	    site->setCyyReco(C[Kalman::kIdxY0][Kalman::kIdxY0]);
	    site->setCtxReco(C[Kalman::kIdxTanPhi][Kalman::kIdxTanPhi]);
	    site->setCtyReco(C[Kalman::kIdxTanTheta][Kalman::kIdxTanTheta]);
	    site->setCqpReco(C[Kalman::kIdxQP][Kalman::kIdxQP]);

	    if(jean) {
                TVector3 jeanPos, jeanDir;
		input->getPosAndDir(jeanPos, jeanDir, jean, kTRUE);
                site->setTxReal(jeanDir.X() / jeanDir.Z());
                site->setTyReal(jeanDir.Y() / jeanDir.Z());
                Float_t ax, ay, atof, ptof;
                jean->getHit(ax,ay,atof,ptof);
                site->setMomReal       (ptof);
                site->setTrackNum(jean->getTrack());
            }

            site->setNcomp(trackSite->getNcompetitors());



            if(kalsys->getHitType() == Kalman::kWireHit) {
                HKalHitWire *hit = NULL;
                Int_t indexHit = -1;

                //---------------------------------------
                // Write data about the site's wire hits.
                //---------------------------------------
                for(Int_t iHit = 0; iHit < trackSite->getNcompetitors(); iHit++) {
                    if((hit = HCategoryManager::newObject(hit, fCatKalHitWire, indexHit)) != 0 ) {

                        if(iHit == 0) {
                            site->setIdxFirst(indexHit);
                        }
                        if(iHit == trackSite->getNcompetitors() - 1) {
                            site->setIdxLast(indexHit);
                        }

                        hit->setCell          (trackSite->getCell(iHit));
                        hit->setTime1         (trackSite->getHit(iHit).getTime1());
                        hit->setTime2         (trackSite->getHit(iHit).getTime2());
                        hit->setTime1Err      (trackSite->getHitDriftTimeErr(iHit));
                        hit->setTimeMeas      (trackSite->getHitDriftTime(iHit));

                        Float_t alpha = trackSite->getHitImpactAngle(iHit);
                        hit->setAlpha         (alpha);
                        Float_t mindist = trackSite->getHitVec(iHit)(0);
                        hit->setMinDist       (mindist);
                        HMdcCal2ParSim *cal2  = (HMdcCal2ParSim*)gHades->getRuntimeDb()->getContainer("MdcCal2ParSim");
                        Float_t timeReco = cal2->calcTime(trackSite->getSector(), trackSite->getModule(), alpha, mindist);
                        hit->setTimeReco      (timeReco);

                        hit->setTimeTof       (trackSite->getHitTimeTof(iHit));
                        hit->setTimeTofCal1   (trackSite->getHit(iHit).getTimeTofCal1());
                        hit->setTimeWireOffset(trackSite->getHit(iHit).getTimeWireOffset());

                        if(kalsys->getDoDaf()) {
                            Int_t nDafs = kalsys->getNdafs();
                            hit->setChi2Daf(trackSite->getHitChi2(iHit));
                            for(Int_t iDaf = 0; iDaf < nDafs; iDaf++) {
                                hit->setWeight(trackSite->getHitWeightHist(iDaf, iHit), iDaf);
                            }
                        }
                    } else {
                        Error("fillDataSites()", "Failed to create hit object");
                    }
                }
            } // filled wire hits

            //------------------------------------------
            // Write data about the site's segment hits.
            // -----------------------------------------
            if(kalsys->getHitType() == Kalman::kSegHit) {
		HKalHit2d *hit = NULL;
                Int_t indexHit = -1;
                if((hit = HCategoryManager::newObject(hit, fCatKalHit2d, indexHit)) != 0 ) {


                    site->setIdxFirst(indexHit);
                    site->setIdxLast(indexHit);

                    hit->setXmeas(trackSite->getHitVec()(0));
                    hit->setYmeas(trackSite->getHitVec()(1));

                    if(kalsys->getDoSmooth()) {
                        hit->setXreco(trackSite->getStateParam(Kalman::kSmoothed, Kalman::kIdxX0));
                        hit->setYreco(trackSite->getStateParam(Kalman::kSmoothed, Kalman::kIdxY0));
                    } else {
                        hit->setXreco(trackSite->getStateParam(Kalman::kFiltered, Kalman::kIdxX0));
                        hit->setYreco(trackSite->getStateParam(Kalman::kFiltered, Kalman::kIdxY0));
		    }
		    if(jean) {
			TVector3 jeanPos, jeanDir;
			input->getPosAndDir(jeanPos, jeanDir, jean, kTRUE);
                        hit->setXreal(jeanPos.X());
                        hit->setYreal(jeanPos.Y());
		    }
		} else {
		    Error("fillDataSites()", "Failed to create hit object");
                }
            } // filled segment hit
        } // filled one site
    } // filled all sites
}

//  -----------------------------------
//  Ctors and Dtor
//  -----------------------------------

HKalFilterTask::HKalFilterTask(Int_t ref, Bool_t sim, Bool_t wire,
			       Bool_t daf, Bool_t comp)
: HReconstructor("KalmanFilterTask", "Kalman filter"),
noKalman("Kalman filter not found."), fMomErr(NULL), fTxErr(NULL),
fTyErr(NULL), materials(NULL), iniSvMethod(0), numTracks(0), numTracksErr(0),
dopid(0), fGetPid(NULL) {
    // Task to run the Kalman filter.
    //
    // Input:
    // ref:   Run ID number.
    // sim:   Simulation/Data.
    // wire:  Run Kalman filter Mdc drift chamber hits or on segment hits.
    // daf:   Apply the Deterministic Annealing Filter (DAF).

    bCompHits  = comp;
    bDaf       = daf;
    bGeantPid  = kFALSE;
    bSim       = sim;
    bWire      = wire;

    bFillSites = kTRUE;

    refId   = ref;

    if(bWire) {
        measDim = 1;
    } else {
        measDim = 2;
    }
    stateDim = 5;

    counterstep  = -1;
    bPrintWarn   = kFALSE;
    bPrintErr    = kFALSE;

    errX    = 0.2; // Segment fit resolution.
    errY    = 0.1;
    errTx   = TMath::Tan(.5 * TMath::DegToRad());
    errTy   = TMath::Tan(.5 * TMath::DegToRad());
    errMom  = 0.05; // ca. Spline resolution.

    // Created later on in init() or reinit().
    input  = NULL;
    kalsys = NULL;

    fCatKalTrack   = NULL;
    fCatKalSite    = NULL;
    fCatKalHitWire = NULL;
    fCatKalHit2d   = NULL;
    fCatMetaMatch   = NULL;
    fCatSplineTrack = NULL;

    if(!createKalSystem()) {
        Error("HKalFilterTask()", "Could not create KalSystem.");
    }
}

HKalFilterTask::~HKalFilterTask(){
    delete fMomErr;
    delete materials;
}

//  -----------------------------------
//  Implementation of public methods
//  -----------------------------------

Int_t HKalFilterTask::getIniPid(HMdcTrkCand const* const cand) const {
    // Get particle hypothesis.

    Int_t pid = HPhysicsConstants::pid("p");

    if(bGeantPid && bSim) {
	HGeantKine *kine = input->getGeantKine(cand);
	if(!kine) return -1;

	Int_t track = -1;
	kine->getParticle(track, pid);
	return pid;
    } else {
	HMetaMatch2 *pMetaMatch =
	    (HMetaMatch2*)fCatMetaMatch->getObject(cand->getMetaMatchInd());

	if(!pMetaMatch) return pid;

	Short_t splineTrackIndex = pMetaMatch->getSplineInd();
	HSplineTrack *pSplineTrack =
	    (HSplineTrack*)fCatSplineTrack->getObject(splineTrackIndex);

	Int_t charge = (Int_t)pSplineTrack->getPolarity();

	Double_t mom = TMath::Max(pSplineTrack->getP(), 100.F);

	UChar_t n = 0;
	Int_t idTof = -1;
	Int_t idRpc = -1;
	while(n < 3 && idTof < 0) {
	    idTof = pMetaMatch->getTofHit1Ind(n);
	    n++;
	}
	n = 0;
	while(n < 3 && idTof < 0) {
	    idTof = pMetaMatch->getTofHit2Ind(n);
	    n++;
	    }
	n = 0;
	while(n < 3 && idRpc < 0) {
	    idRpc = pMetaMatch->getRpcClstInd(n);
	    n++;
	}

	Float_t dist = 0.;
	Float_t tof  = -1.;

	if(idTof >= 0) {
	    HTofHit *tofHit = (HTofHit*)fCatTofHit->getObject(idTof);
	    tofHit->getDistance(dist);
	    dist = dist / 1.e3;
	    tof  = tofHit->getTof() / 1.e9;
	}

	if(idRpc >= 0) {
	    HRpcCluster *rpcHit = (HRpcCluster*)fCatRpcClst->getObject(idRpc);
	    Float_t x, y, z = 0.;
	    rpcHit->getXYZLab(x, y, z);
	    dist = TMath::Sqrt(x*x + y*y + z*z) / 1.e3;
	    tof  = rpcHit->getTof() / 1.e9;
	}

	if(idTof >= 0 || idRpc >= 0) {
	    Double_t beta = (dist / tof) / TMath::C();
	    kalsys->setBetaInput(beta);

	    if(mom < 500. && beta > 0.95) {
		pid = (charge > 0) ? HPhysicsConstants::pid("e+") :
		    HPhysicsConstants::pid("e-");
	    } else {
		Double_t betaPi = mom /
		    (TMath::Sqrt(mom*mom + HPhysicsConstants::mass(HPhysicsConstants::pid("pi+"))));

		Double_t betaP = mom /
		    (TMath::Sqrt(mom*mom + HPhysicsConstants::mass(HPhysicsConstants::pid("p"))));

		if(charge > 0 &&
		   (TMath::Abs(beta - betaP) < TMath::Abs(beta - betaPi))) {
		    pid = HPhysicsConstants::pid("p");
		} else {
		    pid = (charge > 0) ? HPhysicsConstants::pid("pi+") :
			HPhysicsConstants::pid("pi-");
		}
	    }
	} else {
	    pid = (charge > 0) ? HPhysicsConstants::pid("p") :
		HPhysicsConstants::pid("pi-");
	}
    }
    return pid;
}

Bool_t HKalFilterTask::getIniSv(TVectorD &inisv, TMatrixD &iniC,
                                Int_t pid, const TObjArray &allhits,
                                HMetaMatch2 const* const pMetaMatch,
                                HMdcSeg const* const inSeg,
                                HMdcSeg const* const outSeg) const {
    // Calculates initial state vector and covariance matrix for
    // the Kalman filter.
    // Position is derived from first measurement,
    // direction from MDC segments and momentum is taken from Spline fit.
    //
    // output:
    // inisv: Initial state vector.
    // iniC:  Initial covariance matrix.
    // input:
    // pid:        GEANT particle ID.
    // allhits:    Array with MDC hits. Must be of class HKalMdcHit.
    // pMetaMatch: Pointer to Meta match.
    // inSeg:      Pointer to inner MDC segment.
    // outSeg:     Pointer to outer MDC segment.

    if(!pMetaMatch || !inSeg || !outSeg) return kFALSE;

    if(inisv.GetNrows() != stateDim) {
        inisv.ResizeTo(stateDim);
    }
    if(iniC.GetNrows() != stateDim || iniC.GetNcols() != stateDim) {
        iniC.ResizeTo(stateDim, stateDim);
    }


    //---------------------------------------------------------------------
    // Calculate initial values for Kalman filter.
    //---------------------------------------------------------------------

    // Calculate starting position and direction of Geant hit.
    TVector3 inipos, inidir;

    // Derive starting position and direction from segments.
    //? check if first measurement is in mod 0/3
    Int_t iStartHit = 0;
    if(kalsys->getDirection() == kIterBackward) {
        iStartHit = allhits.GetEntries() - 1;
    }

    ((HKalMdcHit*)allhits.At(iStartHit))->getHitVec3(inipos); // Impact with drift cell calculated in input class.

    if(kalsys->getDirection() == kIterForward) {
        inidir.SetPtThetaPhi(1., inSeg->getTheta(), inSeg->getPhi());
    } else {
        inidir.SetPtThetaPhi(1., outSeg->getTheta(), outSeg->getPhi());
    }

    // Get starting momentum from spline.
    Double_t iniTrackMom = 0.;
    Short_t splineTrackIndex = pMetaMatch->getSplineInd();
    if(splineTrackIndex >= 0) {
        HSplineTrack *pSplineTrack = (HSplineTrack*)fCatSplineTrack->getObject(splineTrackIndex);
        // Use momentum from Spline task as input for KF.
        iniTrackMom = TMath::Max(pSplineTrack->getP(), 100.F);
    } else {
        if(bPrintWarn) {
            Warning("execute()", "SplineTrack did not provide information for Kalman filter.");
        }
        return kFALSE;
    }

    if(iniTrackMom == 0.) return kFALSE;

    // Create a starting state vector for the Kalman Filter.
    Int_t particleCharge = HPhysicsConstants::charge(pid);

    HKalTrackState::calcStateVec(inisv, particleCharge/iniTrackMom, inipos, inidir);

    // Initialize covariance.
    iniC(kIdxX0, kIdxX0)             = TMath::Power(errX, 2);
    iniC(kIdxY0, kIdxY0)             = TMath::Power(errY, 2);

    Double_t dTx = errTx;
    Double_t dTy = errTy;

    // Direction error from segment hits.
    if(!fTxErr || !fTyErr) {
	const HMdcSeg *mdcSeg = (kalsys->getDirection() == kIterForward) ? inSeg : outSeg;
        HCategory* mdcHitCat = (HCategory*)gHades->getCurrentEvent()->getCategory(catMdcHit);
	HMdcHit* locHit1 = (HMdcHit*)mdcHitCat->getObject(mdcSeg->getHitInd(0));
	HMdcHit* locHit2 = (HMdcHit*)mdcHitCat->getObject(mdcSeg->getHitInd(1));
	if(locHit1 && locHit2) {
	    HMdcSizesCells* fSizesCells = HMdcSizesCells::getExObject();

	    Double_t x1 = locHit1->getX();
	    Double_t y1 = locHit1->getY();
	    Double_t z1 = 0;
	    Int_t sec1, mod1;
	    locHit1->getSecMod(sec1, mod1);
	    (*fSizesCells)[sec1][mod1].transFrom(x1, y1, z1);

	    Double_t x2 = locHit2->getX();
	    Double_t y2 = locHit2->getY();
	    Double_t z2 = 0;
	    Int_t sec2, mod2;
	    locHit2->getSecMod(sec2, mod2);
	    (*fSizesCells)[sec2][mod2].transFrom(x2, y2, z2);

	    Double_t errx1 = locHit1->getErrX();
	    Double_t erry1 = locHit1->getErrY();
	    Double_t errz1 = 0.03;
	    HGeomVector errLay1(errx1, erry1, errz1);
	    HGeomVector errSec1 = (*fSizesCells)[sec1][mod1].getSecTrans()->getRotMatrix() * errLay1;
	    errx1 = errSec1.getX();
	    erry1 = errSec1.getY();
	    errz1 = errSec1.getZ();

	    Double_t errx2 = locHit2->getErrX();
	    Double_t erry2 = locHit2->getErrY();
	    Double_t errz2 = 0.03;
	    HGeomVector errLay2(errx2, erry2, errz2);
	    HGeomVector errSec2 = (*fSizesCells)[sec2][mod2].getSecTrans()->getRotMatrix() * errLay2;
	    errx2 = errSec2.getX();
	    erry2 = errSec2.getY();
	    errz2 = errSec2.getZ();

	    Double_t x21 = x2 - x1;
	    Double_t y21 = y2 - y1;
	    Double_t z21 = z2 - z1;

	    dTx = TMath::Sqrt(TMath::Power(errz1*x21/(z21*z21), 2.)+
			      TMath::Power(errz2*x21/(z21*z21), 2.)+
			      TMath::Power(errx1/(z21), 2.) +
                              TMath::Power(errx2/(z21), 2.));
	    dTy = TMath::Sqrt(TMath::Power(errz1*y21/(z21*z21), 2.)+
			      TMath::Power(errz2*y21/(z21*z21), 2.)+
			      TMath::Power(errx1/(z21), 2.) +
			      TMath::Power(errx2/(z21), 2.));
	}
    }

    // Custom function to calculate errors.
    if(fTxErr) {
	dTx = fTxErr->Eval(inSeg->getTheta() * TMath::RadToDeg());
    }
    if(fTyErr) {
	dTy = fTyErr->Eval(inSeg->getTheta() * TMath::RadToDeg());
    }

    iniC(kIdxTanPhi,   kIdxTanPhi)   = TMath::Power(dTx, 2);
    iniC(kIdxTanTheta, kIdxTanTheta) = TMath::Power(dTy, 2);

    // The variance of the estimated momentum is
    // <(mom_real - mom_input)^2> = (mom_real - (1+errMom)*mom_real)^2 = (errMom * mom_real)^2.
    // The variance of the estimation error of the state parameter q/p
    // then is <(1/mom_geant - 1/mom_input)^2>.

    Double_t dp = errMom;
    if(fMomErr) {
	dp = fMomErr->Eval(inSeg->getTheta() * TMath::RadToDeg());
    }
    iniC(kIdxQP, kIdxQP) = TMath::Power(dp/(iniTrackMom * (dp + 1.)), 2);

    if(iniC.GetNrows() == 6) {
        iniC(kIdxZ0, kIdxZ0) = TMath::Power(errY, 2);
    }

    return kTRUE;
}

Bool_t HKalFilterTask::getIniSvGeant(TVectorD &inisv, TMatrixD &iniC,
                                     const TObjArray &allhitsGeantMdc,
				     Int_t pid, Bool_t bSmear) const {
    // Calculate starting position and direction of Geant hit.
    TVector3 inipos, inidir;

    Int_t iStartHitGeant = 0;
    if(kalsys->getDirection() == kIterBackward) {
        iStartHitGeant = allhitsGeantMdc.GetEntries() - 1;
    }

    if(allhitsGeantMdc.GetEntries() == 0) {
        if(bPrintErr) {
            Error("getIniSvGeant()", "No Geant points found.");
        }
        return kFALSE;
    }

    HGeantMdc *firstGeant = (HGeantMdc*)allhitsGeantMdc.At(iStartHitGeant);
    if(firstGeant == NULL) {
        if(bPrintErr) {
            Error("getIniSvGeant()", "Could not retrieve Geant point %i", iStartHitGeant);
        }
        return kFALSE;
    }

    input->getPosAndDir(inipos, inidir, firstGeant, kTRUE);

    if(bSmear) {
	inipos.SetX(inipos.X() + gRandom->Gaus(0., errX));
	inipos.SetY(inipos.Y() + gRandom->Gaus(0., errY));
    }

    // Use smeared Geant momentum as input for KF.
    Float_t ax, ay, atof, momGeant;
    firstGeant->getHit(ax, ay, atof, momGeant);
    Double_t iniTrackMom = (bSmear) ? momGeant * (1. + gRandom->Gaus() * errMom) : momGeant;

    Int_t particleCharge = HPhysicsConstants::charge(pid);
    HKalTrackState::calcStateVec(inisv, particleCharge/iniTrackMom, inipos, inidir);

    if(bSmear) {
	inisv[kIdxTanPhi]   = inisv[kIdxTanPhi]   + gRandom->Gaus(0., errTx);
	inisv[kIdxTanTheta] = inisv[kIdxTanTheta] + gRandom->Gaus(0., errTy);
    }

    // Initialize covariance.
    iniC(kIdxX0, kIdxX0)             = TMath::Power(errX, 2);
    iniC(kIdxY0, kIdxY0)             = TMath::Power(errY, 2);
    iniC(kIdxTanPhi,   kIdxTanPhi)   = TMath::Power(errTx, 2);
    iniC(kIdxTanTheta, kIdxTanTheta) = TMath::Power(errTy, 2);
    // The variance of the estimated momentum is
    // <(mom_real - mom_input)^2> = (mom_real - (1+errMom)*mom_real)^2 = (errMom * mom_real)^2.
    // The variance of the estimation error of the state parameter q/p
    // then is <(1/mom_geant - 1/mom_input)^2>.
    iniC(kIdxQP, kIdxQP)             = TMath::Power(1./iniTrackMom * errMom / (errMom + 1.), 2);

    if(iniC.GetNrows() == 6) {
        iniC(kIdxZ0, kIdxZ0) = TMath::Power(errY, 2);
    }

    return kTRUE;
}

Bool_t HKalFilterTask::getIniSvRungeKutta(TVectorD &inisv, TMatrixD &iniC, Int_t pid,
                                const TObjArray& allhits,
                                HMetaMatch2 const* const pMetaMatch) const {
    // Retrieve initial state from Runge-Kutta fit.

    Int_t idx = -1;
    // Find any Runge-Kutta object from MetaMatch.
    for(UChar_t n = 0; n < 3; n++) {
        idx = pMetaMatch->getRungeKuttaIndRpcClst(n);
        if(idx >= 0) break;
        idx = pMetaMatch->getRungeKuttaIndTofHit1(n);
        if(idx >= 0) break;
        idx = pMetaMatch->getRungeKuttaIndTofHit2(n);
        if(idx >= 0) break;
        idx = pMetaMatch->getRungeKuttaIndTofClst(n);
        if(idx >= 0) break;
        idx = pMetaMatch->getRungeKuttaIndShowerHit(n);
        if(idx >= 0) break;
        idx = pMetaMatch->getRungeKuttaIndEmcCluster(n);
        if(idx >= 0) break;
    }
    if(idx < 0) idx = pMetaMatch->getRungeKuttaInd();
    if(idx < 0) return kFALSE;

    HRKTrackB *prk = (HRKTrackB*)(HCategoryManager::getCategory(catRKTrackB)->getObject(idx));
    Double_t hpi   = TMath::Pi()/2.;
    Double_t r     = prk->getRSeg1RK();
    Double_t phi   = prk->getPhiSeg1RK();
    Double_t theta = prk->getThetaSeg1RK();

    TVector3 posSeg, dirSeg;
    posSeg.SetXYZ(r * TMath::Cos(phi + hpi),
                  r * TMath::Sin(phi + hpi),
                  prk->getZSeg1RK());
    dirSeg.SetXYZ(TMath::Cos(phi) * TMath::Sin(theta),
                  TMath::Sin(phi) * TMath::Sin(theta),
                  TMath::Cos(theta));
    Double_t particleCharge = (Double_t)HPhysicsConstants::charge(pid);
    Double_t iniTrackMom = prk->getP();
    Double_t QPSeg = particleCharge / iniTrackMom;

    TVectorD svSeg(getStateDim());
    HKalTrackState::calcStateVec(svSeg, QPSeg, posSeg, dirSeg);

    HKalMdcHit *hit = (HKalMdcHit*)allhits.At(0);

    HKalMdcMeasLayer planeSeg(posSeg, hit->getMeasLayer().getNormal(),
                              hit->getMeasLayer().getMaterialPtr(kFALSE),
                              hit->getMeasLayer().getMaterialPtr(kFALSE),
                              -1, hit->getSector(), 0, 1, 0.);

    Bool_t ms = kalsys->getDoMultScat();
    Bool_t el = kalsys->getDoEnerLoss();
    kalsys->setDoMultScat(kFALSE);
    kalsys->setDoEnerLoss(kFALSE);

    // Propagate track to vertex.
    if(!kalsys->propagateToPlane(inisv, svSeg,
                                 planeSeg, hit->getMeasLayer(),
                                 pid, kIterForward)) {
        kalsys->setDoMultScat(ms);
        kalsys->setDoEnerLoss(el);
        return kFALSE;
    }
    kalsys->setDoMultScat(ms);
    kalsys->setDoEnerLoss(el);

    iniC(kIdxX0, kIdxX0)             = TMath::Power(errX, 2);
    iniC(kIdxY0, kIdxY0)             = TMath::Power(errY, 2);
    iniC(kIdxTanPhi,   kIdxTanPhi)   = TMath::Power(errTx, 2);
    iniC(kIdxTanTheta, kIdxTanTheta) = TMath::Power(errTy, 2);
    // The variance of the estimated momentum is
    // <(mom_real - mom_input)^2> = (mom_real - (1+errMom)*mom_real)^2 = (errMom * mom_real)^2.
    // The variance of the estimation error of the state parameter q/p
    // then is <(1/mom_geant - 1/mom_input)^2>.
    iniC(kIdxQP, kIdxQP)             = TMath::Power(1./iniTrackMom * errMom / (errMom + 1.), 2);

    return kTRUE;
}

Bool_t HKalFilterTask::doPid(Int_t pid) {
    // Returns true if particles with Geant ID pid are going to be filtered.

    if(!bSim) return kTRUE;
    if(pid < 0) return kFALSE;
    Int_t n = dopid.GetSize();
    if(n == 0) return kTRUE;
    for(Int_t i = 0; i < n; i++) {
        if(dopid.At(i) == pid) return kTRUE;
    }

    return kFALSE;
}

Int_t HKalFilterTask::execute(void) {

    TObjArray allhits; // Array that stores the hits.
    TObjArray allhitsGeantMdc;

    Int_t    numTracksErrEvent = 0;
    Int_t    numTracksEvent    = 0;

    UInt_t evtNbr = gHades->getCurrentEvent()->getHeader()->getEventSeqNumber();

    //----------print counter----------------
    if (counterstep > 0 && evtNbr % counterstep == 0) {
        cout<<"**************** Event "<<evtNbr<<" ********************"<<endl;
    }

    HMdcTrkCand* cand = 0;

    //input->resetIterMdcTrkCand();
    if(input) {
        input->resetIterMetaMatch();
    } else {
        Error("execute()", "HKalInput not found. Unable to execute Kalman filter task.");
        return 0;
    }

    while((cand = nextTrack(allhits))) {
#if kalDebug > 1
        cout<<"\n\n\n"<<endl;
        cout<<"*****************************************************"<<endl;
        cout<<"**************** New track candidate ****************"<<endl;
        cout<<"*****************************************************"<<endl;
#endif
        if(allhits.GetEntries() < 3) continue;

	HGeantKine *kine = (bSim ? input->getGeantKine(cand) : NULL);
        if(bSim && !kine) {
            Error("execute()", "No HGeantKine object found.");
            continue;
        }

        HMetaMatch2 *pMetaMatch = (HMetaMatch2*)fCatMetaMatch->getObject(cand->getMetaMatchInd());
        if(!pMetaMatch) {
            if(bPrintWarn) {
                Error("execute()", Form("No META match in track %i of event %i.", numTracksEvent, evtNbr));
            }
            continue;
        }

        HMdcSeg* segs[2];
        input->getMdcSegs(cand, segs);
        if(segs[0] == 0 || segs[1] == 0) {
#if kalDebug > 2
            if(segs[0] == 0) {
                if(segs[1] == 0) {
                    cout<<"Skip track: inner and outer segments are empty."<<endl;
                } else {
                    cout<<"Skip track: inner segment is empty."<<endl;
                }
            } else {
                cout<<"Skip track: outer segment is empty."<<endl;
            }
#endif
            continue;
        }

        Int_t pid = (fGetPid) ? (*fGetPid)(cand) : getIniPid(cand);

        if(!doPid(pid)) {
#if kalDebug > 2
            cout<<"Skip track with PID "<<pid<<endl;
#endif
            continue;
        }

	if(bSim) {
	    input->getGeantMdcRawpoints(allhitsGeantMdc, kine, !bWire);
	}

#if kalDebug > 3
        cout<<endl;
	cout<<"### Hits in track candidate ####"<<endl;
	for(Int_t iEntry = 0; iEntry < allhits.GetEntries(); iEntry++) {
	    HKalMdcHit *hit = dynamic_cast<HKalMdcHit*>(allhits.At(iEntry));
	    if(hit) {
		cout<<"## Hit number: "<<iEntry<<" ##"<<endl;
                hit->print("Hit");
	    }
	}
	if(bSim) {
	    cout<<"### Geant hits belonging to track candidate ####"<<endl;
	    for(Int_t iEntry = 0; iEntry < allhitsGeantMdc.GetEntries(); iEntry++) {
		HGeantMdc *hit = dynamic_cast<HGeantMdc*>(allhitsGeantMdc.At(iEntry));
		if(hit) {
		    cout<<"## Geant hit number: "<<iEntry<<" ##"<<endl;
		    cout<<"x = "<<hit->getX()<<", y = "<<hit->getY()<<endl;
                    TVector3 iniPosGeantSec, iniDirGeantSec;
		    input->getPosAndDir(iniPosGeantSec, iniDirGeantSec,
					(HGeantMdc*)allhitsGeantMdc.At(iEntry),
					kTRUE);
		    cout<<"Position in sector coordinates: "<<endl;
		    cout<<"x = "<<iniPosGeantSec.X()
			<<", y = "<<iniPosGeantSec.Y()
                        <<", z = "<<iniPosGeantSec.Z()<<endl<<endl;
		}
	    }
	}
#endif

        // Create a starting state vector for the Kalman Filter.
        TVectorD inisv(stateDim);
        // Initialize covariance.
        TMatrixD iniC(stateDim, stateDim);

	switch (iniSvMethod) {
	case 1:
	    if(!getIniSvGeant(inisv, iniC, allhitsGeantMdc, pid, kFALSE)) {
		Error("execute()", "Could not calculate initial state vector.");
		continue;
	    }
	    break;
	case 2:
	    if(!getIniSvGeant(inisv, iniC, allhitsGeantMdc, pid, kTRUE)) {
		Error("execute()", "Could not calculate initial state vector.");
		continue;
	    }
	    //inisv[kIdxQP] = HPhysicsConstants::charge(pid) / TMath::Max(((HSplineTrack*)fCatSplineTrack->getObject(pMetaMatch->getSplineInd()))->getP(), 100.F);
	    break;
	case 3:
	    if(!getIniSvRungeKutta(inisv, iniC, pid, allhits, pMetaMatch)) {
		Error("execute()", "Could not calculate initial state vector.");
		continue;
	    }
	    break;
	default:
	    if(!getIniSv(inisv, iniC, pid, allhits, pMetaMatch, segs[0], segs[1])) {
		Error("execute()", "Could not calculate initial state vector.");
		continue;
	    }
	    //TVectorD inisvMomSmear(stateDim);
	    //TMatrixD iniCMomSmear(stateDim, stateDim);
	    //getIniSvGeant(inisvMomSmear, iniCMomSmear, allhitsGeantMdc, pid, kTRUE);
            //inisv[kIdxQP] = inisvMomSmear[kIdxQP];// * 1./(0.994);
	    break;
	}
#if kalDebug > 1
        cout<<"Running Kalman filter on track number "<<numTracksEvent<<" of event "<<evtNbr<<endl;
#endif

        // Run Kalman filter.
        Bool_t bAccepted = kalsys->fitTrack(allhits, inisv, iniC, pid);

        // Propagate track to vertex.
        kalsys->traceToVertex();

        // META matching.
        if(!metaMatcher.matchWithMeta(pMetaMatch, kalsys)) {
            //?
        }

	if(!bAccepted) {
            numTracksErr++;
            numTracksErrEvent++;
            if(bPrintWarn) {
                Warning("Event loop", Form("Errors in track number %i of event %i", numTracksEvent, evtNbr));
            }
        }

        fillData(pMetaMatch, allhitsGeantMdc, segs[0], segs[1]);

        numTracks++;
	numTracksEvent++;
    } // while loop over candidates

    return 0;
}

Bool_t HKalFilterTask::init(void) {
    if(!gHades) {
        Error("init()", "HADES not found.");
        return kFALSE;
    }

    HRuntimeDb* rtdb = gHades->getRuntimeDb();

    if(!rtdb) {
        Error("init()", "Runtime database not found.");
        return kFALSE;
    }

    rtdb->getContainer("MdcTrackGFieldPar");
    rtdb->getContainer("MagnetPar");

    rtdb->getContainer("MdcRawStruct");
    rtdb->getContainer("MdcGeomStruct");
    rtdb->getContainer("MdcLookupRaw");
    rtdb->getContainer("MdcLookupGeom");
    rtdb->getContainer("MdcLayerCorrPar");
    rtdb->getContainer("MdcLayerGeomPar");
    rtdb->getContainer("MdcGeomPar");
    rtdb->getContainer("SpecGeomPar");

    rtdb->getContainer("RichGeometryParameters");
    rtdb->getContainer("RpcGeomPar");
    rtdb->getContainer("ShowerGeometry");
    rtdb->getContainer("TofGeomPar");

    rtdb->getContainer("MdcDigitPar");
    rtdb->getContainer("MdcCal2Par");
    rtdb->getContainer("MdcCal2ParSim");

    fCatKalTrack    = HCategoryManager::addCategory(catKalTrack,   "HKalTrack",   5000, "Kalman filter");
    fCatKalSite     = HCategoryManager::addCategory(catKalSite,    "HKalSite" ,   5000, "Measurement site");
    fCatKalHitWire  = HCategoryManager::addCategory(catKalHitWire, "HKalHitWire", 5000, "Wire Hit");
    fCatKalHit2d    = HCategoryManager::addCategory(catKalHit2d,   "HKalHit2d",   5000, "Segment Hit");

    fCatMetaMatch   = HCategoryManager::getCategory(catMetaMatch);
    fCatSplineTrack = HCategoryManager::getCategory(catSplineTrack);
    fCatTofHit  = HCategoryManager::getCategory(catTofHit);
    fCatRpcClst = HCategoryManager::getCategory(catRpcCluster);


    metaMatcher.init();

    return kTRUE;
    //return createKalSystem();
}

HMdcTrkCand* HKalFilterTask::nextTrack(TObjArray& allhits) {
    // Fill the array allhits with the next track candidate.

    if(bWire) {
	return input->nextWireTrack(allhits);
    }
    return input->nextMdcTrackCand(allhits);
}

Bool_t HKalFilterTask::reinit(void) {
    HMdcSizesCells* fSizesCells = HMdcSizesCells::getExObject();  // check if is already there
    fSizesCells->initContainer();

    if(!fSizesCells) {
        fSizesCells = HMdcSizesCells::getObject();

        fSizesCells->initContainer();
    }

    Int_t nLayersInMdc = 1;
    if(bWire) {
        nLayersInMdc = 6;
    }

    Bool_t bInit = kTRUE;
    if(!input) {
	HKalDetCradle* pCradleHades = new HKalDetCradle(nLayersInMdc, materials);
	input = new HKalInput(pCradleHades);
        bInit = input->init(refId);
        input ->setPrint(bPrintWarn);

        HMagnetPar         *pMagnet = input->getMagnetPar();
        HMdcTrackGFieldPar *pField  = input->getGFieldPar();
        // Set B-Field for track.
        Float_t fieldFactor = pMagnet->getScalingFactor();
        if(pMagnet->getPolarity() < 0) {
            fieldFactor = - fieldFactor;
        }
        bInit &= pMagnet && pField;

        if(kalsys) {
            kalsys->setFieldMap(pField->getPointer(), fieldFactor);
        } else {
            bInit &= createKalSystem();
	}
    }

    metaMatcher.reinit();

    return (bInit);
}

Bool_t HKalFilterTask::finalize(void) {
    delete kalsys;
    delete input;

    Info("finalize", Form("%i tracks reconstructed, %i tracks with errors.",
                          numTracks, numTracksErr));
    return kTRUE;
}


void HKalFilterTask::setErrors(Double_t dx, Double_t dy, Double_t dtx, Double_t dty, Double_t dmom) {
    // Error estimates used to fill the initial covariance matrix.
    // dx, dy:   Position errors in sector coordinates and mm.
    // dtx, dty: tx = tan(px/pz), ty = tan(py/pz) in radians.
    // dmom:     Momentum uncertainty as a fraction. For example 0.1 means initial estimate is
    //           within 10% of the true momentum.

    errX = dx;
    errY = dy;
    errTx = dtx;
    errTy = dty;
    errMom = dmom;
}

void HKalFilterTask::setDoPid(Int_t pid[], Int_t n) {
    // Only reconstruct particles with certain pid.
    // pid: Array containing the Geant particle ids.
    // n:   Size of array pid. Pass n=0 to reconstruct all particles.

    dopid.Set(n);
    for(Int_t i = 0; i < n; i++) {
        dopid.SetAt(pid[i], i);
    }
}

Bool_t HKalFilterTask::setFilterPars(Bool_t wire, Bool_t daf, Bool_t comp) {
    // Modifies the type of the Kalman filter that will be applied:
    // wire:  Run Kalman filter Mdc drift chamber hits or on segment hits.
    // daf:   Apply the Deterministic Annealing Filter (DAF).
    // comp:  Consider competing hits for the DAF.
    //
    // It is recommended to specify the desired values for these parameters
    // already in the contructor.
    // Returns kFALSE if the parameter combination is not valid.
    // An existing Kalman filter object will be deleted along with its
    // settings. 

    bWire     = wire;
    bDaf      = daf;
    bCompHits = comp;
    if(bWire) {
        measDim = 1;
    } else {
        measDim = 2;
    }
    stateDim = 5;
    return createKalSystem();
}

void HKalFilterTask::setVerbose(Int_t v) {
    // Set verbose level:
    // 1: print warnings and error messages
    // 2: print error messages only
    // all else: print nothing.

    (v >= 1 ? bPrintErr  = kTRUE : bPrintErr  = kFALSE);
    (v >= 2 ? bPrintWarn = kTRUE : bPrintWarn = kFALSE);
    if(input) {
        input ->setPrint(bPrintWarn);
    }
    if(kalsys) {
        kalsys->setPrintWarnings(bPrintWarn);
        kalsys->setPrintErrors  (bPrintErr);
    }
}

 hkalfiltertask.cc:1
 hkalfiltertask.cc:2
 hkalfiltertask.cc:3
 hkalfiltertask.cc:4
 hkalfiltertask.cc:5
 hkalfiltertask.cc:6
 hkalfiltertask.cc:7
 hkalfiltertask.cc:8
 hkalfiltertask.cc:9
 hkalfiltertask.cc:10
 hkalfiltertask.cc:11
 hkalfiltertask.cc:12
 hkalfiltertask.cc:13
 hkalfiltertask.cc:14
 hkalfiltertask.cc:15
 hkalfiltertask.cc:16
 hkalfiltertask.cc:17
 hkalfiltertask.cc:18
 hkalfiltertask.cc:19
 hkalfiltertask.cc:20
 hkalfiltertask.cc:21
 hkalfiltertask.cc:22
 hkalfiltertask.cc:23
 hkalfiltertask.cc:24
 hkalfiltertask.cc:25
 hkalfiltertask.cc:26
 hkalfiltertask.cc:27
 hkalfiltertask.cc:28
 hkalfiltertask.cc:29
 hkalfiltertask.cc:30
 hkalfiltertask.cc:31
 hkalfiltertask.cc:32
 hkalfiltertask.cc:33
 hkalfiltertask.cc:34
 hkalfiltertask.cc:35
 hkalfiltertask.cc:36
 hkalfiltertask.cc:37
 hkalfiltertask.cc:38
 hkalfiltertask.cc:39
 hkalfiltertask.cc:40
 hkalfiltertask.cc:41
 hkalfiltertask.cc:42
 hkalfiltertask.cc:43
 hkalfiltertask.cc:44
 hkalfiltertask.cc:45
 hkalfiltertask.cc:46
 hkalfiltertask.cc:47
 hkalfiltertask.cc:48
 hkalfiltertask.cc:49
 hkalfiltertask.cc:50
 hkalfiltertask.cc:51
 hkalfiltertask.cc:52
 hkalfiltertask.cc:53
 hkalfiltertask.cc:54
 hkalfiltertask.cc:55
 hkalfiltertask.cc:56
 hkalfiltertask.cc:57
 hkalfiltertask.cc:58
 hkalfiltertask.cc:59
 hkalfiltertask.cc:60
 hkalfiltertask.cc:61
 hkalfiltertask.cc:62
 hkalfiltertask.cc:63
 hkalfiltertask.cc:64
 hkalfiltertask.cc:65
 hkalfiltertask.cc:66
 hkalfiltertask.cc:67
 hkalfiltertask.cc:68
 hkalfiltertask.cc:69
 hkalfiltertask.cc:70
 hkalfiltertask.cc:71
 hkalfiltertask.cc:72
 hkalfiltertask.cc:73
 hkalfiltertask.cc:74
 hkalfiltertask.cc:75
 hkalfiltertask.cc:76
 hkalfiltertask.cc:77
 hkalfiltertask.cc:78
 hkalfiltertask.cc:79
 hkalfiltertask.cc:80
 hkalfiltertask.cc:81
 hkalfiltertask.cc:82
 hkalfiltertask.cc:83
 hkalfiltertask.cc:84
 hkalfiltertask.cc:85
 hkalfiltertask.cc:86
 hkalfiltertask.cc:87
 hkalfiltertask.cc:88
 hkalfiltertask.cc:89
 hkalfiltertask.cc:90
 hkalfiltertask.cc:91
 hkalfiltertask.cc:92
 hkalfiltertask.cc:93
 hkalfiltertask.cc:94
 hkalfiltertask.cc:95
 hkalfiltertask.cc:96
 hkalfiltertask.cc:97
 hkalfiltertask.cc:98
 hkalfiltertask.cc:99
 hkalfiltertask.cc:100
 hkalfiltertask.cc:101
 hkalfiltertask.cc:102
 hkalfiltertask.cc:103
 hkalfiltertask.cc:104
 hkalfiltertask.cc:105
 hkalfiltertask.cc:106
 hkalfiltertask.cc:107
 hkalfiltertask.cc:108
 hkalfiltertask.cc:109
 hkalfiltertask.cc:110
 hkalfiltertask.cc:111
 hkalfiltertask.cc:112
 hkalfiltertask.cc:113
 hkalfiltertask.cc:114
 hkalfiltertask.cc:115
 hkalfiltertask.cc:116
 hkalfiltertask.cc:117
 hkalfiltertask.cc:118
 hkalfiltertask.cc:119
 hkalfiltertask.cc:120
 hkalfiltertask.cc:121
 hkalfiltertask.cc:122
 hkalfiltertask.cc:123
 hkalfiltertask.cc:124
 hkalfiltertask.cc:125
 hkalfiltertask.cc:126
 hkalfiltertask.cc:127
 hkalfiltertask.cc:128
 hkalfiltertask.cc:129
 hkalfiltertask.cc:130
 hkalfiltertask.cc:131
 hkalfiltertask.cc:132
 hkalfiltertask.cc:133
 hkalfiltertask.cc:134
 hkalfiltertask.cc:135
 hkalfiltertask.cc:136
 hkalfiltertask.cc:137
 hkalfiltertask.cc:138
 hkalfiltertask.cc:139
 hkalfiltertask.cc:140
 hkalfiltertask.cc:141
 hkalfiltertask.cc:142
 hkalfiltertask.cc:143
 hkalfiltertask.cc:144
 hkalfiltertask.cc:145
 hkalfiltertask.cc:146
 hkalfiltertask.cc:147
 hkalfiltertask.cc:148
 hkalfiltertask.cc:149
 hkalfiltertask.cc:150
 hkalfiltertask.cc:151
 hkalfiltertask.cc:152
 hkalfiltertask.cc:153
 hkalfiltertask.cc:154
 hkalfiltertask.cc:155
 hkalfiltertask.cc:156
 hkalfiltertask.cc:157
 hkalfiltertask.cc:158
 hkalfiltertask.cc:159
 hkalfiltertask.cc:160
 hkalfiltertask.cc:161
 hkalfiltertask.cc:162
 hkalfiltertask.cc:163
 hkalfiltertask.cc:164
 hkalfiltertask.cc:165
 hkalfiltertask.cc:166
 hkalfiltertask.cc:167
 hkalfiltertask.cc:168
 hkalfiltertask.cc:169
 hkalfiltertask.cc:170
 hkalfiltertask.cc:171
 hkalfiltertask.cc:172
 hkalfiltertask.cc:173
 hkalfiltertask.cc:174
 hkalfiltertask.cc:175
 hkalfiltertask.cc:176
 hkalfiltertask.cc:177
 hkalfiltertask.cc:178
 hkalfiltertask.cc:179
 hkalfiltertask.cc:180
 hkalfiltertask.cc:181
 hkalfiltertask.cc:182
 hkalfiltertask.cc:183
 hkalfiltertask.cc:184
 hkalfiltertask.cc:185
 hkalfiltertask.cc:186
 hkalfiltertask.cc:187
 hkalfiltertask.cc:188
 hkalfiltertask.cc:189
 hkalfiltertask.cc:190
 hkalfiltertask.cc:191
 hkalfiltertask.cc:192
 hkalfiltertask.cc:193
 hkalfiltertask.cc:194
 hkalfiltertask.cc:195
 hkalfiltertask.cc:196
 hkalfiltertask.cc:197
 hkalfiltertask.cc:198
 hkalfiltertask.cc:199
 hkalfiltertask.cc:200
 hkalfiltertask.cc:201
 hkalfiltertask.cc:202
 hkalfiltertask.cc:203
 hkalfiltertask.cc:204
 hkalfiltertask.cc:205
 hkalfiltertask.cc:206
 hkalfiltertask.cc:207
 hkalfiltertask.cc:208
 hkalfiltertask.cc:209
 hkalfiltertask.cc:210
 hkalfiltertask.cc:211
 hkalfiltertask.cc:212
 hkalfiltertask.cc:213
 hkalfiltertask.cc:214
 hkalfiltertask.cc:215
 hkalfiltertask.cc:216
 hkalfiltertask.cc:217
 hkalfiltertask.cc:218
 hkalfiltertask.cc:219
 hkalfiltertask.cc:220
 hkalfiltertask.cc:221
 hkalfiltertask.cc:222
 hkalfiltertask.cc:223
 hkalfiltertask.cc:224
 hkalfiltertask.cc:225
 hkalfiltertask.cc:226
 hkalfiltertask.cc:227
 hkalfiltertask.cc:228
 hkalfiltertask.cc:229
 hkalfiltertask.cc:230
 hkalfiltertask.cc:231
 hkalfiltertask.cc:232
 hkalfiltertask.cc:233
 hkalfiltertask.cc:234
 hkalfiltertask.cc:235
 hkalfiltertask.cc:236
 hkalfiltertask.cc:237
 hkalfiltertask.cc:238
 hkalfiltertask.cc:239
 hkalfiltertask.cc:240
 hkalfiltertask.cc:241
 hkalfiltertask.cc:242
 hkalfiltertask.cc:243
 hkalfiltertask.cc:244
 hkalfiltertask.cc:245
 hkalfiltertask.cc:246
 hkalfiltertask.cc:247
 hkalfiltertask.cc:248
 hkalfiltertask.cc:249
 hkalfiltertask.cc:250
 hkalfiltertask.cc:251
 hkalfiltertask.cc:252
 hkalfiltertask.cc:253
 hkalfiltertask.cc:254
 hkalfiltertask.cc:255
 hkalfiltertask.cc:256
 hkalfiltertask.cc:257
 hkalfiltertask.cc:258
 hkalfiltertask.cc:259
 hkalfiltertask.cc:260
 hkalfiltertask.cc:261
 hkalfiltertask.cc:262
 hkalfiltertask.cc:263
 hkalfiltertask.cc:264
 hkalfiltertask.cc:265
 hkalfiltertask.cc:266
 hkalfiltertask.cc:267
 hkalfiltertask.cc:268
 hkalfiltertask.cc:269
 hkalfiltertask.cc:270
 hkalfiltertask.cc:271
 hkalfiltertask.cc:272
 hkalfiltertask.cc:273
 hkalfiltertask.cc:274
 hkalfiltertask.cc:275
 hkalfiltertask.cc:276
 hkalfiltertask.cc:277
 hkalfiltertask.cc:278
 hkalfiltertask.cc:279
 hkalfiltertask.cc:280
 hkalfiltertask.cc:281
 hkalfiltertask.cc:282
 hkalfiltertask.cc:283
 hkalfiltertask.cc:284
 hkalfiltertask.cc:285
 hkalfiltertask.cc:286
 hkalfiltertask.cc:287
 hkalfiltertask.cc:288
 hkalfiltertask.cc:289
 hkalfiltertask.cc:290
 hkalfiltertask.cc:291
 hkalfiltertask.cc:292
 hkalfiltertask.cc:293
 hkalfiltertask.cc:294
 hkalfiltertask.cc:295
 hkalfiltertask.cc:296
 hkalfiltertask.cc:297
 hkalfiltertask.cc:298
 hkalfiltertask.cc:299
 hkalfiltertask.cc:300
 hkalfiltertask.cc:301
 hkalfiltertask.cc:302
 hkalfiltertask.cc:303
 hkalfiltertask.cc:304
 hkalfiltertask.cc:305
 hkalfiltertask.cc:306
 hkalfiltertask.cc:307
 hkalfiltertask.cc:308
 hkalfiltertask.cc:309
 hkalfiltertask.cc:310
 hkalfiltertask.cc:311
 hkalfiltertask.cc:312
 hkalfiltertask.cc:313
 hkalfiltertask.cc:314
 hkalfiltertask.cc:315
 hkalfiltertask.cc:316
 hkalfiltertask.cc:317
 hkalfiltertask.cc:318
 hkalfiltertask.cc:319
 hkalfiltertask.cc:320
 hkalfiltertask.cc:321
 hkalfiltertask.cc:322
 hkalfiltertask.cc:323
 hkalfiltertask.cc:324
 hkalfiltertask.cc:325
 hkalfiltertask.cc:326
 hkalfiltertask.cc:327
 hkalfiltertask.cc:328
 hkalfiltertask.cc:329
 hkalfiltertask.cc:330
 hkalfiltertask.cc:331
 hkalfiltertask.cc:332
 hkalfiltertask.cc:333
 hkalfiltertask.cc:334
 hkalfiltertask.cc:335
 hkalfiltertask.cc:336
 hkalfiltertask.cc:337
 hkalfiltertask.cc:338
 hkalfiltertask.cc:339
 hkalfiltertask.cc:340
 hkalfiltertask.cc:341
 hkalfiltertask.cc:342
 hkalfiltertask.cc:343
 hkalfiltertask.cc:344
 hkalfiltertask.cc:345
 hkalfiltertask.cc:346
 hkalfiltertask.cc:347
 hkalfiltertask.cc:348
 hkalfiltertask.cc:349
 hkalfiltertask.cc:350
 hkalfiltertask.cc:351
 hkalfiltertask.cc:352
 hkalfiltertask.cc:353
 hkalfiltertask.cc:354
 hkalfiltertask.cc:355
 hkalfiltertask.cc:356
 hkalfiltertask.cc:357
 hkalfiltertask.cc:358
 hkalfiltertask.cc:359
 hkalfiltertask.cc:360
 hkalfiltertask.cc:361
 hkalfiltertask.cc:362
 hkalfiltertask.cc:363
 hkalfiltertask.cc:364
 hkalfiltertask.cc:365
 hkalfiltertask.cc:366
 hkalfiltertask.cc:367
 hkalfiltertask.cc:368
 hkalfiltertask.cc:369
 hkalfiltertask.cc:370
 hkalfiltertask.cc:371
 hkalfiltertask.cc:372
 hkalfiltertask.cc:373
 hkalfiltertask.cc:374
 hkalfiltertask.cc:375
 hkalfiltertask.cc:376
 hkalfiltertask.cc:377
 hkalfiltertask.cc:378
 hkalfiltertask.cc:379
 hkalfiltertask.cc:380
 hkalfiltertask.cc:381
 hkalfiltertask.cc:382
 hkalfiltertask.cc:383
 hkalfiltertask.cc:384
 hkalfiltertask.cc:385
 hkalfiltertask.cc:386
 hkalfiltertask.cc:387
 hkalfiltertask.cc:388
 hkalfiltertask.cc:389
 hkalfiltertask.cc:390
 hkalfiltertask.cc:391
 hkalfiltertask.cc:392
 hkalfiltertask.cc:393
 hkalfiltertask.cc:394
 hkalfiltertask.cc:395
 hkalfiltertask.cc:396
 hkalfiltertask.cc:397
 hkalfiltertask.cc:398
 hkalfiltertask.cc:399
 hkalfiltertask.cc:400
 hkalfiltertask.cc:401
 hkalfiltertask.cc:402
 hkalfiltertask.cc:403
 hkalfiltertask.cc:404
 hkalfiltertask.cc:405
 hkalfiltertask.cc:406
 hkalfiltertask.cc:407
 hkalfiltertask.cc:408
 hkalfiltertask.cc:409
 hkalfiltertask.cc:410
 hkalfiltertask.cc:411
 hkalfiltertask.cc:412
 hkalfiltertask.cc:413
 hkalfiltertask.cc:414
 hkalfiltertask.cc:415
 hkalfiltertask.cc:416
 hkalfiltertask.cc:417
 hkalfiltertask.cc:418
 hkalfiltertask.cc:419
 hkalfiltertask.cc:420
 hkalfiltertask.cc:421
 hkalfiltertask.cc:422
 hkalfiltertask.cc:423
 hkalfiltertask.cc:424
 hkalfiltertask.cc:425
 hkalfiltertask.cc:426
 hkalfiltertask.cc:427
 hkalfiltertask.cc:428
 hkalfiltertask.cc:429
 hkalfiltertask.cc:430
 hkalfiltertask.cc:431
 hkalfiltertask.cc:432
 hkalfiltertask.cc:433
 hkalfiltertask.cc:434
 hkalfiltertask.cc:435
 hkalfiltertask.cc:436
 hkalfiltertask.cc:437
 hkalfiltertask.cc:438
 hkalfiltertask.cc:439
 hkalfiltertask.cc:440
 hkalfiltertask.cc:441
 hkalfiltertask.cc:442
 hkalfiltertask.cc:443
 hkalfiltertask.cc:444
 hkalfiltertask.cc:445
 hkalfiltertask.cc:446
 hkalfiltertask.cc:447
 hkalfiltertask.cc:448
 hkalfiltertask.cc:449
 hkalfiltertask.cc:450
 hkalfiltertask.cc:451
 hkalfiltertask.cc:452
 hkalfiltertask.cc:453
 hkalfiltertask.cc:454
 hkalfiltertask.cc:455
 hkalfiltertask.cc:456
 hkalfiltertask.cc:457
 hkalfiltertask.cc:458
 hkalfiltertask.cc:459
 hkalfiltertask.cc:460
 hkalfiltertask.cc:461
 hkalfiltertask.cc:462
 hkalfiltertask.cc:463
 hkalfiltertask.cc:464
 hkalfiltertask.cc:465
 hkalfiltertask.cc:466
 hkalfiltertask.cc:467
 hkalfiltertask.cc:468
 hkalfiltertask.cc:469
 hkalfiltertask.cc:470
 hkalfiltertask.cc:471
 hkalfiltertask.cc:472
 hkalfiltertask.cc:473
 hkalfiltertask.cc:474
 hkalfiltertask.cc:475
 hkalfiltertask.cc:476
 hkalfiltertask.cc:477
 hkalfiltertask.cc:478
 hkalfiltertask.cc:479
 hkalfiltertask.cc:480
 hkalfiltertask.cc:481
 hkalfiltertask.cc:482
 hkalfiltertask.cc:483
 hkalfiltertask.cc:484
 hkalfiltertask.cc:485
 hkalfiltertask.cc:486
 hkalfiltertask.cc:487
 hkalfiltertask.cc:488
 hkalfiltertask.cc:489
 hkalfiltertask.cc:490
 hkalfiltertask.cc:491
 hkalfiltertask.cc:492
 hkalfiltertask.cc:493
 hkalfiltertask.cc:494
 hkalfiltertask.cc:495
 hkalfiltertask.cc:496
 hkalfiltertask.cc:497
 hkalfiltertask.cc:498
 hkalfiltertask.cc:499
 hkalfiltertask.cc:500
 hkalfiltertask.cc:501
 hkalfiltertask.cc:502
 hkalfiltertask.cc:503
 hkalfiltertask.cc:504
 hkalfiltertask.cc:505
 hkalfiltertask.cc:506
 hkalfiltertask.cc:507
 hkalfiltertask.cc:508
 hkalfiltertask.cc:509
 hkalfiltertask.cc:510
 hkalfiltertask.cc:511
 hkalfiltertask.cc:512
 hkalfiltertask.cc:513
 hkalfiltertask.cc:514
 hkalfiltertask.cc:515
 hkalfiltertask.cc:516
 hkalfiltertask.cc:517
 hkalfiltertask.cc:518
 hkalfiltertask.cc:519
 hkalfiltertask.cc:520
 hkalfiltertask.cc:521
 hkalfiltertask.cc:522
 hkalfiltertask.cc:523
 hkalfiltertask.cc:524
 hkalfiltertask.cc:525
 hkalfiltertask.cc:526
 hkalfiltertask.cc:527
 hkalfiltertask.cc:528
 hkalfiltertask.cc:529
 hkalfiltertask.cc:530
 hkalfiltertask.cc:531
 hkalfiltertask.cc:532
 hkalfiltertask.cc:533
 hkalfiltertask.cc:534
 hkalfiltertask.cc:535
 hkalfiltertask.cc:536
 hkalfiltertask.cc:537
 hkalfiltertask.cc:538
 hkalfiltertask.cc:539
 hkalfiltertask.cc:540
 hkalfiltertask.cc:541
 hkalfiltertask.cc:542
 hkalfiltertask.cc:543
 hkalfiltertask.cc:544
 hkalfiltertask.cc:545
 hkalfiltertask.cc:546
 hkalfiltertask.cc:547
 hkalfiltertask.cc:548
 hkalfiltertask.cc:549
 hkalfiltertask.cc:550
 hkalfiltertask.cc:551
 hkalfiltertask.cc:552
 hkalfiltertask.cc:553
 hkalfiltertask.cc:554
 hkalfiltertask.cc:555
 hkalfiltertask.cc:556
 hkalfiltertask.cc:557
 hkalfiltertask.cc:558
 hkalfiltertask.cc:559
 hkalfiltertask.cc:560
 hkalfiltertask.cc:561
 hkalfiltertask.cc:562
 hkalfiltertask.cc:563
 hkalfiltertask.cc:564
 hkalfiltertask.cc:565
 hkalfiltertask.cc:566
 hkalfiltertask.cc:567
 hkalfiltertask.cc:568
 hkalfiltertask.cc:569
 hkalfiltertask.cc:570
 hkalfiltertask.cc:571
 hkalfiltertask.cc:572
 hkalfiltertask.cc:573
 hkalfiltertask.cc:574
 hkalfiltertask.cc:575
 hkalfiltertask.cc:576
 hkalfiltertask.cc:577
 hkalfiltertask.cc:578
 hkalfiltertask.cc:579
 hkalfiltertask.cc:580
 hkalfiltertask.cc:581
 hkalfiltertask.cc:582
 hkalfiltertask.cc:583
 hkalfiltertask.cc:584
 hkalfiltertask.cc:585
 hkalfiltertask.cc:586
 hkalfiltertask.cc:587
 hkalfiltertask.cc:588
 hkalfiltertask.cc:589
 hkalfiltertask.cc:590
 hkalfiltertask.cc:591
 hkalfiltertask.cc:592
 hkalfiltertask.cc:593
 hkalfiltertask.cc:594
 hkalfiltertask.cc:595
 hkalfiltertask.cc:596
 hkalfiltertask.cc:597
 hkalfiltertask.cc:598
 hkalfiltertask.cc:599
 hkalfiltertask.cc:600
 hkalfiltertask.cc:601
 hkalfiltertask.cc:602
 hkalfiltertask.cc:603
 hkalfiltertask.cc:604
 hkalfiltertask.cc:605
 hkalfiltertask.cc:606
 hkalfiltertask.cc:607
 hkalfiltertask.cc:608
 hkalfiltertask.cc:609
 hkalfiltertask.cc:610
 hkalfiltertask.cc:611
 hkalfiltertask.cc:612
 hkalfiltertask.cc:613
 hkalfiltertask.cc:614
 hkalfiltertask.cc:615
 hkalfiltertask.cc:616
 hkalfiltertask.cc:617
 hkalfiltertask.cc:618
 hkalfiltertask.cc:619
 hkalfiltertask.cc:620
 hkalfiltertask.cc:621
 hkalfiltertask.cc:622
 hkalfiltertask.cc:623
 hkalfiltertask.cc:624
 hkalfiltertask.cc:625
 hkalfiltertask.cc:626
 hkalfiltertask.cc:627
 hkalfiltertask.cc:628
 hkalfiltertask.cc:629
 hkalfiltertask.cc:630
 hkalfiltertask.cc:631
 hkalfiltertask.cc:632
 hkalfiltertask.cc:633
 hkalfiltertask.cc:634
 hkalfiltertask.cc:635
 hkalfiltertask.cc:636
 hkalfiltertask.cc:637
 hkalfiltertask.cc:638
 hkalfiltertask.cc:639
 hkalfiltertask.cc:640
 hkalfiltertask.cc:641
 hkalfiltertask.cc:642
 hkalfiltertask.cc:643
 hkalfiltertask.cc:644
 hkalfiltertask.cc:645
 hkalfiltertask.cc:646
 hkalfiltertask.cc:647
 hkalfiltertask.cc:648
 hkalfiltertask.cc:649
 hkalfiltertask.cc:650
 hkalfiltertask.cc:651
 hkalfiltertask.cc:652
 hkalfiltertask.cc:653
 hkalfiltertask.cc:654
 hkalfiltertask.cc:655
 hkalfiltertask.cc:656
 hkalfiltertask.cc:657
 hkalfiltertask.cc:658
 hkalfiltertask.cc:659
 hkalfiltertask.cc:660
 hkalfiltertask.cc:661
 hkalfiltertask.cc:662
 hkalfiltertask.cc:663
 hkalfiltertask.cc:664
 hkalfiltertask.cc:665
 hkalfiltertask.cc:666
 hkalfiltertask.cc:667
 hkalfiltertask.cc:668
 hkalfiltertask.cc:669
 hkalfiltertask.cc:670
 hkalfiltertask.cc:671
 hkalfiltertask.cc:672
 hkalfiltertask.cc:673
 hkalfiltertask.cc:674
 hkalfiltertask.cc:675
 hkalfiltertask.cc:676
 hkalfiltertask.cc:677
 hkalfiltertask.cc:678
 hkalfiltertask.cc:679
 hkalfiltertask.cc:680
 hkalfiltertask.cc:681
 hkalfiltertask.cc:682
 hkalfiltertask.cc:683
 hkalfiltertask.cc:684
 hkalfiltertask.cc:685
 hkalfiltertask.cc:686
 hkalfiltertask.cc:687
 hkalfiltertask.cc:688
 hkalfiltertask.cc:689
 hkalfiltertask.cc:690
 hkalfiltertask.cc:691
 hkalfiltertask.cc:692
 hkalfiltertask.cc:693
 hkalfiltertask.cc:694
 hkalfiltertask.cc:695
 hkalfiltertask.cc:696
 hkalfiltertask.cc:697
 hkalfiltertask.cc:698
 hkalfiltertask.cc:699
 hkalfiltertask.cc:700
 hkalfiltertask.cc:701
 hkalfiltertask.cc:702
 hkalfiltertask.cc:703
 hkalfiltertask.cc:704
 hkalfiltertask.cc:705
 hkalfiltertask.cc:706
 hkalfiltertask.cc:707
 hkalfiltertask.cc:708
 hkalfiltertask.cc:709
 hkalfiltertask.cc:710
 hkalfiltertask.cc:711
 hkalfiltertask.cc:712
 hkalfiltertask.cc:713
 hkalfiltertask.cc:714
 hkalfiltertask.cc:715
 hkalfiltertask.cc:716
 hkalfiltertask.cc:717
 hkalfiltertask.cc:718
 hkalfiltertask.cc:719
 hkalfiltertask.cc:720
 hkalfiltertask.cc:721
 hkalfiltertask.cc:722
 hkalfiltertask.cc:723
 hkalfiltertask.cc:724
 hkalfiltertask.cc:725
 hkalfiltertask.cc:726
 hkalfiltertask.cc:727
 hkalfiltertask.cc:728
 hkalfiltertask.cc:729
 hkalfiltertask.cc:730
 hkalfiltertask.cc:731
 hkalfiltertask.cc:732
 hkalfiltertask.cc:733
 hkalfiltertask.cc:734
 hkalfiltertask.cc:735
 hkalfiltertask.cc:736
 hkalfiltertask.cc:737
 hkalfiltertask.cc:738
 hkalfiltertask.cc:739
 hkalfiltertask.cc:740
 hkalfiltertask.cc:741
 hkalfiltertask.cc:742
 hkalfiltertask.cc:743
 hkalfiltertask.cc:744
 hkalfiltertask.cc:745
 hkalfiltertask.cc:746
 hkalfiltertask.cc:747
 hkalfiltertask.cc:748
 hkalfiltertask.cc:749
 hkalfiltertask.cc:750
 hkalfiltertask.cc:751
 hkalfiltertask.cc:752
 hkalfiltertask.cc:753
 hkalfiltertask.cc:754
 hkalfiltertask.cc:755
 hkalfiltertask.cc:756
 hkalfiltertask.cc:757
 hkalfiltertask.cc:758
 hkalfiltertask.cc:759
 hkalfiltertask.cc:760
 hkalfiltertask.cc:761
 hkalfiltertask.cc:762
 hkalfiltertask.cc:763
 hkalfiltertask.cc:764
 hkalfiltertask.cc:765
 hkalfiltertask.cc:766
 hkalfiltertask.cc:767
 hkalfiltertask.cc:768
 hkalfiltertask.cc:769
 hkalfiltertask.cc:770
 hkalfiltertask.cc:771
 hkalfiltertask.cc:772
 hkalfiltertask.cc:773
 hkalfiltertask.cc:774
 hkalfiltertask.cc:775
 hkalfiltertask.cc:776
 hkalfiltertask.cc:777
 hkalfiltertask.cc:778
 hkalfiltertask.cc:779
 hkalfiltertask.cc:780
 hkalfiltertask.cc:781
 hkalfiltertask.cc:782
 hkalfiltertask.cc:783
 hkalfiltertask.cc:784
 hkalfiltertask.cc:785
 hkalfiltertask.cc:786
 hkalfiltertask.cc:787
 hkalfiltertask.cc:788
 hkalfiltertask.cc:789
 hkalfiltertask.cc:790
 hkalfiltertask.cc:791
 hkalfiltertask.cc:792
 hkalfiltertask.cc:793
 hkalfiltertask.cc:794
 hkalfiltertask.cc:795
 hkalfiltertask.cc:796
 hkalfiltertask.cc:797
 hkalfiltertask.cc:798
 hkalfiltertask.cc:799
 hkalfiltertask.cc:800
 hkalfiltertask.cc:801
 hkalfiltertask.cc:802
 hkalfiltertask.cc:803
 hkalfiltertask.cc:804
 hkalfiltertask.cc:805
 hkalfiltertask.cc:806
 hkalfiltertask.cc:807
 hkalfiltertask.cc:808
 hkalfiltertask.cc:809
 hkalfiltertask.cc:810
 hkalfiltertask.cc:811
 hkalfiltertask.cc:812
 hkalfiltertask.cc:813
 hkalfiltertask.cc:814
 hkalfiltertask.cc:815
 hkalfiltertask.cc:816
 hkalfiltertask.cc:817
 hkalfiltertask.cc:818
 hkalfiltertask.cc:819
 hkalfiltertask.cc:820
 hkalfiltertask.cc:821
 hkalfiltertask.cc:822
 hkalfiltertask.cc:823
 hkalfiltertask.cc:824
 hkalfiltertask.cc:825
 hkalfiltertask.cc:826
 hkalfiltertask.cc:827
 hkalfiltertask.cc:828
 hkalfiltertask.cc:829
 hkalfiltertask.cc:830
 hkalfiltertask.cc:831
 hkalfiltertask.cc:832
 hkalfiltertask.cc:833
 hkalfiltertask.cc:834
 hkalfiltertask.cc:835
 hkalfiltertask.cc:836
 hkalfiltertask.cc:837
 hkalfiltertask.cc:838
 hkalfiltertask.cc:839
 hkalfiltertask.cc:840
 hkalfiltertask.cc:841
 hkalfiltertask.cc:842
 hkalfiltertask.cc:843
 hkalfiltertask.cc:844
 hkalfiltertask.cc:845
 hkalfiltertask.cc:846
 hkalfiltertask.cc:847
 hkalfiltertask.cc:848
 hkalfiltertask.cc:849
 hkalfiltertask.cc:850
 hkalfiltertask.cc:851
 hkalfiltertask.cc:852
 hkalfiltertask.cc:853
 hkalfiltertask.cc:854
 hkalfiltertask.cc:855
 hkalfiltertask.cc:856
 hkalfiltertask.cc:857
 hkalfiltertask.cc:858
 hkalfiltertask.cc:859
 hkalfiltertask.cc:860
 hkalfiltertask.cc:861
 hkalfiltertask.cc:862
 hkalfiltertask.cc:863
 hkalfiltertask.cc:864
 hkalfiltertask.cc:865
 hkalfiltertask.cc:866
 hkalfiltertask.cc:867
 hkalfiltertask.cc:868
 hkalfiltertask.cc:869
 hkalfiltertask.cc:870
 hkalfiltertask.cc:871
 hkalfiltertask.cc:872
 hkalfiltertask.cc:873
 hkalfiltertask.cc:874
 hkalfiltertask.cc:875
 hkalfiltertask.cc:876
 hkalfiltertask.cc:877
 hkalfiltertask.cc:878
 hkalfiltertask.cc:879
 hkalfiltertask.cc:880
 hkalfiltertask.cc:881
 hkalfiltertask.cc:882
 hkalfiltertask.cc:883
 hkalfiltertask.cc:884
 hkalfiltertask.cc:885
 hkalfiltertask.cc:886
 hkalfiltertask.cc:887
 hkalfiltertask.cc:888
 hkalfiltertask.cc:889
 hkalfiltertask.cc:890
 hkalfiltertask.cc:891
 hkalfiltertask.cc:892
 hkalfiltertask.cc:893
 hkalfiltertask.cc:894
 hkalfiltertask.cc:895
 hkalfiltertask.cc:896
 hkalfiltertask.cc:897
 hkalfiltertask.cc:898
 hkalfiltertask.cc:899
 hkalfiltertask.cc:900
 hkalfiltertask.cc:901
 hkalfiltertask.cc:902
 hkalfiltertask.cc:903
 hkalfiltertask.cc:904
 hkalfiltertask.cc:905
 hkalfiltertask.cc:906
 hkalfiltertask.cc:907
 hkalfiltertask.cc:908
 hkalfiltertask.cc:909
 hkalfiltertask.cc:910
 hkalfiltertask.cc:911
 hkalfiltertask.cc:912
 hkalfiltertask.cc:913
 hkalfiltertask.cc:914
 hkalfiltertask.cc:915
 hkalfiltertask.cc:916
 hkalfiltertask.cc:917
 hkalfiltertask.cc:918
 hkalfiltertask.cc:919
 hkalfiltertask.cc:920
 hkalfiltertask.cc:921
 hkalfiltertask.cc:922
 hkalfiltertask.cc:923
 hkalfiltertask.cc:924
 hkalfiltertask.cc:925
 hkalfiltertask.cc:926
 hkalfiltertask.cc:927
 hkalfiltertask.cc:928
 hkalfiltertask.cc:929
 hkalfiltertask.cc:930
 hkalfiltertask.cc:931
 hkalfiltertask.cc:932
 hkalfiltertask.cc:933
 hkalfiltertask.cc:934
 hkalfiltertask.cc:935
 hkalfiltertask.cc:936
 hkalfiltertask.cc:937
 hkalfiltertask.cc:938
 hkalfiltertask.cc:939
 hkalfiltertask.cc:940
 hkalfiltertask.cc:941
 hkalfiltertask.cc:942
 hkalfiltertask.cc:943
 hkalfiltertask.cc:944
 hkalfiltertask.cc:945
 hkalfiltertask.cc:946
 hkalfiltertask.cc:947
 hkalfiltertask.cc:948
 hkalfiltertask.cc:949
 hkalfiltertask.cc:950
 hkalfiltertask.cc:951
 hkalfiltertask.cc:952
 hkalfiltertask.cc:953
 hkalfiltertask.cc:954
 hkalfiltertask.cc:955
 hkalfiltertask.cc:956
 hkalfiltertask.cc:957
 hkalfiltertask.cc:958
 hkalfiltertask.cc:959
 hkalfiltertask.cc:960
 hkalfiltertask.cc:961
 hkalfiltertask.cc:962
 hkalfiltertask.cc:963
 hkalfiltertask.cc:964
 hkalfiltertask.cc:965
 hkalfiltertask.cc:966
 hkalfiltertask.cc:967
 hkalfiltertask.cc:968
 hkalfiltertask.cc:969
 hkalfiltertask.cc:970
 hkalfiltertask.cc:971
 hkalfiltertask.cc:972
 hkalfiltertask.cc:973
 hkalfiltertask.cc:974
 hkalfiltertask.cc:975
 hkalfiltertask.cc:976
 hkalfiltertask.cc:977
 hkalfiltertask.cc:978
 hkalfiltertask.cc:979
 hkalfiltertask.cc:980
 hkalfiltertask.cc:981
 hkalfiltertask.cc:982
 hkalfiltertask.cc:983
 hkalfiltertask.cc:984
 hkalfiltertask.cc:985
 hkalfiltertask.cc:986
 hkalfiltertask.cc:987
 hkalfiltertask.cc:988
 hkalfiltertask.cc:989
 hkalfiltertask.cc:990
 hkalfiltertask.cc:991
 hkalfiltertask.cc:992
 hkalfiltertask.cc:993
 hkalfiltertask.cc:994
 hkalfiltertask.cc:995
 hkalfiltertask.cc:996
 hkalfiltertask.cc:997
 hkalfiltertask.cc:998
 hkalfiltertask.cc:999
 hkalfiltertask.cc:1000
 hkalfiltertask.cc:1001
 hkalfiltertask.cc:1002
 hkalfiltertask.cc:1003
 hkalfiltertask.cc:1004
 hkalfiltertask.cc:1005
 hkalfiltertask.cc:1006
 hkalfiltertask.cc:1007
 hkalfiltertask.cc:1008
 hkalfiltertask.cc:1009
 hkalfiltertask.cc:1010
 hkalfiltertask.cc:1011
 hkalfiltertask.cc:1012
 hkalfiltertask.cc:1013
 hkalfiltertask.cc:1014
 hkalfiltertask.cc:1015
 hkalfiltertask.cc:1016
 hkalfiltertask.cc:1017
 hkalfiltertask.cc:1018
 hkalfiltertask.cc:1019
 hkalfiltertask.cc:1020
 hkalfiltertask.cc:1021
 hkalfiltertask.cc:1022
 hkalfiltertask.cc:1023
 hkalfiltertask.cc:1024
 hkalfiltertask.cc:1025
 hkalfiltertask.cc:1026
 hkalfiltertask.cc:1027
 hkalfiltertask.cc:1028
 hkalfiltertask.cc:1029
 hkalfiltertask.cc:1030
 hkalfiltertask.cc:1031
 hkalfiltertask.cc:1032
 hkalfiltertask.cc:1033
 hkalfiltertask.cc:1034
 hkalfiltertask.cc:1035
 hkalfiltertask.cc:1036
 hkalfiltertask.cc:1037
 hkalfiltertask.cc:1038
 hkalfiltertask.cc:1039
 hkalfiltertask.cc:1040
 hkalfiltertask.cc:1041
 hkalfiltertask.cc:1042
 hkalfiltertask.cc:1043
 hkalfiltertask.cc:1044
 hkalfiltertask.cc:1045
 hkalfiltertask.cc:1046
 hkalfiltertask.cc:1047
 hkalfiltertask.cc:1048
 hkalfiltertask.cc:1049
 hkalfiltertask.cc:1050
 hkalfiltertask.cc:1051
 hkalfiltertask.cc:1052
 hkalfiltertask.cc:1053
 hkalfiltertask.cc:1054
 hkalfiltertask.cc:1055
 hkalfiltertask.cc:1056
 hkalfiltertask.cc:1057
 hkalfiltertask.cc:1058
 hkalfiltertask.cc:1059
 hkalfiltertask.cc:1060
 hkalfiltertask.cc:1061
 hkalfiltertask.cc:1062
 hkalfiltertask.cc:1063
 hkalfiltertask.cc:1064
 hkalfiltertask.cc:1065
 hkalfiltertask.cc:1066
 hkalfiltertask.cc:1067
 hkalfiltertask.cc:1068
 hkalfiltertask.cc:1069
 hkalfiltertask.cc:1070
 hkalfiltertask.cc:1071
 hkalfiltertask.cc:1072
 hkalfiltertask.cc:1073
 hkalfiltertask.cc:1074
 hkalfiltertask.cc:1075
 hkalfiltertask.cc:1076
 hkalfiltertask.cc:1077
 hkalfiltertask.cc:1078
 hkalfiltertask.cc:1079
 hkalfiltertask.cc:1080
 hkalfiltertask.cc:1081
 hkalfiltertask.cc:1082
 hkalfiltertask.cc:1083
 hkalfiltertask.cc:1084
 hkalfiltertask.cc:1085
 hkalfiltertask.cc:1086
 hkalfiltertask.cc:1087
 hkalfiltertask.cc:1088
 hkalfiltertask.cc:1089
 hkalfiltertask.cc:1090
 hkalfiltertask.cc:1091
 hkalfiltertask.cc:1092
 hkalfiltertask.cc:1093
 hkalfiltertask.cc:1094
 hkalfiltertask.cc:1095
 hkalfiltertask.cc:1096
 hkalfiltertask.cc:1097
 hkalfiltertask.cc:1098
 hkalfiltertask.cc:1099
 hkalfiltertask.cc:1100
 hkalfiltertask.cc:1101
 hkalfiltertask.cc:1102
 hkalfiltertask.cc:1103
 hkalfiltertask.cc:1104
 hkalfiltertask.cc:1105
 hkalfiltertask.cc:1106
 hkalfiltertask.cc:1107
 hkalfiltertask.cc:1108
 hkalfiltertask.cc:1109
 hkalfiltertask.cc:1110
 hkalfiltertask.cc:1111
 hkalfiltertask.cc:1112
 hkalfiltertask.cc:1113
 hkalfiltertask.cc:1114
 hkalfiltertask.cc:1115
 hkalfiltertask.cc:1116
 hkalfiltertask.cc:1117
 hkalfiltertask.cc:1118
 hkalfiltertask.cc:1119
 hkalfiltertask.cc:1120
 hkalfiltertask.cc:1121
 hkalfiltertask.cc:1122
 hkalfiltertask.cc:1123
 hkalfiltertask.cc:1124
 hkalfiltertask.cc:1125
 hkalfiltertask.cc:1126
 hkalfiltertask.cc:1127
 hkalfiltertask.cc:1128
 hkalfiltertask.cc:1129
 hkalfiltertask.cc:1130
 hkalfiltertask.cc:1131
 hkalfiltertask.cc:1132
 hkalfiltertask.cc:1133
 hkalfiltertask.cc:1134
 hkalfiltertask.cc:1135
 hkalfiltertask.cc:1136
 hkalfiltertask.cc:1137
 hkalfiltertask.cc:1138
 hkalfiltertask.cc:1139
 hkalfiltertask.cc:1140
 hkalfiltertask.cc:1141
 hkalfiltertask.cc:1142
 hkalfiltertask.cc:1143
 hkalfiltertask.cc:1144
 hkalfiltertask.cc:1145
 hkalfiltertask.cc:1146
 hkalfiltertask.cc:1147
 hkalfiltertask.cc:1148
 hkalfiltertask.cc:1149
 hkalfiltertask.cc:1150
 hkalfiltertask.cc:1151
 hkalfiltertask.cc:1152
 hkalfiltertask.cc:1153
 hkalfiltertask.cc:1154
 hkalfiltertask.cc:1155
 hkalfiltertask.cc:1156
 hkalfiltertask.cc:1157
 hkalfiltertask.cc:1158
 hkalfiltertask.cc:1159
 hkalfiltertask.cc:1160
 hkalfiltertask.cc:1161
 hkalfiltertask.cc:1162
 hkalfiltertask.cc:1163
 hkalfiltertask.cc:1164
 hkalfiltertask.cc:1165
 hkalfiltertask.cc:1166
 hkalfiltertask.cc:1167
 hkalfiltertask.cc:1168
 hkalfiltertask.cc:1169
 hkalfiltertask.cc:1170
 hkalfiltertask.cc:1171
 hkalfiltertask.cc:1172
 hkalfiltertask.cc:1173
 hkalfiltertask.cc:1174
 hkalfiltertask.cc:1175
 hkalfiltertask.cc:1176
 hkalfiltertask.cc:1177
 hkalfiltertask.cc:1178
 hkalfiltertask.cc:1179
 hkalfiltertask.cc:1180
 hkalfiltertask.cc:1181
 hkalfiltertask.cc:1182
 hkalfiltertask.cc:1183
 hkalfiltertask.cc:1184
 hkalfiltertask.cc:1185
 hkalfiltertask.cc:1186
 hkalfiltertask.cc:1187
 hkalfiltertask.cc:1188
 hkalfiltertask.cc:1189
 hkalfiltertask.cc:1190
 hkalfiltertask.cc:1191
 hkalfiltertask.cc:1192
 hkalfiltertask.cc:1193
 hkalfiltertask.cc:1194
 hkalfiltertask.cc:1195
 hkalfiltertask.cc:1196
 hkalfiltertask.cc:1197
 hkalfiltertask.cc:1198
 hkalfiltertask.cc:1199
 hkalfiltertask.cc:1200
 hkalfiltertask.cc:1201
 hkalfiltertask.cc:1202
 hkalfiltertask.cc:1203
 hkalfiltertask.cc:1204
 hkalfiltertask.cc:1205
 hkalfiltertask.cc:1206
 hkalfiltertask.cc:1207
 hkalfiltertask.cc:1208
 hkalfiltertask.cc:1209
 hkalfiltertask.cc:1210
 hkalfiltertask.cc:1211
 hkalfiltertask.cc:1212
 hkalfiltertask.cc:1213
 hkalfiltertask.cc:1214
 hkalfiltertask.cc:1215
 hkalfiltertask.cc:1216
 hkalfiltertask.cc:1217
 hkalfiltertask.cc:1218
 hkalfiltertask.cc:1219
 hkalfiltertask.cc:1220
 hkalfiltertask.cc:1221
 hkalfiltertask.cc:1222
 hkalfiltertask.cc:1223
 hkalfiltertask.cc:1224
 hkalfiltertask.cc:1225
 hkalfiltertask.cc:1226
 hkalfiltertask.cc:1227
 hkalfiltertask.cc:1228
 hkalfiltertask.cc:1229
 hkalfiltertask.cc:1230
 hkalfiltertask.cc:1231
 hkalfiltertask.cc:1232
 hkalfiltertask.cc:1233
 hkalfiltertask.cc:1234
 hkalfiltertask.cc:1235
 hkalfiltertask.cc:1236
 hkalfiltertask.cc:1237
 hkalfiltertask.cc:1238
 hkalfiltertask.cc:1239
 hkalfiltertask.cc:1240
 hkalfiltertask.cc:1241
 hkalfiltertask.cc:1242
 hkalfiltertask.cc:1243
 hkalfiltertask.cc:1244
 hkalfiltertask.cc:1245
 hkalfiltertask.cc:1246
 hkalfiltertask.cc:1247
 hkalfiltertask.cc:1248
 hkalfiltertask.cc:1249
 hkalfiltertask.cc:1250
 hkalfiltertask.cc:1251
 hkalfiltertask.cc:1252
 hkalfiltertask.cc:1253
 hkalfiltertask.cc:1254
 hkalfiltertask.cc:1255
 hkalfiltertask.cc:1256
 hkalfiltertask.cc:1257
 hkalfiltertask.cc:1258
 hkalfiltertask.cc:1259
 hkalfiltertask.cc:1260
 hkalfiltertask.cc:1261
 hkalfiltertask.cc:1262
 hkalfiltertask.cc:1263
 hkalfiltertask.cc:1264
 hkalfiltertask.cc:1265
 hkalfiltertask.cc:1266
 hkalfiltertask.cc:1267
 hkalfiltertask.cc:1268
 hkalfiltertask.cc:1269
 hkalfiltertask.cc:1270
 hkalfiltertask.cc:1271
 hkalfiltertask.cc:1272
 hkalfiltertask.cc:1273
 hkalfiltertask.cc:1274
 hkalfiltertask.cc:1275
 hkalfiltertask.cc:1276
 hkalfiltertask.cc:1277
 hkalfiltertask.cc:1278
 hkalfiltertask.cc:1279
 hkalfiltertask.cc:1280
 hkalfiltertask.cc:1281
 hkalfiltertask.cc:1282
 hkalfiltertask.cc:1283
 hkalfiltertask.cc:1284
 hkalfiltertask.cc:1285
 hkalfiltertask.cc:1286
 hkalfiltertask.cc:1287
 hkalfiltertask.cc:1288
 hkalfiltertask.cc:1289
 hkalfiltertask.cc:1290
 hkalfiltertask.cc:1291
 hkalfiltertask.cc:1292
 hkalfiltertask.cc:1293
 hkalfiltertask.cc:1294
 hkalfiltertask.cc:1295
 hkalfiltertask.cc:1296
 hkalfiltertask.cc:1297
 hkalfiltertask.cc:1298
 hkalfiltertask.cc:1299
 hkalfiltertask.cc:1300
 hkalfiltertask.cc:1301
 hkalfiltertask.cc:1302
 hkalfiltertask.cc:1303
 hkalfiltertask.cc:1304
 hkalfiltertask.cc:1305
 hkalfiltertask.cc:1306
 hkalfiltertask.cc:1307
 hkalfiltertask.cc:1308
 hkalfiltertask.cc:1309
 hkalfiltertask.cc:1310
 hkalfiltertask.cc:1311
 hkalfiltertask.cc:1312
 hkalfiltertask.cc:1313
 hkalfiltertask.cc:1314
 hkalfiltertask.cc:1315
 hkalfiltertask.cc:1316
 hkalfiltertask.cc:1317
 hkalfiltertask.cc:1318
 hkalfiltertask.cc:1319
 hkalfiltertask.cc:1320
 hkalfiltertask.cc:1321
 hkalfiltertask.cc:1322
 hkalfiltertask.cc:1323
 hkalfiltertask.cc:1324
 hkalfiltertask.cc:1325