9 #include <pxd/modules/pxdSimulation/PXDInjectionVetoEmulatorModule.h>
10 #include <vxd/geometry/GeoCache.h>
11 #include <vxd/geometry/GeoTools.h>
33 setDescription(
"The module emulates the timing for gated mode operation of PXD.");
34 setPropertyFlags(c_ParallelProcessingCertified);
36 addParam(
"PXDIBTimingName", m_PXDIBTimingName,
37 "The name of the StoreObjPtr of generated Injection Bg timing", std::string(
""));
38 addParam(
"minTimePXD", m_minTimePXD,
39 "Minimum time for the first passage of a noise bunch that can deposit charge in the PXD in nano seconds", -20000.0);
40 addParam(
"maxTimePXD", m_maxTimePXD,
41 "Maximum time for the first passage of a noise bunch that can deposit charge in the PXD in nano seconds", -10000.0);
42 addParam(
"noiseBunchRevolutionTime",
43 m_revolutionTime,
"Noise bunch revolution time in ns", 10000.0);
44 addParam(
"pxdGatedModeLumiFraction",
45 m_pxdGatedModeLumiFraction,
"Fraction of events which are affected by PXD gated mode", 0.2);
52 m_storePXDIBTiming.registerInDataStore(m_PXDIBTimingName, DataStore::EStoreFlags::c_ErrorIfAlreadyRegistered);
61 m_storePXDIBTiming.create();
65 int triggerGate = gRandom->Integer(m_nGates);
66 m_storePXDIBTiming->setTriggerGate(triggerGate);
70 if (gRandom->Rndm() < m_pxdGatedModeLumiFraction) {isGated =
true;}
71 m_storePXDIBTiming->setGated(isGated);
77 time = gRandom->Rndm() * (m_maxTimePXD - m_minTimePXD) + m_minTimePXD;
79 m_storePXDIBTiming->getGatingStartTimes().push_back(time);
80 m_storePXDIBTiming->getGatingStartTimes().push_back(time + m_revolutionTime);
81 m_storePXDIBTiming->getGatingStartTimes().push_back(time + 2 * m_revolutionTime);
82 m_storePXDIBTiming->getGatingStartTimes().push_back(time + 3 * m_revolutionTime);
The module produces a StoreObjPtr of PXDInjectionBGTiming containing PXD timing for gated mode operat...
void initialize() override final
Initialize.
void event() override final
Event.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.