00001
00002
00003
00004
00005
00007
00008 #include <cassert>
00009
00010 #include "CandChop/AlgSliceListFromChopList.h"
00011 #include "CandChop/CandChopListHandle.h"
00012 #include "CandChop/DigitVector.h"
00013
00014 #include "Algorithm/AlgConfig.h"
00015 #include "Algorithm/AlgFactory.h"
00016 #include "Algorithm/AlgHandle.h"
00017 #include "CandData/CandHeader.h"
00018 #include "CandData/CandRecord.h"
00019 #include "CandDigit/CandDigitHandle.h"
00020 #include "CandDigit/CandDigitListHandle.h"
00021 #include "Candidate/CandContext.h"
00022 #include "RecoBase/CandSliceListHandle.h"
00023 #include "RecoBase/CandSliceHandle.h"
00024 #include "RecoBase/CandSlice.h"
00025 #include "RecoBase/CandStripList.h"
00026 #include "MessageService/MsgService.h"
00027 #include "MinosObjectMap/MomNavigator.h"
00028 #include "RawData/RawHeader.h"
00029 #include "RawData/RawRecord.h"
00030 #include "RawData/RawDigitDataBlock.h"
00031 #include "UgliGeometry/UgliGeomHandle.h"
00032 #include "UgliGeometry/UgliStripHandle.h"
00033 #include "Validity/VldContext.h"
00034
00035
00036 ClassImp(AlgSliceListFromChopList)
00037 CVSID( " $Id: AlgSliceListFromChopList.cxx,v 1.3 2005/05/26 10:35:44 tagg Exp $ ");
00038
00039
00040
00041 AlgSliceListFromChopList::AlgSliceListFromChopList()
00042 {
00043 }
00044
00045
00046 AlgSliceListFromChopList::~AlgSliceListFromChopList()
00047 {
00048 }
00049
00050
00051
00052 void AlgSliceListFromChopList::RunAlg(AlgConfig & algConfig,
00053 CandHandle &candHandle,
00054 CandContext &candContext)
00055 {
00061
00062
00063 assert(candHandle.InheritsFrom("CandSliceListHandle"));
00064
00065
00066 const char* stripListAlgorithm = algConfig.GetCharString("StripListAlgorithm");
00067 const char* stripListAlgConfig = algConfig.GetCharString("StripListAlgConfig");
00068
00069
00070 AlgFactory &af = AlgFactory::GetInstance();
00071 AlgHandle ah = af.GetAlgHandle(stripListAlgorithm,stripListAlgConfig);
00072 CandContext cxx(this,candContext.GetMom());
00073 cxx.SetCandRecord(candHandle.GetCandRecord());
00074
00075
00076 const CandChopListHandle* chopList =
00077 dynamic_cast<const CandChopListHandle*>(candContext.GetDataIn());
00078
00079 if(!chopList) {
00080 MSG("Chop",Msg::kError) << "Data input to AlgSliceListFromChopList was bad." << std::endl;
00081 return;
00082 }
00083
00084 Int_t nslice=0;
00085 CandDigitListHandleItr chopItr(chopList->GetDaughterIterator());
00086 while( CandDigitListHandle* chop = chopItr()) {
00087 cxx.SetDataIn(chop);
00088 CandSliceHandle slice = CandSlice::MakeCandidate(ah,cxx);
00089
00090 slice.SetName(Form("Slice%d",nslice));
00091 slice.SetTitle(Form("Slice%d from %s",nslice,chop->GetName()));
00092 candHandle.AddDaughterLink(slice);
00093 nslice++;
00094 }
00095
00096 }
00097
00098
00099 void AlgSliceListFromChopList::Trace(const char * ) const
00100 {
00101 }