#ifndef __JTRIGGERTESTKIT__ #define __JTRIGGERTESTKIT__ #include "TRandom3.h" #include "JTrigger/JTriggerParameters.hh" #include "JMath/JRandom.hh" /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { using JMATH::getRandom; /** * Randomize trigger parameters. * * \param p pointer to valid object */ inline void randomize(JTrigger3DMuon_t::JParameters* p) { p->enabled = getRandom(); p->numberOfHits = getRandom(1, 10); p->numberOfModules = getRandom(1, 10); p->DMax_m = getRandom( 0.0, 999.0, 1.0); p->roadWidth_m = getRandom(50.0, 250.0, 1.0); p->gridAngle_deg = getRandom( 1.0, 10.0, 1.0); p->TMaxExtra_ns = getRandom(10.0, 50.0, 1.0); p->factoryLimit = getRandom(100, 200); } /** * Randomize trigger parameters. * * \param p pointer to valid object */ inline void randomize(JTrigger3DShower_t::JParameters* p) { p->enabled = getRandom(); p->numberOfHits = getRandom(1, 10); p->numberOfModules = getRandom(1, 10); p->DMax_m = getRandom( 0.0, 999.0, 1.0); p->TMaxExtra_ns = getRandom(10.0, 50.0, 1.0); p->factoryLimit = getRandom(100, 200); } /** * Randomize trigger parameters. * * \param p pointer to valid object */ inline void randomize(JTriggerMXShower_t::JParameters* p) { p->enabled = getRandom(); p->numberOfHits = getRandom(1, 10); p->numberOfModules = getRandom(1, 10); p->DMax_m = getRandom( 0.0, 999.0, 1.0); p->TMaxExtra_ns = getRandom(10.0, 50.0, 1.0); p->factoryLimit = getRandom(100, 200); } /** * Randomize trigger parameters. * * \param p pointer to valid object */ inline void randomize(JTriggerNB_t::JParameters* p) { p->enabled = getRandom(); p->pmts.clear(); for (int i = getRandom(1, 10); i != 0; --i) { p->pmts.push_back(JPMTIdentifier_t(getRandom(-1, 100), getRandom(-1, 30))); } } /** * Randomize trigger parameters. * * \param p pointer to valid object */ inline void randomize(JTriggerParameters* p) { p->highRateVeto_Hz = getRandom(1.0e3, 1.0e4, 1.0); p->L2Min = getRandom(2, 3); p->ctMin = getRandom( -1.0, +1.0, 0.1); p->TMaxLocal_ns = getRandom( 10.0, 20.0, 1.0); p->TMaxEvent_ns = getRandom(100.0, 999.0, 1.0); p->numberOfBins = getRandom(100, 1000); p->combineL1 = getRandom(); p->trigger3DMuon = getRandom(); p->trigger3DShower = getRandom(); p->triggerMXShower = getRandom(); p->triggerNB = getRandom(); p->writeSummary = getRandom(0, 100); p->writeL0 = getRandom(0, 100); p->writeL1 = getRandom(0, 100); p->writeL2 = getRandom(0, 100); p->writeSN = getRandom(0, 100); } } #endif