#ifndef __JTRIGGER__JTRIGGER3DMUON__ #define __JTRIGGER__JTRIGGER3DMUON__ #include "JPhysics/JConstants.hh" #include "JGeometry3D/JOmega3D.hh" #include "JTrigger/JMatch3B.hh" #include "JTrigger/JMatch1D.hh" #include "JTrigger/JTrigger3N.hh" #include "JTrigger/JTrigger3DMuon_t.hh" /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { /** * Muon trigger. */ class JTrigger3DMuon : public JTrigger3N { public: /** * Constructor. * * \param input trigger parameters */ JTrigger3DMuon(const JTrigger3DMuon_t::JParameters& input) : JTrigger3N(getParameters(input)) {} /** * Convert trigger parameters. * * \param input trigger parameters * \return trigger parameters */ static JTrigger3N::JParameters getParameters(const JTrigger3DMuon_t::JParameters& input) { using namespace JPP; const double TMaxEvent_ns = (sqrt((input.DMax_m + input.roadWidth_m*getSinThetaC()) * (input.DMax_m - input.roadWidth_m*getSinThetaC())) + input.roadWidth_m * getSinThetaC() * getTanThetaC()) * getInverseSpeedOfLight(); return JTrigger3N::JParameters(input.enabled, input.numberOfHits, input.numberOfModules, TMaxEvent_ns + input.TMaxExtra_ns, JGEOMETRY3D::JOmega3D(input.gridAngle_deg*PI/180.0), JMatch3B(input.roadWidth_m, input.TMaxExtra_ns), JMatch1D(input.roadWidth_m, input.TMaxExtra_ns), input.factoryLimit); } }; } #endif