9 #include <ecl/modules/eclFillCellIdMapping/eclFillCellIdMappingModule.h>
11 #include <ecl/dataobjects/ECLCellIdMapping.h>
12 #include <ecl/dataobjects/ECLCalDigit.h>
14 #include <ecl/geometry/ECLNeighbours.h>
15 #include <ecl/geometry/ECLGeometryPar.h>
17 #include <framework/geometry/B2Vector3.h>
34 setDescription(
"Fills a dataobject that provides maping between cell id and store arrays and neighbour maps");
39 m_eclCalDigits.isRequired();
40 m_eclCellIdMapping.registerInDataStore();
56 B2Vector3D vectorPosition = m_geom->GetCrystalPos(idx - 1);
58 m_CellIdToPhi[idx] = vectorPosition.
Phi();
59 m_CellIdToTheta[idx] = vectorPosition.
Theta();
61 m_geom->Mapping(idx - 1);
62 m_CellIdToPhiId[idx] = m_geom->GetPhiID();
63 m_CellIdToThetaId[idx] = m_geom->GetThetaID();
69 if (!m_eclCellIdMapping) {
70 m_eclCellIdMapping.create();
74 m_eclCellIdMapping->setCellIdToNeighbour5(idx, m_NeighbourMap5->getNeighbours(idx));
75 m_eclCellIdMapping->setCellIdToNeighbour7(idx, m_NeighbourMap7->getNeighbours(idx));
76 m_eclCellIdMapping->setCellIdToPhi(idx, m_CellIdToPhi[idx]);
77 m_eclCellIdMapping->setCellIdToTheta(idx, m_CellIdToTheta[idx]);
78 m_eclCellIdMapping->setCellIdToPhiId(idx, m_CellIdToPhiId[idx]);
79 m_eclCellIdMapping->setCellIdToThetaId(idx, m_CellIdToThetaId[idx]);
83 m_eclCellIdMapping->reset();
85 for (
int i = 0; i < m_eclCalDigits.getEntries(); i++) {
86 m_eclCellIdMapping->setCellIdToStoreArray(m_eclCalDigits[i]->getCellId(), i);
92 if (m_NeighbourMap5)
delete m_NeighbourMap5;
93 if (m_NeighbourMap7)
delete m_NeighbourMap7;
DataType Phi() const
The azimuth angle.
DataType Theta() const
The polar angle.
static constexpr int c_nECLCellIds
Number of ECL CellId.
Fills a dataobject that provides maping between cell id and ECLCalDigit store array.
virtual void initialize() override
Initialize.
virtual void event() override
Event.
virtual void terminate() override
Terminate.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
Class to get the neighbours for a given cell id.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.