AlgFitShowerEMList Class Reference

#include <AlgFitShowerEMList.h>

Inheritance diagram for AlgFitShowerEMList:
AlgBase

List of all members.

Public Member Functions

 AlgFitShowerEMList ()
virtual ~AlgFitShowerEMList ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)

Detailed Description

Definition at line 16 of file AlgFitShowerEMList.h.


Constructor & Destructor Documentation

AlgFitShowerEMList::AlgFitShowerEMList (  ) 

Definition at line 45 of file AlgFitShowerEMList.cxx.

00046 {
00047 
00048 }

AlgFitShowerEMList::~AlgFitShowerEMList (  )  [virtual]

Definition at line 51 of file AlgFitShowerEMList.cxx.

00052 {
00053 
00054 }


Member Function Documentation

void AlgFitShowerEMList::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Implements AlgBase.

Definition at line 57 of file AlgFitShowerEMList.cxx.

References CandHandle::AddDaughterLink(), Registry::Get(), AlgFactory::GetAlgHandle(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), AlgFactory::GetInstance(), CandContext::GetMom(), Msg::kDebug, Msg::kError, CandFitShowerEM::MakeCandidate(), MSG, and CandFitShowerEMHandle::SetCPUTime().

00058 {
00059   MSG("Alg", Msg::kDebug)
00060     << "Starting AlgFitShowerEMList::RunAlg()" << endl;
00061   
00062   assert(cx.GetDataIn());
00063   
00064   if (!(cx.GetDataIn()->InheritsFrom("TObjArray"))) {
00065     return;
00066   }
00067 
00068   const CandSliceListHandle *slicelist = 0;
00069   const CandShowerEMListHandle *showerlist = 0;
00070   const TObjArray *cxin = dynamic_cast<const TObjArray *>(cx.GetDataIn());
00071   for (Int_t i=0; i<=cxin->GetLast(); i++) {
00072     TObject *tobj = cxin->At(i);
00073     if (tobj->InheritsFrom("CandSliceListHandle")) {
00074       slicelist = dynamic_cast<CandSliceListHandle*>(tobj);
00075     }
00076     if (tobj->InheritsFrom("CandShowerEMListHandle")) {
00077       showerlist = dynamic_cast<CandShowerEMListHandle*>(tobj);
00078     }
00079   }
00080   if (!slicelist || !showerlist) {
00081     MSG("error",Msg::kError) <<
00082       "CandSliceListHandle or CandShowerEMListHandle missing\n";
00083   }
00084   
00085   // Create Candcontext
00086   CandContext cxx(this,cx.GetMom());
00087 
00088   //get FitShowerEM config:
00089   const char *charFitShowerEMAlgConfig = 0;
00090   ac.Get("FitShowerEMAlgConfig",charFitShowerEMAlgConfig);
00091 
00092   // Get singleton instance of AlgFactory
00093   AlgFactory &af = AlgFactory::GetInstance();  
00094   AlgHandle ah = af.GetAlgHandle("AlgFitShowerEM",charFitShowerEMAlgConfig);
00095 
00096   TIter showerItr(showerlist->GetDaughterIterator());
00097 
00098   clock_t dummyt;
00099   struct tms t1;
00100   struct tms t2;
00101   static double ticksPerSecond = sysconf(_SC_CLK_TCK);
00102   while (CandShowerEMHandle *shower 
00103          = dynamic_cast<CandShowerEMHandle*>(showerItr())) {
00104     if(shower->GetShwStatus()!=1) continue;
00105     TObjArray cxin;
00106     cxin.Add(shower);
00107     cxx.SetDataIn(&cxin);
00108     dummyt = times(&t1);
00109     CandFitShowerEMHandle fitshower = CandFitShowerEM::MakeCandidate(ah,cxx);
00110     dummyt = times(&t2);
00111     Double_t CPUTime = Double_t(t2.tms_utime+t2.tms_stime
00112                                 -t1.tms_utime-t1.tms_stime)/ticksPerSecond;
00113     fitshower.SetCPUTime(CPUTime);
00114     MSG("FitShowerEM",Msg::kDebug) << "CPUTime = "<<CPUTime<<endl;
00115     ch.AddDaughterLink(fitshower);
00116   }
00117 
00118 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1