20 if (!caloHitVector1.empty() && caloHitVector2.empty())
24 else if (caloHitVector1.empty() && !caloHitVector2.empty())
38 if (caloHitVector.empty())
42 const HitType hitType(caloHitVector.at(0)->GetHitType());
47 double Sqz(0.), Sqx(0.), Sq(0.);
49 for (
const CaloHit *
const pCaloHit : caloHitVector)
51 Sqx += pCaloHit->GetMipEquivalentEnergy() * pCaloHit->GetPositionVector().GetX();
52 Sqz += pCaloHit->GetMipEquivalentEnergy() * pCaloHit->GetPositionVector().GetZ();
53 Sq += pCaloHit->GetMipEquivalentEnergy();
56 if (Sq < std::numeric_limits<double>::epsilon())
59 const CartesianVector position(
static_cast<float>(Sqx / Sq), 0.f,
static_cast<float>(Sqz / Sq));
virtual void GetBestPosition3D(const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianPointVector &fitPositionList1, const pandora::CartesianPointVector &fitPositionList2, ProtoHit &protoHit) const
Get the three dimensional position using a provided two dimensional calo hit and candidate fit positi...
Proto hits are temporary constructs to be used during iterative 3D hit procedure.
const pandora::CaloHit * GetParentCaloHit2D() const
Get the address of the parent 2D calo hit.
void GetShowerHit3D(const pandora::CaloHitVector &caloHitVector1, const pandora::CaloHitVector &caloHitVector2, ProtoHit &protoHit) const
Get the three dimensional position for to a two dimensional calo hit, using the hit and a list of can...
HitType GetHitType() const
Get the calorimeter hit type.
StatusCodeException class.
HitType
Calorimeter hit type enum.
std::vector< const CaloHit * > CaloHitVector