11 #include <tracking/modules/pxdDataReduction/ROIGeneratorModule.h>
12 #include <framework/datastore/StoreObjPtr.h>
13 #include <framework/dataobjects/EventMetaData.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <tracking/dataobjects/ROIid.h>
33 setDescription(
"This module is used to generate a certain number of ROIs");
34 setPropertyFlags(c_ParallelProcessingCertified);
36 addParam(
"ROIListName", m_ROIListName,
"name of the list of ROIs", std::string(
""));
37 addParam(
"nROIs", m_nROIs,
"number of generated ROIs", 1);
39 addParam(
"TrigDivider", m_divider,
"Generates one ROI every TrigDivider events", 2);
40 addParam(
"Layer" , m_layer ,
"on layer", 1);
41 addParam(
"Ladder" , m_ladder ,
" ladder " , 1);
42 addParam(
"Sensor" , m_sensor ,
" sensor " , 1);
44 addParam(
"MinU" , m_minU ,
" min U (pixel column hopefully) ", 0);
45 addParam(
"MaxU" , m_maxU ,
" max U (pixel column hopefully) ", 250 - 1);
48 addParam(
"MinV" , m_minV ,
" min V (pixel column hopefully) ", 0);
49 addParam(
"MaxV" , m_maxV ,
" max v (pixel column hopefully) ", 768 - 1);
51 addParam(
"Random" , m_random ,
"dont use fix position, move pseudo randomly",
false);
54 void ROIGeneratorModule::initialize()
57 eventMetaData.isRequired();
60 roiIDs.registerInDataStore(m_ROIListName);
63 void ROIGeneratorModule::event()
69 int tNr = eventMetaDataPtr->getEvent();
72 if (m_divider != 0 && (tNr % m_divider) != 0)
85 int minU = m_minU, maxU = m_maxU, minV = m_minV, maxV = m_maxV;
88 if (m_nROIs == 1 && m_random) {
136 tmp_ROIid.setMinUid(minU);
137 tmp_ROIid.setMinVid(minV);
138 tmp_ROIid.setMaxUid(maxU);
139 tmp_ROIid.setMaxVid(maxV);
140 tmp_ROIid.setSensorID(sensorID);
147 int dU = (m_maxU - m_minU) / (m_nROIs + 1);
148 int dV = (m_maxV - m_minV) / (m_nROIs + 1);
149 for (
int iROI = 1; iROI < m_nROIs; iROI++) {
151 minU = m_minU + dU * iROI;
153 minV = m_minV + dV * iROI;
156 tmp_ROIid.setMinUid(minU);
157 tmp_ROIid.setMinVid(minV);
158 tmp_ROIid.setMaxUid(maxU);
159 tmp_ROIid.setMaxVid(maxV);
160 tmp_ROIid.setSensorID(sensorID);