00001 00002 // $Id: AlgChop.cxx,v 1.1.1.1 2005/05/16 15:17:11 tagg Exp $ 00003 // 00004 // AlgChop.cxx 00005 // 00007 00008 #include <cassert> 00009 00010 #include "CandChop/AlgChop.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 "MessageService/MsgService.h" 00023 #include "MinosObjectMap/MomNavigator.h" 00024 #include "RawData/RawHeader.h" 00025 #include "RawData/RawRecord.h" 00026 #include "RawData/RawDigitDataBlock.h" 00027 #include "UgliGeometry/UgliGeomHandle.h" 00028 #include "UgliGeometry/UgliStripHandle.h" 00029 #include "Validity/VldContext.h" 00030 00031 #include <vector> 00032 00033 ClassImp(AlgChop) 00034 CVSID( " $Id: AlgChop.cxx,v 1.1.1.1 2005/05/16 15:17:11 tagg Exp $ "); 00035 00036 00037 //______________________________________________________________________ 00038 AlgChop::AlgChop() 00039 { 00040 } 00041 00042 //______________________________________________________________________ 00043 AlgChop::~AlgChop() 00044 { 00045 } 00046 00047 //______________________________________________________________________ 00048 00049 void AlgChop::RunAlg(AlgConfig & /*algConfig*/, 00050 CandHandle &candHandle, // thing to make 00051 CandContext &candContext) 00052 { 00056 00057 const DigitVector* data_ptr = 00058 dynamic_cast<const DigitVector*>((candContext.GetDataIn())); 00059 00060 if(!data_ptr) { 00061 MSG("Chop",Msg::kError) << "Data input to AlgChop was bad." << std::endl; 00062 return; 00063 } 00064 00065 assert(candHandle.InheritsFrom("CandDigitListHandle")); 00066 CandDigitListHandle &digitList = dynamic_cast<CandDigitListHandle &>(candHandle); 00067 00068 // Loop through the digits and add them. 00069 // Select the first non-veto digit to be the start time for the slice. 00070 00071 double tfirst = 9e99; 00072 00073 for(UInt_t i=0;i<data_ptr->size(); i++) { 00074 CandDigitHandle digit = (*data_ptr)[i]; 00075 digitList.AddDaughterLink(digit); 00076 00077 if(! (digit.GetPlexSEIdAltL().IsVetoShield()) ) { 00078 double t = digit.GetTime(); 00079 if(t<tfirst) tfirst = t; 00080 } 00081 } 00082 00083 if(tfirst==9e99) tfirst = 0; 00084 digitList.SetAbsTime(tfirst); 00085 } 00086 00087 //______________________________________________________________________ 00088 void AlgChop::Trace(const char * /* c */) const 00089 { 00090 }
1.3.9.1