CandSliceHandle Class Reference

#include <CandSliceHandle.h>

Inheritance diagram for CandSliceHandle:
CandHandle FarDetSliceHandle

List of all members.

Public Member Functions

 CandSliceHandle ()
 CandSliceHandle (const CandSliceHandle &cdh)
 CandSliceHandle (CandSlice *cd)
virtual ~CandSliceHandle ()
virtual CandSliceHandleDupHandle () const
virtual void Trace (const char *c="") const
Int_t GetNStrip (PlaneView::PlaneView_t=PlaneView::kUnknown) const
Int_t GetNDigit (StripEnd::StripEnd_t=StripEnd::kWhole) const
virtual Int_t GetNPlane (PlaneView::PlaneView_t=PlaneView::kUnknown) const
virtual Int_t GetBegPlane (PlaneView::PlaneView_t=PlaneView::kUnknown) const
virtual Int_t GetEndPlane (PlaneView::PlaneView_t=PlaneView::kUnknown) const
virtual Double_t GetBegTime () const
virtual Double_t GetEndTime () const
virtual Double_t GetCharge (CalDigitType::CalDigitType_t=CalDigitType::kPE) const
virtual Double_t GetCorrTime () const
virtual Double_t GetCorrBegTime () const
virtual Double_t GetCorrEndTime () const

Detailed Description

Definition at line 25 of file CandSliceHandle.h.


Constructor & Destructor Documentation

CandSliceHandle::CandSliceHandle (  ) 

Definition at line 34 of file CandSliceHandle.cxx.

Referenced by DupHandle().

00035 {
00036 }

CandSliceHandle::CandSliceHandle ( const CandSliceHandle cdh  ) 

Definition at line 39 of file CandSliceHandle.cxx.

00039                                                            :
00040 CandHandle(cdh)
00041 {
00042 }

CandSliceHandle::CandSliceHandle ( CandSlice cd  ) 

Definition at line 45 of file CandSliceHandle.cxx.

00045                                               :
00046 CandHandle(cd)
00047 {
00048 }

CandSliceHandle::~CandSliceHandle (  )  [virtual]

Definition at line 51 of file CandSliceHandle.cxx.

00052 {
00053 }


Member Function Documentation

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

Reimplemented from CandHandle.

Reimplemented in FarDetSliceHandle.

Definition at line 56 of file CandSliceHandle.cxx.

References CandSliceHandle().

Referenced by CandEventHandle::SetCandSlice(), CandRecoHandle::SetCandSlice(), and CandClusterHandle::SetCandSlice().

00057 {
00058   return (new CandSliceHandle(*this));
00059 }

Int_t CandSliceHandle::GetBegPlane ( PlaneView::PlaneView_t  planeview_t = PlaneView::kUnknown  )  const [virtual]

Definition at line 131 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), CandStripHandle::GetPlaneView(), PlaneView::kA, PlaneView::kB, and PlaneView::kUnknown.

00132 {
00133   TIter stripItr(GetDaughterIterator());
00134   CandStripHandle *strip;
00135   Bool_t first(1);
00136   Int_t plane=0;
00137   while ((strip = dynamic_cast<CandStripHandle*>(stripItr()))) {
00138     PlaneView::PlaneView_t planeview = strip->GetPlaneView();
00139     if (planeview!=PlaneView::kA && planeview!=PlaneView::kB &&
00140         (planeview_t==PlaneView::kUnknown || planeview_t==planeview) &&
00141         (first || strip->GetPlane()<plane)) {
00142       first = 0;
00143       plane = strip->GetPlane();
00144     }
00145   }
00146   return plane;
00147 }

Double_t CandSliceHandle::GetBegTime (  )  const [virtual]

Definition at line 168 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

00169 {
00170   TIter stripItr(GetDaughterIterator());
00171   Double_t time = 0.;
00172   Bool_t first = 1;
00173   while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) {
00174     if (first || strip->GetBegTime()<time) {
00175       time = strip->GetBegTime();
00176       first = 0;
00177     }
00178   }
00179   return time;
00180 }

Double_t CandSliceHandle::GetCharge ( CalDigitType::CalDigitType_t  caltype_t = CalDigitType::kPE  )  const [virtual]

Definition at line 198 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

Referenced by EVD::UpdateSummary().

00199 {
00200   TIter stripItr(GetDaughterIterator());
00201   Double_t charge = 0.;
00202   while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) {
00203     charge += strip->GetCharge(caltype_t);
00204   }
00205   return charge;
00206 }

Double_t CandSliceHandle::GetCorrBegTime (  )  const [virtual]

Definition at line 224 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

Referenced by NtpCandSlice::NtpCandSlice(), and SliceSRKeyFromForwardTime().

00225 {
00226  Double_t corrtime=0.;
00227   TIter stripItr(GetDaughterIterator());
00228   while (CandStripHandle *striphandle = dynamic_cast<CandStripHandle*>(stripItr())) {
00229     if (!corrtime || striphandle->GetCorrBegTime()<corrtime) {
00230       corrtime = striphandle->GetCorrBegTime();
00231      }
00232   }
00233   return corrtime;
00234 }

Double_t CandSliceHandle::GetCorrEndTime (  )  const [virtual]

Definition at line 239 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

Referenced by NtpCandSlice::NtpCandSlice().

00240 {
00241  Double_t corrtime=0.;
00242  TIter stripItr(GetDaughterIterator());
00243  while (CandStripHandle *striphandle = dynamic_cast<CandStripHandle*>(stripItr())) {
00244    if (!corrtime || striphandle->GetCorrBegTime()>corrtime) {
00245      corrtime = striphandle->GetCorrBegTime();
00246    }
00247  }
00248  return corrtime;
00249 }

Double_t CandSliceHandle::GetCorrTime (  )  const [virtual]

Definition at line 209 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

00210 {
00211  Double_t corrtime=0.;
00212   Double_t totph=0.;
00213   TIter stripItr(GetDaughterIterator());
00214   while (CandStripHandle *striphandle = dynamic_cast<CandStripHandle*>(stripItr())) {
00215      corrtime += striphandle->GetCharge()*striphandle->GetCorrBegTime();
00216      totph += striphandle->GetCharge();    
00217   }
00218   if (totph>0.) corrtime /= totph;
00219   return corrtime;
00220 }

Int_t CandSliceHandle::GetEndPlane ( PlaneView::PlaneView_t  planeview_t = PlaneView::kUnknown  )  const [virtual]

Definition at line 149 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), CandStripHandle::GetPlaneView(), PlaneView::kA, PlaneView::kB, and PlaneView::kUnknown.

00150 {
00151   TIter stripItr(GetDaughterIterator());
00152   CandStripHandle *strip;
00153   Bool_t first(1);
00154   Int_t plane=0;
00155   while ((strip = dynamic_cast<CandStripHandle*>(stripItr()))) {
00156     PlaneView::PlaneView_t planeview = strip->GetPlaneView();
00157     if (planeview!=PlaneView::kA && planeview!=PlaneView::kB &&
00158         (planeview_t==PlaneView::kUnknown || planeview_t==planeview) &&
00159         (first || strip->GetPlane()>plane)) {
00160       first = 0;
00161       plane = strip->GetPlane();
00162     }
00163   }
00164   return plane;
00165 }

Double_t CandSliceHandle::GetEndTime (  )  const [virtual]

Definition at line 183 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator().

00184 {
00185   TIter stripItr(GetDaughterIterator());
00186   Double_t time = 0.;
00187   Bool_t first = 1;
00188   while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) {
00189     if (first || strip->GetEndTime()>time) {
00190       time = strip->GetEndTime();
00191       first = 0;
00192     }
00193   }
00194   return time;
00195 }

Int_t CandSliceHandle::GetNDigit ( StripEnd::StripEnd_t  stripend_t = StripEnd::kWhole  )  const

Definition at line 90 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator(), CandStripHandle::GetNDigit(), and n.

Referenced by NtpCandSlice::NtpCandSlice().

00091 {
00092   Int_t n=0;
00093   TIter stripItr(GetDaughterIterator());
00094   CandStripHandle *strip;
00095   while ((strip = dynamic_cast<CandStripHandle*>(stripItr()))) {
00096     n += strip->GetNDigit(stripend_t);
00097   }
00098   return n;
00099 }

Int_t CandSliceHandle::GetNPlane ( PlaneView::PlaneView_t  planeview_t = PlaneView::kUnknown  )  const [virtual]

Definition at line 102 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator(), VHS::GetPlane(), CandStripHandle::GetPlane(), CandStripHandle::GetPlaneView(), PlaneView::kA, PlaneView::kB, and PlaneView::kUnknown.

00103 {
00104   TIter stripItr(GetDaughterIterator());
00105   map<Int_t,Bool_t> occupancy;
00106   CandStripHandle *strip;
00107   Int_t minplane = -1;
00108   Int_t maxplane = -1;
00109   while ((strip = dynamic_cast<CandStripHandle*>(stripItr()))) {
00110     PlaneView::PlaneView_t planeview = strip->GetPlaneView();
00111     if (planeview!=PlaneView::kA && planeview!=PlaneView::kB &&
00112         (planeview_t==PlaneView::kUnknown || planeview==planeview_t)) {
00113       occupancy[strip->GetPlane()] = kTRUE;
00114       if (minplane<0 || strip->GetPlane()<minplane) minplane = strip->GetPlane();
00115       if (maxplane<0 || strip->GetPlane()>maxplane) maxplane = strip->GetPlane();
00116     }
00117   }
00118   Int_t nplane = 0;
00119   map<Int_t,Bool_t>::iterator iter;
00120   for (Int_t iplane=minplane; iplane<=maxplane; iplane++) {
00121     iter = occupancy.find(iplane);
00122     if (iter!=occupancy.end()) {
00123       nplane++;
00124     }
00125   }
00126 
00127   return nplane;
00128 }

Int_t CandSliceHandle::GetNStrip ( PlaneView::PlaneView_t  planeview_t = PlaneView::kUnknown  )  const

Definition at line 73 of file CandSliceHandle.cxx.

References CandHandle::GetDaughterIterator(), CandHandle::GetNDaughters(), CandStripHandle::GetPlaneView(), PlaneView::kUnknown, and n.

Referenced by StripListKG::CreateStrips(), and NtpCandSlice::NtpCandSlice().

00074 {
00075   if (planeview_t==PlaneView::kUnknown) {
00076     return GetNDaughters();
00077   }
00078   Int_t n=0;
00079   TIter stripItr(GetDaughterIterator());
00080   CandStripHandle *strip;
00081   while ((strip = dynamic_cast<CandStripHandle*>(stripItr()))) {
00082     PlaneView::PlaneView_t planeview = strip->GetPlaneView();
00083     if (planeview == planeview_t) {
00084       n++;
00085     }
00086   }
00087   return n;
00088 }

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

Reimplemented from CandHandle.

Reimplemented in FarDetSliceHandle.

Definition at line 63 of file CandSliceHandle.cxx.

References Msg::kDebug, and MSG.

00064 {
00065   MSG("Cand", Msg::kDebug)
00066     << "**********Begin CandSliceHandle::Trace(\"" << c << "\")" << endl
00067            << "Information from CandSliceHandle's CandHandle: " << endl;
00068   CandHandle::Trace(c);
00069   MSG("Cand", Msg::kDebug)
00070      << "**********End CandSliceHandle::Trace(\"" << c << "\")" << endl;
00071 }


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1