BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
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
20using std::cerr;
21using std::endl;
22
24{
25 public:
26 /** Constructor **/
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
51};
52
53#endif
Defines unique identifiers (enum) for all BM@N detector systems.
@ kSSD
int Int_t
#define ClassDef(name, id)
virtual ~CbmMvdDetectorId()
Destructor.
Int_t StationNr(Int_t detectorId) const
Get station number from detector ID.
CbmMvdDetectorId()
Constructor.
Int_t SystemId(Int_t detectorId) const
Get System identifier from detector ID.
Int_t DetectorId(Int_t iStation) const
Create unique detector ID from station number.