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

In This Package:

RpcValidTag.cc
Go to the documentation of this file.
00001 #include "RpcValidTag.h"
00002 #include "LafKernel/PhyEvent.h"
00003 #include "LafKernel/ToolFactory.h"
00004 #include <algorithm>
00005 #include <fstream>
00006 
00007 DECLARE_TOOL(RpcValidTag);
00008 
00009 RpcValidTag::RpcValidTag(const std::string& name)
00010     : ITagBase(name),
00011       m_notValid(false),
00012       m_fileNum(-1)
00013 {
00014     std::string  listname;
00015     setOption("GoodFileList", listname);
00016 
00017     std::string  fname;
00018     std::ifstream  fs(listname.c_str());
00019     while ( (fs>>fname).good() ) {
00020         m_vFlist.push_back(fname);
00021     }
00022 }
00023 
00024 RpcValidTag::~RpcValidTag()
00025 {
00026 }
00027 
00028 bool RpcValidTag::tag(PhyEvent* event)
00029 {
00030     if ( event->m_det != 7 )  return false;  //not RPC event
00031 
00032     if ( m_fileNum != event->m_fileNum ) {
00033         m_fileNum = event->m_fileNum;
00034         std::vector<std::string>::iterator itf =
00035             std::find(m_vFlist.begin(), m_vFlist.end(), event->getFileName());
00036         m_notValid = (itf == m_vFlist.end());
00037     }
00038     return m_notValid;
00039 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:56 for SelCycler by doxygen 1.7.4