#ifndef HFORWARDBASICTRACKER_H #define HFORWARDBASICTRACKER_H #include "hgeomvector.h" #include "hreconstructor.h" #include "stsdef.h" #include #include #include #include #include #include #include #include class HCategory; class HStsDigiPar; class HStsGeomPar; class HForwardCandFinderPar; class HForwardCand; class HStsCal; class HStsCalPar; class HForwardBasicTracker : public HReconstructor { public: HForwardBasicTracker(const Text_t* name, const Text_t* title); virtual ~HForwardBasicTracker(); virtual Bool_t init(); virtual Bool_t reinit(); virtual Int_t execute(); virtual Bool_t finalize(); void clear(Bool_t all = kTRUE); private: HCategory* pKine; // Kine category for sim HCategory* pStrawCal; // Input array of straw hits HCategory* pForwardCand; // Output array of candidates HStsGeomPar* pStsGeomPar; // strips geometry HStsCalPar* pCalPar; // cal run par HForwardCandFinderPar* pStrawVFPar; // vector finder parameters Bool_t isSimulation; // flag to mark simulation run typedef std::pair HitPair; typedef std::pair DoubletPair; std::multimap fHitPl[STS_MAX_MODULES] [STS_MAX_LAYERS * STS_MAX_PLANES]; //! hit indices on planes vs tube No std::list fVectorsFull; //! full tracks vectors // vector finder helper vectors static const Int_t MAX_POSSIBLE_HITS = 150; HStsCal* fStraw[MAX_POSSIBLE_HITS]; // straw shortcut Float_t fZ[STS_MAX_VPLANES]; // absoult Z-distance Float_t fDz[STS_MAX_VPLANES]; // Z-dist. from the first module layer Float_t fCosa[STS_MAX_VPLANES]; // cos of the stereo angle Float_t fSina[STS_MAX_VPLANES]; // sin of the stereo angle Float_t fZ0[STS_MAX_MODULES]; // Z-coord. of the first layers Float_t fZavg; HGeomVector* stsCellsLab[STS_MAX_MODULES][STS_MAX_LAYERS][STS_MAX_CELLS]; // Centre of the strip [mm] HGeomVector* stsCellsLoc[STS_MAX_MODULES][STS_MAX_LAYERS][STS_MAX_CELLS]; // Centre of the strip [mm] // cut variables Float_t fLRErrU; // hit meas. error for LR Float_t fLRCutChi2; // Chi2-cut Float_t fTanCut; // Tan-cut Float_t fCutX; Float_t fCutY; Int_t fMaxHits; Int_t nMaxBest; // system matrices std::map fLus; std::map fMatr; // keeps pair of hit indexes in a double-layer std::vector fPair[STS_MAX_MODULES][STS_MAX_LAYERS]; struct VectorInfo { Int_t patt; Int_t straw_obj_index[STS_MAX_VPLANES]; Double_t pars[5]; }; std::vector fModuleVectors[STS_MAX_MODULES]; void computeMatrix(); /// Get hits from HStsCal and sort them module and layer likewise /// @return number of accepted hits Int_t getHits(); /// Make vectors of hits in a singlke module. void makeVectors(); /// Iteratively adds double-layers to a vector. Called by makeVectors() void processDouble(Int_t m, Int_t l, Int_t patt, Int_t (&straw_obj_index)[STS_MAX_VPLANES]); /// Adds vector to the finds vectors registry. HForwardCand* addVector(Int_t patt, const Int_t (&straw_obj_index)[STS_MAX_VPLANES], Double_t chi2, Double_t* pars); /// Create a vector from the double-layers. void findLine(Int_t patt, const Int_t (&straw_obj_index)[STS_MAX_VPLANES], Double_t* pars); /// Calculate Chi2 from a group of layers Double_t findChi2(Int_t patt, const Int_t (&straw_obj_index)[STS_MAX_VPLANES], Double_t* pars, Float_t error); void checkParams(); void matchVectors(); void storeVectors(); void setTrackId(HForwardCand* vec); Bool_t fillForwardCandSim(HForwardCand* part, Int_t track); // statistics Int_t n_events; // number of analyzed events Int_t n_ok_events; // number of analyzed events with at least one vector reconstructed Int_t n_vecs; // number of analyzed events }; #endif