BmnRoot
Loading...
Searching...
No Matches
CbmStsDetectorId.h
Go to the documentation of this file.
1
22#ifndef CBMSTSDETECTORID_H
23#define CBMSTSDETECTORID_H 1
24
25#include "BmnDetectorList.h"
26
28{
29 public:
32
33
35 virtual ~CbmStsDetectorId() { }
36
37
44 Int_t DetectorId(Int_t station, Int_t sector,
45 Int_t side, Int_t channel) const {
46 return ( kGEM & 15 ) // System ID on bits 0-3
47 | ( ( station & fgkStatMask ) << fgkStatShift ) // Station number
48 | ( ( sector & fgkSectMask ) << fgkSectShift ) // Sector number
49 | ( ( side & fgkSideMask ) << fgkSideShift ) // Side on bit
50 | ( ( channel & fgkChanMask ) << fgkChanShift ); // Channel number
51 }
52
53
55 Int_t SystemId(Int_t detectorId) const {
56 return ( detectorId & 15 );
57 }
58
59
61 Int_t StationNr(Int_t detectorId) const {
62 return ( (detectorId >> fgkStatShift) & fgkStatMask );
63 }
64
65
67 Int_t SectorNr(Int_t detectorId) const {
68 return ( (detectorId >> fgkSectShift) & fgkSectMask );
69 }
70
71
73 Int_t Side(Int_t detectorId) const {
74 return ( (detectorId >> fgkSideShift) & fgkSideMask );
75 }
76
77
79 Int_t ChannelNr(Int_t detectorId) const {
80 return ( (detectorId >> fgkChanShift) & fgkChanMask );
81 }
82
83
85 static const Int_t fgkStatBits;
86 static const Int_t fgkSectBits;
87 static const Int_t fgkSideBits;
88 static const Int_t fgkChanBits;
89
90
91
92 private:
93
95 static const Int_t fgkStatShift;
96 static const Int_t fgkSectShift;
97 static const Int_t fgkSideShift;
98 static const Int_t fgkChanShift;
99
101 static const Int_t fgkStatMask;
102 static const Int_t fgkSectMask;
103 static const Int_t fgkSideMask;
104 static const Int_t fgkChanMask;
105
106
107 ClassDef(CbmStsDetectorId, 1);
108
109};
110
111
112#endif
@ kGEM
static const Int_t fgkSideBits
static const Int_t fgkStatBits
Int_t StationNr(Int_t detectorId) const
Int_t ChannelNr(Int_t detectorId) const
Int_t SystemId(Int_t detectorId) const
virtual ~CbmStsDetectorId()
Int_t Side(Int_t detectorId) const
Int_t SectorNr(Int_t detectorId) const
static const Int_t fgkSectBits
static const Int_t fgkChanBits
Int_t DetectorId(Int_t station, Int_t sector, Int_t side, Int_t channel) const
Defines unique identifiers (enum) for all BM@N detector systems.