|
10 | 10 | #include <ecl/modules/eclCRFinder/ECLCRFinderModule.h> |
11 | 11 |
|
12 | 12 | // FRAMEWORK |
| 13 | +#include <framework/core/Environment.h> |
13 | 14 | #include <framework/gearbox/Unit.h> |
| 15 | +#include <framework/logging/LogConfig.h> |
14 | 16 | #include <framework/logging/Logger.h> |
15 | 17 |
|
16 | 18 | //ECL |
@@ -125,11 +127,17 @@ void ECLCRFinderModule::initialize() |
125 | 127 | m_cellIdToTempCRIdVec.resize(8737); /**< cellid -> CR. */ |
126 | 128 | m_calDigitStoreArrPosition.resize(8737); |
127 | 129 |
|
| 130 | + // Check if we are running this module online |
| 131 | + m_isOnlineProcessing = (Environment::Instance().getRealm() == LogConfig::c_Online) ? true : false; |
| 132 | + if (m_isOnlineProcessing) { |
| 133 | + m_energyCut[1] = 1.5 * Belle2::Unit::MeV; |
| 134 | + m_energyCutBkgd[1] = 1.5 * Belle2::Unit::MeV; |
| 135 | + } |
128 | 136 | } |
129 | 137 |
|
130 | 138 | void ECLCRFinderModule::beginRun() |
131 | 139 | { |
132 | | - ; |
| 140 | + |
133 | 141 | } |
134 | 142 |
|
135 | 143 | void ECLCRFinderModule::event() |
@@ -239,9 +247,14 @@ void ECLCRFinderModule::event() |
239 | 247 |
|
240 | 248 | //------------------------------------------------------- |
241 | 249 | // 'find" in a map is faster if the number of seeds is not too large, can be replaced easily once we know what seed cuts we want. |
| 250 | + // This is weird: if we are running online, we use behaviour that was in place until release-05, |
| 251 | + // otherwise we use the one implemented since release-06 |
| 252 | + // This is fundamental for avoiding a segfault error caused by veeery noisy ECL events, |
| 253 | + // but note it is a temporary fix. |
242 | 254 | for (unsigned int pos = 1; pos < m_cellIdToSeedVec.size(); ++pos) { |
243 | | - if (m_cellIdToSeedVec[pos] > 0 and m_cellIdToCheckVec[pos] == 0) { |
244 | | - m_cellIdToCheckVec[pos] = 1; |
| 255 | + // check for m_isOnlineProcessing is for release-05 behaviour |
| 256 | + if (m_cellIdToSeedVec[pos] > 0 and (m_cellIdToCheckVec[pos] == 0 or m_isOnlineProcessing)) { |
| 257 | + if (!m_isOnlineProcessing) m_cellIdToCheckVec[pos] = 1; // release-06 and newer versions |
245 | 258 | checkNeighbours(pos, m_tempCRId, 0); |
246 | 259 | ++m_tempCRId; // This is just a number, will be replaced by a consecutive number later in this module |
247 | 260 | } |
@@ -332,10 +345,19 @@ void ECLCRFinderModule::checkNeighbours(const int cellid, const int tempcrid, co |
332 | 345 |
|
333 | 346 | B2DEBUG(300, " --> ECLCRFinderModule::checkNeighbours(): m_cellIdToTempCRIdVec[" << neighbour << "] " << |
334 | 347 | m_cellIdToTempCRIdVec[neighbour]); |
335 | | - if (m_cellIdToCheckVec[neighbour] == 0) { // only check again if we have not looked at that digit before |
336 | | - m_cellIdToCheckVec[neighbour] = 1; |
337 | | - checkNeighbours(neighbour, tempcrid, 1); |
338 | | - |
| 348 | + // This is weird: if we are running online, we use behaviour that was in place until release-05, |
| 349 | + // otherwise we use the one implemented since release-06 |
| 350 | + // This is fundamental for avoiding a segfault error caused by veeery noisy ECL events, |
| 351 | + // but note it is a temporary fix. |
| 352 | + if (m_isOnlineProcessing) { // release-05 |
| 353 | + if (m_cellIdToTempCRIdVec[neighbour] == 0) { // found |
| 354 | + checkNeighbours(neighbour, tempcrid, 1); |
| 355 | + } |
| 356 | + } else { // release-06 and newer versions |
| 357 | + if (m_cellIdToCheckVec[neighbour] == 0) { // only check again if we have not looked at that digit before |
| 358 | + m_cellIdToCheckVec[neighbour] = 1; |
| 359 | + checkNeighbours(neighbour, tempcrid, 1); |
| 360 | + } |
339 | 361 | } |
340 | 362 | } |
341 | 363 | } |
|
0 commit comments