00001 #include "TDPGeneratorFactory.h" 00002 #include "debug_tools.h" 00003 #include "PassThroughDPGenerator.h" 00004 #include <iostream> 00005 using std::cout; 00006 using std::endl; 00007 00008 IDs::generator PassThroughDPGenerator::fStaticId = IDs::generator("PassThrough", IDs::kAnyConfig); 00009 00010 PassThroughDPGenerator::PassThroughDPGenerator(TDPGeneratorOptions* opts): 00011 TVDetectorPulseGenerator("PassThrough",opts), fUseFast(opts->GetBool("use_fast",true)){ 00012 // double check that we can use the slow source, ie. for detectors where 00013 // the fast / slow channel are different 00014 } 00015 00016 int PassThroughDPGenerator::ProcessPulses( DetectorPulseList& output){ 00017 const AnalysedPulseList* pulses=PulseList(fUseFast); 00018 // Major hack to force fill both channels in the produced TDP which makes 00019 // later analysis easier 00020 SetPulseLists(pulses,pulses); 00021 for(AnalysedPulseList::const_iterator i_pulse=pulses->begin(); 00022 i_pulse!=pulses->end(); i_pulse++){ 00023 TDetectorPulse* det_pulse = MakeTDP(i_pulse-pulses->begin(),i_pulse-pulses->begin()); // Create the TDetectorPulse 00024 output.push_back(det_pulse); 00025 } 00026 return 0; 00027 } 00028 00029 ALCAP_TDP_GENERATOR(PassThrough,use_fast);