#ifndef HMDCTRACKFINDER_H
#define HMDCTRACKFINDER_H
#include "hreconstructor.h"
#include "TStopwatch.h"
class HIterator;
class HCategory;
class HMdc34ClFinder;
class HMdcLookUpTb;
class HMdcEvntListCells;
class HMdcGeantEvent;
class HMdcClusMetaMatch;
class HMdcTrackFinder : public HReconstructor {
protected:
HMdcLookUpTb *fLookUpTb;
HMdc34ClFinder *p34ClFinder;
HMdcClusMetaMatch *pClusMetaMatch;
Int_t nModules[6];
Int_t numLayers[6][4];
Int_t typeClFinder;
Bool_t isClustToHit;
HCategory *fClusCat;
HCategory *fSegCat;
Bool_t perMdcClus;
HLocation locClus;
HLocation locNewCl;
HIterator *iterClus;
HMdcEvntListCells *event;
Bool_t isMdcLCellsOwn;
HMdcGeantEvent *geantEvent;
Bool_t isGeantEventOwn;
Int_t level4[2];
Int_t level5[2];
Int_t clFndrLevel[6][4];
Bool_t prntSt;
Bool_t tarSFinderOnly;
public:
HMdcTrackFinder(Bool_t isCOff, Int_t typeClFn=0);
HMdcTrackFinder(const Text_t *name, const Text_t *title,
Bool_t isCOff, Int_t typeClFn=0);
HMdcTrackFinder(void);
HMdcTrackFinder(const Text_t *name, const Text_t *title);
~HMdcTrackFinder(void);
Bool_t init(void);
Bool_t reinit(void);
Int_t execute(void);
Bool_t finalize(void) {return kTRUE;}
void setPersistency(Bool_t perCl);
void setParContainers();
void setNLayers(Int_t *lst);
void setLevel(Int_t l4s1, Int_t l5s1, Int_t l4s2, Int_t l5s2);
void setLevelSeg1(Int_t l4, Int_t l5);
void setLevelSeg2(Int_t l4, Int_t l5);
void printStatus(void);
void calcClFndrLevel(void);
Int_t clFndrBeforField(void);
void targSegFinderOnly(void) {tarSFinderOnly = kTRUE;}
HMdcClusMetaMatch* getClusMetaMatch(void) {return pClusMetaMatch;}
protected:
Int_t findOuterSegClusters(void);
void setMod34Levels(void);
void sortTracksInClusters(void);
Bool_t initMetaMatch(void);
ClassDef(HMdcTrackFinder,0)
};
#endif