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++) {
77 int crysID = cellIDFromEnergy - 1;
82 float dPhi = phi -
phiEdge[crysID];
83 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
84 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
85 if (dTheta >= 0 and dTheta <=
thetaWidth[crysID] and dPhi >= 0 and dPhi <=
phiWidth[crysID]) {
95 int tempCrysID = tempCellID - 1;
97 dPhi = phi -
phiEdge[tempCrysID];
98 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
99 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
102 if (dTheta >= 0 and dTheta <=
thetaWidth[tempCrysID] and dPhi >= 0 and dPhi <=
phiWidth[tempCrysID]) {
114 for (
int crys = 8735; crys >= 0; crys--) {
117 if (dPhi > TMath::Pi()) {dPhi -= 2.*TMath::Pi();}
118 if (dPhi < -TMath::Pi()) {dPhi += 2.*TMath::Pi();}
119 if (dPhi >= 0 and dPhi <=
phiWidth[crys] and dTheta >= 0) {
130 crysID = cellIDFromEnergy - 1;
136 int cellID = crysID + 1;
148 if ((iPhiMech == 0 and iRegion != 1) or (iPhiMech ==
crysBetweenMech[thetaID] - 1 and iRegion == 1)) {
153 }
else if ((iPhiMech ==
crysBetweenMech[thetaID] - 1 and iRegion != 1) or (iPhiMech == 0 and iRegion == 1)) {
164 int iLocalTheta = (int)(nPositions * dTheta /
thetaWidth[crysID]);
165 if (iLocalTheta < 0) {iLocalTheta = 0;}
166 if (iLocalTheta >= nPositions) {iLocalTheta = nPositions - 1;}
168 int iLocalPhi = (int)(nPositions * dPhi /
phiWidth[crysID]);
169 if (iLocalPhi < 0) {iLocalPhi = 0;}
170 if (iLocalPhi >= nPositions) {iLocalPhi = nPositions - 1;}
174 if (reversePhi) {iLocalPhi = nPositions - iLocalPhi - 1;}
177 std::vector<int> position;
178 position.push_back(cellID);
179 position.push_back(thetaID);
180 position.push_back(iRegion);
181 position.push_back(iLocalTheta);
182 position.push_back(iLocalPhi);
183 position.push_back(iPhiMech);
184 position.push_back(iStatus);
DBObjPtr< ECLCrystalCalib > m_ECLCrystalPhiEdge
lower edges of crystals, phi
std::vector< float > thetaEdge
lower theta edges from DB object
std::vector< int > crysBetweenMech
crystals between phi mechanical structure per thetaID
std::vector< float > phiEdge
lower phi edges from DB object
~ECLLeakagePosition()
Destructor.
ECL::ECLNeighbours * neighbours
8 nearest neighbours to crystal
std::vector< int > thetaIDofCrysID
thetaID of each crystal ID
const int firstBarrelThetaID
first barrel thetaID
DBObjPtr< ECLCrystalCalib > m_ECLCrystalThetaWidth
width in theta
DBObjPtr< ECLCrystalCalib > m_ECLCrystalPhiWidth
width in phi
ECLLeakagePosition()
Constructor.
std::vector< int > getLeakagePosition(const int cellIDFromEnergy, const float theta, const float phi, const int nPositions)
Return postion.
std::vector< float > phiWidth
crystal phi widths from DB object
const int lastBarrelThetaID
last barrel thetaID
DBObjPtr< ECLCrystalCalib > m_ECLCrystalThetaEdge
Required geometry payloads.
std::vector< float > thetaWidth
crystal theta widths from DB object
std::vector< int > phiIDofCrysID
phiID of each crystal ID
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.