| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

TsExternalTriggerTool Class Reference

#include <TsExternalTriggerTool.h>

Inheritance diagram for TsExternalTriggerTool:

[legend]
Collaboration diagram for TsExternalTriggerTool:
[legend]
List of all members.

Public Types

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  Status

Public Member Functions

 TsExternalTriggerTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TsExternalTriggerTool ()
virtual StatusCode mutate (DayaBay::SimTrigHeader *trigHeader, const DayaBay::ElecHeader &elecHeader)
 Modify the event.
virtual StatusCode initialize ()
virtual StatusCode finalize ()
INTupleSvcntupleSvc () const
INTupleSvcevtColSvc () const
IDataProviderSvcdetSvc () const
IDataProviderSvcevtSvc () const
IIncidentSvcincSvc () const
IChronoStatSvcchronoSvc () const
IHistogramSvchistoSvc () const
IAlgContextSvccontextSvc () const
DataObjectput (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
DataObjectput (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
IUpdateManagerSvcupdMgrSvc () const
IDataProviderSvcfastContainersSvc () 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
MsgStreammsgStream (const MSG::Level level) const
MsgStreamalways () const
MsgStreamfatal () const
MsgStreamerr () const
MsgStreamerror () const
MsgStreamwarning () const
MsgStreaminfo () const
MsgStreamdebug () const
MsgStreamverbose () const
MsgStreammsg () const
const Statisticscounters () const
StatEntitycounter (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 IInterfaceparent () 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 PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
virtual const std::vector<
Property * > & 
getProperties () const
PropertyMgrgetPropertyMgr ()
ISvcLocatorserviceLocator () const
ISvcLocatorsvcLoc () const
IMessageSvcmsgSvc () const
IToolSvctoolSvc () 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 *)
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
IAuditorSvcauditorSvc () const
IMonitorSvcmonitorSvc () 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 IInterfaceparent () 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 InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
 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< ServiceEntryServices

Protected Member Functions

StatusCode releaseTool (const IAlgTool *tool) const
StatusCode releaseSvc (const IInterface *svc) const
int outputLevel () const
virtual unsigned long refCount () const
IntegerPropertyoutputLevelProperty ()
void initOutputLevel (Property &prop)

Static Protected Attributes

static const bool IgnoreRootInTES
static const bool UseRootInTES

Private Member Functions

DayaBay::Trigger::TriggerType_t getTriggerType (DayaBay::Detector det)

Private Attributes

std::vector< std::string > m_detectorsToProcess
int m_triggerOffset
double m_frequency
bool m_autoSet

Detailed Description

Definition at line 28 of file TsExternalTriggerTool.h.


Constructor & Destructor Documentation

TsExternalTriggerTool::TsExternalTriggerTool ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Definition at line 13 of file TsExternalTriggerTool.cc.

00016     : GaudiTool(type,name,parent)
00017 {
00018   declareInterface< ITsTriggerTool >(this) ;
00019   // for now add all but RPC's as default.
00020   m_detectorsToProcess.push_back("DayaBayAD1");
00021   m_detectorsToProcess.push_back("DayaBayAD2");
00022   m_detectorsToProcess.push_back("DayaBayIWS");
00023   m_detectorsToProcess.push_back("DayaBayOWS");
00024   m_detectorsToProcess.push_back("LingAoAD1");
00025   m_detectorsToProcess.push_back("LingAoAD2");
00026   m_detectorsToProcess.push_back("LingAoIWS");
00027   m_detectorsToProcess.push_back("LingAoOWS"); 
00028   m_detectorsToProcess.push_back("FarAD1");
00029   m_detectorsToProcess.push_back("FarAD2");
00030   m_detectorsToProcess.push_back("FarAD3");
00031   m_detectorsToProcess.push_back("FarAD4");
00032   m_detectorsToProcess.push_back("FarIWS");
00033   m_detectorsToProcess.push_back("FarOWS");
00034   
00035   declareProperty("DetectorsToProcess",m_detectorsToProcess,
00036                   "List of detectors to process with this tool");
00037   declareProperty("TriggerOffset",m_triggerOffset=24,
00038                   "Adjustable trigger offset for external triggering, in trigger clock cycles");
00039   declareProperty("Frequency",m_frequency=1.0*CLHEP::hertz,
00040                   "Frequency of external triggering");
00041   declareProperty("AutoSet",m_autoSet=true,
00042                   "Auto-set the external triggering based on electronics simulation input");
00043 }

TsExternalTriggerTool::~TsExternalTriggerTool (  )  [virtual]

Definition at line 45 of file TsExternalTriggerTool.cc.

00045 {}


Member Function Documentation

StatusCode TsExternalTriggerTool::mutate ( DayaBay::SimTrigHeader trigHeader,
const DayaBay::ElecHeader elecHeader 
) [virtual]

Modify the event.

Implements ITsTriggerTool.

Definition at line 57 of file TsExternalTriggerTool.cc.

00059 {     
00060   debug() << "running mutate()" << endreq;
00061   DayaBay::SimTrigCommandHeader* trigCH 
00062      = const_cast<DayaBay::SimTrigCommandHeader*>(trigHeader->commandHeader());
00063   
00064   const DayaBay::ElecCrateHeader* crateHeader = elecHeader.crateHeader();
00065   DayaBay::ElecCrateHeader::CrateMap cmap = crateHeader->crates();
00066   DayaBay::ElecCrateHeader::CrateMap::iterator detIterator;
00067   
00068   std::vector<std::string>::iterator it;
00069   debug() << "processing " << m_detectorsToProcess.size() 
00070           << " detectors." << endreq;
00071   
00072   // loop over detectors 
00073   for(it = m_detectorsToProcess.begin(); 
00074       it != m_detectorsToProcess.end(); 
00075       ++it){
00076     short int detId =  DayaBay::Detector::siteDetPackedFromString(*it);
00077     DayaBay::Detector det(detId);
00078     debug() << "Processing " << *it << " which is " << det << endreq;
00079     
00080     // create and add a triggerCollection for this detector
00081     DayaBay::SimTrigCommandCollection *tcc 
00082       = new DayaBay::SimTrigCommandCollection();
00083     tcc->setHeader(trigCH);
00084     tcc->setDetector(det);
00085     trigCH->addCollection(tcc);
00086     detIterator = cmap.find(det);
00087     if(detIterator != cmap.end()){
00088       // A crate was found for this detector
00089       debug() << "A crate was found for " << det 
00090               << " processing..." << endreq;
00091 
00092       int i = 0;
00093       if(m_autoSet){
00094         i = 0;
00095       }else{
00096         // FIXME: implement non-auto external triggering
00097         error() << "Non-auto external triggering not yet implemented." 
00098                 << endreq;
00099       }
00100       
00101       DayaBay::Trigger::TriggerType_t type = getTriggerType(det);
00102       i += m_triggerOffset;
00103       DayaBay::SimTrigCommand *tc = new DayaBay::SimTrigCommand(det,type,i,0,0,0);
00104       trigCH->addCommand(tc);
00105       debug() << "Adding Trigger at cycle\t" <<  i
00106               << " With type " << type <<  endreq;
00107     }// end if crate exists
00108   }
00109   return StatusCode::SUCCESS;                               
00110 }

StatusCode TsExternalTriggerTool::initialize (  )  [virtual]

Reimplemented from GaudiTool.

Definition at line 47 of file TsExternalTriggerTool.cc.

00048 {
00049   return StatusCode::SUCCESS;
00050 }

StatusCode TsExternalTriggerTool::finalize (  )  [virtual]

Reimplemented from GaudiTool.

Definition at line 52 of file TsExternalTriggerTool.cc.

00053 {
00054   return StatusCode::SUCCESS;
00055 }

DayaBay::Trigger::TriggerType_t TsExternalTriggerTool::getTriggerType ( DayaBay::Detector  det  )  [private]

Definition at line 112 of file TsExternalTriggerTool.cc.

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 }


Member Data Documentation

std::vector<std::string> TsExternalTriggerTool::m_detectorsToProcess [private]

Definition at line 44 of file TsExternalTriggerTool.h.

int TsExternalTriggerTool::m_triggerOffset [private]

Definition at line 45 of file TsExternalTriggerTool.h.

double TsExternalTriggerTool::m_frequency [private]

Definition at line 46 of file TsExternalTriggerTool.h.

bool TsExternalTriggerTool::m_autoSet [private]

Definition at line 47 of file TsExternalTriggerTool.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:50:04 2011 for TrigSim by doxygen 1.4.7