00001 #include "TAPGeneratorFactory.h" 00002 #include "SimpIntAPGenerator.h" 00003 #include "TPulseIsland.h" 00004 #include "TAnalysedPulse.h" 00005 #include "SetupNavigator.h" 00006 #include <iostream> 00007 using std::cout; 00008 using std::endl; 00009 00010 SimpIntAPGenerator::SimpIntAPGenerator(TAPGeneratorOptions* opts): 00011 TVAnalysedPulseGenerator("SimpInt", opts), 00012 fSimpleIntegral(SetupNavigator::Instance()->GetPedestal(GetChannel()), 00013 TSetupData::Instance()->GetTriggerPolarity(TSetupData::Instance()->GetBankName(GetChannel().str()))) { 00014 00015 } 00016 00017 int SimpIntAPGenerator::ProcessPulses( 00018 const PulseIslandList& pulseList, AnalysedPulseList& analysedList) 00019 { 00020 TAnalysedPulse* outPulse; 00021 00022 for(PulseIslandList::const_iterator pIt = pulseList.begin(); pIt != pulseList.end(); pIt++) 00023 { 00024 // We will need new calibration parameters from integral method 00025 // energy = fECalibSlope* integral + fECalibOffset; 00026 double integral = fSimpleIntegral(*pIt); 00027 00028 outPulse=MakeNewTAP(pIt-pulseList.begin()); 00029 outPulse->SetIntegral(integral); 00030 // outPulse->SetEnergy(energy); 00031 // Add the pulse to the TAP list 00032 analysedList.push_back(outPulse); 00033 } 00034 00035 00036 // returning 0 tells the caller that we were successful, return non-zero if not 00037 return 0; 00038 } 00039 00040 // Similar to the modules, this macro registers the generator with 00041 // MakeAnalysedPulses. The first argument is compulsory and gives the name of 00042 // this generator. All subsequent arguments will be used as names for arguments 00043 // given directly within the modules file. See the github wiki for more. 00044 // 00045 // NOTE: for TAP generators OMIT the APGenerator part of the class' name 00046 ALCAP_TAP_GENERATOR(SimpInt);