Lookup table for PMT addresses in optical module.  
 More...
#include <JModuleAddressMap.hh>
Lookup table for PMT addresses in optical module. 
Definition at line 82 of file JModuleAddressMap.hh.
 
  
  
      
        
          | JDETECTOR::JModuleAddressMap::JModuleAddressMap  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
The list of valid PMT address translations should be build according to the detector type. The internal router is used to convert a readout channel (TDC) to a PMT readout address. 
Definition at line 92 of file JModuleAddressMap.hh.
 
 
  
  
      
        
          | bool JDETECTOR::JModuleAddressMap::has  | 
          ( | 
          const int  | 
          index | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test whether index is available. 
- Parameters
 - 
  
  
 
- Returns
 - true if index is available; else false 
 
Definition at line 103 of file JModuleAddressMap.hh.
  105       return (index >= 0 && index < (
int) this->size());
 
 
 
 
  
  
      
        
          | bool JDETECTOR::JModuleAddressMap::hasTDC  | 
          ( | 
          const int  | 
          tdc | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test whether TDC is available. 
- Parameters
 - 
  
  
 
- Returns
 - true if TDC is available; else false 
 
Definition at line 115 of file JModuleAddressMap.hh.
  117       return (tdc >= 0 && tdc < (
int) 
router.size() && 
router[tdc] != -1);
 
std::vector< int > router
 
 
 
 
Test whether PMT is available. 
- Parameters
 - 
  
  
 
- Returns
 - true if PMT is available; else false 
 
Definition at line 127 of file JModuleAddressMap.hh.
  131       const_iterator p = lower_bound(this->begin(), this->end(), address, less<JPMTPhysicalAddress>());
 
  133       return (p != this->end() && *p == address);
 
 
 
 
  
  
      
        
          | void JDETECTOR::JModuleAddressMap::configure  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Configure internal router. 
Definition at line 140 of file JModuleAddressMap.hh.
  144       sort(this->begin(), this->end(), less<JPMTPhysicalAddress>());
 
  146       for (const_iterator i = this->begin(); i != this->end(); ++i) {
 
  148         if (i->tdc >= (
int) 
router.size()) {
 
  149           router.resize(i->tdc + 1, -1);
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance. 
 
std::vector< int > router
 
 
 
 
  
  
      
        
          | void JDETECTOR::JModuleAddressMap::swap  | 
          ( | 
          const int  | 
          i1,  | 
         
        
           | 
           | 
          const int  | 
          i2  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Swap readout addresses corresponding to indices. 
- Parameters
 - 
  
    | i1 | first index  | 
    | i2 | second index  | 
  
   
Definition at line 163 of file JModuleAddressMap.hh.
  165       std::swap(
router[at(i1).tdc], 
 
  168       std::swap(static_cast<JPMTReadoutAddress&>(at(i1)), 
 
  169                 static_cast<JPMTReadoutAddress&>(at(i2)));
 
std::vector< int > router
 
 
 
 
  
  
      
        
          | void JDETECTOR::JModuleAddressMap::swapTDC  | 
          ( | 
          const int  | 
          tdc1,  | 
         
        
           | 
           | 
          const int  | 
          tdc2  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Swap physical addresses corresponding to TDCs. 
- Parameters
 - 
  
    | tdc1 | first TDC  | 
    | tdc2 | second TDC  | 
  
   
Definition at line 179 of file JModuleAddressMap.hh.
  181       std::swap(static_cast<JPMTReadoutAddress&>(at(
router[tdc1])), 
 
  182                 static_cast<JPMTReadoutAddress&>(at(
router[tdc2])));
 
std::vector< int > router
 
 
 
 
  
  
      
        
          | int JDETECTOR::JModuleAddressMap::getIndex  | 
          ( | 
          const int  | 
          tdc | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get PMT logical index for given TDC channel. 
- Parameters
 - 
  
  
 
- Returns
 - PMT logical index 
 
Definition at line 196 of file JModuleAddressMap.hh.
std::vector< int > router
 
 
 
 
Get PMT address translator. 
- Parameters
 - 
  
  
 
- Returns
 - PMT address translator 
 
Definition at line 208 of file JModuleAddressMap.hh.
int getIndex(const int tdc) const 
Get PMT logical index for given TDC channel. 
 
 
 
 
  
  
      
        
          | const JPMTPhysicalAddress& JDETECTOR::JModuleAddressMap::getPMTPhysicalAddress  | 
          ( | 
          const int  | 
          tdc | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get PMT physical address. 
- Parameters
 - 
  
  
 
- Returns
 - PMT physical address 
 
Definition at line 220 of file JModuleAddressMap.hh.
const JPMTAddressTranslator & getAddressTranslator(const int tdc) const 
Get PMT address translator. 
 
 
 
 
Get PMT address translator. 
- Parameters
 - 
  
    | address | PMT physical address  | 
  
   
- Returns
 - PMT address translator 
 
Definition at line 232 of file JModuleAddressMap.hh.
  236       const_iterator p = lower_bound(this->begin(), this->end(), address, less<JPMTPhysicalAddress>());
 
  238       if (p != this->end() && *p == address)
 
  241         THROW(JIndexOutOfRange, 
"Invalid PMT address " << address);
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
 
 
 
Get PMT readout address. 
- Parameters
 - 
  
    | address | PMT physical address  | 
  
   
- Returns
 - PMT readout address 
 
Definition at line 251 of file JModuleAddressMap.hh.
const JPMTAddressTranslator & getAddressTranslator(const int tdc) const 
Get PMT address translator. 
 
 
 
 
The documentation for this class was generated from the following file: