2022-08-04 17:27:33 -04:00
|
|
|
#include "DigitizerPHA.h"
|
|
|
|
//#include "DigitizerPSD.h"
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]){
|
|
|
|
|
|
|
|
DigitizerPHA * dig = new DigitizerPHA[2];
|
2022-08-04 17:27:33 -04:00
|
|
|
//DigitizerPSD * psd = new DigitizerPSD();
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-04 18:02:03 -04:00
|
|
|
dig[0].OpenDigitizer(0,0, true);
|
|
|
|
dig[1].OpenDigitizer(1,0, true);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-04 17:27:33 -04:00
|
|
|
//psd->OpenDigitizer(2,0);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
printf("======================= \n");
|
|
|
|
|
|
|
|
//dig[0].SetDCOffset(0.2);
|
|
|
|
//dig[0].SetDCOffset(0.3, 1);
|
|
|
|
|
2022-08-04 17:27:33 -04:00
|
|
|
//dig[0].SetRecordLength(2000);
|
|
|
|
//dig[0].SetEventAggregation(0);
|
|
|
|
//dig[0].SetInputDynamicRange(0);
|
|
|
|
//dig[0].SetNumSamplePreTrigger(500);
|
|
|
|
//dig[0].SetDCOffset(0.1);
|
|
|
|
//dig[0].SetTriggerPolarity(0);
|
|
|
|
//
|
|
|
|
//dig[0].SetTrapezoidRescaling(31);
|
|
|
|
//dig[0].SetPeakSampling(3);
|
|
|
|
//dig[0].SetPulsePolarity(1);
|
|
|
|
//dig[0].SetBaselineSampling(4);
|
|
|
|
//dig[0].SetRollOverFlag(0);
|
|
|
|
//dig[0].SetPileUpFlag(1);
|
|
|
|
|
|
|
|
//dig[0].SetPulsePolarity(0, 1);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
//for( int ch = 0; ch < dig[0].GetNChannel(); ch++){
|
|
|
|
// uint32_t data = dig[0].ReadRegister((uint32_t) RegisterDPP::ChannelDCOffset, ch);
|
|
|
|
// printf(" %d %% \n", data );
|
|
|
|
//}
|
|
|
|
|
2022-08-04 17:27:33 -04:00
|
|
|
dig[0].SetTriggerThreshold(2400);
|
|
|
|
dig[0].SetTriggerHoldOff(100);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
2022-08-04 17:27:33 -04:00
|
|
|
dig[0].PrintBoardConfiguration();
|
|
|
|
dig[0].GetChannelSettingFromDigitizer(0);
|
|
|
|
dig[0].GetChannelSettingFromDigitizer(1);
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
delete [] dig;
|
2022-08-04 17:27:33 -04:00
|
|
|
//delete psd;
|
2022-08-03 19:00:41 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|