#include <TsFilterTool.h>
Inheritance diagram for TsFilterTool:
Public Types | |
| SUCCESS | |
| NO_INTERFACE | |
| VERSMISMATCH | |
| LAST_ERROR | |
| SUCCESS | |
| NO_INTERFACE | |
| VERSMISMATCH | |
| LAST_ERROR | |
| enum | Status |
Public Member Functions | |
| TsFilterTool (const std::string &type, const std::string &name, const IInterface *parent) | |
| virtual | ~TsFilterTool () |
| virtual StatusCode | mutate (DayaBay::SimTrigHeader *trigHeader, const DayaBay::ElecHeader &elecHeader) |
| Modify the event. | |
| virtual StatusCode | initialize () |
| virtual StatusCode | finalize () |
| INTupleSvc * | ntupleSvc () const |
| INTupleSvc * | evtColSvc () const |
| IDataProviderSvc * | detSvc () const |
| IDataProviderSvc * | evtSvc () const |
| IIncidentSvc * | incSvc () const |
| IChronoStatSvc * | chronoSvc () const |
| IHistogramSvc * | histoSvc () const |
| IAlgContextSvc * | contextSvc () const |
| DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
| DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
| Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
| TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
| TYPE * | getDet (const std::string &location) const |
| bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| bool | exist (const std::string &location, const bool useRootInTES=true) const |
| bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
| bool | existDet (const std::string &location) const |
| TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
| TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
| TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
| SERVICE * | svc (const std::string &name, const bool create=true) const |
| IUpdateManagerSvc * | updMgrSvc () const |
| IDataProviderSvc * | fastContainersSvc () const |
| StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
| StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
| StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
| StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| MsgStream & | msgStream (const MSG::Level level) const |
| MsgStream & | always () const |
| MsgStream & | fatal () const |
| MsgStream & | err () const |
| MsgStream & | error () const |
| MsgStream & | warning () const |
| MsgStream & | info () const |
| MsgStream & | debug () const |
| MsgStream & | verbose () const |
| MsgStream & | msg () const |
| const Statistics & | counters () const |
| StatEntity & | counter (const std::string &tag) const |
| MSG::Level | msgLevel () const |
| bool | msgLevel (const MSG::Level level) const |
| void | resetMsgStream () const |
| bool | typePrint () const |
| bool | propsPrint () const |
| bool | statPrint () const |
| bool | errorsPrint () const |
| long | printStat (const MSG::Level level=MSG::ALWAYS) const |
| long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
| long | printProps (const MSG::Level level=MSG::ALWAYS) const |
| void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
| StatusCode | runUpdate () |
| TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
| StatusCode | release (const IInterface *interface) const |
| virtual unsigned long | release () |
| const std::string & | context () const |
| const std::string & | rootInTES () const |
| double | globalTimeOffset () const |
| virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
| virtual unsigned long | addRef () |
| virtual const std::string & | name () const |
| virtual const std::string & | type () const |
| virtual const IInterface * | parent () const |
| virtual StatusCode | configure () |
| virtual StatusCode | start () |
| virtual StatusCode | stop () |
| virtual StatusCode | terminate () |
| virtual StatusCode | reinitialize () |
| virtual StatusCode | restart () |
| virtual Gaudi::StateMachine::State | FSMState () const |
| virtual Gaudi::StateMachine::State | targetFSMState () const |
| virtual StatusCode | sysInitialize () |
| virtual StatusCode | sysStart () |
| virtual StatusCode | sysStop () |
| virtual StatusCode | sysFinalize () |
| virtual StatusCode | sysReinitialize () |
| virtual StatusCode | sysRestart () |
| virtual StatusCode | setProperty (const Property &p) |
| virtual StatusCode | setProperty (const std::string &s) |
| virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
| StatusCode | setProperty (const std::string &name, const TYPE &value) |
| virtual StatusCode | getProperty (Property *p) const |
| virtual const Property & | getProperty (const std::string &name) const |
| virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
| virtual const std::vector< Property * > & | getProperties () const |
| PropertyMgr * | getPropertyMgr () |
| ISvcLocator * | serviceLocator () const |
| ISvcLocator * | svcLoc () const |
| IMessageSvc * | msgSvc () const |
| IToolSvc * | toolSvc () const |
| StatusCode | setProperties () |
| StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const |
| StatusCode | service (const std::string &type, const std::string &name, T *&svc) const |
| void | declInterface (const InterfaceID &, void *) |
| Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
| Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
| IAuditorSvc * | auditorSvc () const |
| IMonitorSvc * | monitorSvc () const |
| void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
| void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
| virtual const std::string & | type () const =0 |
| virtual const IInterface * | parent () const =0 |
| virtual StatusCode | configure ()=0 |
| virtual StatusCode | start ()=0 |
| virtual StatusCode | stop ()=0 |
| virtual StatusCode | terminate ()=0 |
| virtual StatusCode | reinitialize ()=0 |
| virtual StatusCode | restart ()=0 |
| virtual Gaudi::StateMachine::State | FSMState () const =0 |
| virtual StatusCode | sysInitialize ()=0 |
| virtual StatusCode | sysStart ()=0 |
| virtual StatusCode | sysStop ()=0 |
| virtual StatusCode | sysFinalize ()=0 |
| virtual StatusCode | sysReinitialize ()=0 |
| virtual StatusCode | sysRestart ()=0 |
| virtual unsigned long | refCount () const =0 |
| virtual const std::string & | name () const =0 |
| virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
| virtual unsigned long | addRef ()=0 |
| virtual unsigned long | release ()=0 |
Static Public Member Functions | |
| static const InterfaceID & | interfaceID () |
| static const InterfaceID & | interfaceID () |
| static const InterfaceID & | interfaceID () |
| static const InterfaceID & | interfaceID () |
| Retrieve interface ID. | |
Public Attributes | |
| SUCCESS | |
| NO_INTERFACE | |
| VERSMISMATCH | |
| LAST_ERROR | |
Protected Types | |
| typedef std::map< std::string, StatEntity > | Statistics |
| typedef std::map< std::string, unsigned int > | Counter |
| typedef std::vector< IAlgTool * > | AlgTools |
| typedef std::pair< IInterface *, std::string > | ServiceEntry |
| typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
| StatusCode | releaseTool (const IAlgTool *tool) const |
| StatusCode | releaseSvc (const IInterface *svc) const |
| int | outputLevel () const |
| virtual unsigned long | refCount () const |
| IntegerProperty & | outputLevelProperty () |
| void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
| static const bool | IgnoreRootInTES |
| static const bool | UseRootInTES |
Private Attributes | |
| unsigned int | m_recoveryCycles |
| bool | m_active |
Definition at line 28 of file TsFilterTool.h.
| TsFilterTool::TsFilterTool | ( | const std::string & | type, | |
| const std::string & | name, | |||
| const IInterface * | parent | |||
| ) |
Definition at line 14 of file TsFilterTool.cc.
00017 : GaudiTool(type,name,parent) 00018 { 00019 declareInterface< ITsTriggerTool >(this) ; 00020 declareProperty("RecoveryTime",m_recoveryCycles=24, 00021 "Number of nhit (80MHz) clock cycles for trigger dead time"); 00022 declareProperty("ApplyFilter",m_active=false, 00023 "If set to true the tool will filter trigger commands."); 00024 }
| TsFilterTool::~TsFilterTool | ( | ) | [virtual] |
| StatusCode TsFilterTool::mutate | ( | DayaBay::SimTrigHeader * | trigHeader, | |
| const DayaBay::ElecHeader & | elecHeader | |||
| ) | [virtual] |
Modify the event.
Implements ITsTriggerTool.
Definition at line 40 of file TsFilterTool.cc.
00042 { 00043 if ( !m_active ){ 00044 debug() << "TsFilterTool is not active, so doing nothing" << endreq; 00045 return StatusCode::SUCCESS; 00046 } 00047 00048 debug() << "running mutate()" << endreq; 00049 const DayaBay::SimTrigCommandHeader *tch = trigHeader->commandHeader(); 00050 const DayaBay::SimTrigCommandHeader::detCollMap trigCollMap 00051 = tch->collections(); 00052 DayaBay::SimTrigCommandHeader::detCollMap::const_iterator trigIt; 00053 //Loop over All trigger Collections 00054 for(trigIt = trigCollMap.begin(); trigIt != trigCollMap.end(); ++trigIt) 00055 { 00056 DayaBay::Detector det(trigIt->first); 00057 debug() << "found " << (trigIt->second)->commands().size() 00058 << " commands for " << det.detName() << endreq; 00059 00060 DayaBay::SimTrigCommandCollection *triggerColl = 00061 const_cast<DayaBay::SimTrigCommandCollection*>(trigIt->second); 00062 00063 // sort the trigger commands by clock cycle 00064 triggerColl->sort(); 00065 00066 DayaBay::SimTrigCommandCollection::CommandContainer& detTriggers = 00067 const_cast<DayaBay::SimTrigCommandCollection::CommandContainer&>(triggerColl->commands()); 00068 00069 DayaBay::SimTrigCommandCollection::CommandContainer::iterator tcIt; 00070 // Loop over all triggers in each collection 00071 int prevCycle=-1; 00072 for(tcIt=detTriggers.begin();tcIt!=detTriggers.end();/*in loop*/){ 00073 verbose() << "Trigger: " << **tcIt << endreq; 00074 int thiscycle = (*tcIt)->clockCycle(); 00075 if(thiscycle == prevCycle){// combined triggers at same clock cycle 00076 verbose() << "Combining trigger with the previous one" 00077 << **tcIt << endreq; 00078 00079 // combine the triggers 00080 DayaBay::Trigger::TriggerType_t type = (*tcIt)->type(); 00081 tcIt = detTriggers.erase(tcIt); // returns next element 00082 --tcIt; // go back to previous one. 00083 int newtype = (int) (type | (*tcIt)->type()); // update its type 00084 (*tcIt)->setType( (DayaBay::Trigger::TriggerType_t) newtype ); 00085 ++tcIt; // go to command for next pass through for loop 00086 00087 }else if ((unsigned int) (thiscycle-prevCycle) < m_recoveryCycles ){ 00088 00089 // remove triggers within "recovery time" 00090 verbose() << "Removing trigger that occured during recovery window " 00091 << **tcIt << endreq; 00092 tcIt = detTriggers.erase(tcIt); // returns next element 00093 00094 }else{ // leave this one as it is 00095 00096 prevCycle=thiscycle; 00097 ++tcIt; 00098 } 00099 } 00100 verbose() << "Done Filtering. " << *triggerColl << endreq; 00101 } 00102 00103 return StatusCode::SUCCESS; 00104 }
| StatusCode TsFilterTool::initialize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 28 of file TsFilterTool.cc.
00029 { 00030 debug() << "Initializing TsFilterTool" << endreq; 00031 return StatusCode::SUCCESS; 00032 }
| StatusCode TsFilterTool::finalize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 34 of file TsFilterTool.cc.
00035 { 00036 debug() << "Finalizing TsFilterTool" << endreq; 00037 return StatusCode::SUCCESS; 00038 }
| const InterfaceID & ITsTriggerTool::interfaceID | ( | ) | [static, inherited] |
Retrieve interface ID.
Reimplemented from IAlgTool.
Definition at line 8 of file ITsTriggerTool.cc.
00009 { 00010 return IID_ITsTriggerTool; 00011 }
unsigned int TsFilterTool::m_recoveryCycles [private] |
Definition at line 44 of file TsFilterTool.h.
bool TsFilterTool::m_active [private] |
Definition at line 45 of file TsFilterTool.h.
1.4.7