/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/TrigEvent/TrigEvent-00-01-02/src/TrigTOFT.cxx

Go to the documentation of this file.
00001 #include <iostream>
00002 #include "TrigEvent/TrigTOFT.h"
00003 
00004 TrigTOFT::TrigTOFT(char* name) 
00005 {
00006   m_name = name;
00007 }
00008 
00009 void TrigTOFT::initialize()
00010 {
00011   for(int i = 0; i < 176; i++) 
00012     for(int j = 0; j < 21; j++) {
00013     if(i < 6) m_tofTrigCondi[i][j] = 0;
00014     if(i < 48) {
00015       m_wetofHitMap[i][j] = 0;
00016       m_eetofHitMap[i][j] = 0;
00017     }
00018     m_btofHitMap[i][j] = 0;
00019   }
00020 }
00021 
00022 void TrigTOFT::setTOFTTrigData( uint32_t boardId, uint32_t window, uint32_t datasize, const uint32_t* data) {
00023 
00024   if(boardId != 0xDA) std::cerr << "ERROR: You set the wrong board data to TrigTOFT!!!" << std::endl;
00025 
00026   m_window = window; 
00027 
00028   for (uint32_t i = 0; i < datasize; i++) {
00029     int winId = int (i/14);
00030     //int id = (i-winId*14)%14;
00031     //DW4 trigger conditions
00032     if(i==(1+winId*14)) {
00033       for(uint32_t condId = 1,loop = 0; loop < 6; condId <<=1,loop++) {
00034         if(data[i] & condId) m_tofTrigCondi[loop][winId] = 1;
00035       }
00036     }
00037 
00038     //DW9-DW12 for inner layer hit, DW13--DW16 outer layer hit
00039     if(i >= (6+winId*14) && i <= (13+winId*14)) {
00040       if(i == (6+winId*14) || i == (10+winId*14)) {
00041         for(uint32_t btofId = 1,loop = 0; loop < 16; btofId <<=1,loop++) {
00042           if(data[i] & btofId) {
00043             if(i == (6+winId*14))  m_btofHitMap[loop+72][winId] = 1;
00044             if(i == (10+winId*14)) m_btofHitMap[loop+72+88][winId] = 1;
00045           }
00046         }
00047       }
00048       else {
00049         for(uint32_t btofId = 1,loop = 0; loop < 24; btofId <<=1,loop++) {
00050           if(data[i] & btofId) {
00051             if(i >= (7+winId*14) && i <= (9+winId*14)) m_btofHitMap[loop+(9+winId*14-i)*24][winId] = 1;
00052             else m_btofHitMap[loop+(13+winId*14-i)*24+88][winId] = 1;
00053           }
00054         }
00055       }
00056     }
00057 
00058     //DW7-DW8 for east end cap hits
00059     if(i>=(4+winId*14) && i<=(5+winId*14)) {
00060       for(uint32_t eetofId = 1,loop = 0; loop < 24; eetofId <<=1,loop++) {
00061         if(data[i] & eetofId)  m_eetofHitMap[loop+(5+winId*14-i)*24][winId] = 1; 
00062       }
00063     }
00064 
00065     //DW5-DW6 for east end cap hits
00066     if(i>=(2+winId*14) && i<=(3+winId*14)) {
00067       for(uint32_t wetofId = 1,loop = 0; loop < 24; wetofId <<=1,loop++) {
00068         if(data[i] & wetofId) m_wetofHitMap[loop+(3+winId*14-i)*24][winId] = 1;
00069       }
00070     }
00071   }
00072 }

Generated on Tue Nov 29 23:11:43 2016 for BOSS_7.0.2 by  doxygen 1.4.7