some improvements
This commit is contained in:
parent
b1b3402227
commit
f713efbc41
22
ClassData.h
22
ClassData.h
|
@ -101,7 +101,7 @@ inline Data::Data(){
|
||||||
ch2ns = 2.0;
|
ch2ns = 2.0;
|
||||||
boardSN = 0;
|
boardSN = 0;
|
||||||
DPPType = V1730_DPP_PHA_CODE;
|
DPPType = V1730_DPP_PHA_CODE;
|
||||||
IsNotRollOverFakeAgg = true;
|
IsNotRollOverFakeAgg = false;
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
for ( int i = 0; i < MaxNChannels; i++) TotNumEvents[i] = 0;
|
for ( int i = 0; i < MaxNChannels; i++) TotNumEvents[i] = 0;
|
||||||
ClearData();
|
ClearData();
|
||||||
|
@ -136,7 +136,7 @@ inline void Data::ClearTriggerRate(){
|
||||||
inline void Data::ClearData(){
|
inline void Data::ClearData(){
|
||||||
nByte = 0;
|
nByte = 0;
|
||||||
AllocatedSize = 0;
|
AllocatedSize = 0;
|
||||||
IsNotRollOverFakeAgg = true;
|
IsNotRollOverFakeAgg = false;
|
||||||
for( int i = 0 ; i < MaxNChannels; i++){
|
for( int i = 0 ; i < MaxNChannels; i++){
|
||||||
NumEvents[i] = 0;
|
NumEvents[i] = 0;
|
||||||
firstTimestamp[0] = -1;
|
firstTimestamp[0] = -1;
|
||||||
|
@ -196,7 +196,7 @@ inline void Data::SaveBuffer(const char * fileName){
|
||||||
|
|
||||||
inline void Data::PrintStat() const{
|
inline void Data::PrintStat() const{
|
||||||
|
|
||||||
if( IsNotRollOverFakeAgg ) {
|
if( !IsNotRollOverFakeAgg ) {
|
||||||
printf(" this is roll-over fake event or no events.\n");
|
printf(" this is roll-over fake event or no events.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -267,9 +267,11 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
||||||
|
|
||||||
nw = nw + 1; word = ReadBuffer(nw, verbose);
|
nw = nw + 1; word = ReadBuffer(nw, verbose);
|
||||||
unsigned int BoardID = ((word >> 27) & 0x1F);
|
unsigned int BoardID = ((word >> 27) & 0x1F);
|
||||||
|
unsigned short pattern = ((word >> 8 ) & 0x7FFF );
|
||||||
bool BoardFailFlag = ((word >> 26) & 0x1 );
|
bool BoardFailFlag = ((word >> 26) & 0x1 );
|
||||||
unsigned int ChannelMask = ( word & 0xFF ) ;
|
unsigned int ChannelMask = ( word & 0xFF ) ;
|
||||||
if( verbose >= 1 ) printf("Board ID(type) : %d, FailFlag = %d, ChannelMask = 0x%X\n", BoardID, BoardFailFlag, ChannelMask);
|
if( verbose >= 1 ) printf("Board ID(type) : %d, FailFlag = %d, Patten = %u, ChannelMask = 0x%X\n",
|
||||||
|
BoardID, BoardFailFlag, pattern, ChannelMask);
|
||||||
|
|
||||||
if( BoardID > 0 ) {
|
if( BoardID > 0 ) {
|
||||||
switch(BoardID){
|
switch(BoardID){
|
||||||
|
@ -278,9 +280,13 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nw = nw + 2;
|
nw = nw + 1;
|
||||||
unsigned int AggCounter = ReadBuffer(nw, verbose);
|
unsigned int bdAggCounter = ReadBuffer(nw, verbose);
|
||||||
if( verbose >= 2 ) printf("Agg Counter : %u \n", AggCounter);
|
if( verbose >= 1 ) printf("Board Agg Counter : %u \n", bdAggCounter & 0x7FFFFF);
|
||||||
|
|
||||||
|
nw = nw + 1;
|
||||||
|
unsigned int bdAggTimeTag = ReadBuffer(nw, verbose);
|
||||||
|
if( verbose >= 2 ) printf("Agg Counter : %u \n", bdAggTimeTag);
|
||||||
|
|
||||||
for( int chMask = 0; chMask < MaxNChannels/2 ; chMask ++ ){
|
for( int chMask = 0; chMask < MaxNChannels/2 ; chMask ++ ){
|
||||||
if( ((ChannelMask >> chMask) & 0x1 ) == 0 ) continue;
|
if( ((ChannelMask >> chMask) & 0x1 ) == 0 ) continue;
|
||||||
|
@ -304,7 +310,7 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
||||||
|
|
||||||
///Calculate trigger rate and first and last Timestamp
|
///Calculate trigger rate and first and last Timestamp
|
||||||
for(int ch = 0; ch < MaxNChannels; ch++){
|
for(int ch = 0; ch < MaxNChannels; ch++){
|
||||||
if( NumEventsDecoded[ch] > 0 ) IsNotRollOverFakeAgg = false;
|
if( NumEventsDecoded[ch] > 0 ) IsNotRollOverFakeAgg = true;
|
||||||
unsigned long long dTime = Timestamp[ch][NumEvents[ch]-1] - Timestamp[ch][NumEvents[ch] - NumEventsDecoded[ch]];
|
unsigned long long dTime = Timestamp[ch][NumEvents[ch]-1] - Timestamp[ch][NumEvents[ch] - NumEventsDecoded[ch]];
|
||||||
double sec = dTime * ch2ns / 1e9;
|
double sec = dTime * ch2ns / 1e9;
|
||||||
TriggerRate[ch] = NumEventsDecoded[ch]/sec;
|
TriggerRate[ch] = NumEventsDecoded[ch]/sec;
|
||||||
|
|
|
@ -220,7 +220,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
if( debug) printf("---------- event built : %llu \n", evID);
|
if( debug) printf("---------- event built : %llu \n", evID);
|
||||||
|
|
||||||
if( countBdAgg > 74) break;
|
//if( countBdAgg > 74) break;
|
||||||
|
|
||||||
}while(!feof(haha) && ftell(haha) < inFileSize);
|
}while(!feof(haha) && ftell(haha) < inFileSize);
|
||||||
|
|
||||||
|
@ -250,6 +250,7 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
unsigned long long firstTimeStamp = -1;
|
unsigned long long firstTimeStamp = -1;
|
||||||
unsigned long long lastTimeStamp = 0;
|
unsigned long long lastTimeStamp = 0;
|
||||||
unsigned long long smallestLastTimeStamp = -1;
|
unsigned long long smallestLastTimeStamp = -1;
|
||||||
|
unsigned int maxNumEvent = 0;
|
||||||
for( int chI = 0; chI < MaxNChannels ; chI ++){
|
for( int chI = 0; chI < MaxNChannels ; chI ++){
|
||||||
if( data->NumEvents[chI] == 0 ) continue;
|
if( data->NumEvents[chI] == 0 ) continue;
|
||||||
|
|
||||||
|
@ -260,15 +261,18 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
if( data->Timestamp[chI][ev] > lastTimeStamp ) {
|
if( data->Timestamp[chI][ev] > lastTimeStamp ) {
|
||||||
lastTimeStamp = data->Timestamp[chI][ev];
|
lastTimeStamp = data->Timestamp[chI][ev];
|
||||||
}
|
}
|
||||||
|
if( ev + 1 > maxNumEvent ) maxNumEvent = ev + 1;
|
||||||
if( data->Timestamp[chI][ev] < smallestLastTimeStamp ){
|
if( data->Timestamp[chI][ev] < smallestLastTimeStamp ){
|
||||||
smallestLastTimeStamp = data->Timestamp[chI][ev];
|
smallestLastTimeStamp = data->Timestamp[chI][ev];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( maxNumEvent == 0 ) return;
|
||||||
|
|
||||||
if( verbose) printf("================ time range : %llu - %llu, smallest Last %llu\n", firstTimeStamp, lastTimeStamp, smallestLastTimeStamp );
|
if( verbose) printf("================ time range : %llu - %llu, smallest Last %llu\n", firstTimeStamp, lastTimeStamp, smallestLastTimeStamp );
|
||||||
unsigned short lastEv[MaxNChannels] = {0}; /// store the last event number for each ch
|
unsigned short lastEv[MaxNChannels] = {0}; /// store the last event number for each ch
|
||||||
unsigned short exhaustedCh = 0; /// to stop
|
unsigned short exhaustedCh = 0; /// when exhaustedCh == MaxNChannels ==> stop
|
||||||
bool breakFlag = false;
|
bool singleChannelExhaustedFlag = false; /// when a single ch has data but exhaused ==> stop
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
|
@ -283,7 +287,7 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
ch1st = chI;
|
ch1st = chI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !isLastData && ((smallestLastTimeStamp - time1st) < NTimeWinForBuffer * timeWin) ) break;
|
if( !isLastData && ((smallestLastTimeStamp - time1st) < NTimeWinForBuffer * timeWin) && maxNumEvent < MaxNData * 0.6 ) break;
|
||||||
if( ch1st > MaxNChannels ) break;
|
if( ch1st > MaxNChannels ) break;
|
||||||
|
|
||||||
multi ++;
|
multi ++;
|
||||||
|
@ -307,6 +311,7 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
|
|
||||||
/// build the rest of the event
|
/// build the rest of the event
|
||||||
exhaustedCh = 0;
|
exhaustedCh = 0;
|
||||||
|
singleChannelExhaustedFlag = false;
|
||||||
for( int chI = ch1st; chI < ch1st + MaxNChannels; chI ++){
|
for( int chI = ch1st; chI < ch1st + MaxNChannels; chI ++){
|
||||||
unsigned short chX = chI % MaxNChannels;
|
unsigned short chX = chI % MaxNChannels;
|
||||||
if( data->NumEvents[chX] == 0 ) {
|
if( data->NumEvents[chX] == 0 ) {
|
||||||
|
@ -315,6 +320,7 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
}
|
}
|
||||||
if( data->NumEvents[chX] <= lastEv[chX] ) {
|
if( data->NumEvents[chX] <= lastEv[chX] ) {
|
||||||
exhaustedCh ++;
|
exhaustedCh ++;
|
||||||
|
singleChannelExhaustedFlag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( timeWin == 0 ) continue;
|
if( timeWin == 0 ) continue;
|
||||||
|
@ -359,16 +365,7 @@ void EventBuilder(Data * data, const unsigned int timeWin, bool traceOn, bool is
|
||||||
evID++;
|
evID++;
|
||||||
multi = 0;
|
multi = 0;
|
||||||
|
|
||||||
/// Check Last event break;
|
}while( !singleChannelExhaustedFlag || (exhaustedCh < MaxNChannels) );
|
||||||
breakFlag = false;
|
|
||||||
for( int chI = 0; chI < MaxNChannels ; chI++){
|
|
||||||
if( lastEv[chI] == 0 ) continue;
|
|
||||||
if( lastEv[chI] >= data->NumEvents[chI] ) {
|
|
||||||
breakFlag = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}while( !breakFlag || (exhaustedCh < MaxNChannels) );
|
|
||||||
|
|
||||||
///========== clear built data
|
///========== clear built data
|
||||||
/// move the last data to the top,
|
/// move the last data to the top,
|
||||||
|
|
100
FSUDAQ.cpp
100
FSUDAQ.cpp
|
@ -19,30 +19,6 @@
|
||||||
|
|
||||||
#include "FSUDAQ.h"
|
#include "FSUDAQ.h"
|
||||||
|
|
||||||
enum MenuIdentifiers{
|
|
||||||
|
|
||||||
M_DIGITIZER_OPEN,
|
|
||||||
M_FILE_OPEN,
|
|
||||||
M_EXIT,
|
|
||||||
M_LOAD_SETTINGS,
|
|
||||||
M_TRIGGER_SUMMARY,
|
|
||||||
M_CH_SETTING_PHA,
|
|
||||||
M_CH_SETTING_PSD,
|
|
||||||
M_REGISTER_SETTING,
|
|
||||||
M_BOARD_SETTINGS,
|
|
||||||
M_PROGRAM_SETTINGS,
|
|
||||||
M_FINDPEAKS
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ModeIdentifiers{
|
|
||||||
|
|
||||||
Mode_EnergyHist,
|
|
||||||
Mode_CountHist,
|
|
||||||
Mode_Oscilloscope,
|
|
||||||
Mode_DataRun
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
long get_time(){
|
long get_time(){
|
||||||
long time_ms;
|
long time_ms;
|
||||||
struct timeval t1;
|
struct timeval t1;
|
||||||
|
@ -52,6 +28,20 @@ long get_time(){
|
||||||
return time_ms;
|
return time_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Double_t traceFunc(Double_t *x, Double_t *par){
|
||||||
|
///par[0] = baseline
|
||||||
|
///par[1] = start time
|
||||||
|
///par[2] = rise time
|
||||||
|
///par[3] = Amp
|
||||||
|
///par[4] = decay time
|
||||||
|
Double_t result = par[0];
|
||||||
|
if(x[0] > par[1]){
|
||||||
|
Double_t y = x[0]-par[1];
|
||||||
|
result += par[3] *(1 - TMath::Exp( - y / par[2])) * TMath::Exp(-y / par[4]);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
///============= Global variable
|
///============= Global variable
|
||||||
TH1F * hEnergy[MaxNBoards][MaxNChannels] = {NULL};
|
TH1F * hEnergy[MaxNBoards][MaxNChannels] = {NULL};
|
||||||
TH1F * hChannel[MaxNBoards] = {NULL};
|
TH1F * hChannel[MaxNBoards] = {NULL};
|
||||||
|
@ -77,6 +67,29 @@ TGNumberEntry * MainWindow::runIDEntry = NULL;
|
||||||
|
|
||||||
BoardSetting * MainWindow::boardSetting = NULL;
|
BoardSetting * MainWindow::boardSetting = NULL;
|
||||||
|
|
||||||
|
enum MenuIdentifiers{
|
||||||
|
|
||||||
|
M_DIGITIZER_OPEN,
|
||||||
|
M_FILE_OPEN,
|
||||||
|
M_EXIT,
|
||||||
|
M_LOAD_SETTINGS,
|
||||||
|
M_TRIGGER_SUMMARY,
|
||||||
|
M_CH_SETTING_PHA,
|
||||||
|
M_CH_SETTING_PSD,
|
||||||
|
M_REGISTER_SETTING,
|
||||||
|
M_BOARD_SETTINGS,
|
||||||
|
M_PROGRAM_SETTINGS,
|
||||||
|
M_FINDPEAKS
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ModeIdentifiers{
|
||||||
|
|
||||||
|
Mode_EnergyHist,
|
||||||
|
Mode_CountHist,
|
||||||
|
Mode_Oscilloscope,
|
||||||
|
Mode_DataRun
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
||||||
|
|
||||||
|
@ -236,7 +249,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
||||||
LogMsg((char*)"The LogMsg is not complete for all actions. [update later]");
|
LogMsg((char*)"The LogMsg is not complete for all actions. [update later]");
|
||||||
LogMsg((char*)"Please \"Open Digitizers\" to start.");
|
LogMsg((char*)"Please \"Open Digitizers\" to start.");
|
||||||
|
|
||||||
//HandleMenu(M_DIGITIZER_OPEN);
|
HandleMenu(M_DIGITIZER_OPEN);
|
||||||
//HandleMenu(M_BOARD_SETTINGS);
|
//HandleMenu(M_BOARD_SETTINGS);
|
||||||
//HandleMenu(M_CH_SETTING_PHA);
|
//HandleMenu(M_CH_SETTING_PHA);
|
||||||
//HandleMenu(M_CH_SETTING_PSD);
|
//HandleMenu(M_CH_SETTING_PSD);
|
||||||
|
@ -261,6 +274,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
||||||
|
|
||||||
}
|
}
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
|
|
||||||
delete fMenuBar;
|
delete fMenuBar;
|
||||||
delete fMenuFile;
|
delete fMenuFile;
|
||||||
delete fMenuDigitizers;
|
delete fMenuDigitizers;
|
||||||
|
@ -697,21 +711,6 @@ void MainWindow::PlotSingleTrace(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Double_t traceFunc(Double_t *x, Double_t *par){
|
|
||||||
///par[0] = baseline
|
|
||||||
///par[1] = start time
|
|
||||||
///par[2] = rise time
|
|
||||||
///par[3] = Amp
|
|
||||||
///par[4] = decay time
|
|
||||||
Double_t result = par[0];
|
|
||||||
if(x[0] > par[1]){
|
|
||||||
Double_t y = x[0]-par[1];
|
|
||||||
result += par[3] *(1 - TMath::Exp( - y / par[2])) * TMath::Exp(-y / par[4]);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::FitTrace(){
|
void MainWindow::FitTrace(){
|
||||||
printf("=== %s not impletement.\n", __func__);
|
printf("=== %s not impletement.\n", __func__);
|
||||||
|
|
||||||
|
@ -823,7 +822,12 @@ void * MainWindow::RunThread(void * ptr){
|
||||||
|
|
||||||
fEcanvas->GetCanvas()->cd();
|
fEcanvas->GetCanvas()->cd();
|
||||||
|
|
||||||
///Fill trace
|
CurrentTime = get_time();
|
||||||
|
ElapsedTime = CurrentTime - PreviousTime; /// milliseconds
|
||||||
|
|
||||||
|
if( ElapsedTime > 500 ){
|
||||||
|
|
||||||
|
/// use the last trace
|
||||||
if( cbMode->GetSelected() == Mode_Oscilloscope && hasTrace){
|
if( cbMode->GetSelected() == Mode_Oscilloscope && hasTrace){
|
||||||
|
|
||||||
unsigned short nData = data->NumEvents[ch];
|
unsigned short nData = data->NumEvents[ch];
|
||||||
|
@ -847,10 +851,6 @@ void * MainWindow::RunThread(void * ptr){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentTime = get_time();
|
|
||||||
ElapsedTime = CurrentTime - PreviousTime; /// milliseconds
|
|
||||||
|
|
||||||
if( ElapsedTime > 500 ){
|
|
||||||
|
|
||||||
///Fill Channel Count
|
///Fill Channel Count
|
||||||
for( int i = 0 ; i < digi[boardID]->GetNChannel(); i++){
|
for( int i = 0 ; i < digi[boardID]->GetNChannel(); i++){
|
||||||
|
@ -886,15 +886,7 @@ int main(int argc, char **argv) {
|
||||||
new MainWindow(gClient->GetRoot(),800,800);
|
new MainWindow(gClient->GetRoot(),800,800);
|
||||||
theApp.Run();
|
theApp.Run();
|
||||||
|
|
||||||
delete gAnaTrace1;
|
printf("------ see you next time :) ------ \n");
|
||||||
delete gAnaTrace2;
|
|
||||||
delete gDigiTrace1;
|
|
||||||
delete gDigiTrace2;
|
|
||||||
|
|
||||||
for( int i = 0; i < MaxNBoards; i++){
|
|
||||||
delete hChannel[i];
|
|
||||||
for( int j = 0; j < MaxNChannels; j++) delete hEnergy[i][j];
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -775,8 +775,17 @@ BoardSetting::~BoardSetting(){
|
||||||
|
|
||||||
printf("close BoardSetting window\n");
|
printf("close BoardSetting window\n");
|
||||||
|
|
||||||
|
/// this is essential to delete any TGNumberEntry, when the focu on it and close the windows --> crash.
|
||||||
|
delete numAggBLT;
|
||||||
|
delete numRunStartStopDelay;
|
||||||
|
delete numMajorCoinWin;
|
||||||
|
delete numBufferOccpGain;
|
||||||
|
//delete numExtendVetoDelay;
|
||||||
|
for( int i = 0; i < 8; i++) delete TRGValMajorLevel[i];
|
||||||
|
delete TRGOUTMajorLevel;
|
||||||
|
delete GlbMajorLevel;
|
||||||
|
|
||||||
delete boardIDEntry;
|
delete boardIDEntry;
|
||||||
for(int i = 0; i < NUM_BOARD_INFO; i++) delete entry[i];
|
|
||||||
|
|
||||||
fMain->Cleanup();
|
fMain->Cleanup();
|
||||||
delete fMain;
|
delete fMain;
|
||||||
|
|
|
@ -92,7 +92,7 @@ class BoardSetting{
|
||||||
//TGCheckButton * bTRGValMskLVSDGLB;
|
//TGCheckButton * bTRGValMskLVSDGLB;
|
||||||
//TGCheckButton * bTRGValMskLVSDLCL;
|
//TGCheckButton * bTRGValMskLVSDLCL;
|
||||||
TGCheckButton * bEnableExtTRG;
|
TGCheckButton * bEnableExtTRG;
|
||||||
TGNumberEntry * numExtendVetoDelay;
|
//TGNumberEntry * numExtendVetoDelay;
|
||||||
|
|
||||||
/// Trigger Validation Mask
|
/// Trigger Validation Mask
|
||||||
TGCheckButton * cbTRGValMskCh[8][8];
|
TGCheckButton * cbTRGValMskCh[8][8];
|
||||||
|
|
|
@ -209,6 +209,13 @@ ChannelSettingPHA::ChannelSettingPHA(const TGWindow *p, UInt_t w, UInt_t h, int
|
||||||
cbTriggerMode->AddEntry("Anti-Coin.", 3);
|
cbTriggerMode->AddEntry("Anti-Coin.", 3);
|
||||||
cbTriggerMode->Resize(width, 20);
|
cbTriggerMode->Resize(width, 20);
|
||||||
cbTriggerMode->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
|
cbTriggerMode->Connect("Changed()", "ChannelSettingPHA", this, "SetDPPAlgorithm1()");
|
||||||
|
|
||||||
|
/// ShapedTriggerWidth = 0x1084 /// R/W
|
||||||
|
TGLabel * lbShapeTrigWidth = new TGLabel(vfTrigger1, "Shaped Trigger Width [ns]"); vfTrigger1->AddFrame(lbShapeTrigWidth, layoutHintsR);
|
||||||
|
numShapedTriggerWidth = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numShapedTriggerWidth, layoutHints);
|
||||||
|
numShapedTriggerWidth->Resize(width, 20);
|
||||||
|
numShapedTriggerWidth->Connect("Modified()", "ChannelSettingPHA", this, "SetShaperTriggerWidth()");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{///================== Trapezoid Settings
|
{///================== Trapezoid Settings
|
||||||
|
@ -475,6 +482,7 @@ ChannelSettingPHA::~ChannelSettingPHA(){
|
||||||
delete numInputRiseTime;
|
delete numInputRiseTime;
|
||||||
delete numRiseTimeValidWin;
|
delete numRiseTimeValidWin;
|
||||||
delete cbTriggerMode;
|
delete cbTriggerMode;
|
||||||
|
delete numShapedTriggerWidth;
|
||||||
|
|
||||||
delete numTrapRiseTime;
|
delete numTrapRiseTime;
|
||||||
delete numTrapFlatTop;
|
delete numTrapFlatTop;
|
||||||
|
@ -602,6 +610,7 @@ void ChannelSettingPHA::ChangeCh(){
|
||||||
cbTriggerSmoothing ->Select( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::RCCR2SmoothingFactor, ch), false);
|
cbTriggerSmoothing ->Select( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::RCCR2SmoothingFactor, ch), false);
|
||||||
numInputRiseTime ->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::InputRiseTime, ch) * 4 * ch2ns, false);
|
numInputRiseTime ->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::InputRiseTime, ch) * 4 * ch2ns, false);
|
||||||
numRiseTimeValidWin->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::RiseTimeValidationWindow, ch) * ch2ns, false);
|
numRiseTimeValidWin->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::RiseTimeValidationWindow, ch) * ch2ns, false);
|
||||||
|
numShapedTriggerWidth->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::ShapedTriggerWidth, ch) * ch2ns, false);
|
||||||
|
|
||||||
numTrapRiseTime->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::TrapezoidRiseTime, ch) * 4 * ch2ns, false);
|
numTrapRiseTime->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::TrapezoidRiseTime, ch) * 4 * ch2ns, false);
|
||||||
numTrapFlatTop->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::TrapezoidFlatTop, ch) * 4 * ch2ns, false);
|
numTrapFlatTop->SetNumber( digi[boardID]->GetSettingFromMemory(Register::DPP::PHA::TrapezoidFlatTop, ch) * 4 * ch2ns, false);
|
||||||
|
@ -763,12 +772,13 @@ void ChannelSettingPHA::SetRecordLength() {printf("=== %s\n", __func__); Chan
|
||||||
void ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::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 ChannelSettingPHA::SetShaperTriggerWidth() {printf("=== %s\n", __func__); ChangeAStep(numShapedTriggerWidth, 4, Register::DPP::PHA::ShapedTriggerWidth);}
|
||||||
|
|
||||||
void ChannelSettingPHA::SetEventAggregate() {
|
void ChannelSettingPHA::SetEventAggregate() {
|
||||||
printf("=== %s\n", __func__);
|
printf("=== %s\n", __func__);
|
||||||
|
|
|
@ -41,6 +41,7 @@ class ChannelSettingPHA{
|
||||||
TGNumberEntry * numInputRiseTime;
|
TGNumberEntry * numInputRiseTime;
|
||||||
TGNumberEntry * numRiseTimeValidWin;
|
TGNumberEntry * numRiseTimeValidWin;
|
||||||
TGComboBox * cbTriggerMode;
|
TGComboBox * cbTriggerMode;
|
||||||
|
TGNumberEntry * numShapedTriggerWidth;
|
||||||
|
|
||||||
TGNumberEntry * numTrapRiseTime;
|
TGNumberEntry * numTrapRiseTime;
|
||||||
TGNumberEntry * numTrapFlatTop;
|
TGNumberEntry * numTrapFlatTop;
|
||||||
|
@ -105,6 +106,7 @@ class ChannelSettingPHA{
|
||||||
void SetTriggerSmoothing();
|
void SetTriggerSmoothing();
|
||||||
void SetInputRiseTime();
|
void SetInputRiseTime();
|
||||||
void SetRiseTimeValidWin();
|
void SetRiseTimeValidWin();
|
||||||
|
void SetShaperTriggerWidth();
|
||||||
|
|
||||||
void SetTrapRiseTime();
|
void SetTrapRiseTime();
|
||||||
void SetTrapFlatTop();
|
void SetTrapFlatTop();
|
||||||
|
|
|
@ -472,10 +472,62 @@ ChannelSettingPSD::~ChannelSettingPSD(){
|
||||||
isOpened = false;
|
isOpened = false;
|
||||||
|
|
||||||
delete boardIDEntry;
|
delete boardIDEntry;
|
||||||
|
delete chIDEntry;
|
||||||
|
|
||||||
|
delete eTemp ;
|
||||||
|
|
||||||
delete cbOnOff;
|
delete cbOnOff;
|
||||||
delete cbInputDynamicRange;
|
|
||||||
delete cbPolarity;
|
delete cbPolarity;
|
||||||
|
delete cbInputDynamicRange;
|
||||||
|
delete numRecordLength;
|
||||||
|
delete numPreTrigger;
|
||||||
|
delete numEventAgg;
|
||||||
|
|
||||||
|
|
||||||
|
delete numTriggerThreshold;
|
||||||
|
delete numTriggerHoldOff;
|
||||||
|
delete numlbChargeZeroSupThreshold;
|
||||||
|
delete numTrigLatency;
|
||||||
|
delete numDCOffset;
|
||||||
|
delete numThresholdPSDCut;
|
||||||
|
delete numPURGAPThreshold;
|
||||||
|
delete cbTriggerMode;
|
||||||
|
|
||||||
|
|
||||||
|
delete numCFDDelay;
|
||||||
|
delete cbCFDFraction;
|
||||||
|
delete cbCFDInterPt;
|
||||||
|
delete numShortGateWidth;
|
||||||
|
delete numLongGateWidth;
|
||||||
|
delete numGateOffset;
|
||||||
|
delete numFixBaseline;
|
||||||
|
delete cbBaseLineAvg;
|
||||||
|
|
||||||
|
delete cbChargeSensitivity;
|
||||||
|
delete cbChargePedestal;
|
||||||
|
delete cbTriggerCount;
|
||||||
|
delete cbDiscrimationMode;
|
||||||
|
delete cbPileUpGate;
|
||||||
|
delete cbPileUp;
|
||||||
|
delete cbTestPulseRate;
|
||||||
|
delete cbBaselineLongGate;
|
||||||
|
delete cbDiscardQlongQthr;
|
||||||
|
delete cbOverRange;
|
||||||
|
delete cbTrigHysteresis;
|
||||||
|
delete cbInhibitOppostieParity;
|
||||||
|
|
||||||
|
delete cbLocalShapedTrigger;
|
||||||
|
delete cbLocalTriggerValid;
|
||||||
|
delete cbAddLocalTriggerValid;
|
||||||
|
delete cbVetoSource;
|
||||||
|
delete cbInputSmoothinFactor;
|
||||||
|
delete cbTriggerCounterRate;
|
||||||
|
delete cbMarkSaturatedPulse;
|
||||||
|
delete cbVetoMode;
|
||||||
|
delete cbResetTimeStamp;
|
||||||
|
|
||||||
|
delete cbDisableSelfTrigger;
|
||||||
|
delete cbExtraWordOption;
|
||||||
|
|
||||||
/// fMain must be delete last;
|
/// fMain must be delete last;
|
||||||
fMain->Cleanup();
|
fMain->Cleanup();
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ChannelSettingPSD{
|
||||||
TGComboBox * cbDisableSelfTrigger;
|
TGComboBox * cbDisableSelfTrigger;
|
||||||
TGComboBox * cbExtraWordOption;
|
TGComboBox * cbExtraWordOption;
|
||||||
|
|
||||||
int NChannel; // hard coded = 16
|
int NChannel; /// hard coded = 16 when no digitizer
|
||||||
bool isOpened;
|
bool isOpened;
|
||||||
|
|
||||||
int presentBoardID;
|
int presentBoardID;
|
||||||
|
|
|
@ -64,6 +64,7 @@ ProgramSetting::~ProgramSetting(){
|
||||||
|
|
||||||
delete txtIP;
|
delete txtIP;
|
||||||
delete txtDBName;
|
delete txtDBName;
|
||||||
|
delete txtDataPath;
|
||||||
|
|
||||||
fMain->Cleanup();
|
fMain->Cleanup();
|
||||||
delete fMain;
|
delete fMain;
|
||||||
|
|
|
@ -21,7 +21,6 @@ class RegisterSetting{
|
||||||
TGMainFrame * fMain;
|
TGMainFrame * fMain;
|
||||||
|
|
||||||
TGNumberEntry * boardIDEntry;
|
TGNumberEntry * boardIDEntry;
|
||||||
|
|
||||||
TGTextEntry * txtAddress;
|
TGTextEntry * txtAddress;
|
||||||
TGComboBox * cbName;
|
TGComboBox * cbName;
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,6 @@ TriggerSummary::~TriggerSummary(){
|
||||||
delete numUpdateTime;
|
delete numUpdateTime;
|
||||||
|
|
||||||
updateFlag = false;
|
updateFlag = false;
|
||||||
|
|
||||||
thread->Join();
|
thread->Join();
|
||||||
|
|
||||||
///delete thread; /// Don;t delete the thread, otherwise, thread will not run after close and reopen.
|
///delete thread; /// Don;t delete the thread, otherwise, thread will not run after close and reopen.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user