19 std::map<int, double> mapLayerWeigthedX;
20 std::map<int, double> mapLayerWeigthedY;
21 std::map<int, double> mapLayerZ1;
22 std::map<int, double> mapLayerZ2;
23 std::map<int, double> mapLayerSumWeigthsX;
24 std::map<int, double> mapLayerSumWeigthsY;
34 int layer = hit.GetLayerNumber();
38 if (!mapLayerWeigthedX.contains(layer)) {
39 mapLayerWeigthedX[layer] = 0.;
40 mapLayerSumWeigthsX[layer] = 0.;
42 mapLayerWeigthedX[layer] += hit.GetX() * hitEnergy;
43 mapLayerSumWeigthsX[layer] += hitEnergy;
44 mapLayerZ1[layer] = hit.GetZ();
47 if (!mapLayerWeigthedY.contains(layer)) {
48 mapLayerWeigthedY[layer] = 0.;
49 mapLayerSumWeigthsY[layer] = 0.;
51 mapLayerWeigthedY[layer] += hit.GetY() * hitEnergy;
52 mapLayerSumWeigthsY[layer] += hitEnergy;
53 mapLayerZ2[layer] = hit.GetZ();
57 auto const& [minLayerX, weightedMinX] = *mapLayerWeigthedX.begin();
58 double minX = weightedMinX / mapLayerSumWeigthsX[minLayerX];
59 double minZ1 = mapLayerZ1[minLayerX];
61 auto const& [minLayerY, weightedMinY] = *mapLayerWeigthedY.begin();
62 double minY = weightedMinY / mapLayerSumWeigthsY[minLayerY];
63 double minZ2 = mapLayerZ1[minLayerY];
65 double minZ = (minZ1 + minZ2) / 2.;
69 auto const& [maxLayerX, weightedMaxX] = *mapLayerWeigthedX.rbegin();
70 double maxX = weightedMaxX / mapLayerSumWeigthsX[maxLayerX];
71 double maxZ1 = mapLayerZ1[maxLayerX];
73 auto const& [maxLayerY, weightedMaxY] = *mapLayerWeigthedY.rbegin();
74 double maxY = weightedMaxY / mapLayerSumWeigthsY[maxLayerY];
75 double maxZ2 = mapLayerZ1[maxLayerY];
77 double maxZ = (maxZ1 + maxZ2) / 2.;
84 TVector3 direction = end - start;
85 double eta = direction.Eta();
86 double phi = direction.Phi();
98 std::cout <<
"-I- splitcalCluster: " << std::endl;
99 std::cout <<
" (eta,phi,energy) = " <<
_eta <<
" , " <<
_phi <<
" , "
101 std::cout <<
" start(x,y,z) = " <<
_start[0] <<
" , " <<
_start[1]
102 <<
" , " <<
_start[2] << std::endl;
103 std::cout <<
" end(x,y,z) = " <<
_end[0] <<
" , " <<
_end[1] <<
" , "
104 <<
_end[2] << std::endl;
105 std::cout <<
"------- " << std::endl;
void SetStartPoint(const double &x, const double &y, const double &z)
void ComputeEtaPhiE(const std::vector< splitcalHit > &hits)
void SetEndPoint(const double &x, const double &y, const double &z)
std::array< double, 3 > _end
std::vector< double > _hitWeights
std::vector< int > _hitIndices
virtual void Print() const
void SetEtaPhiE(double &eta, double &phi, double &e)
virtual ~splitcalCluster()
std::array< double, 3 > _start