#ifndef HParticleMetaMatcher_h #define HParticleMetaMatcher_h #include "hgeomtransform.h" #include "hgeomvector.h" #include "hreconstructor.h" #include "hrpccluster.h" #include "hemccluster.h" #include "htofcluster.h" #include "TVector3.h" #include #define EMCMAXCELL 163 #define RPCMAXCELL 31 using namespace std; // from hydra class HCategory; class HGeomVector; class HMetaMatchPar; class HRpcGeomPar; class HRpcGeomCellPar; class HEmcGeomPar; class HTofGeomPar; class HParticleCand; class HSpecGeomPar; class HParticleMetaMatcher : public HReconstructor { protected: HCategory* fCatEmcCluster; //! pointer to the Emc cluster category HCategory* fCatTofHit; //! 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 HRpcGeomCellPar* pGeomCellPar; //! Rpc cell info HEmcGeomPar* fEmcGeometry; //! Emc geometry HTofGeomPar* fTofGeometry; //! TOF geometry HSpecGeomPar* pSpecGeomPar; //! sector lab trans HGeomTransform labSecTrans[6]; //! [sec] HGeomTransform modSecTransRpc[6]; //! [sec] HGeomTransform modSecTransEmc[6]; //! [sec] HGeomTransform modSecTransTof[6][8]; //! [sec][mod] TVector3 normVecRpc[6][3]; //! [sec][plane col{0,2,4}, {1,3,5}, mid] normal vector on the RPC module in the sector coordinate system TVector3 normVecEmc[6]; //! [sec] normal vector on the Emc module in the sector coordinate system TVector3 normVecTof[6][8]; //! [sec][mod] normal vector on each Tof module in the sector coordinate system TVector3 centerVecRpc[6][3]; //! [sec][plane col{0,2,4}, {1,3,5}, mid] center vector on the RPC module in the sector coordinate system TVector3 centerVecEmc[6]; //! [sec] center vector on the Emc module in the sector coordinate system TVector3 centerVecTof[6][8]; //! [sec][mod] center vector on each Tof module in the sector coordinate system HGeomVector cellRPC[6][6][RPCMAXCELL][4]; //! [sec][col][cell] 4points HGeomVector cellEMC[6][EMCMAXCELL][4]; //! [sec][cell] 4points HGeomVector cellTOF[6][8][8][4]; //! [sec][mod][cell] 4points Float_t DPlanesRpc; //! RPC displacement for collumns //------------------------------------ // return fake objects for recalcXXX() functions HRpcCluster rpccluster; //! HTofCluster tofcluster; //! HEmcCluster emccluster; //! //------------------------------------ // MDC hit on meta calculated by recalcXXX() functions HGeomVector trackMetaMod; //! HGeomVector trackMetaSec; //! HGeomVector trackMetaLab; //! Bool_t fDebug; //! switch print on/off void calcSegPoints(TVector3& p1,TVector3& p2,Double_t phiseg,Double_t thetaseg,Double_t roseg,Double_t zseg); Bool_t findIntersectionLinePlane(TVector3 &pointIntersect, const TVector3 &pos, const TVector3 &dir, const TVector3 &planeCenter, const TVector3 &planeNormal); Bool_t traceToMeta(const HParticleCand* cand,TVector3 &metaHit, const TVector3 &metaCenter, const TVector3 &metaNorm); Bool_t isInRpcCell(HGeomVector& vmod,Int_t s,Int_t col,Int_t c); Bool_t isInTofCell(HGeomVector& vmod,Int_t s,Int_t col,Int_t c); Bool_t isInEmcCell(HGeomVector& vmod,Int_t s,Int_t c); public: HParticleMetaMatcher(const Text_t *name = "HParticleMetaMatcher",const Text_t *title ="HParticleMetaMatcher"); virtual ~HParticleMetaMatcher() { ; } void setDebug(Bool_t debug=kTRUE) {fDebug = debug;} const HRpcCluster* recalcRpc(HParticleCand* cand); const HTofCluster* recalcTof(HParticleCand* cand); const HEmcCluster* recalcEmc(HParticleCand* cand); const HGeomVector& getTrackMetaMod() { return trackMetaMod;} // only valid direct following recalcXXX() call! const HGeomVector& getTrackMetaSec() { return trackMetaSec;} // only valid direct following recalcXXX() call! const HGeomVector& getTrackMetaLab() { return trackMetaLab;} // only valid direct following recalcXXX() call! Bool_t predictRpcCell(HParticleCand* cand,HGeomVector& hit1,HGeomVector& hit2,Int_t& s,Int_t& col1,Int_t& cell1,Int_t& col2,Int_t& cell2); Bool_t predictTofCell(HParticleCand* cand,HGeomVector& hit0,HGeomVector& hit1,Int_t& s,Int_t& mod0,Int_t& cell0,Int_t& mod1,Int_t& cell1); Bool_t predictEmcCell(HParticleCand* cand,HGeomVector& hit,Int_t& s,Int_t& pos,Int_t& cell); const HGeomVector* getRpcCellGeom(Int_t s,Int_t col,Int_t cell); const HGeomVector* getTofCellGeom(Int_t s,Int_t mod,Int_t cell); const HGeomVector* getEmcCellGeom(Int_t s,Int_t cell); void getEmcCellArray(Int_t s,Int_t cell,vector& vcells); Bool_t init (); Bool_t reinit (); Int_t execute() { return 0; } Bool_t finalize() { return kTRUE; } ClassDef(HParticleMetaMatcher,0) }; #endif // HParticleMetaMatcher_h