#include "IReconShower.hxx" ClassImp(COMET::IReconShower); COMET::IReconShower::IReconShower() { fState = new IShowerState; fNodes = new IReconNodeContainerImpl; } COMET::IReconShower::IReconShower(const COMET::IReconShower& shower) : COMET::IReconBase(shower) { fNodes = new IReconNodeContainerImpl; // Copy the nodes // Create new nodes with IShowerState's COMET::IReconNodeContainer::const_iterator in; for (in=shower.GetNodes().begin(); in!=shower.GetNodes().end();in++){ COMET::IHandle node(new COMET::IReconNode); COMET::IHandle object = (*in)->GetObject(); node->SetObject(object); COMET::IHandle tstate = (*in)->GetState(); if (tstate){ COMET::IHandle pstate(new COMET::IShowerState(*tstate)); node->SetState(pstate); } node->SetQuality((*in)->GetQuality()); fNodes->push_back(node); } if (shower.GetState()) { COMET::IHandle state = shower.GetState(); fState = new IShowerState(*state); } else { fState = new IShowerState; } } COMET::IReconShower::~IReconShower() {} double COMET::IReconShower::GetEDeposit() const { IHandle state = GetState(); if (!state) throw EMissingField(); return state->GetEDeposit(); } TLorentzVector COMET::IReconShower::GetPosition() const { // This is the preferred way to access a state field. IHandle state = GetState(); if (!state) throw EMissingField(); return state->GetPosition(); } TLorentzVector COMET::IReconShower::GetPositionVariance() const { // This is the preferred way to access a state field. IHandle state = GetState(); if (!state) throw EMissingField(); return state->GetPositionVariance(); } bool COMET::IReconShower::IsXShower() const { TLorentzVector var = GetPositionVariance(); if (COMET::ICorrValues::IsFree(var.X())) return false; return true; } bool COMET::IReconShower::IsYShower() const { TLorentzVector var = GetPositionVariance(); if (COMET::ICorrValues::IsFree(var.Y())) return false; return true; } bool COMET::IReconShower::IsZShower() const { TLorentzVector var = GetPositionVariance(); if (COMET::ICorrValues::IsFree(var.Z())) return false; return true; } int COMET::IReconShower::GetDimensions() const{ TLorentzVector var = GetPositionVariance(); int dim = 0; if (IsXShower()) ++dim; if (IsYShower()) ++dim; if (IsZShower()) ++dim; return dim; } TVector3 COMET::IReconShower::GetDirection() const { // This is the preferred way to access a state field. IHandle state = GetState(); if (!state) throw EMissingField(); return state->GetDirection(); } TVector3 COMET::IReconShower::GetConeAngle() const { IHandle state = GetState(); if (!state) throw EMissingField(); return state->GetCone(); }