checked data processes online = data saved. need to update the statsitics
This commit is contained in:
parent
d60ad72d84
commit
cc9854a79d
3
Makefile
3
Makefile
|
@ -44,7 +44,6 @@ Pixie16Class.o : Pixie16Class.h Pixie16Class.cpp DataBlock.h
|
|||
pixieDict.cxx : pixieDAQ.h pixieDAQLinkDef.h
|
||||
@echo "--------- creating pcm and cxx "
|
||||
@rootcling -f pixieDict.cxx -c pixieDAQ.h -p $(PIXIE_LIB_PATH) pixieDAQLinkDef.h
|
||||
# @rootcling -f pixieDict.cxx -c pixieDAQ.h mainSettings.h -p $(PIXIE_LIB_PATH) pixieDAQLinkDef.h
|
||||
|
||||
pixieDAQ.o : pixieDict.cxx pixieDAQ.cpp pixieDAQ.h
|
||||
@echo "--------- creating pixieDAQ.o"
|
||||
|
@ -53,8 +52,6 @@ pixieDAQ.o : pixieDict.cxx pixieDAQ.cpp pixieDAQ.h
|
|||
mainSettings.o : mainSettings.cpp mainSettings.h
|
||||
@echo "--------- creating mainSettings.o"
|
||||
$(CC) $(CFLAGS) $(PIXIE_LIB_PATH) mainSettings.cpp $(ROOT_FLAG)
|
||||
# $(CC) $(CFLAGS) $(PIXIE_LIB_PATH) Pixie16Class.o mainSettings.cpp $(ROOT_FLAG)
|
||||
# $(CC) $(CFLAGS) $(PIXIE_LIB_PATH) Pixie16Class.o mainSettings.cpp pixieDict.cxx $(ROOT_FLAG)
|
||||
|
||||
|
||||
#--------------------------
|
||||
|
|
|
@ -337,12 +337,20 @@ void Pixie16::AdjustOffset(){
|
|||
}
|
||||
|
||||
void Pixie16::CaptureBaseLine(unsigned short modID, unsigned short ch){
|
||||
|
||||
retval = Pixie16AcquireBaselines(modID);
|
||||
if( CheckError("Pixie16AcquireBaselines::MOD::"+std::to_string(modID)) < 0 ) return;
|
||||
|
||||
|
||||
///somehow, this change the DSPParFile
|
||||
std::string temp = DSPParFile[modID];
|
||||
|
||||
retval = Pixie16ReadSglChanBaselines(Baselines, TimeStamps, 3640, modID, ch);
|
||||
if( CheckError("Pixie16ReadSglChanBaselines::MOD::"+std::to_string(modID) + "CH::"+std::to_string(ch)) < 0 ) return;
|
||||
|
||||
strcpy(DSPParFile[modID], temp.c_str());
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Pixie16::CaptureADCTrace(unsigned short modID, unsigned short ch){
|
||||
|
@ -359,17 +367,13 @@ void Pixie16::StartRun(bool listMode){
|
|||
|
||||
unsigned short mode = NEW_RUN; //RESUME_RUN
|
||||
|
||||
//listmode
|
||||
if( listMode ){
|
||||
|
||||
//SetDigitizerSynchWait(1, i);
|
||||
//SetDigitizerInSynch(0, i);
|
||||
|
||||
///listmode
|
||||
retval = Pixie16StartListModeRun(NumModules, LIST_MODE_RUN, mode);
|
||||
if( CheckError("Pixie16StartListModeRun") < 0 ) return;
|
||||
printf("\033[32m LIST_MODE run\033[0m\n");
|
||||
}else{
|
||||
//MCA mode
|
||||
///MCA mode
|
||||
retval = Pixie16StartHistogramRun(NumModules, mode);
|
||||
if( CheckError("Pixie16StartHistogramRun") < 0 ) return;
|
||||
printf("\033[32m MCA MODE run\033[0m\n");
|
||||
|
@ -628,13 +632,13 @@ void Pixie16::PrintChannelAllSettings(unsigned short modID, unsigned short ch){
|
|||
|
||||
void Pixie16::PrintChannelsMainSettings(unsigned short modID){
|
||||
|
||||
printf("====+=====+======+========+========+===========+==========+==========+==========+========+========+=========+=======+====== \n");
|
||||
printf("====+=====+======+========+========+===========+==========+==========+==========+=======+=========+=========+=======+====== \n");
|
||||
printf(" ch | En | Gain | Trig_L | Trig_G | Threshold | Polarity | Energy_L | Energy_G | Tau | Trace | Trace_d | Voff | BL \n");
|
||||
printf("----+-----+------+--------+--------+-----------+----------+----------+----------+--------+--------+---------+-------+------ \n");
|
||||
printf("----+-----+------+--------+--------+-----------+----------+----------+----------+-------+---------+---------+-------+------ \n");
|
||||
for( int ch = 0; ch < 16; ch ++){
|
||||
printf(" %2d |", ch);
|
||||
printf(" %3s |", GetChannelOnOff(modID, ch) ? "On" : "Off" );
|
||||
printf(" %3s |", GetChannelGain(modID, ch) ? "x1" : "1/4" );
|
||||
printf(" %4s |", GetChannelGain(modID, ch) ? "x1" : "1/4" );
|
||||
printf(" %6.2f |", GetChannelTriggerRiseTime(modID, ch));
|
||||
printf(" %6.2f |", GetChannelTriggerFlatTop(modID, ch));
|
||||
printf(" %9.2f |", GetChannelTriggerThreshold(modID, ch));
|
||||
|
|
|
@ -32,7 +32,7 @@ MainSettings::MainSettings(const TGWindow *p, UInt_t w, UInt_t h, Pixie16 * pixi
|
|||
modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
modIDEntry->SetWidth(50);
|
||||
modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1);
|
||||
//modIDEntry->Connect("Modified()", "MainSettings", this, "ChangeMod()");
|
||||
modIDEntry->Connect("Modified()", "MainSettings", this, "ChangeMod()");
|
||||
hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
|
||||
TGLabel * lb2 = new TGLabel(hframe, "Setting File :");
|
||||
|
@ -347,6 +347,7 @@ void MainSettings::OpenFile(){
|
|||
if( fi.fFilename != NULL ) {
|
||||
settingFileName = fi.fFilename;
|
||||
teFileName->SetText(settingFileName + " (not saved)");
|
||||
//TODO change the pixie->DSPParFile[]
|
||||
}
|
||||
dir = fi.fIniDir;
|
||||
}
|
||||
|
|
114
pixieDAQ.cpp
114
pixieDAQ.cpp
|
@ -58,29 +58,70 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
|
||||
/// Create a horizontal frame widget with buttons
|
||||
TGHorizontalFrame *hframe = new TGHorizontalFrame(fMain,200,40);
|
||||
fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX,2,2,2,2));
|
||||
|
||||
TGLabel * lb1 = new TGLabel(hframe, "Module ID :");
|
||||
hframe->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
///================= signal Channel group
|
||||
TGGroupFrame * group1 = new TGGroupFrame(hframe, "Single Channel", kHorizontalFrame);
|
||||
hframe->AddFrame(group1, new TGLayoutHints(kLHintsCenterX, 5,5,3,3) );
|
||||
|
||||
modIDEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
TGHorizontalFrame *hframe1 = new TGHorizontalFrame(group1,200,30);
|
||||
group1->AddFrame(hframe1);
|
||||
|
||||
TGLabel * lb1 = new TGLabel(hframe1, "Module ID :");
|
||||
hframe1->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 2, 2, 2, 2));
|
||||
|
||||
modIDEntry = new TGNumberEntry(hframe1, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
modIDEntry->SetWidth(50);
|
||||
modIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetNumModule()-1);
|
||||
hframe->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
hframe1->AddFrame(modIDEntry, new TGLayoutHints(kLHintsCenterX , 2, 2, 3, 2));
|
||||
|
||||
TGLabel * lb2 = new TGLabel(hframe, "Ch :");
|
||||
hframe->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
|
||||
TGLabel * lb2 = new TGLabel(hframe1, "Ch :");
|
||||
hframe1->AddFrame(lb2, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 2, 2, 3, 2));
|
||||
|
||||
chEntry = new TGNumberEntry(hframe, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
chEntry = new TGNumberEntry(hframe1, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
|
||||
chEntry->SetWidth(50);
|
||||
chEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, pixie->GetDigitizerNumChannel(0));
|
||||
hframe->AddFrame(chEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
|
||||
hframe1->AddFrame(chEntry, new TGLayoutHints(kLHintsCenterX , 2, 2, 3, 2));
|
||||
|
||||
TGTextButton *bGetADCTrace = new TGTextButton(hframe,"&Get ADC Trace");
|
||||
TGTextButton *bGetADCTrace = new TGTextButton(hframe1,"Get &ADC Trace");
|
||||
bGetADCTrace->Connect("Clicked()","MainWindow",this,"getADCTrace()");
|
||||
hframe->AddFrame(bGetADCTrace, new TGLayoutHints(kLHintsCenterX, 5,5,3,4));
|
||||
hframe1->AddFrame(bGetADCTrace, new TGLayoutHints(kLHintsCenterX, 2,2,3,2));
|
||||
|
||||
TGTextButton *bGetBaseLine = new TGTextButton(hframe1,"Get &BaseLine");
|
||||
bGetBaseLine->Connect("Clicked()","MainWindow",this,"getBaseLine()");
|
||||
hframe1->AddFrame(bGetBaseLine, new TGLayoutHints(kLHintsCenterX, 2,2,3,2));
|
||||
|
||||
///================= Start Run group
|
||||
TGGroupFrame * group2 = new TGGroupFrame(hframe, "Start run", kHorizontalFrame);
|
||||
hframe->AddFrame(group2, new TGLayoutHints(kLHintsCenterX, 2,2,3,3) );
|
||||
|
||||
TGHorizontalFrame *hframe2 = new TGHorizontalFrame(group2,200,30);
|
||||
group2->AddFrame(hframe2);
|
||||
|
||||
TGTextButton *bStartRun = new TGTextButton(hframe2,"Start &Run");
|
||||
bStartRun->Connect("Clicked()","MainWindow",this,"StartRun()");
|
||||
hframe2->AddFrame(bStartRun, new TGLayoutHints(kLHintsCenterX, 2,2,3,2));
|
||||
|
||||
TGTextButton *bStopRun = new TGTextButton(hframe2,"Stop Run");
|
||||
bStopRun->Connect("Clicked()","MainWindow",this,"StopRun()");
|
||||
hframe2->AddFrame(bStopRun, new TGLayoutHints(kLHintsCenterX, 2,2,3,4));
|
||||
|
||||
TGTextButton *bScalar = new TGTextButton(hframe2,"Scalar");
|
||||
//bScalar->Connect("Clicked()","MainWindow",this,"getADCTrace()");
|
||||
hframe2->AddFrame(bScalar, new TGLayoutHints(kLHintsCenterX, 2,2,3,2));
|
||||
|
||||
|
||||
fMain->AddFrame(hframe, new TGLayoutHints(kLHintsCenterX,2,2,2,2));
|
||||
///================= Read evt group
|
||||
TGGroupFrame * group3 = new TGGroupFrame(hframe, "Read Evt", kHorizontalFrame);
|
||||
hframe->AddFrame(group3, new TGLayoutHints(kLHintsCenterX, 2,2,3,3) );
|
||||
|
||||
TGHorizontalFrame *hframe3 = new TGHorizontalFrame(group3,200,30);
|
||||
group3->AddFrame(hframe3);
|
||||
|
||||
TGTextButton *bOpenEVT = new TGTextButton(hframe3,"OpenEvt");
|
||||
//bOpenEVT->Connect("Clicked()","MainWindow",this,"StartRun()");
|
||||
hframe3->AddFrame(bOpenEVT, new TGLayoutHints(kLHintsCenterX, 2,2,3,2));
|
||||
|
||||
|
||||
/// Create canvas widget
|
||||
fEcanvas = new TRootEmbeddedCanvas("Ecanvas",fMain,800,400);
|
||||
|
@ -102,7 +143,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
fMain->MapWindow();
|
||||
|
||||
|
||||
//HandleMenu(M_MAIN_CH_SETTINGS);
|
||||
///HandleMenu(M_MAIN_CH_SETTINGS);
|
||||
|
||||
///================ pixie
|
||||
///printf("Removing Pixie16Msg.log \n");
|
||||
|
@ -171,7 +212,7 @@ void MainWindow::getADCTrace() {
|
|||
gTrace->SetPoint(i, i*dt, haha[i]);
|
||||
}
|
||||
gTrace->GetXaxis()->SetTitle("time [us]");
|
||||
gTrace->Draw("AP");
|
||||
gTrace->Draw("APL");
|
||||
|
||||
TCanvas *fCanvas = fEcanvas->GetCanvas();
|
||||
fCanvas->cd();
|
||||
|
@ -179,6 +220,37 @@ void MainWindow::getADCTrace() {
|
|||
|
||||
}
|
||||
|
||||
void MainWindow::getBaseLine(){
|
||||
|
||||
printf("1 %s \n", pixie->GetSettingFile(0).c_str());
|
||||
|
||||
int modID = modIDEntry->GetNumber();
|
||||
int ch = chEntry->GetNumber();
|
||||
pixie->CaptureBaseLine(modID, ch);
|
||||
|
||||
printf("2 %s \n", pixie->GetSettingFile(0).c_str());
|
||||
|
||||
double * baseline = pixie->GetBasline();
|
||||
double * baselineTime = pixie->GetBaselineTimestamp();
|
||||
|
||||
printf("3 %s \n", pixie->GetSettingFile(0).c_str());
|
||||
|
||||
TGraph * gTrace = new TGraph();
|
||||
|
||||
for( int i = 0 ; i < pixie->GetBaslineLength(); i++){
|
||||
gTrace->SetPoint(i, baselineTime[i]*1000, baseline[i]);
|
||||
}
|
||||
gTrace->GetXaxis()->SetTitle("time [ns]");
|
||||
gTrace->Draw("APL");
|
||||
|
||||
printf("4 %s \n", pixie->GetSettingFile(0).c_str());
|
||||
|
||||
|
||||
TCanvas *fCanvas = fEcanvas->GetCanvas();
|
||||
fCanvas->cd();
|
||||
fCanvas->Update();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::GoodBye(){
|
||||
|
@ -191,6 +263,22 @@ void MainWindow::GoodBye(){
|
|||
|
||||
}
|
||||
|
||||
void MainWindow::StartRun(){
|
||||
|
||||
pixie->StartRun(1);
|
||||
|
||||
///start a loop that show scalar, plot
|
||||
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::StopRun(){
|
||||
|
||||
pixie->StopRun();
|
||||
|
||||
pixie->PrintStatistics(0);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
printf(" Welcome to pixie16 DQ \n");
|
||||
|
|
|
@ -37,14 +37,13 @@ public:
|
|||
|
||||
void HandleMenu(Int_t id);
|
||||
|
||||
|
||||
void openPixie();
|
||||
|
||||
void getADCTrace();
|
||||
void getBaseLine();
|
||||
|
||||
void openMainSettings();
|
||||
|
||||
|
||||
void StartRun();
|
||||
void StopRun();
|
||||
|
||||
void GoodBye();
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "TString.h"
|
||||
#include "TBenchmark.h"
|
||||
|
||||
#include "../armory/DataBlock.h"
|
||||
#include "../DataBlock.h"
|
||||
|
||||
#define MAX_CRATES 2
|
||||
#define MAX_BOARDS_PER_CRATE 13
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
rm -f Pixie16Msg.log
|
||||
|
||||
./example $1 --config=example_config.json
|
||||
./testing/example $1 --config=testing/example_config.json
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"slot": 2,
|
||||
"dsp": {
|
||||
"ldr": "/usr/opt/Pixie16/pixie16_revf_general_12b250m_41847_2019-05-18/dsp/Pixie16DSP_revfgeneral_12b250m_r41847.ldr",
|
||||
"par": "/home/ryan/Pixie16/ryan/test_ryan.set",
|
||||
"par": "/home/ryan/Pixie16/GUI/test_ryan.set",
|
||||
"var": "/usr/opt/Pixie16/pixie16_revf_general_12b250m_41847_2019-05-18/dsp/Pixie16DSP_revfgeneral_12b250m_r41847.var"
|
||||
},
|
||||
"fpga": {
|
||||
|
|
|
@ -131,14 +131,14 @@ int main(int argc, char *argv[]){
|
|||
pixie->PrintChannelsMainSettings(0);
|
||||
|
||||
|
||||
pixie->CaptureADCTrace(0, ch);
|
||||
unsigned short * haha = pixie->GetADCTrace();
|
||||
double dt = pixie->GetChannelSetting("XDT", 0, ch);
|
||||
for( int i = 0 ; i < pixie->GetADCTraceLength(); i++){
|
||||
gTrace->SetPoint(i, i*dt, haha[i]);
|
||||
}
|
||||
gTrace->GetXaxis()->SetTitle("time [us]");
|
||||
canvas->cd(3); gTrace->Draw("APL");
|
||||
//pixie->CaptureADCTrace(0, ch);
|
||||
//unsigned short * haha = pixie->GetADCTrace();
|
||||
//double dt = pixie->GetChannelSetting("XDT", 0, ch);
|
||||
//for( int i = 0 ; i < pixie->GetADCTraceLength(); i++){
|
||||
// gTrace->SetPoint(i, i*dt, haha[i]);
|
||||
//}
|
||||
//gTrace->GetXaxis()->SetTitle("time [us]");
|
||||
//canvas->cd(3); gTrace->Draw("APL");
|
||||
|
||||
|
||||
|
||||
|
@ -152,7 +152,8 @@ int main(int argc, char *argv[]){
|
|||
//canvas->cd(2); gTrace->Draw("APL");
|
||||
|
||||
|
||||
/*
|
||||
pixie->OpenFile("haha.evt", false);
|
||||
|
||||
printf("start run for %f sec\n", time);
|
||||
|
||||
uint32_t StartTime = get_time(), CurrentTime = get_time();
|
||||
|
@ -163,6 +164,7 @@ int main(int argc, char *argv[]){
|
|||
while( CurrentTime - StartTime < time * 1000 ){
|
||||
|
||||
pixie->ReadData(0);
|
||||
pixie->SaveData();
|
||||
|
||||
while( pixie->GetNextWord() < pixie->GetnFIFOWords() ){
|
||||
|
||||
|
@ -200,6 +202,13 @@ int main(int argc, char *argv[]){
|
|||
}
|
||||
|
||||
pixie->StopRun();
|
||||
pixie->CloseFile();
|
||||
|
||||
canvas->cd(1); hch->Draw();
|
||||
canvas->cd(2); hE->Draw();
|
||||
canvas->Modified();
|
||||
canvas->Update();
|
||||
gSystem->ProcessEvents();
|
||||
|
||||
//pixie->PrintData();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user