FairRoot/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 {
8  public:
9  //provide an unique number for a wire
10  static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iBox, Int_t iWire)
11  { return iWire + 10*iBox + 10000*iLayer + 1000000*iOct + 10000000*iMod; }
12  //provide an unique number for a strip
13  static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iStrip)
14  { return (iStrip + 2000) + (10000*iLayer + 1000000*iOct + 10000000*iMod); }
15  //provide an unique number for a layer
16  static Int_t LayerID(Int_t iMod, Int_t iOct, Int_t iLayer )
17  { return 10000*iLayer + 1000000*iOct + 10000000*iMod; }
18  static Int_t LayerID(Int_t detID) { return detID/10000*10000; }
19  //inverse operation
20  static Short_t Module (Int_t detID) { return (detID/10000000);}
21  static Short_t Sector (Int_t detID) { return ((detID/1000000)%10);}
22  static Short_t Layer (Int_t detID) { return ((detID/10000)%100);}
23  static Short_t Box (Int_t detID) { return ((detID/10)%1000);}
24  static Short_t Wire (Int_t detID) { return (detID%10);}
25  static Short_t Strip (Int_t detID) { return (detID%10000 - 2000);}
26  static Bool_t isWire (Int_t detID) { return detID%10000 < 2000 ; }
27  static Bool_t isStrip(Int_t detID) { return detID%10000 >= 2000; }
28  private:
29  PndMdtID();
30  ~PndMdtID();
31 };
32 
33 
34 #endif
static Short_t Box(Int_t detID)
Definition: PndMdtID.h:23
static Bool_t isWire(Int_t detID)
Definition: PndMdtID.h:26
static Short_t Module(Int_t detID)
Definition: PndMdtID.h:20
static Short_t Layer(Int_t detID)
Definition: PndMdtID.h:22
static Int_t LayerID(Int_t iMod, Int_t iOct, Int_t iLayer)
Definition: PndMdtID.h:16
static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iBox, Int_t iWire)
Definition: PndMdtID.h:10
static Short_t Sector(Int_t detID)
Definition: PndMdtID.h:21
static Short_t Strip(Int_t detID)
Definition: PndMdtID.h:25
static Bool_t isStrip(Int_t detID)
Definition: PndMdtID.h:27
static Int_t LayerID(Int_t detID)
Definition: PndMdtID.h:18
static Int_t Identifier(Int_t iMod, Int_t iOct, Int_t iLayer, Int_t iStrip)
Definition: PndMdtID.h:13
static Short_t Wire(Int_t detID)
Definition: PndMdtID.h:24