AlgRmMuList Class Reference

#include <AlgRmMuList.h>

Inheritance diagram for AlgRmMuList:
AlgBase

List of all members.

Public Member Functions

 AlgRmMuList ()
virtual ~AlgRmMuList ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Detailed Description

Definition at line 13 of file AlgRmMuList.h.


Constructor & Destructor Documentation

AlgRmMuList::AlgRmMuList (  ) 

Definition at line 33 of file AlgRmMuList.cxx.

00034 {
00035 }

AlgRmMuList::~AlgRmMuList (  )  [virtual]

Definition at line 38 of file AlgRmMuList.cxx.

00039 {
00040 }


Member Function Documentation

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

Implements AlgBase.

Definition at line 43 of file AlgRmMuList.cxx.

References CandHandle::AddDaughterLink(), Registry::Get(), AlgHandle::GetAlgConfig(), AlgFactory::GetAlgHandle(), CandContext::GetCandRecord(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), AlgFactory::GetInstance(), CandContext::GetMom(), GetRemovableTrack(), Msg::kDebug, Msg::kSynopsis, Registry::LockKeys(), Registry::LockValues(), CandRmMu::MakeCandidate(), MSG, SelectEvent(), Registry::Set(), CandRmMuHandle::SetOrigEvtIndex(), Registry::UnLockKeys(), and Registry::UnLockValues().

00044 {
00045 
00046   MSG("AlgRmMu", Msg::kDebug) << "Starting AlgRmMuList::RunAlg()" << endl;
00047   assert(cx.GetDataIn());
00048   if (!(cx.GetDataIn()->InheritsFrom("TObjArray"))) {
00049     return;
00050   }
00051 
00052   Int_t cMaxTrackLikePlanes = 0;
00053   const char *charRmMuAlgConfig = 0;
00054   ac.Get("MaxTrackLikePlanes",cMaxTrackLikePlanes);
00055   ac.Get("RmMuAlgConfig",charRmMuAlgConfig);
00056 
00057   AlgFactory &af = AlgFactory::GetInstance();  
00058   AlgHandle ah = af.GetAlgHandle("AlgRmMu",charRmMuAlgConfig);
00059   AlgConfig& algconfig = ah.GetAlgConfig();
00060   algconfig.UnLockKeys();
00061   algconfig.UnLockValues();
00062   algconfig.Set("MaxTrackLikePlanes",cMaxTrackLikePlanes);
00063   algconfig.LockKeys();
00064   algconfig.LockValues();
00065   
00066   CandEventListHandle *eventlist = 0;
00067   CandTrackListHandle *tracklist = 0;
00068   CandDigitListHandle *digitlist = 0;
00069   const TObjArray *cxin = dynamic_cast<const TObjArray *>(cx.GetDataIn());
00070   for (Int_t i=0; i<=cxin->GetLast(); i++) {
00071     TObject *tobj = cxin->At(i);
00072     if(!tobj) continue;
00073     if(tobj->InheritsFrom("CandEventListHandle")){
00074       eventlist = dynamic_cast<CandEventListHandle*>(tobj);
00075       MSG("RlgRmMu", Msg::kDebug) << "Got EventList" << endl;
00076     }
00077     if(tobj->InheritsFrom("CandTrackListHandle")){
00078       tracklist = dynamic_cast<CandTrackListHandle*>(tobj);
00079       MSG("RlgRmMu", Msg::kDebug) << "Got TrackList" << endl;
00080     }
00081     if(tobj->InheritsFrom("CandDigitListHandle")){
00082       digitlist = dynamic_cast<CandDigitListHandle*>(tobj);
00083       MSG("RlgRmMu", Msg::kDebug) << "Got DigitList" << endl;
00084     }
00085   }
00086 
00087   if(eventlist==NULL || digitlist==NULL || tracklist==NULL) {
00088     MSG("AlgRmMu",Msg::kSynopsis) << " Bailing out of Event eventlist = " 
00089                                   << eventlist << " tracklist = " << tracklist 
00090                                   << " digitlist = " << digitlist <<endl; 
00091     return;
00092   }
00093 
00094   CandContext cxx(this,cx.GetMom());
00095   CandRecord *candrec = cx.GetCandRecord();
00096   assert(candrec);
00097   cxx.SetCandRecord(candrec);
00098 
00099   Int_t evtIndex = 0;
00100   CandEventHandleItr eventItr(eventlist->GetDaughterIterator());
00101   while(CandEventHandle *event = 
00102          dynamic_cast<CandEventHandle*>(eventItr()) ){
00103     if(SelectEvent(event)){
00104       CandTrackHandle* track = GetRemovableTrack(event,tracklist);
00105       if(track){
00106         TObjArray rmmuarray;
00107         rmmuarray.Add(event);
00108         rmmuarray.Add(track);
00109         rmmuarray.Add(digitlist);
00110         cxx.SetDataIn(&rmmuarray);
00111         MSG("RmMu",Msg::kDebug) << "forming rumu candidate\n";
00112         CandRmMuHandle rmmuhandle = CandRmMu::MakeCandidate(ah,cxx);
00113         rmmuhandle.SetOrigEvtIndex(evtIndex);
00114         ch.AddDaughterLink(rmmuhandle);
00115       }
00116     }
00117     evtIndex+=1;
00118   }
00119 }

void AlgRmMuList::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 122 of file AlgRmMuList.cxx.

00123 {
00124 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1