channelSetting to channelSettingPHA

This commit is contained in:
carina@hades 2022-09-23 17:43:30 -04:00
parent 6a64b37e38
commit 90643460d3
7 changed files with 209 additions and 146 deletions

View File

@ -24,7 +24,8 @@ enum MenuIdentifiers{
M_FILE_OPEN, M_FILE_OPEN,
M_EXIT, M_EXIT,
M_TRIGGER_SUMMARY, M_TRIGGER_SUMMARY,
M_CH_SETTING, M_CH_SETTING_PHA,
M_CH_SETTING_PSD,
M_BOARD_SETTINGS, M_BOARD_SETTINGS,
M_PROGRAM_SETTINGS, M_PROGRAM_SETTINGS,
M_FINDPEAKS, M_FINDPEAKS,
@ -63,7 +64,8 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
fMenuDigitizers->AddEntry("&Trigger Summary", M_TRIGGER_SUMMARY); fMenuDigitizers->AddEntry("&Trigger Summary", M_TRIGGER_SUMMARY);
fMenuDigitizers->AddSeparator(); fMenuDigitizers->AddSeparator();
fMenuDigitizers->AddEntry("Digitizer &Settings", M_BOARD_SETTINGS); fMenuDigitizers->AddEntry("Digitizer &Settings", M_BOARD_SETTINGS);
fMenuDigitizers->AddEntry("&Channel Settings", M_CH_SETTING); fMenuDigitizers->AddEntry("&Channel Settings (PHA)", M_CH_SETTING_PHA);
fMenuDigitizers->AddEntry("&Channel Settings (PSD)", M_CH_SETTING_PSD);
fMenuDigitizers->AddSeparator(); fMenuDigitizers->AddSeparator();
fMenuDigitizers->AddEntry("&Program Settings", M_PROGRAM_SETTINGS); fMenuDigitizers->AddEntry("&Program Settings", M_PROGRAM_SETTINGS);
fMenuDigitizers->Connect("Activated(Int_t)", "MainWindow", this, "HandleMenu(Int_t)"); fMenuDigitizers->Connect("Activated(Int_t)", "MainWindow", this, "HandleMenu(Int_t)");
@ -129,15 +131,15 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
///settingsSummary = NULL; ///settingsSummary = NULL;
boardSetting = NULL; boardSetting = NULL;
channelSetting = NULL; channelSettingPHA = NULL;
///scalarPanel = NULL; ///scalarPanel = NULL;
LogMsg("Ready to run."); LogMsg("Ready to run.");
//HandleMenu(M_DIGITIZER_SCAN); //HandleMenu(M_DIGITIZER_SCAN);
// //
//HandleMenu(M_BOARD_SETTINGS); HandleMenu(M_BOARD_SETTINGS);
HandleMenu(M_CH_SETTING); //HandleMenu(M_CH_SETTING_PHA);
} }
MainWindow::~MainWindow() { MainWindow::~MainWindow() {
@ -154,7 +156,7 @@ MainWindow::~MainWindow() {
if( digi != NULL ) delete [] digi; if( digi != NULL ) delete [] digi;
delete boardSetting; delete boardSetting;
delete channelSetting; delete channelSettingPHA;
//delete settingsSummary; //delete settingsSummary;
//delete scalarPanel; //delete scalarPanel;
@ -226,9 +228,9 @@ void MainWindow::HandleMenu(Int_t id){
}break; }break;
///========================= Channel setting ///========================= Channel setting
case M_CH_SETTING: case M_CH_SETTING_PHA:
channelSetting = new ChannelSetting(gClient->GetRoot(), 600, 600, digi, nDigi); channelSettingPHA = new ChannelSettingPHA(gClient->GetRoot(), 600, 600, digi, nDigi, 0);
channelSetting->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)"); channelSettingPHA->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)");
break; break;
@ -237,6 +239,7 @@ void MainWindow::HandleMenu(Int_t id){
if( boardSetting == NULL ) { if( boardSetting == NULL ) {
boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi); boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
boardSetting->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)"); boardSetting->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)");
boardSetting->Connect("Haha(Int_t)", "MainWindow", this, "OpenChannelSetting(Int_t)");
}else{ }else{
if ( boardSetting->IsOpen() == false ){ if ( boardSetting->IsOpen() == false ){
boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi); boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi);
@ -326,6 +329,16 @@ void MainWindow::GoodBye(){
} }
void MainWindow::OpenChannelSetting(Int_t boardID){
printf("#### %s \n", __func__);
//if( digi[boardID]->GetDPPType() == V1730_DPP_PHA_CODE ){
channelSettingPHA = new ChannelSettingPHA(gClient->GetRoot(), 600, 600, digi, nDigi, boardID);
channelSettingPHA->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)");
//}
}
void MainWindow::LogMsg(char * msg){ void MainWindow::LogMsg(char * msg){
time_t now = time(0); time_t now = time(0);

View File

@ -17,7 +17,7 @@
#include "DigitizerPSD.h" #include "DigitizerPSD.h"
#include "boardSetting.h" #include "boardSetting.h"
#include "channelSetting.h" #include "channelSettingPHA.h"
///#include "settingsSummary.h" ///#include "settingsSummary.h"
///#include "scalarPanel.h" ///#include "scalarPanel.h"
@ -55,7 +55,7 @@ private:
static DigitizerPSD ** psd; static DigitizerPSD ** psd;
BoardSetting * boardSetting; BoardSetting * boardSetting;
ChannelSetting * channelSetting; ChannelSettingPHA * channelSettingPHA;
//SettingsSummary * settingsSummary; //SettingsSummary * settingsSummary;
//ScalarPanel * scalarPanel; //ScalarPanel * scalarPanel;
@ -69,6 +69,7 @@ private:
// //
//TGTextEditor * configEditor; //TGTextEditor * configEditor;
public: public:
MainWindow(const TGWindow *p, UInt_t w, UInt_t h); MainWindow(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~MainWindow(); virtual ~MainWindow();
@ -89,6 +90,7 @@ public:
//void ChangeMod(); //void ChangeMod();
//void ChangeChannel(); //void ChangeChannel();
void OpenChannelSetting(Int_t);
void LogMsg(char * ); void LogMsg(char * );
void GoodBye(); void GoodBye();
}; };

View File

@ -11,7 +11,7 @@ CAENLIBS = -lCAENDigitizer
ROOTLIBS = `root-config --cflags --glibs` ROOTLIBS = `root-config --cflags --glibs`
OBJS = channelSetting.o boardSetting.o ClassDigitizer.o DigitizerPHA.o DigitizerPSD.o FSUDAQ.o OBJS = channelSettingPHA.o boardSetting.o ClassDigitizer.o DigitizerPHA.o DigitizerPSD.o FSUDAQ.o
######################################################################### #########################################################################
@ -55,9 +55,9 @@ boardSetting.o : boardSetting.h boardSetting.cpp
@echo "----------- creating boardSetting.o" @echo "----------- creating boardSetting.o"
$(CC) $(COPTS) -c boardSetting.cpp $(ROOTLIBS) $(CC) $(COPTS) -c boardSetting.cpp $(ROOTLIBS)
channelSetting.o : channelSetting.h channelSetting.cpp channelSettingPHA.o : channelSettingPHA.h channelSettingPHA.cpp
@echo "----------- creating channelSetting.o" @echo "----------- creating channelSettingPHA.o"
$(CC) $(COPTS) -c channelSetting.cpp $(ROOTLIBS) $(CC) $(COPTS) -c channelSettingPHA.cpp $(ROOTLIBS)
#CutsCreator: $(OBJS3) src/CutsCreator.c #CutsCreator: $(OBJS3) src/CutsCreator.c

View File

@ -22,11 +22,9 @@ TString boardSettingName[NUM_BOARD_INFO] = { "Model",
Pixel_t BoardSetting::red = 0; Pixel_t BoardSetting::red = 0;
Pixel_t BoardSetting::blue = 0; Pixel_t BoardSetting::blue = 0;
TGNumberEntry * BoardSetting::boardIDEntry = NULL; TGNumberEntry * BoardSetting::boardIDEntry = NULL;
Digitizer ** BoardSetting::digi = NULL; Digitizer ** BoardSetting::digi = NULL;
//DigitizerPHA * BoardSetting::pha = NULL;
//DigitizerPSD * BoardSetting::psd = NULL;
TGTextEntry * BoardSetting::txtACQStatus = NULL; TGTextEntry * BoardSetting::txtACQStatus = NULL;
TGTextEntry * BoardSetting::txtACQEventReady = NULL; TGTextEntry * BoardSetting::txtACQEventReady = NULL;
TGTextEntry * BoardSetting::txtACQEventFull = NULL; TGTextEntry * BoardSetting::txtACQEventFull = NULL;
@ -120,7 +118,7 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
TGHorizontalFrame * hRow3 = new TGHorizontalFrame(vframe); vframe->AddFrame(hRow3, new TGLayoutHints(kLHintsExpandX)); TGHorizontalFrame * hRow3 = new TGHorizontalFrame(vframe); vframe->AddFrame(hRow3, new TGLayoutHints(kLHintsExpandX));
{///========= ACD Status {///========= ACD Status
TGGroupFrame * gAcqStatus = new TGGroupFrame(hRow3, "ACQ Status", kHorizontalFrame); hRow3->AddFrame(gAcqStatus, new TGLayoutHints(kLHintsExpandX)); TGGroupFrame * gAcqStatus = new TGGroupFrame(hRow3, "ACQ Status", kHorizontalFrame); hRow3->AddFrame(gAcqStatus, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGHorizontalFrame * hfAcqStatus = new TGHorizontalFrame(gAcqStatus); gAcqStatus->AddFrame(hfAcqStatus, new TGLayoutHints(kLHintsExpandX)); TGHorizontalFrame * hfAcqStatus = new TGHorizontalFrame(gAcqStatus); gAcqStatus->AddFrame(hfAcqStatus, new TGLayoutHints(kLHintsExpandX));
TGVerticalFrame * vAcqStatus1 = new TGVerticalFrame(hfAcqStatus); hfAcqStatus->AddFrame(vAcqStatus1); TGVerticalFrame * vAcqStatus1 = new TGVerticalFrame(hfAcqStatus); hfAcqStatus->AddFrame(vAcqStatus1);
@ -209,7 +207,7 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
} }
{///==========="Readout Status" {///==========="Readout Status"
TGGroupFrame * gReadoutStatus = new TGGroupFrame(hRow3, "Readout Status", kHorizontalFrame); hRow3->AddFrame(gReadoutStatus, new TGLayoutHints( kLHintsExpandY, 5, 5, 0, 0) ); TGGroupFrame * gReadoutStatus = new TGGroupFrame(hRow3, "Readout Status", kHorizontalFrame); hRow3->AddFrame(gReadoutStatus, new TGLayoutHints( kLHintsExpandY, 0, 0, 0, 0) );
TGVerticalFrame * vReadoutStatus = new TGVerticalFrame(gReadoutStatus); gReadoutStatus->AddFrame(vReadoutStatus, new TGLayoutHints(kLHintsCenterY | kLHintsExpandY, 5, 5, 10, 0)); TGVerticalFrame * vReadoutStatus = new TGVerticalFrame(gReadoutStatus); gReadoutStatus->AddFrame(vReadoutStatus, new TGLayoutHints(kLHintsCenterY | kLHintsExpandY, 5, 5, 10, 0));
@ -229,6 +227,14 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
txtVMEFIFO->SetTextColor(blue); txtVMEFIFO->SetTextColor(blue);
} }
TGHorizontalFrame * hRow0 = new TGHorizontalFrame(vframe); vframe->AddFrame(hRow0, new TGLayoutHints( kLHintsExpandX));
//hRow0->ChangeOptions((hRow0->GetOptions() | kFixedHeight));
//hRow0->
TGTextButton * bOpenChannelSetting = new TGTextButton(hRow0, "Open Channel Setting"); hRow0->AddFrame(bOpenChannelSetting, new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 5, 0, 5, 0));
bOpenChannelSetting->SetHeight(40);
bOpenChannelSetting->Connect("Clicked()", "BoardSetting", this, "OpenChannelSetting()");
TGHorizontalFrame * hRow1 = new TGHorizontalFrame(vframe); vframe->AddFrame(hRow1, new TGLayoutHints( kLHintsExpandX)); TGHorizontalFrame * hRow1 = new TGHorizontalFrame(vframe); vframe->AddFrame(hRow1, new TGLayoutHints( kLHintsExpandX));
{///========= Board Configure {///========= Board Configure
@ -619,7 +625,7 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
cbAnaMonitor->AddEntry("Voltage Level", 4); cbAnaMonitor->AddEntry("Voltage Level", 4);
cbAnaMonitor->Resize(150, 20); cbAnaMonitor->Resize(150, 20);
cbAnaMonitor->Connect("Changed()", "BoardSetting", this, "SetAnalogMonitorMode()"); cbAnaMonitor->Connect("Changed()", "BoardSetting", this, "SetAnalogMonitorMode()");
//cbAnaMonitor->Connect("Changed()", "ChannelSetting", this, "ChangePolarity()"); //Example to call other class //cbAnaMonitor->Connect("Changed()", "ChannelSettingPHA", this, "ChangePolarity()"); //Example to call other class
///"Buffer Occupancy Gain ///"Buffer Occupancy Gain
TGLabel * lbBufferOccpGain = new TGLabel(vFrontIOCtrl_label, "Buffer Occupancy Gain"); vFrontIOCtrl_label->AddFrame(lbBufferOccpGain, haha); TGLabel * lbBufferOccpGain = new TGLabel(vFrontIOCtrl_label, "Buffer Occupancy Gain"); vFrontIOCtrl_label->AddFrame(lbBufferOccpGain, haha);
@ -1034,6 +1040,18 @@ void BoardSetting::ChangeBoard(){
//################################################ Change Settings //################################################ Change Settings
void BoardSetting::OpenChannelSetting(){
printf("=== %s\n", __func__);
Int_t boardID = boardIDEntry->GetNumber();
Haha(boardID);
}
void BoardSetting::Haha(Int_t boardID){ /// this is for sending signal to mainwindow to open channel setting for the board
printf("=== %s\n", __func__);
Emit("Haha(Int_t)", boardID);
}
void BoardSetting::ResetSettingToDefault(){ /// same for PHA and PSD void BoardSetting::ResetSettingToDefault(){ /// same for PHA and PSD
printf("=== %s\n", __func__); printf("=== %s\n", __func__);

View File

@ -30,8 +30,6 @@ class BoardSetting{
int nDigi; int nDigi;
static Digitizer ** digi; static Digitizer ** digi;
//static DigitizerPHA * pha;
//static DigitizerPSD * psd;
/// board failure status /// board failure status
TGTextEntry * enPLLStatus; TGTextEntry * enPLLStatus;
@ -139,6 +137,8 @@ class BoardSetting{
///=== Button ///=== Button
void ResetSettingToDefault(); void ResetSettingToDefault();
void ClearBuffer(); void ClearBuffer();
void OpenChannelSetting();
///=== Board Configure ///=== Board Configure
void SetBoardConfiguration(); void SetBoardConfiguration();
@ -169,7 +169,8 @@ class BoardSetting{
///==== Readout Control ///==== Readout Control
void SetReadOutControl(); void SetReadOutControl();
///==== Others
void LogMsg(TString msg); // *SIGNAL* void LogMsg(TString msg); // *SIGNAL*
void Haha(Int_t boardID); // *SIGNAL*
}; };
#endif #endif

View File

@ -8,19 +8,20 @@
#include <TGTableContainer.h> #include <TGTableContainer.h>
#include <TGFileDialog.h> #include <TGFileDialog.h>
#include "channelSetting.h" #include "channelSettingPHA.h"
ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nDigi){ ChannelSettingPHA::ChannelSettingPHA(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nDigi, int boardID){
this->digi = digi; this->digi = digi;
this->nDigi = nDigi;
Pixel_t red, green; Pixel_t red, green;
gClient->GetColorByName("red", red); gClient->GetColorByName("red", red);
gClient->GetColorByName("green", green); gClient->GetColorByName("green", green);
fMain = new TGMainFrame(p,w,h); fMain = new TGMainFrame(p,w,h);
fMain->SetWindowName("Channel Settings "); fMain->SetWindowName("Channel Settings PHA");
fMain->Connect("CloseWindow()", "ChannelSetting", this, "CloseWindow()"); fMain->Connect("CloseWindow()", "ChannelSettingPHA", this, "CloseWindow()");
TGLayoutHints * layoutHintsR = new TGLayoutHints(kLHintsRight, 5,5,3,2); /// left, right, top, bottom TGLayoutHints * layoutHintsR = new TGLayoutHints(kLHintsRight, 5,5,3,2); /// left, right, top, bottom
TGLayoutHints * layoutHints = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5,5,0,0); /// left, right, top, bottom TGLayoutHints * layoutHints = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5,5,0,0); /// left, right, top, bottom
@ -32,12 +33,14 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
///==========Board choose ///==========Board choose
TGLabel * lb0 = new TGLabel(hframe0, "Module ID :"); hframe0->AddFrame(lb0, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); TGLabel * lb0 = new TGLabel(hframe0, "Module ID :"); hframe0->AddFrame(lb0, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
boardIDEntry = new TGNumberEntry(hframe0, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hframe0->AddFrame(boardIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); boardIDEntry = new TGNumberEntry(hframe0, boardID, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hframe0->AddFrame(boardIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
boardIDEntry->SetWidth(50); boardIDEntry->SetWidth(50);
boardIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, nDigi); boardIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, nDigi);
boardIDEntry->Connect("Modified()", "ChannelSetting", this, "ChangeBoard()"); boardIDEntry->Connect("Modified()", "ChannelSettingPHA", this, "ChangeBoard()");
if( nDigi <= 1 ) boardIDEntry->SetState(false); if( nDigi <= 1 ) boardIDEntry->SetState(false);
this->presentBoardID = boardID;
NChannel = 16 ;// digi[0]->GetNChannel(); NChannel = 16 ;// digi[0]->GetNChannel();
TGLabel * lb1 = new TGLabel(hframe0, "Channel :"); hframe0->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); TGLabel * lb1 = new TGLabel(hframe0, "Channel :"); hframe0->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
@ -45,13 +48,12 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
chIDEntry->SetWidth(50); chIDEntry->SetWidth(50);
chIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, NChannel-1); chIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, -1, NChannel-1);
chIDEntry->SetNumber(0, false); chIDEntry->SetNumber(0, false);
chIDEntry->Connect("Modified()", "ChannelSetting", this, "ChangeCh()"); chIDEntry->Connect("Modified()", "ChannelSettingPHA", this, "ChangeCh()");
hframe0->AddFrame(chIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4)); hframe0->AddFrame(chIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
TGTextButton* bSetAllChannels = new TGTextButton(hframe0, "Set All Channels", 1); hframe0->AddFrame(bSetAllChannels, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); TGTextButton* bSetAllChannels = new TGTextButton(hframe0, "Set All Channels", 1); hframe0->AddFrame(bSetAllChannels, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
bSetAllChannels->SetState(kButtonUp); bSetAllChannels->SetState(kButtonUp);
bSetAllChannels->Connect("Clicked()", "ChannelSetting", this, "SetAllChannels()"); bSetAllChannels->Connect("Clicked()", "ChannelSettingPHA", this, "SetAllChannels()");
///const uint32_t ChannelADCTemperature = 0x10A8; /// R ///const uint32_t ChannelADCTemperature = 0x10A8; /// R
TGLabel * lbTemp = new TGLabel(hframe0, "Temperature [C] :"); hframe0->AddFrame(lbTemp, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4)); TGLabel * lbTemp = new TGLabel(hframe0, "Temperature [C] :"); hframe0->AddFrame(lbTemp, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
@ -59,7 +61,6 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
eTemp->SetEnabled(false); eTemp->SetEnabled(false);
eTemp->Resize(50,20); eTemp->Resize(50,20);
int boardID = boardIDEntry->GetNumber();
int ch = chIDEntry->GetNumber(); int ch = chIDEntry->GetNumber();
int width = 80; int width = 80;
@ -78,7 +79,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbOnOff->AddEntry("ON", 1); cbOnOff->AddEntry("ON", 1);
cbOnOff->AddEntry("off", 0); cbOnOff->AddEntry("off", 0);
cbOnOff->Resize(width, 20); cbOnOff->Resize(width, 20);
cbOnOff->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "SetChannelMask()"); cbOnOff->Connect("Selected(Int_t, Int_t)", "ChannelSettingPHA", this, "SetChannelMask()");
///----------- Polarity ///----------- Polarity
TGLabel * lbPol = new TGLabel(vfInput1, "Polarity");vfInput1->AddFrame(lbPol, layoutHintsR); TGLabel * lbPol = new TGLabel(vfInput1, "Polarity");vfInput1->AddFrame(lbPol, layoutHintsR);
@ -86,7 +87,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbPolarity->AddEntry("Positive +", 1); cbPolarity->AddEntry("Positive +", 1);
cbPolarity->AddEntry("Negative -", 0); cbPolarity->AddEntry("Negative -", 0);
cbPolarity->Resize(width, 20); cbPolarity->Resize(width, 20);
cbPolarity->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbPolarity->Connect("Selected(Int_t, Int_t)", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
///---------- Input Dynamic Range ///---------- Input Dynamic Range
TGLabel * lbInputDynamicRange = new TGLabel(vfInput1, "Input Range");vfInput1->AddFrame(lbInputDynamicRange, layoutHintsR); TGLabel * lbInputDynamicRange = new TGLabel(vfInput1, "Input Range");vfInput1->AddFrame(lbInputDynamicRange, layoutHintsR);
@ -94,25 +95,25 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbInputDynamicRange->AddEntry("2.0 Vpp", 0); cbInputDynamicRange->AddEntry("2.0 Vpp", 0);
cbInputDynamicRange->AddEntry("0.5 Vpp", 1); cbInputDynamicRange->AddEntry("0.5 Vpp", 1);
cbInputDynamicRange->Resize(width, 20); cbInputDynamicRange->Resize(width, 20);
cbInputDynamicRange->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "SetInputDynamicRange()"); cbInputDynamicRange->Connect("Selected(Int_t, Int_t)", "ChannelSettingPHA", this, "SetInputDynamicRange()");
///---------- Record Length ///---------- Record Length
TGLabel * lbRecordLength = new TGLabel(vfInput1, "Record Length [ns]"); vfInput1->AddFrame(lbRecordLength, layoutHintsR); TGLabel * lbRecordLength = new TGLabel(vfInput1, "Record Length [ns]"); vfInput1->AddFrame(lbRecordLength, layoutHintsR);
numRecordLength = new TGNumberEntry(vfInput2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numRecordLength, layoutHints); numRecordLength = new TGNumberEntry(vfInput2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numRecordLength, layoutHints);
numRecordLength->Resize(width, 20); numRecordLength->Resize(width, 20);
numRecordLength->Connect("Modified()", "ChannelSetting", this, "SetRecordLength()"); numRecordLength->Connect("Modified()", "ChannelSettingPHA", this, "SetRecordLength()");
///const uint32_t PreTrigger = 0x1038; /// R/W ///const uint32_t PreTrigger = 0x1038; /// R/W
TGLabel * lbPreTrigger = new TGLabel(vfInput1, "Pre trigger [ns]"); vfInput1->AddFrame(lbPreTrigger, layoutHintsR); TGLabel * lbPreTrigger = new TGLabel(vfInput1, "Pre trigger [ns]"); vfInput1->AddFrame(lbPreTrigger, layoutHintsR);
numPreTrigger = new TGNumberEntry(vfInput2, 2000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numPreTrigger, layoutHints); numPreTrigger = new TGNumberEntry(vfInput2, 2000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numPreTrigger, layoutHints);
numPreTrigger->Resize(width, 20); numPreTrigger->Resize(width, 20);
numPreTrigger->Connect("Modified()", "ChannelSetting", this, "SetPreTrigger()"); numPreTrigger->Connect("Modified()", "ChannelSettingPHA", this, "SetPreTrigger()");
///const uint32_t NumberEventsPerAggregate_G = 0x1034; /// R/W, ///const uint32_t NumberEventsPerAggregate_G = 0x1034; /// R/W,
TGLabel * lbEventAgg = new TGLabel(vfInput1, "Events / Aggregate"); vfInput1->AddFrame(lbEventAgg, layoutHintsR); TGLabel * lbEventAgg = new TGLabel(vfInput1, "Events / Aggregate"); vfInput1->AddFrame(lbEventAgg, layoutHintsR);
numEventAgg = new TGNumberEntry(vfInput2, 512, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numEventAgg, layoutHints); numEventAgg = new TGNumberEntry(vfInput2, 512, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numEventAgg, layoutHints);
numEventAgg->Resize(width, 20); numEventAgg->Resize(width, 20);
numEventAgg->Connect("Modified()", "ChannelSetting", this, "SetEventAggregate()"); numEventAgg->Connect("Modified()", "ChannelSettingPHA", this, "SetEventAggregate()");
///const uint32_t ShapedTriggerWidth = 0x1084; /// R/W not sure ///const uint32_t ShapedTriggerWidth = 0x1084; /// R/W not sure
///const uint32_t VetoWidth = 0x10D4; /// R/W ///const uint32_t VetoWidth = 0x10D4; /// R/W
@ -131,19 +132,19 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
TGLabel * lbTriggerThreshold = new TGLabel(vfTrigger1, "Trigger Threshold [LSB]"); vfTrigger1->AddFrame(lbTriggerThreshold, layoutHintsR); TGLabel * lbTriggerThreshold = new TGLabel(vfTrigger1, "Trigger Threshold [LSB]"); vfTrigger1->AddFrame(lbTriggerThreshold, layoutHintsR);
numTriggerThreshold = new TGNumberEntry(vfTrigger2, 100, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerThreshold, layoutHints); numTriggerThreshold = new TGNumberEntry(vfTrigger2, 100, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerThreshold, layoutHints);
numTriggerThreshold->Resize(width, 20); numTriggerThreshold->Resize(width, 20);
numTriggerThreshold->Connect("Modified()", "ChannelSetting", this, "SetTriggerThreshold()"); numTriggerThreshold->Connect("Modified()", "ChannelSettingPHA", this, "SetTriggerThreshold()");
///const uint32_t TriggerHoldOffWidth = 0x1074; /// R/W ///const uint32_t TriggerHoldOffWidth = 0x1074; /// R/W
TGLabel * lbTriggerHoldOff = new TGLabel(vfTrigger1, "Trigger Holdoff [ns]"); vfTrigger1->AddFrame(lbTriggerHoldOff, layoutHintsR); TGLabel * lbTriggerHoldOff = new TGLabel(vfTrigger1, "Trigger Holdoff [ns]"); vfTrigger1->AddFrame(lbTriggerHoldOff, layoutHintsR);
numTriggerHoldOff = new TGNumberEntry(vfTrigger2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerHoldOff, layoutHints); numTriggerHoldOff = new TGNumberEntry(vfTrigger2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerHoldOff, layoutHints);
numTriggerHoldOff->Resize(width, 20); numTriggerHoldOff->Resize(width, 20);
numTriggerHoldOff->Connect("Modified()", "ChannelSetting", this, "SetTriggerHoldOff()"); numTriggerHoldOff->Connect("Modified()", "ChannelSettingPHA", this, "SetTriggerHoldOff()");
///const uint32_t ChannelDCOffset = 0x1098; /// R/W ///const uint32_t ChannelDCOffset = 0x1098; /// R/W
TGLabel * lbDCOffset = new TGLabel(vfTrigger1, "DC offset [%]"); vfTrigger1->AddFrame(lbDCOffset, layoutHintsR); TGLabel * lbDCOffset = new TGLabel(vfTrigger1, "DC offset [%]"); vfTrigger1->AddFrame(lbDCOffset, layoutHintsR);
numDCOffset = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numDCOffset, layoutHints); numDCOffset = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numDCOffset, layoutHints);
numDCOffset->Resize(width, 20); numDCOffset->Resize(width, 20);
numDCOffset->Connect("Modified()", "ChannelSetting", this, "SetDCOffset()"); numDCOffset->Connect("Modified()", "ChannelSettingPHA", this, "SetDCOffset()");
///const uint32_t RCCR2SmoothingFactor = 0x1054; /// R/W Trigger Filter smoothing, triggerSmoothingFactor ///const uint32_t RCCR2SmoothingFactor = 0x1054; /// R/W Trigger Filter smoothing, triggerSmoothingFactor
TGLabel * lbTriggerSmoothing = new TGLabel(vfTrigger1, "Trigger Smoothing"); vfTrigger1->AddFrame(lbTriggerSmoothing, layoutHintsR); TGLabel * lbTriggerSmoothing = new TGLabel(vfTrigger1, "Trigger Smoothing"); vfTrigger1->AddFrame(lbTriggerSmoothing, layoutHintsR);
@ -157,19 +158,19 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbTriggerSmoothing->AddEntry("64 samples", 32); cbTriggerSmoothing->AddEntry("64 samples", 32);
cbTriggerSmoothing->AddEntry("128 samples", 0x3F); cbTriggerSmoothing->AddEntry("128 samples", 0x3F);
cbTriggerSmoothing->Resize(width, 20); cbTriggerSmoothing->Resize(width, 20);
cbTriggerSmoothing->Connect("Changed()", "ChannelSetting", this, "SetTriggerSmoothing()"); cbTriggerSmoothing->Connect("Changed()", "ChannelSettingPHA", this, "SetTriggerSmoothing()");
///const uint32_t InputRiseTime = 0x1058; /// R/W OK ///const uint32_t InputRiseTime = 0x1058; /// R/W OK
TGLabel * lbInputRiseTime = new TGLabel(vfTrigger1, "Input rise time [ns]"); vfTrigger1->AddFrame(lbInputRiseTime, layoutHintsR); TGLabel * lbInputRiseTime = new TGLabel(vfTrigger1, "Input rise time [ns]"); vfTrigger1->AddFrame(lbInputRiseTime, layoutHintsR);
numInputRiseTime = new TGNumberEntry(vfTrigger2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numInputRiseTime, layoutHints); numInputRiseTime = new TGNumberEntry(vfTrigger2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numInputRiseTime, layoutHints);
numInputRiseTime->Resize(width, 20); numInputRiseTime->Resize(width, 20);
numInputRiseTime->Connect("Modified()", "ChannelSetting", this, "SetInputRiseTime()"); numInputRiseTime->Connect("Modified()", "ChannelSettingPHA", this, "SetInputRiseTime()");
///const uint32_t RiseTimeValidationWindow = 0x1070; /// R/W OK ///const uint32_t RiseTimeValidationWindow = 0x1070; /// R/W OK
TGLabel * lbRiseTimeValidWin = new TGLabel(vfTrigger1, "Rise Time Val. Win. [ns]"); vfTrigger1->AddFrame(lbRiseTimeValidWin, layoutHintsR); TGLabel * lbRiseTimeValidWin = new TGLabel(vfTrigger1, "Rise Time Val. Win. [ns]"); vfTrigger1->AddFrame(lbRiseTimeValidWin, layoutHintsR);
numRiseTimeValidWin = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numRiseTimeValidWin, layoutHints); numRiseTimeValidWin = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numRiseTimeValidWin, layoutHints);
numRiseTimeValidWin->Resize(width, 20); numRiseTimeValidWin->Resize(width, 20);
numRiseTimeValidWin->Connect("Modified()", "ChannelSetting", this, "SetRiseTimeValidWin()"); numRiseTimeValidWin->Connect("Modified()", "ChannelSettingPHA", this, "SetRiseTimeValidWin()");
/// DPP1 bit[19:18] /// DPP1 bit[19:18]
TGLabel * lbTriggerMode = new TGLabel(vfTrigger1, "Trig. Mode"); vfTrigger1->AddFrame(lbTriggerMode, layoutHintsR); TGLabel * lbTriggerMode = new TGLabel(vfTrigger1, "Trig. Mode"); vfTrigger1->AddFrame(lbTriggerMode, layoutHintsR);
@ -178,7 +179,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbTriggerMode->AddEntry("Coin.", 1); cbTriggerMode->AddEntry("Coin.", 1);
cbTriggerMode->AddEntry("Anti-Coin.", 3); cbTriggerMode->AddEntry("Anti-Coin.", 3);
cbTriggerMode->Resize(width, 20); cbTriggerMode->Resize(width, 20);
cbTriggerMode->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbTriggerMode->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
} }
{///================== Trapezoid Settings {///================== Trapezoid Settings
@ -192,31 +193,31 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
TGLabel * lbTrapRiseTime = new TGLabel(vfTrap1, "Rise time [ns]"); vfTrap1->AddFrame(lbTrapRiseTime, layoutHintsR); TGLabel * lbTrapRiseTime = new TGLabel(vfTrap1, "Rise time [ns]"); vfTrap1->AddFrame(lbTrapRiseTime, layoutHintsR);
numTrapRiseTime = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapRiseTime, layoutHints); numTrapRiseTime = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapRiseTime, layoutHints);
numTrapRiseTime->Resize(width, 20); numTrapRiseTime->Resize(width, 20);
numTrapRiseTime->Connect("Modified()", "ChannelSetting", this, "SetTrapRiseTime()"); numTrapRiseTime->Connect("Modified()", "ChannelSettingPHA", this, "SetTrapRiseTime()");
///const uint32_t TrapezoidFlatTop = 0x1060; /// R/W OK ///const uint32_t TrapezoidFlatTop = 0x1060; /// R/W OK
TGLabel * lbTrapFlatTop = new TGLabel(vfTrap1, "Flat Top [ns]"); vfTrap1->AddFrame(lbTrapFlatTop, layoutHintsR); TGLabel * lbTrapFlatTop = new TGLabel(vfTrap1, "Flat Top [ns]"); vfTrap1->AddFrame(lbTrapFlatTop, layoutHintsR);
numTrapFlatTop = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapFlatTop, layoutHints); numTrapFlatTop = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapFlatTop, layoutHints);
numTrapFlatTop->Resize(width, 20); numTrapFlatTop->Resize(width, 20);
numTrapFlatTop->Connect("Modified()", "ChannelSetting", this, "SetTrapFlatTop()"); numTrapFlatTop->Connect("Modified()", "ChannelSettingPHA", this, "SetTrapFlatTop()");
///const uint32_t DecayTime = 0x1068; /// R/W OK ///const uint32_t DecayTime = 0x1068; /// R/W OK
TGLabel * lbDecay = new TGLabel(vfTrap1, "Decay [ns]"); vfTrap1->AddFrame(lbDecay, layoutHintsR); TGLabel * lbDecay = new TGLabel(vfTrap1, "Decay [ns]"); vfTrap1->AddFrame(lbDecay, layoutHintsR);
numDecay = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numDecay, layoutHints); numDecay = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numDecay, layoutHints);
numDecay->Resize(width, 20); numDecay->Resize(width, 20);
numDecay->Connect("Modified()", "ChannelSetting", this, "SetDecay()"); numDecay->Connect("Modified()", "ChannelSettingPHA", this, "SetDecay()");
///const uint32_t PeakingTime = 0x1064; /// R/W OK ///const uint32_t PeakingTime = 0x1064; /// R/W OK
TGLabel * lbPeaking = new TGLabel(vfTrap1, "Peaking [ns]"); vfTrap1->AddFrame(lbPeaking, layoutHintsR); TGLabel * lbPeaking = new TGLabel(vfTrap1, "Peaking [ns]"); vfTrap1->AddFrame(lbPeaking, layoutHintsR);
numPeaking = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeaking, layoutHints); numPeaking = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeaking, layoutHints);
numPeaking->Resize(width, 20); numPeaking->Resize(width, 20);
numPeaking->Connect("Modified()", "ChannelSetting", this, "SetPeaking()"); numPeaking->Connect("Modified()", "ChannelSettingPHA", this, "SetPeaking()");
///const uint32_t PeakHoldOff = 0x1078; /// R/W OK ///const uint32_t PeakHoldOff = 0x1078; /// R/W OK
TGLabel * lbPeakHoldOff = new TGLabel(vfTrap1, "Peaking Holdoff [ns]"); vfTrap1->AddFrame(lbPeakHoldOff, layoutHintsR); TGLabel * lbPeakHoldOff = new TGLabel(vfTrap1, "Peaking Holdoff [ns]"); vfTrap1->AddFrame(lbPeakHoldOff, layoutHintsR);
numPeakHoldOff = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeakHoldOff, layoutHints); numPeakHoldOff = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeakHoldOff, layoutHints);
numPeakHoldOff->Resize(width, 20); numPeakHoldOff->Resize(width, 20);
numPeakHoldOff->Connect("Modified()", "ChannelSetting", this, "SetPeakHoldOff()"); numPeakHoldOff->Connect("Modified()", "ChannelSettingPHA", this, "SetPeakHoldOff()");
/// DPP1 bit[13:12] /// DPP1 bit[13:12]
TGLabel * lbPeakMean = new TGLabel(vfTrap1, "Peak Mean"); vfTrap1->AddFrame(lbPeakMean, layoutHintsR); TGLabel * lbPeakMean = new TGLabel(vfTrap1, "Peak Mean"); vfTrap1->AddFrame(lbPeakMean, layoutHintsR);
@ -226,7 +227,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbPeakMean->AddEntry("16 samples", 2); cbPeakMean->AddEntry("16 samples", 2);
cbPeakMean->AddEntry("64 samples", 3); cbPeakMean->AddEntry("64 samples", 3);
cbPeakMean->Resize(width, 20); cbPeakMean->Resize(width, 20);
cbPeakMean->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbPeakMean->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
/// DPP1 bit[22:20] /// DPP1 bit[22:20]
TGLabel * lbBaseLineAvg = new TGLabel(vfTrap1, "Baseline avg."); vfTrap1->AddFrame(lbBaseLineAvg, layoutHintsR); TGLabel * lbBaseLineAvg = new TGLabel(vfTrap1, "Baseline avg."); vfTrap1->AddFrame(lbBaseLineAvg, layoutHintsR);
@ -239,7 +240,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbBaseLineAvg->AddEntry("4096 sp.", 5); cbBaseLineAvg->AddEntry("4096 sp.", 5);
cbBaseLineAvg->AddEntry("16384 sp.", 6); cbBaseLineAvg->AddEntry("16384 sp.", 6);
cbBaseLineAvg->Resize(width, 20); cbBaseLineAvg->Resize(width, 20);
cbBaseLineAvg->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbBaseLineAvg->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
} }
@ -266,7 +267,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbDecimation->AddEntry("4 samples", 2); cbDecimation->AddEntry("4 samples", 2);
cbDecimation->AddEntry("8 samples", 3); cbDecimation->AddEntry("8 samples", 3);
cbDecimation->Resize(width, 20); cbDecimation->Resize(width, 20);
cbDecimation->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbDecimation->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
TGLabel * lbDecimationGain = new TGLabel(vfDPPCtrl11, "Decimation Gain :"); vfDPPCtrl11->AddFrame(lbDecimationGain, haha); TGLabel * lbDecimationGain = new TGLabel(vfDPPCtrl11, "Decimation Gain :"); vfDPPCtrl11->AddFrame(lbDecimationGain, haha);
cbDecimationGain = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbDecimationGain); cbDecimationGain = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbDecimationGain);
@ -275,21 +276,21 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbDecimationGain->AddEntry("x 4", 2); cbDecimationGain->AddEntry("x 4", 2);
cbDecimationGain->AddEntry("x 8", 3); cbDecimationGain->AddEntry("x 8", 3);
cbDecimationGain->Resize(width, 20); cbDecimationGain->Resize(width, 20);
cbDecimationGain->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbDecimationGain->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
TGLabel * lbRollOver = new TGLabel(vfDPPCtrl11, "Roll-Over Flag :"); vfDPPCtrl11->AddFrame(lbRollOver, haha); TGLabel * lbRollOver = new TGLabel(vfDPPCtrl11, "Roll-Over Flag :"); vfDPPCtrl11->AddFrame(lbRollOver, haha);
cbRollOver = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbRollOver); cbRollOver = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbRollOver);
cbRollOver->AddEntry("Disabled", 0); cbRollOver->AddEntry("Disabled", 0);
cbRollOver->AddEntry("Enabled", 1); cbRollOver->AddEntry("Enabled", 1);
cbRollOver->Resize(width, 20); cbRollOver->Resize(width, 20);
cbRollOver->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbRollOver->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
TGLabel * lbPileUp = new TGLabel(vfDPPCtrl11, "Pile-Up Flag :"); vfDPPCtrl11->AddFrame(lbPileUp, haha); TGLabel * lbPileUp = new TGLabel(vfDPPCtrl11, "Pile-Up Flag :"); vfDPPCtrl11->AddFrame(lbPileUp, haha);
cbPileUp = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbPileUp); cbPileUp = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbPileUp);
cbPileUp->AddEntry("Disabled", 0); cbPileUp->AddEntry("Disabled", 0);
cbPileUp->AddEntry("Enabled", 1); cbPileUp->AddEntry("Enabled", 1);
cbPileUp->Resize(width, 20); cbPileUp->Resize(width, 20);
cbPileUp->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbPileUp->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
TGVerticalFrame * vfDPPCtrl21 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl21, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0)); TGVerticalFrame * vfDPPCtrl21 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl21, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGVerticalFrame * vfDPPCtrl22 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl22, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0)); TGVerticalFrame * vfDPPCtrl22 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl22, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
@ -302,7 +303,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbLocalShapedTrigger->AddEntry("Odd Channel", 2); cbLocalShapedTrigger->AddEntry("Odd Channel", 2);
cbLocalShapedTrigger->AddEntry("OR", 3); cbLocalShapedTrigger->AddEntry("OR", 3);
cbLocalShapedTrigger->Resize(width, 20); cbLocalShapedTrigger->Resize(width, 20);
cbLocalShapedTrigger->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbLocalShapedTrigger->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbLocalTriggerValid = new TGLabel(vfDPPCtrl21, "Local Trigger Valid. :"); vfDPPCtrl21->AddFrame(lbLocalTriggerValid, haha); TGLabel * lbLocalTriggerValid = new TGLabel(vfDPPCtrl21, "Local Trigger Valid. :"); vfDPPCtrl21->AddFrame(lbLocalTriggerValid, haha);
cbLocalTriggerValid = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbLocalTriggerValid); cbLocalTriggerValid = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbLocalTriggerValid);
@ -312,7 +313,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbLocalTriggerValid->AddEntry("AND", 3); cbLocalTriggerValid->AddEntry("AND", 3);
cbLocalTriggerValid->AddEntry("OR", 4); cbLocalTriggerValid->AddEntry("OR", 4);
cbLocalTriggerValid->Resize(100, 20); cbLocalTriggerValid->Resize(100, 20);
cbLocalTriggerValid->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbLocalTriggerValid->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbVetoSource = new TGLabel(vfDPPCtrl21, "Veto Source :"); vfDPPCtrl21->AddFrame(lbVetoSource, haha); TGLabel * lbVetoSource = new TGLabel(vfDPPCtrl21, "Veto Source :"); vfDPPCtrl21->AddFrame(lbVetoSource, haha);
cbVetoSource = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbVetoSource); cbVetoSource = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbVetoSource);
@ -321,7 +322,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbVetoSource->AddEntry("individually set for paired channel", 2); cbVetoSource->AddEntry("individually set for paired channel", 2);
cbVetoSource->AddEntry("negative saturation", 3); cbVetoSource->AddEntry("negative saturation", 3);
cbVetoSource->Resize(width, 20); cbVetoSource->Resize(width, 20);
cbVetoSource->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbVetoSource->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbTriggerCounterRate = new TGLabel(vfDPPCtrl21, "Trigger Counter Rate :"); vfDPPCtrl21->AddFrame(lbTriggerCounterRate, haha); TGLabel * lbTriggerCounterRate = new TGLabel(vfDPPCtrl21, "Trigger Counter Rate :"); vfDPPCtrl21->AddFrame(lbTriggerCounterRate, haha);
cbTriggerCounterRate = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTriggerCounterRate); cbTriggerCounterRate = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTriggerCounterRate);
@ -329,28 +330,28 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbTriggerCounterRate->AddEntry(" 128", 1); cbTriggerCounterRate->AddEntry(" 128", 1);
cbTriggerCounterRate->AddEntry("8192", 2); cbTriggerCounterRate->AddEntry("8192", 2);
cbTriggerCounterRate->Resize(width, 20); cbTriggerCounterRate->Resize(width, 20);
cbTriggerCounterRate->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbTriggerCounterRate->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbBaselineCal = new TGLabel(vfDPPCtrl21, "Active Baseline Cal. :"); vfDPPCtrl21->AddFrame(lbBaselineCal, haha); TGLabel * lbBaselineCal = new TGLabel(vfDPPCtrl21, "Active Baseline Cal. :"); vfDPPCtrl21->AddFrame(lbBaselineCal, haha);
cbBaselineCal = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineCal); cbBaselineCal = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineCal);
cbBaselineCal->AddEntry("Enabled", 0); cbBaselineCal->AddEntry("Enabled", 0);
cbBaselineCal->AddEntry("Disabled", 1); cbBaselineCal->AddEntry("Disabled", 1);
cbBaselineCal->Resize(width, 20); cbBaselineCal->Resize(width, 20);
cbBaselineCal->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbBaselineCal->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbTagCorrelatedEvent = new TGLabel(vfDPPCtrl21, "Tag correlated events :"); vfDPPCtrl21->AddFrame(lbTagCorrelatedEvent, haha); TGLabel * lbTagCorrelatedEvent = new TGLabel(vfDPPCtrl21, "Tag correlated events :"); vfDPPCtrl21->AddFrame(lbTagCorrelatedEvent, haha);
cbTagCorrelatedEvent = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTagCorrelatedEvent); cbTagCorrelatedEvent = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTagCorrelatedEvent);
cbTagCorrelatedEvent->AddEntry("Disabled", 0); cbTagCorrelatedEvent->AddEntry("Disabled", 0);
cbTagCorrelatedEvent->AddEntry("Enabled", 1); cbTagCorrelatedEvent->AddEntry("Enabled", 1);
cbTagCorrelatedEvent->Resize(width, 20); cbTagCorrelatedEvent->Resize(width, 20);
cbTagCorrelatedEvent->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbTagCorrelatedEvent->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGLabel * lbBaselineOptimize = new TGLabel(vfDPPCtrl11, "Baseline Optimaization :"); vfDPPCtrl11->AddFrame(lbBaselineOptimize, haha); TGLabel * lbBaselineOptimize = new TGLabel(vfDPPCtrl11, "Baseline Optimaization :"); vfDPPCtrl11->AddFrame(lbBaselineOptimize, haha);
cbBaselineOptimize = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineOptimize); cbBaselineOptimize = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineOptimize);
cbBaselineOptimize->AddEntry("Disabled", 0); cbBaselineOptimize->AddEntry("Disabled", 0);
cbBaselineOptimize->AddEntry("Enabled", 1); cbBaselineOptimize->AddEntry("Enabled", 1);
cbBaselineOptimize->Resize(width, 20); cbBaselineOptimize->Resize(width, 20);
cbBaselineOptimize->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbBaselineOptimize->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
TGHorizontalFrame * hfDPPCtrl2 = new TGHorizontalFrame(vfDPPCtrl); vfDPPCtrl->AddFrame(hfDPPCtrl2, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 0)); TGHorizontalFrame * hfDPPCtrl2 = new TGHorizontalFrame(vfDPPCtrl); vfDPPCtrl->AddFrame(hfDPPCtrl2, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 0));
@ -364,7 +365,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbDisableSelfTrigger->AddEntry("used to acquire and propagate to trigger logic", 0); cbDisableSelfTrigger->AddEntry("used to acquire and propagate to trigger logic", 0);
cbDisableSelfTrigger->AddEntry("only propagate to trigger logic", 1); cbDisableSelfTrigger->AddEntry("only propagate to trigger logic", 1);
cbDisableSelfTrigger->Resize(300, 20); cbDisableSelfTrigger->Resize(300, 20);
cbLocalShapedTrigger->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm1()"); cbLocalShapedTrigger->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
TGLabel * lbExtra2WordOption = new TGLabel(vfDPPCtrl_a, "Extras 2 Word Option :"); vfDPPCtrl_a->AddFrame(lbExtra2WordOption, haha); TGLabel * lbExtra2WordOption = new TGLabel(vfDPPCtrl_a, "Extras 2 Word Option :"); vfDPPCtrl_a->AddFrame(lbExtra2WordOption, haha);
cbExtra2WordOption = new TGComboBox(vfDPPCtrl_b); vfDPPCtrl_b->AddFrame(cbExtra2WordOption); cbExtra2WordOption = new TGComboBox(vfDPPCtrl_b); vfDPPCtrl_b->AddFrame(cbExtra2WordOption);
@ -373,7 +374,7 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
cbExtra2WordOption->AddEntry("[31:16] Lost Trigger Counter [15:0] Total Trigger Counter", 4); cbExtra2WordOption->AddEntry("[31:16] Lost Trigger Counter [15:0] Total Trigger Counter", 4);
cbExtra2WordOption->AddEntry("[31:16] Event Before Zero Crossing [15:0] Event After Zero Crossing", 5); cbExtra2WordOption->AddEntry("[31:16] Event Before Zero Crossing [15:0] Event After Zero Crossing", 5);
cbExtra2WordOption->Resize(400, 20); cbExtra2WordOption->Resize(400, 20);
cbLocalShapedTrigger->Connect("Changed()", "ChannelSetting", this, "SetDPPAlgorithm2()"); cbLocalShapedTrigger->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm2()");
} }
@ -385,9 +386,9 @@ ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer
isOpened = true; isOpened = true;
} }
ChannelSetting::~ChannelSetting(){ ChannelSettingPHA::~ChannelSettingPHA(){
printf("close ChannelSetting window\n"); printf("close ChannelSettingPHA window\n");
isOpened = false; isOpened = false;
@ -403,20 +404,48 @@ ChannelSetting::~ChannelSetting(){
} }
void ChannelSetting::LogMsg(TString msg){ void ChannelSettingPHA::LogMsg(TString msg){
Emit("LogMsg(char*)", msg.Data()); Emit("LogMsg(char*)", msg.Data());
} }
void ChannelSetting::ChangeBoard(){ void ChannelSettingPHA::ChangeBoard(){
if ( digi == NULL ) return; if ( digi == NULL ) return;
int boardID = boardIDEntry->GetNumber(); int boardID = boardIDEntry->GetNumber();
ch2ns = (unsigned short) digi[boardID]->GetCh2ns();
ChangeCh(); if( digi[boardID]->GetDPPType() != V1730_DPP_PHA_CODE){
if( boardID > presentBoardID ) {
for( int i = boardID +1 ; i < nDigi; i++){
if( digi[i]->GetDPPType() == V1730_DPP_PHA_CODE ){
boardID = i;
boardIDEntry->SetNumber(i, false);
break;
}
if( i = nDigi -1 ) return;
} }
void ChannelSetting::ChangeCh(){ }else{
for( int i = boardID - 1 ; i >= 0; i--){
if( digi[i]->GetDPPType() == V1730_DPP_PHA_CODE ){
boardID = i;
boardIDEntry->SetNumber(i, false);
break;
}
if( i = nDigi -1 ) return;
}
}
}
ch2ns = (unsigned short) digi[boardID]->GetCh2ns();
ChangeCh();
}
void ChannelSettingPHA::ChangeCh(){
LogMsg(Form("========== Change to Channel %d", (int)chIDEntry->GetNumber())); LogMsg(Form("========== Change to Channel %d", (int)chIDEntry->GetNumber()));
@ -441,8 +470,6 @@ void ChannelSetting::ChangeCh(){
eTemp->SetText(Form("%d C", digi[boardID]->ReadRegister(Register::DPP::ChannelADCTemperature, ch)), false); eTemp->SetText(Form("%d C", digi[boardID]->ReadRegister(Register::DPP::ChannelADCTemperature, ch)), false);
if( digi[boardID]->GetDPPType() == V1730_DPP_PHA_CODE ){
numTriggerThreshold->SetNumber( digi[boardID]->ReadRegister(Register::DPP::PHA::TriggerThreshold, ch), false); numTriggerThreshold->SetNumber( digi[boardID]->ReadRegister(Register::DPP::PHA::TriggerThreshold, ch), false);
numTriggerHoldOff ->SetNumber( digi[boardID]->ReadRegister(Register::DPP::PHA::TriggerHoldOffWidth, ch) * 4 * ch2ns, false); numTriggerHoldOff ->SetNumber( digi[boardID]->ReadRegister(Register::DPP::PHA::TriggerHoldOffWidth, ch) * 4 * ch2ns, false);
cbTriggerSmoothing ->Select( digi[boardID]->ReadRegister(Register::DPP::PHA::RCCR2SmoothingFactor, ch), false); cbTriggerSmoothing ->Select( digi[boardID]->ReadRegister(Register::DPP::PHA::RCCR2SmoothingFactor, ch), false);
@ -486,11 +513,10 @@ void ChannelSetting::ChangeCh(){
cbBaselineOptimize->Select( ( (temp >> 29) & 0x1), false); cbBaselineOptimize->Select( ( (temp >> 29) & 0x1), false);
cbExtra2WordOption->Select( ( (temp >> 8) & 0x7), false); cbExtra2WordOption->Select( ( (temp >> 8) & 0x7), false);
}
} }
void ChannelSetting::SetAllChannels(){ void ChannelSettingPHA::SetAllChannels(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
@ -533,7 +559,7 @@ void ChannelSetting::SetAllChannels(){
} }
void ChannelSetting::SetChannelMask(){ void ChannelSettingPHA::SetChannelMask(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
@ -548,7 +574,7 @@ void ChannelSetting::SetChannelMask(){
} }
void ChannelSetting::SetDPPAlgorithm1(){ void ChannelSettingPHA::SetDPPAlgorithm1(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
@ -579,7 +605,7 @@ void ChannelSetting::SetDPPAlgorithm1(){
} }
void ChannelSetting::SetDPPAlgorithm2(){ void ChannelSettingPHA::SetDPPAlgorithm2(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
@ -608,7 +634,7 @@ void ChannelSetting::SetDPPAlgorithm2(){
} }
void ChannelSetting::SetInputDynamicRange(){ void ChannelSettingPHA::SetInputDynamicRange(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
@ -618,7 +644,7 @@ void ChannelSetting::SetInputDynamicRange(){
} }
void ChannelSetting::ChangeAStep(TGNumberEntry * numEntry, unsigned short stepSize, uint32_t address){ void ChannelSettingPHA::ChangeAStep(TGNumberEntry * numEntry, unsigned short stepSize, uint32_t address){
unsigned int temp = numEntry->GetNumber(); unsigned int temp = numEntry->GetNumber();
unsigned int res = temp % (stepSize * ch2ns); unsigned int res = temp % (stepSize * ch2ns);
@ -631,20 +657,20 @@ void ChannelSetting::ChangeAStep(TGNumberEntry * numEntry, unsigned short stepSi
if( digi != NULL ) digi[boardID]->WriteRegister(address, temp / stepSize / ch2ns , ch); if( digi != NULL ) digi[boardID]->WriteRegister(address, temp / stepSize / ch2ns , ch);
} }
void ChannelSetting::SetRecordLength() {printf("=== %s\n", __func__); ChangeAStep(numRecordLength, 8, Register::DPP::RecordLength_G); } void ChannelSettingPHA::SetRecordLength() {printf("=== %s\n", __func__); ChangeAStep(numRecordLength, 8, Register::DPP::RecordLength_G); }
void ChannelSetting::SetPreTrigger() {printf("=== %s\n", __func__); ChangeAStep(numPreTrigger, 4, Register::DPP::PreTrigger);} void ChannelSettingPHA::SetPreTrigger() {printf("=== %s\n", __func__); ChangeAStep(numPreTrigger, 4, Register::DPP::PreTrigger);}
void ChannelSetting::SetEventAggregate() {printf("=== %s\n", __func__); ChangeAStep(numEventAgg, 1, Register::DPP::NumberEventsPerAggregate_G);} void ChannelSettingPHA::SetEventAggregate() {printf("=== %s\n", __func__); ChangeAStep(numEventAgg, 1, Register::DPP::NumberEventsPerAggregate_G);}
void ChannelSetting::SetTriggerThreshold(){printf("=== %s\n", __func__); ChangeAStep(numTriggerThreshold, 1, Register::DPP::PHA::TriggerThreshold); } void ChannelSettingPHA::SetTriggerThreshold(){printf("=== %s\n", __func__); ChangeAStep(numTriggerThreshold, 1, Register::DPP::PHA::TriggerThreshold); }
void ChannelSetting::SetTriggerHoldOff() {printf("=== %s\n", __func__); ChangeAStep(numTriggerHoldOff, 4, Register::DPP::PHA::TriggerHoldOffWidth);} void ChannelSettingPHA::SetTriggerHoldOff() {printf("=== %s\n", __func__); ChangeAStep(numTriggerHoldOff, 4, Register::DPP::PHA::TriggerHoldOffWidth);}
void ChannelSetting::SetInputRiseTime() {printf("=== %s\n", __func__); ChangeAStep(numInputRiseTime, 4, Register::DPP::PHA::InputRiseTime);} void ChannelSettingPHA::SetInputRiseTime() {printf("=== %s\n", __func__); ChangeAStep(numInputRiseTime, 4, Register::DPP::PHA::InputRiseTime);}
void ChannelSetting::SetRiseTimeValidWin(){printf("=== %s\n", __func__); ChangeAStep(numRiseTimeValidWin, 1, Register::DPP::PHA::RiseTimeValidationWindow);} void ChannelSettingPHA::SetRiseTimeValidWin(){printf("=== %s\n", __func__); ChangeAStep(numRiseTimeValidWin, 1, Register::DPP::PHA::RiseTimeValidationWindow);}
void ChannelSetting::SetTrapRiseTime() {printf("=== %s\n", __func__); ChangeAStep(numTrapRiseTime, 4, Register::DPP::PHA::TrapezoidRiseTime);} void ChannelSettingPHA::SetTrapRiseTime() {printf("=== %s\n", __func__); ChangeAStep(numTrapRiseTime, 4, Register::DPP::PHA::TrapezoidRiseTime);}
void ChannelSetting::SetTrapFlatTop() {printf("=== %s\n", __func__); ChangeAStep(numTrapFlatTop, 4, Register::DPP::PHA::TrapezoidFlatTop);} void ChannelSettingPHA::SetTrapFlatTop() {printf("=== %s\n", __func__); ChangeAStep(numTrapFlatTop, 4, Register::DPP::PHA::TrapezoidFlatTop);}
void ChannelSetting::SetDecay() {printf("=== %s\n", __func__); ChangeAStep(numDecay, 4, Register::DPP::PHA::DecayTime);} void ChannelSettingPHA::SetDecay() {printf("=== %s\n", __func__); ChangeAStep(numDecay, 4, Register::DPP::PHA::DecayTime);}
void ChannelSetting::SetPeaking() {printf("=== %s\n", __func__); ChangeAStep(numPeaking, 4, Register::DPP::PHA::PeakingTime);} void ChannelSettingPHA::SetPeaking() {printf("=== %s\n", __func__); ChangeAStep(numPeaking, 4, Register::DPP::PHA::PeakingTime);}
void ChannelSetting::SetPeakHoldOff() {printf("=== %s\n", __func__); ChangeAStep(numPeakHoldOff, 4, Register::DPP::PHA::PeakHoldOff);} void ChannelSettingPHA::SetPeakHoldOff() {printf("=== %s\n", __func__); ChangeAStep(numPeakHoldOff, 4, Register::DPP::PHA::PeakHoldOff);}
void ChannelSetting::SetDCOffset(){ void ChannelSettingPHA::SetDCOffset(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
short boardID = boardIDEntry->GetNumber(); short boardID = boardIDEntry->GetNumber();
@ -655,7 +681,7 @@ void ChannelSetting::SetDCOffset(){
if( digi != NULL ) digi[boardID]->WriteRegister(Register::DPP::ChannelDCOffset, bit , ch); if( digi != NULL ) digi[boardID]->WriteRegister(Register::DPP::ChannelDCOffset, bit , ch);
} }
void ChannelSetting::SetTriggerSmoothing(){ void ChannelSettingPHA::SetTriggerSmoothing(){
printf("=== %s\n", __func__); printf("=== %s\n", __func__);
if ( digi == NULL ) return; if ( digi == NULL ) return;
short boardID = boardIDEntry->GetNumber(); short boardID = boardIDEntry->GetNumber();

View File

@ -1,5 +1,5 @@
#ifndef CHANNEL_SETTING_H #ifndef CHANNEL_SETTING_PHA_H
#define CHANNEL_SETTING_H #define CHANNEL_SETTING_PHA_H
#include <TQObject.h> #include <TQObject.h>
#include <RQ_OBJECT.h> #include <RQ_OBJECT.h>
@ -13,8 +13,8 @@
class TGWindow; class TGWindow;
class TGMainFrame; class TGMainFrame;
class ChannelSetting{ class ChannelSettingPHA{
RQ_OBJECT("ChannelSetting") RQ_OBJECT("ChannelSettingPHA")
private: private:
TGMainFrame * fMain; TGMainFrame * fMain;
@ -64,16 +64,19 @@ class ChannelSetting{
TGComboBox * cbExtra2WordOption; TGComboBox * cbExtra2WordOption;
Digitizer ** digi; Digitizer ** digi;
int NChannel; int nDigi;
int NChannel; // hard coded = 16
bool isOpened; bool isOpened;
int presentBoardID;
unsigned short ch2ns; unsigned short ch2ns;
void ChangeAStep(TGNumberEntry * numEntry, unsigned short stepSize, uint32_t address); void ChangeAStep(TGNumberEntry * numEntry, unsigned short stepSize, uint32_t address);
public: public:
ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nDigi); ChannelSettingPHA(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nDigi, int boardID);
virtual ~ChannelSetting(); virtual ~ChannelSettingPHA();
void CloseWindow() { delete this; } void CloseWindow() { delete this; }