10#include <ecl/geometry/ECLLeakagePosition.h>
11#include <ecl/dbobjects/ECLCrystalCalib.h>
12#include <ecl/geometry/ECLNeighbours.h>
23 m_ECLCrystalThetaEdge(
"ECLCrystalThetaEdge"),
24 m_ECLCrystalPhiEdge(
"ECLCrystalPhiEdge"),
25 m_ECLCrystalThetaWidth(
"ECLCrystalThetaWidth"),
26 m_ECLCrystalPhiWidth(
"ECLCrystalPhiWidth")
47 for (
int thID = 0; thID < 69; thID++) {
78 int crysID = cellIDFromEnergy - 1;
84 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
85 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
96 int tempCrysID = tempCellID - 1;
99 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
100 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
103 if (dTheta >= 0 and dTheta <=
m_thetaWidth[tempCrysID] and dPhi >= 0 and dPhi <=
m_phiWidth[tempCrysID]) {
115 for (
int crys = 8735; crys >= 0; crys--) {
118 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
119 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
120 if (dPhi >= 0 and dPhi <=
m_phiWidth[crys] and dTheta >= 0) {
131 crysID = cellIDFromEnergy - 1;
137 int cellID = crysID + 1;
149 if ((iPhiMech == 0 and iRegion != 1) or (iPhiMech ==
m_crysBetweenMech[thetaID] - 1 and iRegion == 1)) {
154 }
else if ((iPhiMech ==
m_crysBetweenMech[thetaID] - 1 and iRegion != 1) or (iPhiMech == 0 and iRegion == 1)) {
165 int iLocalTheta = (int)(nPositions * dTheta /
m_thetaWidth[crysID]);
166 if (iLocalTheta < 0) {iLocalTheta = 0;}
167 if (iLocalTheta >= nPositions) {iLocalTheta = nPositions - 1;}
169 int iLocalPhi = (int)(nPositions * dPhi /
m_phiWidth[crysID]);
170 if (iLocalPhi < 0) {iLocalPhi = 0;}
171 if (iLocalPhi >= nPositions) {iLocalPhi = nPositions - 1;}
175 if (reversePhi) {iLocalPhi = nPositions - iLocalPhi - 1;}
178 std::vector<int> position;
179 position.push_back(cellID);
180 position.push_back(thetaID);
181 position.push_back(iRegion);
182 position.push_back(iLocalTheta);
183 position.push_back(iLocalPhi);
184 position.push_back(iPhiMech);
185 position.push_back(iStatus);
DBObjPtr< ECLCrystalCalib > m_ECLCrystalPhiEdge
lower edges of crystals, phi
std::vector< int > m_crysBetweenMech
crystals between phi mechanical structure per thetaID
ECL::ECLNeighbours * m_neighbours
8 nearest neighbours to crystal
std::vector< int > m_thetaIDofCrysID
thetaID of each crystal ID
std::vector< float > m_thetaEdge
lower theta edges from DB object
~ECLLeakagePosition()
Destructor.
std::vector< int > m_phiIDofCrysID
phiID of each crystal ID
std::vector< float > m_thetaWidth
crystal theta widths from DB object
DBObjPtr< ECLCrystalCalib > m_ECLCrystalThetaWidth
width in theta
std::vector< float > m_phiWidth
crystal phi widths from DB object
DBObjPtr< ECLCrystalCalib > m_ECLCrystalPhiWidth
width in phi
ECLLeakagePosition()
Constructor.
const int m_firstBarrelThetaID
first barrel thetaID
std::vector< int > getLeakagePosition(const int cellIDFromEnergy, const float theta, const float phi, const int nPositions)
Return position.
std::vector< float > m_phiEdge
lower phi edges from DB object
const int m_lastBarrelThetaID
last barrel thetaID
DBObjPtr< ECLCrystalCalib > m_ECLCrystalThetaEdge
Required geometry payloads.
Class to get the neighbours for a given cell id.
const std::vector< short int > & getNeighbours(short int cid) const
Return the neighbours for a given cell ID.
short int getCrystalsPerRing(const short int thetaid) const
return number of crystals in a given theta ring
Abstract base class for different kinds of events.