/** CbmLitHitData.h * @author Andrey Lebedev * @since 2008 * @version 1.0 ** ** Class for accessing the hits in the track reconstruction. **/ #ifndef CBMLITHITDATA_H_ #define CBMLITHITDATA_H_ #include "CbmLitTypes.h" #include #include #include class CbmLitDetectorLayout; class CbmLitHit; class CbmLitHitData { public: /* Constructor */ CbmLitHitData(); /* Destructor */ virtual ~CbmLitHitData(); /* Sets the detector layout for which the hits are arranged *@param layout Detector layout */ void SetDetectorLayout( const CbmLitDetectorLayout& layout); /* Adds the hit using station group, station and substation indices *@param stationGroup Index of the station group in the detector *@param station Index of the station in the station group *@param substation Index of the substation in the station *@param hit Pointer to the hit to be added */ void AddHit( int stationGroup, int station, int substation, CbmLitHit* hit); /*Adds the hit using absolute detector plane (substation) index in the detector *@param planeId Index of the detector plane (substation) in the detector *@param hit Pointer to the hit to be added */ void AddHit( int planeId, CbmLitHit* hit); /* Gets the hit using station group, station and substation indices *@param stationGroup Index of the station group in the detector *@param station Index of the station in the station group *@param substation Index of the substation in the station *@param hitId Hit index in the array of hits for the specified substation */ const CbmLitHit* GetHit( int stationGroup, int station, int substation, int hitId) const; /* Returns the hit using absolute detector plane (substation) index in the detector *@param planeId Index of the detector plane (substation) in the detector *@param hitId Hit index in the array of hits for the specified substation */ const CbmLitHit* GetHit( int planeId, int hitId) const; /* Returns hits iterators using station group, station and substation indices *@param stationGroup Index of the station group in the detector *@param station Index of the station in the station group *@param substation Index of the substation in the station */ HitPtrIteratorPair GetHits( int stationGroup, int station, int substation); /* Returns hits iterators using absolute detector plane (substation) index in the detector *@param planeId Index of the detector plane (substation) in the detector */ HitPtrIteratorPair GetHits( int planeId); /* Returns number of hits for the specified substation *@param stationGroup Index of the station group in the detector *@param station Index of the station in the station group *@param substation Index of the substation in the station */ int GetNofHits( int stationGroup, int station, int substation) const; /* Returns maximum hit error in [cm] and the name of the coordinate * ("X", "Y", "U")for the specified substation. *@param stationGroup Index of the station group in the detector *@param station Index of the station in the station group *@param substation Index of the substation in the station */ std::pair GetMaxErr( int stationGroup, int station, int substation) const; /* Returns maximum hit error in [cm] and the name of the coordinate * ("X", "Y", "U")for the specified substation. *@param planeId Index of the detector plane (substation) in the detector */ std::pair GetMaxErr( int planeId) const; /* Clears the hit arrays */ void Clear(); /* Returns std::string representation of this class */ virtual std::string ToString() const; private: /* Calculates station group, station and substation indices using the * detector plane number. *@param planeId [in] Detector plane index *@param stationGroup [out] Index of the station group in the detector *@param station [out] Index of the station in the station group *@param subsattion [out] Index of the substation in the station */ void StationByPlaneId( int planeId, int& stationGroup, int& station, int& substation) const; // Arrays with hits std::vector > > fHits; // Arrays with maximum hit position errors for each substation std::vector > > > fMaxErr; }; #endif /*CBMLITHITDATA_H_*/