#include <TsESumTriggerTool.h>
Inheritance diagram for TsESumTriggerTool:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
TsESumTriggerTool (const std::string &type, const std::string &name, const IInterface *parent) | |
virtual | ~TsESumTriggerTool () |
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 Member Functions | |
virtual StatusCode | fillTriggers (DayaBay::SimTrigHeader *trigHeader, const DayaBay::ElecHeader &elecHeader) |
double | getULThreshold (DayaBay::Detector det) |
double | getDTThreshold (DayaBay::Detector det) |
int | getDigitalValue (double analogThresh) |
DayaBay::Trigger::TriggerType_t | getTriggerType (DayaBay::Detector det) |
Private Attributes | |
unsigned int | m_recoveryCycles |
double | m_ADThreshold |
double | m_FarIWSThreshold |
double | m_FarOWSThreshold |
double | m_NearIWSThreshold |
double | m_NearOWSThreshold |
std::map< std::string, double > | m_UpperLowerThresholdMap |
std::map< std::string, double > | m_TotalDigitalThresholdMap |
std::vector< std::string > | m_detectorsToProcess |
Definition at line 28 of file TsESumTriggerTool.h.
TsESumTriggerTool::TsESumTriggerTool | ( | const std::string & | type, | |
const std::string & | name, | |||
const IInterface * | parent | |||
) |
Definition at line 16 of file TsESumTriggerTool.cc.
00019 : GaudiTool(type,name,parent) 00020 { 00021 declareInterface< ITsTriggerTool >(this) ; 00022 // for now add all but RPC's as default. 00023 m_detectorsToProcess.push_back("DayaBayAD1"); 00024 m_detectorsToProcess.push_back("DayaBayAD2"); 00025 m_detectorsToProcess.push_back("DayaBayIWS"); 00026 m_detectorsToProcess.push_back("DayaBayOWS"); 00027 m_detectorsToProcess.push_back("LingAoAD1"); 00028 m_detectorsToProcess.push_back("LingAoAD2"); 00029 m_detectorsToProcess.push_back("LingAoIWS"); 00030 m_detectorsToProcess.push_back("LingAoOWS"); 00031 m_detectorsToProcess.push_back("FarAD1"); 00032 m_detectorsToProcess.push_back("FarAD2"); 00033 m_detectorsToProcess.push_back("FarAD3"); 00034 m_detectorsToProcess.push_back("FarAD4"); 00035 m_detectorsToProcess.push_back("FarIWS"); 00036 m_detectorsToProcess.push_back("FarOWS"); 00037 00038 m_UpperLowerThresholdMap["DayaBayAD1"]=DayaBay::Trigger::kADESumThreshold; 00039 m_UpperLowerThresholdMap["DayaBayAD2"]=DayaBay::Trigger::kADESumThreshold; 00040 m_UpperLowerThresholdMap["DayaBayIWS"]=DayaBay::Trigger::kNearIWSESumThreshold; 00041 m_UpperLowerThresholdMap["DayaBayOWS"]=DayaBay::Trigger::kNearOWSESumThreshold; 00042 m_UpperLowerThresholdMap["LingAoAD1"]=DayaBay::Trigger::kADESumThreshold; 00043 m_UpperLowerThresholdMap["LingAoAD2"]=DayaBay::Trigger::kADESumThreshold; 00044 m_UpperLowerThresholdMap["LingAoIWS"]=DayaBay::Trigger::kNearIWSESumThreshold; 00045 m_UpperLowerThresholdMap["LingAoOWS"]=DayaBay::Trigger::kNearOWSESumThreshold; 00046 m_UpperLowerThresholdMap["FarAD1"]=DayaBay::Trigger::kADESumThreshold; 00047 m_UpperLowerThresholdMap["FarAD2"]=DayaBay::Trigger::kADESumThreshold; 00048 m_UpperLowerThresholdMap["FarAD3"]=DayaBay::Trigger::kADESumThreshold; 00049 m_UpperLowerThresholdMap["FarAD4"]=DayaBay::Trigger::kADESumThreshold; 00050 m_UpperLowerThresholdMap["FarIWS"]=DayaBay::Trigger::kFarIWSESumThreshold; 00051 m_UpperLowerThresholdMap["FarOWS"]=DayaBay::Trigger::kFarOWSESumThreshold; 00052 00053 m_TotalDigitalThresholdMap["DayaBayAD1"]=DayaBay::Trigger::kADESumThreshold; 00054 m_TotalDigitalThresholdMap["DayaBayAD2"]=DayaBay::Trigger::kADESumThreshold; 00055 m_TotalDigitalThresholdMap["DayaBayIWS"]=DayaBay::Trigger::kNearIWSESumThreshold; 00056 m_TotalDigitalThresholdMap["DayaBayOWS"]=DayaBay::Trigger::kNearOWSESumThreshold; 00057 m_TotalDigitalThresholdMap["LingAoAD1"]=DayaBay::Trigger::kADESumThreshold; 00058 m_TotalDigitalThresholdMap["LingAoAD2"]=DayaBay::Trigger::kADESumThreshold; 00059 m_TotalDigitalThresholdMap["LingAoIWS"]=DayaBay::Trigger::kNearIWSESumThreshold; 00060 m_TotalDigitalThresholdMap["LingAoOWS"]=DayaBay::Trigger::kNearOWSESumThreshold; 00061 m_TotalDigitalThresholdMap["FarAD1"]=DayaBay::Trigger::kADESumThreshold; 00062 m_TotalDigitalThresholdMap["FarAD2"]=DayaBay::Trigger::kADESumThreshold; 00063 m_TotalDigitalThresholdMap["FarAD3"]=DayaBay::Trigger::kADESumThreshold; 00064 m_TotalDigitalThresholdMap["FarAD4"]=DayaBay::Trigger::kADESumThreshold; 00065 m_TotalDigitalThresholdMap["FarIWS"]=DayaBay::Trigger::kFarIWSESumThreshold; 00066 m_TotalDigitalThresholdMap["FarOWS"]=DayaBay::Trigger::kFarOWSESumThreshold; 00067 00068 00069 declareProperty("DetectorsToProcess",m_detectorsToProcess, 00070 "List of detectors to process with this tool"); 00071 declareProperty("RecoveryTime",m_recoveryCycles=20, 00072 "Number of esum (200 MHz) clock cycles for trigger dead time"); 00073 declareProperty("UpperLowerThresholdMap",m_UpperLowerThresholdMap, 00074 "Map indexed by detector name with value of Thrshold in volts"); 00075 declareProperty("DigitalTotalThresholdMap",m_TotalDigitalThresholdMap, 00076 "Map indexed by detector name with value of Thrshold in volts"); 00077 }
TsESumTriggerTool::~TsESumTriggerTool | ( | ) | [virtual] |
StatusCode TsESumTriggerTool::mutate | ( | DayaBay::SimTrigHeader * | trigHeader, | |
const DayaBay::ElecHeader & | elecHeader | |||
) | [virtual] |
Modify the event.
Implements ITsTriggerTool.
Definition at line 287 of file TsESumTriggerTool.cc.
00289 { 00290 return fillTriggers(trigHeader,elecHeader); 00291 }
StatusCode TsESumTriggerTool::initialize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 81 of file TsESumTriggerTool.cc.
00082 { 00083 std::vector<std::string>::iterator it; 00084 00085 // loop over detectors 00086 for(it = m_detectorsToProcess.begin(); 00087 it != m_detectorsToProcess.end(); 00088 ++it){ 00089 short int detId = DayaBay::Detector::siteDetPackedFromString(*it); 00090 DayaBay::Detector det(detId); 00091 info() << det 00092 << " is setup with Upper Lower threshold " 00093 << getULThreshold(det) 00094 << endreq; 00095 info() << det 00096 << " is setup with Digital Total threshold " 00097 << getDTThreshold(det) 00098 << endreq; 00099 } 00100 00101 return StatusCode::SUCCESS; 00102 }
StatusCode TsESumTriggerTool::finalize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 104 of file TsESumTriggerTool.cc.
00105 { 00106 return StatusCode::SUCCESS; 00107 }
StatusCode TsESumTriggerTool::fillTriggers | ( | DayaBay::SimTrigHeader * | trigHeader, | |
const DayaBay::ElecHeader & | elecHeader | |||
) | [private, virtual] |
Definition at line 109 of file TsESumTriggerTool.cc.
00111 { 00112 debug() << "running fillTriggers()" << endreq; 00113 DayaBay::SimTrigCommandHeader* trigCH 00114 = const_cast<DayaBay::SimTrigCommandHeader*>(trigHeader->commandHeader()); 00115 00116 const DayaBay::ElecCrateHeader* crateHeader = elecHeader.crateHeader(); 00117 DayaBay::ElecCrateHeader::CrateMap cmap = crateHeader->crates(); 00118 DayaBay::ElecCrateHeader::CrateMap::iterator detIterator; 00119 00120 std::vector<std::string>::iterator it; 00121 debug() << "processing " << m_detectorsToProcess.size() 00122 << " detectors." << endreq; 00123 00124 // loop over detectors 00125 for(it = m_detectorsToProcess.begin(); 00126 it != m_detectorsToProcess.end(); 00127 ++it){ 00128 short int detId = DayaBay::Detector::siteDetPackedFromString(*it); 00129 DayaBay::Detector det(detId); 00130 verbose() << "Processing " << *it << " which is " << det << endreq; 00131 00132 const DayaBay::SimTrigCommandHeader::detCollMap trigCollMap = trigCH->collections(); 00133 00134 00135 detIterator = cmap.find(det); 00136 if(detIterator != cmap.end()){ 00137 // A crate was found for this detector 00138 debug() << "A crate was found for " << det 00139 << " processing..." << endreq; 00140 00141 DayaBay::SimTrigCommandCollection *tcc = 0; 00142 if( trigCollMap.find(det) == trigCollMap.end() ){ 00143 tcc = new DayaBay::SimTrigCommandCollection(); 00144 tcc->setHeader(trigCH); 00145 tcc->setDetector(det); 00146 trigCH->addCollection(tcc); 00147 } 00148 00149 00150 // Get the crate from the header object 00151 DayaBay::ElecFeeCrate *crate 00152 = dynamic_cast<DayaBay::ElecFeeCrate*>(cmap[det]); 00153 00154 // get esum hits... 00155 DayaBay::AnalogSignal& upperEsum = crate->esumUpper(); 00156 DayaBay::AnalogSignal& lowerEsum = crate->esumLower(); 00157 DayaBay::AnalogSignal& totalEsum = crate->esumTotal(); 00158 DayaBay::DigitalSignal& totalAdc = crate->esumADC(); 00159 00160 // threshold for upper and lower esums. 00161 double ULthreshold = getULThreshold(det); 00162 00163 // threshold for digital and total esums. 00164 double DTthreshold = getDTThreshold(det); 00165 00166 verbose() << "UL Trigger Threshold " << ULthreshold << endreq; 00167 verbose() << "DT Trigger Threshold " << DTthreshold << endreq; 00168 00169 // 00170 // IN ALL CASES BELOW THE FOLLOWING APPLIES 00171 // 00172 // convert the esum clock to the next Nhit clock cycle 00173 // for the trigger command. by default this will report the 00174 // 200MHz esum clock to a 80 MHz adc clock cycle so it's 00175 // properly handeled by the readout. 00176 // 2*(1 + (previous ADC cycle)) --> trigger reported at next 80 MHz 00177 // clock cycle 00178 // The Esum Triggers are checked at 40MHz but ReadoutSim expectes them 00179 // to be reported at 80MHz, so its calculate at 40 then doubled 00180 // to 80. 00181 // 00182 00183 // Do upperEsumTriggers 00184 00185 for( unsigned int i = 0; i < upperEsum.size() ; ++i ) 00186 { 00187 if ( upperEsum[i] >= ULthreshold ) 00188 { 00189 DayaBay::Trigger::TriggerType_t type = getTriggerType(det); 00190 type = DayaBay::Trigger::TriggerType_t(type | DayaBay::Trigger::kESumLow); 00191 00192 unsigned int trigcycle = 2* ( 1 + 00193 (i * DayaBay::AdcCycles) / (DayaBay::EsumCycles) ); 00194 DayaBay::SimTrigCommand *tc = 00195 new DayaBay::SimTrigCommand(det,type,trigcycle,0,totalAdc[i],DayaBay::ESumComp::kESumHigh); 00196 debug() << "Adding Upper Esum Trigger at cycle\t" << i 00197 << " With type " << type 00198 << " \n\t Nhit clock cycle: " << trigcycle 00199 << " \n\t Esum clock cycle: " << i << endreq; 00200 verbose() << "Waiting " << m_recoveryCycles 00201 << " cycles to recover" << endreq; 00202 i += m_recoveryCycles; 00203 trigCH->addCommand(tc); 00204 00205 } 00206 } 00207 00208 // Do lowerEsumTriggers 00209 00210 for( unsigned int i = 0; i < lowerEsum.size() ; ++i ) 00211 { 00212 if ( lowerEsum[i] >= ULthreshold ) 00213 { 00214 DayaBay::Trigger::TriggerType_t type = getTriggerType(det); 00215 type = DayaBay::Trigger::TriggerType_t( DayaBay::Trigger::kESumHigh); 00216 00217 unsigned int trigcycle = 2* ( 1 + 00218 (i * DayaBay::AdcCycles) / (DayaBay::EsumCycles) ); 00219 DayaBay::SimTrigCommand *tc = 00220 new DayaBay::SimTrigCommand(det,type,trigcycle,0,totalAdc[i],DayaBay::ESumComp::kESumLow); 00221 debug() << "Adding Lower Esum Trigger at cycle\t" << i 00222 << " With type " << type 00223 << " \n\t Nhit clock cycle: " << trigcycle 00224 << " \n\t Esum clock cycle: " << i << endreq; 00225 verbose() << "Waiting " << m_recoveryCycles 00226 << " cycles to recover" << endreq; 00227 i += m_recoveryCycles; 00228 trigCH->addCommand(tc); 00229 00230 } 00231 } 00232 00233 // Do TotalEsumTriggers 00234 for( unsigned int i = 0; i < totalEsum.size() ; ++i ) 00235 { 00236 if ( totalEsum[i] >= DTthreshold ) 00237 { 00238 DayaBay::Trigger::TriggerType_t type = getTriggerType(det); 00239 type = DayaBay::Trigger::TriggerType_t(DayaBay::Trigger::kESumAll); 00240 00241 unsigned int trigcycle = 2* ( 1 + 00242 (i * DayaBay::AdcCycles) / (DayaBay::EsumCycles) ); 00243 DayaBay::SimTrigCommand *tc = 00244 new DayaBay::SimTrigCommand(det,type,trigcycle,0,totalAdc[i],DayaBay::ESumComp::kESumTotal); 00245 debug() << "Adding Total Esum Trigger at cycle\t" << i 00246 << " With type " << type 00247 << " \n\t Nhit clock cycle: " << trigcycle 00248 << " \n\t Esum clock cycle: " << i << endreq; 00249 verbose() << "Waiting " << m_recoveryCycles 00250 << " cycles to recover" << endreq; 00251 i += m_recoveryCycles; 00252 trigCH->addCommand(tc); 00253 00254 } 00255 } 00256 00257 // Do DigitalEsumTriggers 00258 for( unsigned int i = 0; i < totalAdc.size() ; ++i ) 00259 { 00260 if ( totalAdc[i] >= getDigitalValue(DTthreshold) ) 00261 { 00262 DayaBay::Trigger::TriggerType_t type = getTriggerType(det); 00263 type = DayaBay::Trigger::TriggerType_t(DayaBay::Trigger::kESumADC); 00264 00265 unsigned int trigcycle = 2* ( 1 + 00266 (i * DayaBay::AdcCycles) / (DayaBay::EsumCycles) ); 00267 DayaBay::SimTrigCommand *tc = 00268 new DayaBay::SimTrigCommand(det,type,trigcycle,0,totalAdc[i],0); 00269 debug() << "Adding ADC Esum Trigger at cycle\t" << i 00270 << " With type " << type 00271 << " \n\t Nhit clock cycle: " << trigcycle 00272 << " \n\t Esum clock cycle: " << i << endreq; 00273 verbose() << "Waiting " << m_recoveryCycles 00274 << " cycles to recover" << endreq; 00275 i += m_recoveryCycles; 00276 trigCH->addCommand(tc); 00277 00278 } 00279 } 00280 00281 }// end if crate exists 00282 } 00283 return StatusCode::SUCCESS; 00284 }
double TsESumTriggerTool::getULThreshold | ( | DayaBay::Detector | det | ) | [private] |
Definition at line 296 of file TsESumTriggerTool.cc.
00296 { 00297 if( m_UpperLowerThresholdMap.find(det.detName()) 00298 != m_UpperLowerThresholdMap.end() ){ 00299 return m_UpperLowerThresholdMap[det.detName()]; 00300 } 00301 warning() << "Requesting a esum threshold for " << det.detName() 00302 << " but none was specified in imput map " << endreq; 00303 warning() << "Using default value as defined in Conventions/Trigger.h" 00304 << endreq; 00305 if(det.detectorId() == DetectorId::kAD1 || 00306 det.detectorId() == DetectorId::kAD2 || 00307 det.detectorId() == DetectorId::kAD3 || 00308 det.detectorId() == DetectorId::kAD4 ){ 00309 return DayaBay::Trigger::kADESumThreshold; 00310 } 00311 if(det.detectorId() == DetectorId::kIWS){ 00312 if(det.site() == Site::kFar){ 00313 return DayaBay::Trigger::kFarIWSESumThreshold; 00314 }else{ 00315 return DayaBay::Trigger::kNearIWSESumThreshold; 00316 } 00317 } 00318 if(det.detectorId() == DetectorId::kOWS){ 00319 if(det.site() == Site::kFar){ 00320 return DayaBay::Trigger::kFarOWSESumThreshold; 00321 }else{ 00322 return DayaBay::Trigger::kNearOWSESumThreshold; 00323 } 00324 } 00325 return 0.0; 00326 }
double TsESumTriggerTool::getDTThreshold | ( | DayaBay::Detector | det | ) | [private] |
Definition at line 328 of file TsESumTriggerTool.cc.
00328 { 00329 if( m_TotalDigitalThresholdMap.find(det.detName()) 00330 != m_TotalDigitalThresholdMap.end() ){ 00331 return m_TotalDigitalThresholdMap[det.detName()]; 00332 } 00333 00334 warning() << "Requesting a esum threshold for " << det.detName() 00335 << " but none was specified in imput map " << endreq; 00336 warning() << "Using default value as defined in Conventions/Trigger.h" 00337 << endreq; 00338 00339 if(det.detectorId() == DetectorId::kAD1 || 00340 det.detectorId() == DetectorId::kAD2 || 00341 det.detectorId() == DetectorId::kAD3 || 00342 det.detectorId() == DetectorId::kAD4 ){ 00343 return DayaBay::Trigger::kADESumThreshold; 00344 } 00345 if(det.detectorId() == DetectorId::kIWS){ 00346 if(det.site() == Site::kFar){ 00347 return DayaBay::Trigger::kFarIWSESumThreshold; 00348 }else{ 00349 return DayaBay::Trigger::kNearIWSESumThreshold; 00350 } 00351 } 00352 if(det.detectorId() == DetectorId::kOWS){ 00353 if(det.site() == Site::kFar){ 00354 return DayaBay::Trigger::kFarOWSESumThreshold; 00355 }else{ 00356 return DayaBay::Trigger::kNearOWSESumThreshold; 00357 } 00358 } 00359 return 0.0; 00360 }
int TsESumTriggerTool::getDigitalValue | ( | double | analogThresh | ) | [private] |
Definition at line 374 of file TsESumTriggerTool.cc.
00374 { 00375 analogThresh=0; // yes compliler I am used, please don't warn me. 00376 return 4095; // essentially turn it off right now 00377 //return (unsigned int) analogThresh; 00378 }
DayaBay::Trigger::TriggerType_t TsESumTriggerTool::getTriggerType | ( | DayaBay::Detector | det | ) | [private] |
Definition at line 362 of file TsESumTriggerTool.cc.
00362 { 00363 DayaBay::Trigger::TriggerType_t type = DayaBay::Trigger::kUnknown; 00364 if(det.detectorId() == DetectorId::kAD1) type = DayaBay::Trigger::kAD1; 00365 if(det.detectorId() == DetectorId::kAD2) type = DayaBay::Trigger::kAD2; 00366 if(det.detectorId() == DetectorId::kAD3) type = DayaBay::Trigger::kAD3; 00367 if(det.detectorId() == DetectorId::kAD4) type = DayaBay::Trigger::kAD4; 00368 if(det.detectorId() == DetectorId::kIWS) type = DayaBay::Trigger::kIWS; 00369 if(det.detectorId() == DetectorId::kOWS) type = DayaBay::Trigger::kOWS; 00370 if( type == DayaBay::Trigger::kUnknown) return type; 00371 return DayaBay::Trigger::TriggerType_t(DayaBay::Trigger::kESum | type); 00372 }
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 TsESumTriggerTool::m_recoveryCycles [private] |
Definition at line 45 of file TsESumTriggerTool.h.
double TsESumTriggerTool::m_ADThreshold [private] |
Definition at line 47 of file TsESumTriggerTool.h.
double TsESumTriggerTool::m_FarIWSThreshold [private] |
Definition at line 48 of file TsESumTriggerTool.h.
double TsESumTriggerTool::m_FarOWSThreshold [private] |
Definition at line 49 of file TsESumTriggerTool.h.
double TsESumTriggerTool::m_NearIWSThreshold [private] |
Definition at line 50 of file TsESumTriggerTool.h.
double TsESumTriggerTool::m_NearOWSThreshold [private] |
Definition at line 51 of file TsESumTriggerTool.h.
std::map<std::string,double> TsESumTriggerTool::m_UpperLowerThresholdMap [private] |
Definition at line 53 of file TsESumTriggerTool.h.
std::map<std::string,double> TsESumTriggerTool::m_TotalDigitalThresholdMap [private] |
Definition at line 54 of file TsESumTriggerTool.h.
std::vector<std::string> TsESumTriggerTool::m_detectorsToProcess [private] |
Definition at line 59 of file TsESumTriggerTool.h.