CandClusterHandle Class Reference

#include <CandClusterHandle.h>

Inheritance diagram for CandClusterHandle:

CandHandle List of all members.

Public Member Functions

 CandClusterHandle ()
 CandClusterHandle (const CandClusterHandle &cdh)
 CandClusterHandle (CandCluster *cd)
virtual ~CandClusterHandle ()
virtual CandClusterHandleDupHandle () const
virtual void Trace (const char *c="") const
void SetCandSlice (const CandSliceHandle *slice)
const CandSliceHandleGetCandSlice () const
void IsShowerLike (Bool_t)
Bool_t IsShowerLike () const
void IsTrackLike (Bool_t)
Bool_t IsTrackLike () const
virtual PlaneView::PlaneView_t GetPlaneView () const
virtual Int_t GetNStrip () const
virtual Int_t GetNPlane () const
virtual Int_t GetBegPlane () const
virtual Int_t GetEndPlane () const
virtual Double_t GetBegTime () const
virtual Double_t GetEndTime () const
virtual Double_t GetCharge () const
virtual Double_t GetTPos () const

Static Public Member Functions

static NavKey KeyFromObject (const CandClusterHandle *)
static NavKey KeyFromView (const CandClusterHandle *)
static NavKey KeyFromSlice (const CandClusterHandle *)

Detailed Description

Definition at line 25 of file CandClusterHandle.h.


Constructor & Destructor Documentation

CandClusterHandle::CandClusterHandle (  ) 

Definition at line 31 of file CandClusterHandle.cxx.

Referenced by DupHandle().

00032 {
00033 }

CandClusterHandle::CandClusterHandle ( const CandClusterHandle cdh  ) 

Definition at line 36 of file CandClusterHandle.cxx.

00036                                                                  :
00037   CandHandle(cdh)
00038 {
00039 }

CandClusterHandle::CandClusterHandle ( CandCluster cd  ) 

Definition at line 42 of file CandClusterHandle.cxx.

00042                                                     :
00043   CandHandle(cd)
00044 {
00045 }

CandClusterHandle::~CandClusterHandle (  )  [virtual]

Definition at line 48 of file CandClusterHandle.cxx.

00049 {
00050 }


Member Function Documentation

CandClusterHandle * CandClusterHandle::DupHandle (  )  const [virtual]

Reimplemented from CandHandle.

Definition at line 53 of file CandClusterHandle.cxx.

References CandClusterHandle().

Referenced by CandTrackSRHandle::AddCluster(), and CandShowerHandle::AddCluster().

00054 {
00055   return (new CandClusterHandle(*this));
00056 }

Int_t CandClusterHandle::GetBegPlane (  )  const [virtual]

Definition at line 165 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

Referenced by GetNPlane().

00166 {
00167   TIter cshItr(GetDaughterIterator());
00168   Int_t plane = 0;
00169   Bool_t first = 1;
00170   while (CandStripHandle *csh =
00171                              dynamic_cast<CandStripHandle*>(cshItr())) {
00172     if (first || csh->GetPlane()<plane) {
00173       plane = csh->GetPlane();
00174       first = 0;
00175     }
00176   }
00177   return plane;
00178 }

Double_t CandClusterHandle::GetBegTime (  )  const [virtual]

Definition at line 197 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

00198 {
00199   TIter cshItr(GetDaughterIterator());
00200   Double_t time = 0.;
00201   Bool_t first = 1;
00202   while (CandStripHandle *csh =
00203                              dynamic_cast<CandStripHandle*>(cshItr())) {
00204     if (first || csh->GetBegTime()<time) {
00205       time = csh->GetBegTime();
00206       first = 0;
00207     }
00208   }
00209   return time;
00210 }

const CandSliceHandle * CandClusterHandle::GetCandSlice (  )  const

Definition at line 80 of file CandClusterHandle.cxx.

References CandHandle::GetCandBase().

Referenced by KeyFromSlice().

00081 {
00082   return dynamic_cast<const CandCluster *>(GetCandBase())->fCandSlice;
00083 }

Double_t CandClusterHandle::GetCharge (  )  const [virtual]

Definition at line 229 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

00230 {
00231   TIter cshItr(GetDaughterIterator());
00232   Double_t charge = 0.;
00233   while (CandStripHandle *csh =
00234                              dynamic_cast<CandStripHandle*>(cshItr())) {
00235     charge += csh->GetCharge();
00236   }
00237   return charge;
00238 }

Int_t CandClusterHandle::GetEndPlane (  )  const [virtual]

Definition at line 180 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

Referenced by GetNPlane().

00181 {
00182   TIter cshItr(GetDaughterIterator());
00183   Int_t plane = 0;
00184   Bool_t first = 1;
00185   while (CandStripHandle *csh =
00186                              dynamic_cast<CandStripHandle*>(cshItr())) {
00187     if (first || csh->GetPlane()>plane) {
00188       plane = csh->GetPlane();
00189       first = 0;
00190     }
00191   }
00192   return plane;
00193 }

Double_t CandClusterHandle::GetEndTime (  )  const [virtual]

Definition at line 212 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

00213 {
00214   TIter cshItr(GetDaughterIterator());
00215   Double_t time = 0.;
00216   Bool_t first = 1;
00217   while (CandStripHandle *csh =
00218                              dynamic_cast<CandStripHandle*>(cshItr())) {
00219     if (first || csh->GetEndTime()>time) {
00220       time = csh->GetEndTime();
00221       first = 0;
00222     }
00223   }
00224   return time;
00225 }

Int_t CandClusterHandle::GetNPlane (  )  const [virtual]

Definition at line 130 of file CandClusterHandle.cxx.

References GetBegPlane(), CandHandle::GetDaughterIterator(), GetEndPlane(), PlaneView::kA, PlaneView::kB, and CandStripHandle::KeyFromPlane().

00131 {
00132   Int_t begplane = GetBegPlane();
00133   if (begplane==0) {
00134     return 0;
00135   }
00136   Int_t endplane = GetEndPlane();
00137   if (begplane==endplane) {
00138     return 1;
00139   }
00140   Int_t ncount = 2;
00141   CandStripHandleItr stripItr(GetDaughterIterator());
00142   CandStripHandleKeyFunc *stripKf = stripItr.CreateKeyFunc();
00143   stripKf->SetFun(CandStripHandle::KeyFromPlane);
00144   stripItr.GetSet()->AdoptSortKeyFunc(stripKf);
00145   stripKf = 0;
00146   while (stripItr.IsValid() && stripItr.Ptr()->GetPlane()<=begplane) {
00147     stripItr.Next();
00148   }
00149   Int_t oldplane = stripItr.Ptr()->GetPlane();
00150   while (CandStripHandle *strip =
00151                            dynamic_cast<CandStripHandle*>(stripItr())) {
00152     if (strip->GetPlaneView()!=PlaneView::kA &&
00153         strip->GetPlaneView()!=PlaneView::kB) {
00154       if (strip->GetPlane()!=oldplane) {
00155         ncount++;
00156       }
00157       oldplane = strip->GetPlane();
00158     }
00159   }
00160   return ncount;
00161 }

Int_t CandClusterHandle::GetNStrip (  )  const [virtual]

Definition at line 125 of file CandClusterHandle.cxx.

References CandHandle::GetNDaughters().

00126 {
00127   return GetNDaughters();
00128 }

PlaneView::PlaneView_t CandClusterHandle::GetPlaneView (  )  const [virtual]

Definition at line 112 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator(), and PlaneView::kUnknown.

Referenced by KeyFromView(), and AlgClusterSRList::RunAlg().

00113 {
00114   CandStripHandleItr cshItr(GetDaughterIterator());
00115   if (CandStripHandle *csh = cshItr()) {
00116     return csh->GetPlaneView();
00117   }
00118   else {
00119     return PlaneView::kUnknown;
00120   }
00121 }

Double_t CandClusterHandle::GetTPos (  )  const [virtual]

Definition at line 242 of file CandClusterHandle.cxx.

References CandHandle::GetDaughterIterator().

00243 {
00244   TIter cshItr(GetDaughterIterator());
00245   Double_t charge = 0.;
00246   Double_t tpos = 0.;
00247   while (CandStripHandle *csh =
00248                              dynamic_cast<CandStripHandle*>(cshItr())) {
00249     charge += csh->GetCharge();
00250     tpos += csh->GetCharge()*csh->GetTPos();
00251   }
00252   tpos /= charge;
00253   return tpos;
00254 }

Bool_t CandClusterHandle::IsShowerLike (  )  const

Definition at line 105 of file CandClusterHandle.cxx.

References CandHandle::GetCandBase().

00106 {
00107   return dynamic_cast<const CandCluster *>(GetCandBase())->fShowerLike;
00108 }

void CandClusterHandle::IsShowerLike ( Bool_t   ) 

Definition at line 99 of file CandClusterHandle.cxx.

References CandHandle::GetOwnedCandBase().

Referenced by AlgEventSRList::BuildEventFromUnassoc(), AlgEventSRList::CreatePrimaryShower(), KeyFromObject(), AlgEventSRList::MergeShowers(), and AlgClusterSRList::RunAlg().

00100 {
00101   dynamic_cast<CandCluster *>(GetOwnedCandBase())->fShowerLike = bvar;
00102 
00103 }

Bool_t CandClusterHandle::IsTrackLike (  )  const

Definition at line 92 of file CandClusterHandle.cxx.

References CandHandle::GetCandBase().

00093 {
00094   return dynamic_cast<const CandCluster *>(GetCandBase())->fTrackLike;
00095 }

void CandClusterHandle::IsTrackLike ( Bool_t   ) 

Definition at line 87 of file CandClusterHandle.cxx.

References CandHandle::GetOwnedCandBase().

Referenced by KeyFromObject(), and AlgClusterSRList::RunAlg().

00088 {
00089   dynamic_cast<CandCluster *>(GetOwnedCandBase())->fTrackLike = bvar;
00090 }

NavKey CandClusterHandle::KeyFromObject ( const CandClusterHandle  )  [static]

Definition at line 261 of file CandClusterHandle.cxx.

References IsShowerLike(), and IsTrackLike().

00262 {
00263   if (cluster->IsShowerLike()) {
00264     return 1;
00265   }
00266   if (cluster->IsTrackLike()) {
00267     return 2;
00268   }
00269   return 0;
00270 }

NavKey CandClusterHandle::KeyFromSlice ( const CandClusterHandle  )  [static]

Definition at line 283 of file CandClusterHandle.cxx.

References GetCandSlice(), and CandHandle::GetUidInt().

Referenced by AlgShowerSRList::RunAlg(), and AlgEventSRList::RunAlg().

00284 {
00285   if (cluster->GetCandSlice()) {
00286     return static_cast<Int_t>(cluster->GetCandSlice()->GetUidInt());
00287   } 
00288   return 0;
00289 
00290 }

NavKey CandClusterHandle::KeyFromView ( const CandClusterHandle  )  [static]

Definition at line 273 of file CandClusterHandle.cxx.

References CandHandle::FindDaughter(), GetPlaneView(), and PlaneView::kUnknown.

00274 {
00275   if (const CandStripHandle *strip =
00276        dynamic_cast<const CandStripHandle *>(cluster->FindDaughter())) {
00277     return static_cast<Int_t>(const_cast<CandStripHandle *>
00278       (strip)->GetPlaneView());
00279   }
00280   return static_cast<Int_t>(PlaneView::kUnknown);
00281 }

void CandClusterHandle::SetCandSlice ( const CandSliceHandle slice  ) 

Definition at line 70 of file CandClusterHandle.cxx.

References CandSliceHandle::DupHandle(), and CandHandle::GetOwnedCandBase().

Referenced by AlgEventSRList::AddStripToEvent(), AlgEventSRList::BuildEventFromUnassoc(), AlgEventSRList::CreatePrimaryShower(), AlgEventSRList::MergeShowers(), and AlgClusterSRList::RunAlg().

00071 {
00072   if (slice) {                 // fCandSlice is now an owned CandHandle*
00073     CandSliceHandle *ch = slice->DupHandle();
00074     delete (dynamic_cast<CandCluster *>
00075                                       (GetOwnedCandBase()))->fCandSlice;
00076     dynamic_cast<CandCluster *>(GetOwnedCandBase())->fCandSlice = ch;
00077   }
00078 }

void CandClusterHandle::Trace ( const char *  c = ""  )  const [virtual]

Reimplemented from CandHandle.

Definition at line 59 of file CandClusterHandle.cxx.

References Msg::kDebug, MSG, and CandHandle::Trace().

00060 {
00061   MSG("Cand", Msg::kDebug)
00062   << "**********Begin CandClusterHandle::Trace(\"" << c << "\")" << endl
00063          << "Information from CandClusterHandle's CandHandle: " << endl;
00064   CandHandle::Trace(c);
00065   MSG("Cand", Msg::kDebug)
00066    << "**********End CandClusterHandle::Trace(\"" << c << "\")" << endl;
00067 }


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:18 2014 for loon by  doxygen 1.4.7