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

TMuiClusterMapO.cxx

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

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