• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/Users/jmonk/Physics/ForIA/src/L1TriggerBit.cxx

Go to the documentation of this file.
00001 #include "ForIA/L1TriggerBit.hh"
00002 
00003 #include <iostream>
00004 
00005 namespace ForIA{
00006    
00007   const unsigned int L1TriggerBit::s_nBitsPerBC = 8;
00008   
00009   L1TriggerBit::L1TriggerBit(): m_doFillBits(true), m_rdo_TAV(0){//, m_nTriggerBits(256){
00010     
00011   }
00012   
00013   bool L1TriggerBit::hasBit(Bit bit){
00014    
00015     if(m_doFillBits){
00016       fillBits();
00017     }else if(m_rdo_TAV==0){
00018       return false;
00019     }
00020     
00021     return m_bits.test(bit);
00022   }
00023   
00024   void L1TriggerBit::fillBits(){
00025         
00026     if(m_rdo_TAV == 0) return;
00027         
00028     unsigned int offset  = s_nBitsPerBC * m_lvl1aBC; 
00029     unsigned int pos     = 0;
00030     unsigned int word    = 0;
00031     unsigned int longBit = 1;
00032     
00033     while(pos != N_BITS && word !=8){
00034       
00035       if(m_rdo_TAV->at(word + offset) & longBit){
00036         m_bits[pos] = true;
00037       }
00038       ++pos;
00039       
00040       if(pos % 32 == 0 && pos != 0){
00041         ++word;
00042         longBit=1;
00043       }else{
00044         longBit <<= 1;
00045       }
00046     }
00047     
00048     
00049     m_doFillBits = false;
00050     return;
00051   }
00052   
00053 }

Generated on Mon Jul 30 2012 16:56:35 for ForIA by  doxygen 1.7.2