ROOT logo
#ifndef HKalMetaMatcher_h
#define HKalMetaMatcher_h

// from ROOT
class     TVector3;
#include "TMath.h"

// from hydra
class HCategory;
class HGeomVector;
class HMetaMatchPar;
class HRpcGeomPar;
class HShowerGeometry;
class HEmcGeomPar;
class HTofGeomPar;
#include "hgeomtransform.h"
#include "hmetamatch2.h"

#include "hkalifilt.h"
#include "hkalmetamatch.h"

class HKalMetaMatcher : public TObject {

private:
    static const Int_t nMetaTabs   = META_TAB_SIZE; // Number of meta matches that are stored for each system.
    static const Int_t tofClusterSize = 3;          // For tof detector store hit 1, hit 2 and cluster separately.

    Bool_t           bIsMatched;

    HCategory*       fCatShower;      // pointer to the Shower category
    HCategory*       fCatEmcCluster;  // pointer to the Emc cluster category
    HCategory*       fCatTof;         // pointer to the Tof hit category
    HCategory*       fCatTofCluster;  // pointer to the Tof cluster category
    HCategory*       fCatRpcCluster;  // pointer to the Rpc cluster category.

    HRpcGeomPar*     fRpcGeometry;    // Rpc geometry
    HShowerGeometry* fShowerGeometry; // Shower geometry
    HEmcGeomPar*     fEmcGeometry;    // Emc geometry
    HTofGeomPar*     fTofGeometry;    // TOF geometry

    HMetaMatchPar*   fMatchPar;

    HKalMetaMatch    matchesRpc   [nMetaTabs];
    HKalMetaMatch    matchesShower[nMetaTabs];
    HKalMetaMatch    matchesEmc   [nMetaTabs];
    HKalMetaMatch    matchesTof   [nMetaTabs][tofClusterSize];

    HGeomTransform   labSecTrans[6];       //
    HGeomTransform   modSecTransRpc[6];    //
    HGeomTransform   modSecTransShower[6]; //
    HGeomTransform   modSecTransEmc[6]; //
    HGeomTransform   modSecTransTof[6][8]; //

    TVector3         normVecRpc[6];    // normal vector on the RPC module in the sector coordinate system
    TVector3         normVecShower[6]; // normal vector on the Shower module in the sector coordinate system
    TVector3         normVecEmc[6];    // normal vector on the Emc module in the sector coordinate system
    TVector3         normVecTof[6][8]; // normal vector on each Tof module in the sector coordinate system

    HKalIFilt*       pKalsys;         // Pointer to Kalman filter.

protected:

    virtual void    getMetaRecoPos (Float_t &xReco, Float_t &yReco, Float_t &zReco) const;

    virtual Float_t getP           () const;

    virtual Float_t getTrackLength () const;

    virtual Bool_t  traceToMeta    (const TVector3 &metaHit, const TVector3 &metaNorm);

public:

    HKalMetaMatcher();

    virtual ~HKalMetaMatcher() { ; }

    virtual Float_t calcQuality    (Float_t dx, Float_t dy, Float_t s2x, Float_t s2y) const { return TMath::Sqrt(dx*dx/s2x + dy*dy/s2y); }

    virtual void    clearMatches   ();

    virtual void    init           ();

    virtual Bool_t  matchWithMeta  (HMetaMatch2 const* const pMetaMatch, HKalIFilt *const pKalsys);

    virtual void    matchWithRpc   (HMetaMatch2 const* const pMetaMatch);

    virtual void    matchWithShower(HMetaMatch2 const* const pMetaMatch);

    virtual void    matchWithEmc   (HMetaMatch2 const* const pMetaMatch);

    virtual void    matchWithTof   (HMetaMatch2 const* const pMetaMatch);

    virtual void    reinit         ();

    virtual Int_t   getClstrSize   (Int_t sys) const;

    virtual Bool_t  getIsMatched   () const                                { return bIsMatched; }

    virtual const HKalMetaMatch& getMatch(Int_t sys, Int_t tab, Int_t clstr) const;

    virtual Int_t   getNmetaTabs   () const { return nMetaTabs; }

    ClassDef(HKalMetaMatcher, 0)
};

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