ROOT logo
#ifndef HShowerHitFinder_H
#define HShowerHitFinder_H

#include "hreconstructor.h"
#include "hlocation.h"
#include "hratree.h"
#include "hspecgeompar.h"
#include "hgeomvector.h"

class HCategory;
class HIterator;
class HShowerCal;
class HShowerHit;
class HShowerPID;
class HShowerHitHeader;
class HShowerCriterium;
class HShowerHitFPar;
class HShowerGeometry;
class HSpecGeomPar;

class HShowerHitFinder : public HReconstructor {
private:
    HLocation          m_Loc;            //!
    HRaTree           *m_pCellArr;       //! random access table for searching local maxima

    HCategory         *m_pCalCat;        //! Pointer to the cal data category
    HCategory         *m_pHitCat;        //! Pointer to the hit data category
    HCategory         *m_pPIDCat;        //! Pointer to the hit data category
    HCategory         *m_pHitHdrCat;     //! Pointer to the hit header data category

    HShowerHitFPar    *m_pHitFPar;       //! Pointer to the hit finder parameters container
    HShowerGeometry   *m_pGeometry;      //! Pointer to geometry parameters container
    HSpecGeomPar      *m_pHSpecGeomPar;

    HIterator         *fIter;            //! Iterator for calibrated fired pads
    Bool_t            m_bIsFillPID;      //! flag for filling PID level - default TRUE
    Bool_t            m_bIsSort;         //! flag for sorting data by m_nAddress - default FALSE

    HShowerCriterium *m_pCriterium;      //! definition of shower criterium

    Bool_t isSim ;                       //! is simulation ?

public:
    HShowerHitFinder();
    HShowerHitFinder(const Text_t *name,const Text_t *title);
    ~HShowerHitFinder();

    Int_t  execute       (void);
    Bool_t init          (void);
    Bool_t finalize      (void);
    Bool_t initParameters(void);

    Bool_t  lookForHit(HShowerCal* cal, HLocation &fLoc);
    Float_t calculateSum(HLocation &fLoc, Int_t nRange, Int_t* pncs = NULL);
    Float_t calculateVar(HLocation &fLoc, Int_t nRange, Float_t avg);
    Bool_t  isLocalMax  (HLocation &fLoc);
    HShowerHitFinder &operator=(HShowerHitFinder &c);

    HCategory*       getCalCat      () { return m_pCalCat;}
    HCategory*       getHitCat      () { return m_pHitCat;}
    HCategory*       getPIDCat      () { return m_pPIDCat;}
    HShowerHitFPar*  getHitFPar     () { return m_pHitFPar;}
    HShowerGeometry* getGeometry    () { return m_pGeometry;}
    HSpecGeomPar*    getHSpecGeomPar() { return m_pHSpecGeomPar;}


    void setCalCat(HCategory* pCalCat)               { m_pCalCat = pCalCat;}
    void setHitCat(HCategory* pHitCat)               { m_pHitCat = pHitCat;}
    void setPIDCat(HCategory* pPIDCat)               { m_pPIDCat = pPIDCat;}
    void setHitFPar(HShowerHitFPar* pPar)            { m_pHitFPar= pPar;}
    void setGeometry(HShowerGeometry* pGeometry)     { m_pGeometry= pGeometry;}
    void setCriterium(HShowerCriterium* pCrit);
    void setHSpecGeomPar(HSpecGeomPar *pSpecGeometry){ m_pHSpecGeomPar = pSpecGeometry;}

    Bool_t IsSortFlagSet()                           { return m_bIsSort;}
    Bool_t IsFillPID()                               { return m_bIsFillPID;}
    void setSortFlag(Bool_t bSort = kTRUE)           { m_bIsSort = bSort;}
    void setFillPID(Bool_t bIsFillPID = kTRUE)       { m_bIsFillPID = bIsFillPID;}

private:
    void fillSums(HShowerHit* hit, HLocation &fLoc);
    virtual void calcCoord(HShowerHit* hit, HLocation &fLoc);
    virtual void calcCoordWithSigma(HShowerHit* hit, HLocation &fLoc, Int_t nRange);


    void fillPID(HShowerHit* hit, HShowerPID* pid);

    HShowerHitHeader* getHitHeader(HLocation &fLoc);
    void updateClusters(HLocation &fLoc);
    void updateLocalMax(HLocation &fLoc);
    void updateFiredCells(HLocation &fLoc);

    ClassDef(HShowerHitFinder,0) //ROOT extension
};

#endif
 hshowerhitfinder.h:1
 hshowerhitfinder.h:2
 hshowerhitfinder.h:3
 hshowerhitfinder.h:4
 hshowerhitfinder.h:5
 hshowerhitfinder.h:6
 hshowerhitfinder.h:7
 hshowerhitfinder.h:8
 hshowerhitfinder.h:9
 hshowerhitfinder.h:10
 hshowerhitfinder.h:11
 hshowerhitfinder.h:12
 hshowerhitfinder.h:13
 hshowerhitfinder.h:14
 hshowerhitfinder.h:15
 hshowerhitfinder.h:16
 hshowerhitfinder.h:17
 hshowerhitfinder.h:18
 hshowerhitfinder.h:19
 hshowerhitfinder.h:20
 hshowerhitfinder.h:21
 hshowerhitfinder.h:22
 hshowerhitfinder.h:23
 hshowerhitfinder.h:24
 hshowerhitfinder.h:25
 hshowerhitfinder.h:26
 hshowerhitfinder.h:27
 hshowerhitfinder.h:28
 hshowerhitfinder.h:29
 hshowerhitfinder.h:30
 hshowerhitfinder.h:31
 hshowerhitfinder.h:32
 hshowerhitfinder.h:33
 hshowerhitfinder.h:34
 hshowerhitfinder.h:35
 hshowerhitfinder.h:36
 hshowerhitfinder.h:37
 hshowerhitfinder.h:38
 hshowerhitfinder.h:39
 hshowerhitfinder.h:40
 hshowerhitfinder.h:41
 hshowerhitfinder.h:42
 hshowerhitfinder.h:43
 hshowerhitfinder.h:44
 hshowerhitfinder.h:45
 hshowerhitfinder.h:46
 hshowerhitfinder.h:47
 hshowerhitfinder.h:48
 hshowerhitfinder.h:49
 hshowerhitfinder.h:50
 hshowerhitfinder.h:51
 hshowerhitfinder.h:52
 hshowerhitfinder.h:53
 hshowerhitfinder.h:54
 hshowerhitfinder.h:55
 hshowerhitfinder.h:56
 hshowerhitfinder.h:57
 hshowerhitfinder.h:58
 hshowerhitfinder.h:59
 hshowerhitfinder.h:60
 hshowerhitfinder.h:61
 hshowerhitfinder.h:62
 hshowerhitfinder.h:63
 hshowerhitfinder.h:64
 hshowerhitfinder.h:65
 hshowerhitfinder.h:66
 hshowerhitfinder.h:67
 hshowerhitfinder.h:68
 hshowerhitfinder.h:69
 hshowerhitfinder.h:70
 hshowerhitfinder.h:71
 hshowerhitfinder.h:72
 hshowerhitfinder.h:73
 hshowerhitfinder.h:74
 hshowerhitfinder.h:75
 hshowerhitfinder.h:76
 hshowerhitfinder.h:77
 hshowerhitfinder.h:78
 hshowerhitfinder.h:79
 hshowerhitfinder.h:80
 hshowerhitfinder.h:81
 hshowerhitfinder.h:82
 hshowerhitfinder.h:83
 hshowerhitfinder.h:84
 hshowerhitfinder.h:85
 hshowerhitfinder.h:86
 hshowerhitfinder.h:87
 hshowerhitfinder.h:88
 hshowerhitfinder.h:89
 hshowerhitfinder.h:90
 hshowerhitfinder.h:91
 hshowerhitfinder.h:92
 hshowerhitfinder.h:93
 hshowerhitfinder.h:94
 hshowerhitfinder.h:95
 hshowerhitfinder.h:96