BmnRoot
26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
CbmMvdDetectorId.h
Go to the documentation of this file.
1
// -------------------------------------------------------------------------
2
// ----- CbmMvdDetectorId header file -----
3
// ----- Created 22/04/09 by V. Friese -----
4
// -------------------------------------------------------------------------
5
6
/** CbmMvdDetectorId.h
7
** Defines unique detector identifier for all MVD components.
8
** Classes using this ID scheme should derive from this class.
9
** @author V.Friese <v.friese@gsi.de>
10
**/
11
12
#ifndef CBMMVDDETECTORID_H
13
#define CBMMVDDETECTORID_H 1
14
15
#include "
BmnDetectorList.h
"
16
#include "
TObject.h
"
17
18
#include <iostream>
19
20
using
std::cerr;
21
using
std::endl;
22
23
class
CbmMvdDetectorId
24
{
25
public
:
26
/** Constructor **/
27
CbmMvdDetectorId
();
28
29
/** Destructor **/
30
virtual
~CbmMvdDetectorId
() {}
31
32
/** Create unique detector ID from station number **/
33
Int_t
DetectorId
(
Int_t
iStation)
const
{
return
(
kSSD
| (iStation << 5)); }
34
35
/** Get System identifier from detector ID **/
36
Int_t
SystemId
(
Int_t
detectorId)
const
37
{
38
Int_t
iSystem = detectorId & 31;
39
if
(iSystem !=
kSSD
) {
40
cerr <<
"-E- CbmMvdDetectorId::GetSystemId : "
41
<<
"wrong system ID "
<< iSystem << endl;
42
return
-1;
43
}
44
return
iSystem;
45
}
46
47
/** Get station number from detector ID **/
48
Int_t
StationNr
(
Int_t
detectorId)
const
{
return
((detectorId & (~31)) >> 5); }
49
50
ClassDef
(
CbmMvdDetectorId
, 1);
51
};
52
53
#endif
BmnDetectorList.h
Defines unique identifiers (enum) for all BM@N detector systems.
kSSD
@ kSSD
Definition
BmnDetectorList.h:37
Int_t
int Int_t
ClassDef
#define ClassDef(name, id)
TObject.h
CbmMvdDetectorId
Definition
CbmMvdDetectorId.h:24
CbmMvdDetectorId::~CbmMvdDetectorId
virtual ~CbmMvdDetectorId()
Destructor.
Definition
CbmMvdDetectorId.h:30
CbmMvdDetectorId::StationNr
Int_t StationNr(Int_t detectorId) const
Get station number from detector ID.
Definition
CbmMvdDetectorId.h:48
CbmMvdDetectorId::CbmMvdDetectorId
CbmMvdDetectorId()
Constructor.
Definition
CbmMvdDetectorId.cxx:7
CbmMvdDetectorId::SystemId
Int_t SystemId(Int_t detectorId) const
Get System identifier from detector ID.
Definition
CbmMvdDetectorId.h:36
CbmMvdDetectorId::DetectorId
Int_t DetectorId(Int_t iStation) const
Create unique detector ID from station number.
Definition
CbmMvdDetectorId.h:33
base
cbm
CbmMvdDetectorId.h
Generated on
for BmnRoot by
1.17.0