21 auto min = std::min_element(fHits.cbegin(),
24 { return a.GetPosition().Z() < b.GetPosition().Z(); });
25 if (min == fHits.end())
27 throw std::logic_error(
"R3BNeulandCluster::GetFirstHit(): Cluster has no Hits!");
34 auto min = std::min_element(fHits.cbegin(),
37 if (min == fHits.end())
39 throw std::logic_error(
"R3BNeulandCluster::GetFirstHit(): Cluster has no Hits!");
46 auto max = std::max_element(fHits.cbegin(),
49 if (max == fHits.end())
51 throw std::logic_error(
"R3BNeulandCluster::GetLastHit(): Cluster has no Hits!");
58 auto max = std::max_element(fHits.cbegin(),
61 if (max == fHits.end())
63 throw std::logic_error(
"R3BNeulandCluster::GetLastHit(): Cluster has no Hits!");
70 return std::accumulate(
71 fHits.begin(), fHits.end(), 0., [](
const Double_t sum,
const R3BNeulandHit& hit) { return sum + hit.GetE(); });
81 TVector3 centroid = std::accumulate(fHits.cbegin(),
86 return centroid * (1. /
GetE());
92 Double_t mom = std::accumulate(fHits.cbegin(),
96 { return c + (hit.GetPosition() - centroid).Mag() * hit.GetE(); });
110 os <<
"R3BNeulandCluster: NeuLAND Cluster with size " << cluster.
GetSize() << std::endl;
113 os <<
" Sum Energy: " << cluster.
GetE() << std::endl
ClassImp(R3B::Neuland::Cal2HitPar)
std::ostream & operator<<(std::ostream &os, const R3BNeulandCluster &cluster)
R3BNeulandHit GetFirstHit() const
TVector3 GetEnergyCentroid() const
void Print(const Option_t *) const override
Double_t GetRCluster(Double_t beta) const
R3BNeulandHit GetMaxEnergyHit() const
Double_t GetRECluster(Double_t ekin) const
TVector3 GetPosition() const
Double_t GetEnergyMoment() const
R3BNeulandHit GetLastHit() const
R3BNeulandHit GetForemostHit() const
auto GetT() const -> double
auto GetPosition() const -> TVector3
auto GetE() const -> double