/** CbmMuchSector.h *@author M.Ryzhinskiy *@since 15.03.07 *@version 1.0 ** ** This class describes the digitization scheme for a sector of the MuCh. ** The sector is a rectangle of size fLx and fLy. The following ** types are implemented: ** 1 = GEMs ** 2 = CPCs **/ #ifndef CBMMUCHSECTOR_H #define CBMMUCHSECTOR_H 1 #include #include #include #include #include "TNamed.h" class CbmMuchSectorDigiPar; class CbmMuchDigitize; class CbmMuchSector : public TNamed { public: /** Default constructor **/ CbmMuchSector(); /** Standard constructor *@param detId Unique detector identifier *@param iType Sensor type (1,2) *@param x0 sector centre x coordinate in global c.s [cm] *@param y0 sector centre y coordinate in global c.s [cm] *@param rotation rotation in global c.s. [rad] *@param lx sector length in x [cm] *@param ly sector length in y [cm] *@param dx Readout pitch (strip) or pixel width in x [cm] *@param dy Pixel width in y [cm]. *@param iCannels Number of channels the sector has. **/ CbmMuchSector(Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t rotation, Double_t lx, Double_t ly, Double_t dx, Double_t dy, Int_t iChannels = 128); CbmMuchSector(TString tempName, Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t z0, Double_t rotation, Double_t lx, Double_t ly, Double_t d, Double_t dx, Double_t dy, Int_t iChannels = 128); /** Destructor **/ virtual ~CbmMuchSector(); /** Accessors **/ TString GetDetectorName() const { return fName.Data(); } Int_t GetDetectorId() const { return fDetectorId; } Int_t GetSystemId() const { return ( fDetectorId & (15<<24) ) >> 24; } Int_t GetStationNr() const { return ( fDetectorId & (255<<16) ) >> 16; } Int_t GetSectorNr() const { // sector number within the station return ( fDetectorId & (32767<<1) ) >> 1; } Int_t GetType() const { return fType; } Double_t GetX0() const { return fX0; } Double_t GetY0() const { return fY0; } Double_t GetZ0() const { return fZ0; } Double_t GetRotation() const { return fRotation; } Double_t GetSinRot() const { return fSinRot; } Double_t GetCosRot() const { return fCosRot; } Double_t GetLx() const { return fLx; } Double_t GetLy() const { return fLy; } Double_t GetD() const { return fD; } Double_t GetDx() const { return fDx; } Double_t GetDy() const { return fDy; } Double_t GetSigmaX() const { return fSigmaX; } Double_t GetSigmaY() const { return fSigmaY; } Double_t GetSigmaXY() const { return fSigmaXY; } Int_t GetNChannels() const { return fNChannels; } /** Calculate channel number for a coordinate pair. *@param x x coordinate in global c.s. [cm] *@param y y coordinate in global c.s. [cm] *@value iChan channel number. -1 if point is outside sector. **/ Int_t GetChannel(Double_t x, Double_t y); /** Test whether a coordinate pair (x,y) in global coordinates is ** inside the sector **/ Bool_t Inside(Double_t x, Double_t y); /** Activate the channels corresponding to a MCPoint. *@param ipt Index of MCPoint *@param x x coordinate of point (global c.s.) *@param y y coordinate of point (global c.s.) *@value kTRUE if the point is inside the sector, else kFALSE **/ Bool_t ActivateChannels(Int_t ipt, Double_t x, Double_t y); /** The index of the MCPoint that has caused a pad to be fired. *@param iPad Pad index *@value Index of MCPoint **/ Int_t GetPointIndex(Int_t iPad); /** Clear the maps of fired strips **/ void Reset(); /** Screen output **/ void Print(); private: /** ------------- Data members --------------------------**/ TString fName; // Station name Int_t fDetectorId; // Unique detector ID Int_t fType; // Sensor type Double_t fX0, fY0; // Coordinates of the sector centre [cm] Double_t fRotation; // Rotation angle in global c.s. [rad] Double_t fSinRot; // Sin(fRotation) Double_t fCosRot; // Cos(fRotation) Double_t fLx, fLy; // Dimensions of the sector [cm] Double_t fDx; // Pad's width [cm] Double_t fDy; // Pad's height [cm] Double_t fZ0; // z position of the sector [cm] Double_t fD; // thickness of the sector [cm] /** Number of channels **/ Int_t fNChannels; /** Errors of hit coordinates: size/sqrt(12) **/ // Logically, this belongs to the HitFinder, but it is here // for performance reasons: to be executed once per sector, not for // each MCPoint Double_t fSigmaX; // RMS in x, global c.s. [cm] Double_t fSigmaY; // RMS in y, global c.s. [cm] Double_t fSigmaXY; // Covariance in global c.s. [cm**2] /** STL sets containing the active channels **/ std::set fActive; //! /** STL map from the index of the fired pad to the ** index of the MCPoint **/ std::map< Int_t, Int_t > fTrueHits; //! /** ------------- Private methods ------------------------**/ /** Calculate coordinates in internal coordinate system *@param x x coordinate in global system *@param y y coordinate in global system *@param xint internal x coordinate (return) *@param yint internal y coordinate (return) *@value kTRUE if point is inside the sector **/ Bool_t IntCoord(Double_t x, Double_t y, Double_t& xint, Double_t& yint) const; /** Check whether a point is inside the sector *@param xint x coordinate of point (internal system) *@param yint y coordinate of point (internal system) *@value kTRUE if inside sector, else kFALSE **/ Bool_t IsInside(Double_t xint, Double_t yint) const; friend class CbmMuchDigitize; ClassDef(CbmMuchSector,1); }; #endif