Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TMuiKeyGen.h

Go to the documentation of this file.
00001 // Static Class : TMuiKeyGen
00002 // Author: J.Newby 
00003 // Date: 2/12/03
00004 // Description: Generates keys for PHENIX MUID objects
00005 
00006 #ifndef __TMuiKeyGen_H__
00007 #define __TMuiKeyGen_H__
00008 
00009 #include<TDataType.h>
00010 #include<PHKey.hh>
00011 
00013 
00014 
00022 class TMuiKeyGen
00023 {
00024 
00025  public:
00026 
00029   typedef PHKey::object_key_type key_type; 
00030   typedef std::pair<key_type,key_type> key_range;
00031 
00033   static key_type get_key(UShort_t i_arm, 
00034                           UShort_t i_plane, 
00035                           UShort_t i_panel, 
00036                           UShort_t i_orientation, 
00037                           UShort_t i_index);
00038   
00039   static key_type get_hash_key(UShort_t i_arm,
00040                                UShort_t i_plane,
00041                                UShort_t i_panel,
00042                                UShort_t i_orientation);
00043 
00045   /* TMui1DRoadMapO also uses this four argument get_key_range, but plane=0 since plane
00046      is not relevant for 1D Roads */ 
00047  static key_range get_key_range(UShort_t i_arm,
00048                                  UShort_t i_plane,
00049                                  UShort_t i_panel,
00050                                  UShort_t i_orientation);
00051 
00053   static key_type get_key(UShort_t i_arm,
00054                           UShort_t i_plane,
00055                           UShort_t i_index);
00056 
00058   static key_range get_key_range(UShort_t i_arm,
00059                                  UShort_t i_plane);
00060                              
00062   static key_type get_key(UShort_t i_arm,
00063                           UShort_t i_index);
00064 
00065 
00067   static key_range get_key_range(UShort_t i_arm);
00068 
00070   static int get_index(key_type);
00071 
00073   static ULong_t get_max_index() { return INDEX_MASK; }
00074   
00075  private:
00076   
00077   // Note: we must define sufficients bits 
00078   // for arm_max+1.. plane_max+1 etc
00079   //
00080   static const ULong_t ARM_BITS=2;
00081   static const ULong_t PLANE_BITS=4;
00082   static const ULong_t PANEL_BITS=4;
00083   static const ULong_t ORIENTATION_BITS=2;
00084   static const ULong_t INDEX_BITS=20;  
00085   
00086   static const ULong_t ARM_MASK = 0x00000003;
00087   static const ULong_t PLANE_MASK = 0x0000000F;
00088   static const ULong_t PANEL_MASK = 0x0000000F;
00089   static const ULong_t ORIENTATION_MASK = 0x00000003;
00090   static const ULong_t INDEX_MASK = 0x000FFFFF; 
00091 
00092   static const ULong_t INDEX_SHIFT=0;
00093   static const ULong_t ORIENTATION_SHIFT = INDEX_BITS + INDEX_SHIFT;
00094   static const ULong_t PANEL_SHIFT = ORIENTATION_BITS + ORIENTATION_SHIFT;
00095   static const ULong_t PLANE_SHIFT = PANEL_SHIFT + PANEL_BITS;
00096   static const ULong_t ARM_SHIFT = PLANE_SHIFT + PLANE_BITS;
00097   
00098 };
00099 
00119 #endif // __TMuiKeyGen_H__
00120 

MUIOO: PHENIX Muon Identifier Analysis Framework. Documentation by doxygen
Last modified: