/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GeneralMuonTag.cc
Go to the documentation of this file.
00001 #include "GeneralMuonTag.h"
00002 #include "LafKernel/PhyEvent.h"
00003 #include "LafKernel/ToolFactory.h"
00004 
00005 DECLARE_TOOL(GeneralMuonTag);
00006 
00007 GeneralMuonTag::GeneralMuonTag(const std::string& name)
00008     : IFanTagBase(),
00009       ToolBase(name)
00010 {
00011     setOption("CoincWindow", m_window = 2e-6);
00012 }
00013 
00014 bool GeneralMuonTag::tag(PhyEventBuf *buf)
00015 {
00016     static const std::string ukey = "TotalE";
00017 
00018     PhyEvent* event = buf->curEvt();
00019 
00020     if ( (!event->isRPC()) && event->m_userTag.find(ukey) == event->m_userTag.end() ) {
00021         unsigned int dflag = 1<<(event->m_det);
00022         float totalE = event->isAD() ? event->energy() : event->m_nPESum*2.5;
00023         PhyEventBuf::Iterator it = buf->current();
00024         while ( ++it < buf->end() ) {
00025             PhyEvent* _evt = *it;
00026             if ( (_evt->m_trigTime - event->m_trigTime) > m_window ) break;
00027             //criterions
00028             if ( ! _evt->isRPC() ) {
00029                 unsigned int dindex = 1<<(_evt->m_det);
00030                 if ( (dflag&dindex) == 0 ) {
00031                     totalE += _evt->isAD() ? _evt->energy() : _evt->m_nPESum*2.5;
00032                     dflag &= dindex;
00033                 }
00034                 _evt->m_userTag[ukey] = -1.0;
00035             }
00036         }
00037         event->m_userTag[ukey] = totalE;
00038     }
00039 
00040     return false;
00041 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:53 for FanCycler by doxygen 1.7.4