Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AlgSliceListFromChopList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: AlgSliceListFromChopList.cxx,v 1.3 2005/05/26 10:35:44 tagg Exp $
00003 //
00004 // AlgSliceListFromChopList.cxx
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,  // thing to make
00054                        CandContext &candContext)
00055 {
00061 
00062   // Make sure output is the right kind.
00063   assert(candHandle.InheritsFrom("CandSliceListHandle"));
00064 
00065   // Get config parameters.
00066   const char* stripListAlgorithm = algConfig.GetCharString("StripListAlgorithm");
00067   const char* stripListAlgConfig = algConfig.GetCharString("StripListAlgConfig");
00068 
00069   // Set up the strip maker.
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   // Get the input data (the list of Chops)
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); // Some slight jiggery-pokery here: 
00089                                                               // I'm running a strip algorithm to make a slice
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 * /* c */) const
00100 {
00101 }

Generated on Mon Feb 15 11:06:19 2010 for loon by  doxygen 1.3.9.1