PandaRoot
PndMdtID.h
Go to the documentation of this file.
1 #ifndef PNDMDTID_HH
2 #define PNDMDTID_HH
3 
4 #include "Rtypes.h"
5 
6 class PndMdtID {
7  public:
8  // provide an unique number for a wire
9  static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iBox, Int_t iWire) { return iWire + 10 * iBox + 10000 * iLayer + 1000000 * iOct + 10000000 * iMod; }
10  // provide an unique number for a strip
11  static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iStrip) { return (iStrip + 2000) + (10000 * iLayer + 1000000 * iOct + 10000000 * iMod); }
12  // provide an unique number for a layer
13  static Int_t LayerID(Int_t iMod, Int_t iOct, Int_t iLayer) { return 10000 * iLayer + 1000000 * iOct + 10000000 * iMod; }
14  static Int_t LayerID(Int_t detID) { return detID / 10000 * 10000; }
15  // inverse operation
16  static Short_t Module(Int_t detID) { return (detID / 10000000); }
17  static Short_t Sector(Int_t detID) { return ((detID / 1000000) % 10); }
18  static Short_t Layer(Int_t detID) { return ((detID / 10000) % 100); }
19  static Short_t Box(Int_t detID) { return ((detID / 10) % 1000); }
20  static Short_t Wire(Int_t detID) { return (detID % 10); }
21  static Short_t Strip(Int_t detID) { return (detID % 10000 - 2000); }
22  static Bool_t isWire(Int_t detID) { return detID % 10000 < 2000; }
23  static Bool_t isStrip(Int_t detID) { return detID % 10000 >= 2000; }
24 
25  private:
26  PndMdtID();
27  ~PndMdtID();
28 };
29 
30 #endif
static Short_t Box(Int_t detID)
Definition: PndMdtID.h:19
static Bool_t isWire(Int_t detID)
Definition: PndMdtID.h:22
static Short_t Module(Int_t detID)
Definition: PndMdtID.h:16
static Short_t Layer(Int_t detID)
Definition: PndMdtID.h:18
static Int_t LayerID(Int_t iMod, Int_t iOct, Int_t iLayer)
Definition: PndMdtID.h:13
static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iBox, Int_t iWire)
Definition: PndMdtID.h:9
static Short_t Sector(Int_t detID)
Definition: PndMdtID.h:17
static Short_t Strip(Int_t detID)
Definition: PndMdtID.h:21
static Bool_t isStrip(Int_t detID)
Definition: PndMdtID.h:23
static Int_t LayerID(Int_t detID)
Definition: PndMdtID.h:14
static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iStrip)
Definition: PndMdtID.h:11
static Short_t Wire(Int_t detID)
Definition: PndMdtID.h:20