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

TMuiMCHitMapO.cxx

Go to the documentation of this file.
00001 #include<TMuiMCHitMapO.h>
00002 #include<PHKeyIterator.h>
00003 #include<PHConstKeyIterator.h>
00004 
00005 
00006 TMuiMCHitMapO::TMuiMCHitMapO() : _count(0) {;}
00007 
00008 
00009 TMuiMCHitMapO::TMuiMCHitMapO(PHKey::map_key_type map_key) : 
00010   PHMap<PHKey::key_type, TMuiMCHitO, TMuiMCHitO_v1>(map_key), _count(0){;}
00011 
00012 
00013 TMuiMCHitMapO::iterator TMuiMCHitMapO::insert_new(UShort_t arm,
00014                                                   UShort_t plane)
00015 {
00016   
00017   UShort_t index = get_roll_count();
00018   
00019   // get the key for new object
00020   //
00021   TMuiKeyGen::key_type key = TMuiKeyGen::get_key(arm,
00022                                                  plane,
00023                                                  index);
00024   // full key
00025   //
00026   Key full_key(get_map_key(),key);
00027   
00028   // insert 
00029   //
00030   insert(full_key, new value_imp_type(full_key,
00031                                       arm,
00032                                       plane,
00033                                       index));
00034   
00035   // okay not so efficient 
00036   //
00037   return find(full_key);
00038 }
00039 
00040 
00041 TMuiMCHitMapO::iterator 
00042 TMuiMCHitMapO::get(UShort_t arm)                
00043 {
00044   // key range associated with this plane
00045   //
00046   TMuiKeyGen::key_type lower_key = TMuiKeyGen::get_key(arm,0);
00047   TMuiKeyGen::key_type upper_key = TMuiKeyGen::get_key(arm+1,0)-1;
00048   // return the iterator with specified range
00049   //
00050   Key lower(get_map_key(),lower_key);
00051   Key upper(get_map_key(),upper_key);
00052   return find(lower,upper);
00053 }
00054 
00055 
00056 TMuiMCHitMapO::const_iterator 
00057 TMuiMCHitMapO::get(UShort_t arm) const          
00058 {
00059   // key range associated with this plane
00060   //
00061   TMuiKeyGen::key_type lower_key = TMuiKeyGen::get_key(arm,0);
00062   TMuiKeyGen::key_type upper_key = TMuiKeyGen::get_key(arm+1,0)-1;
00063 
00064   // return the iterator with specified range
00065   //
00066   Key lower(get_map_key(),lower_key);
00067   Key upper(get_map_key(),upper_key);
00068   return find(lower,upper);
00069 }
00070 
00071 TMuiMCHitMapO::iterator
00072 TMuiMCHitMapO::get(UShort_t arm,
00073                    UShort_t plane)
00074 {
00075   // key range associated with this plane
00076   //
00077   TMuiKeyGen::key_range range = TMuiKeyGen::get_key_range(arm,
00078                                                           plane);
00079   
00080 
00081   Key lower(get_map_key(),range.first);
00082   Key upper(get_map_key(),range.second);
00083   return find(lower,upper);
00084 
00085 }
00086 
00087 TMuiMCHitMapO::const_iterator
00088 TMuiMCHitMapO::get(UShort_t arm,
00089                    UShort_t plane) const
00090 {
00091   // key range associated with this plane
00092   //
00093   TMuiKeyGen::key_range range = TMuiKeyGen::get_key_range(arm,
00094                                                           plane);
00095   Key lower(get_map_key(),range.first);
00096   Key upper(get_map_key(),range.second);
00097   return find(lower,upper);
00098 }
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 

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