small mods trying to get influx working and channels set for raisor run

This commit is contained in:
Calem@RAISOR 2024-09-14 10:52:18 -05:00
parent b9158237e4
commit b30e87392f
3 changed files with 26 additions and 26 deletions

View File

@ -11,7 +11,7 @@
#include <cmath>
#include "math.h"
#include <algorithm>
#include "TLine.h"
//#include "TLine.h"
//#include <TMarker.h>
#include <vector>
#include <iostream>
@ -188,7 +188,7 @@ inline void BeamTune::UpdateHistograms(){
// Create the line and store it in the vector
TLine *line = new TLine(Xr, Yr, X2, Y2);
//TLine *line = new TLine(Xr, Yr, X2, Y2);
//line->SetLineColor(kBlack);
// Set line color based on Y2 value
/*
@ -213,8 +213,8 @@ inline void BeamTune::UpdateHistograms(){
//markers.push_back(endMarker);
hFrame->Fill(Xr,Yr, sX2,Y2);
hFrame1->Fill(X2,Y2);
//hFrame->Fill(Xr,Yr, sX2,Y2);
//hFrame1->Fill(X2,Y2);
// Draw all the lines after the loop

View File

@ -28,7 +28,7 @@ public:
evtbder->SetTimeWindow(500);
//========== use the influx from the Analyzer
influx = new InfluxDB("https://fsunuc.physics.fsu.edu/influx/");
influx = new InfluxDB("http://localhost:8086");
dataBaseName = "testing";
SetUpCanvas(); // see below
@ -145,9 +145,9 @@ inline void Cross::UpdateHistograms(){
for( int k = 0; k < (int) event.size(); k++ ){
//event[k].Print();
if( event[k].ch == 6 ) {ch1 = event[k].energy; t1 = event[k].timestamp;} // Reads channel 6 of the digitizer corresponding to dE
if( event[k].ch == 7 ) {ch4 = event[k].energy; t4 = event[k].timestamp;} // Reads channel 7 of the digitizer corresponding to E
if( event[k].ch == 1 ) {ch7 = event[k].energy; t7 = event[k].timestamp;}
if( event[k].ch == 0 ) {ch1 = event[k].energy; t1 = event[k].timestamp;} // Reads channel 0 of the digitizer corresponding to dE
if( event[k].ch == 2 ) {ch4 = event[k].energy; t4 = event[k].timestamp;} // Reads channel 2 of the digitizer corresponding to E
if( event[k].ch == 7 ) {ch7 = event[k].energy; t7 = event[k].timestamp;} //RF Timing if setup
}
@ -157,9 +157,9 @@ inline void Cross::UpdateHistograms(){
hdE->Fill(ch1);
hE->Fill(ch4);
hdT->Fill(ch7);
hTotE->Fill(ch1*0.25*0.25 + ch4);
hTotE->Fill(ch1 + ch4);
hdEE->Fill(ch4,ch1);
hdEtotE->Fill(ch1*0.25*0.25 + ch4,ch1);
hdEtotE->Fill(ch1 + ch4,ch1);
hdEdT->Fill((t7-t1)*1e9,ch1);
hTWin->Fill((t4-t1)*1e9);
@ -210,21 +210,21 @@ inline void Cross::UpdateHistograms(){
hdEtotE->UpdatePlot();
hdEdT->UpdatePlot();
hTWin->UpdatePlot();
/*
//========== output to Influx
QList<QString> cutNameList = hPID->GetCutNameList();
for( int p = 0; p < cutList.count(); p ++){
if( cutList[p].isEmpty() ) continue;
double dT = (tMax[p]-tMin[p]) * tick2ns / 1e9; // tick to sec
double rate = count[p]*1.0/(dT);
//printf("%llu %llu, %f %d\n", tMin[p], tMax[p], dT, count[p]);
//printf("%10s | %d | %f Hz \n", cutNameList[p].toStdString().c_str(), count[p], rate);
QList<QString> cutNameList1 = hdEE->GetCutNameList();
for( int p = 0; p < cutList1.count(); p ++){
if( cutList1[p].isEmpty() ) continue;
double dT = (tMax1[p]-tMin1[p]) / 1e9; // tick to sec
double rate = count1[p]*1.0/(dT);
//printf("%llu %llu, %f %d\n", tMin1[p], tMax1[p], dT, count1[p]);
printf("%10s | %d | %f Hz \n", cutNameList1[p].toStdString().c_str(), count1[p], rate);
influx->AddDataPoint("Cut,name=" + cutNameList[p].toStdString()+ " value=" + std::to_string(rate));
influx->WriteData(dataBaseName);
influx->AddDataPoint("Cut,name=" + cutNameList1[p].toStdString()+ " value=" + std::to_string(rate));
influx->WriteData("testing");
influx->ClearDataPointsBuffer();
}
*/
}

View File

@ -145,9 +145,9 @@ inline void Target::UpdateHistograms(){
for( int k = 0; k < (int) event.size(); k++ ){
//event[k].Print();
if( event[k].ch == 6 ) {ch1 = event[k].energy; t1 = event[k].timestamp;} // Reads channel 6 of the digitizer corresponding to dE
if( event[k].ch == 7 ) {ch4 = event[k].energy; t4 = event[k].timestamp;} // Reads channel 7 of the digitizer corresponding to E
if( event[k].ch == 1 ) {ch7 = event[k].energy; t7 = event[k].timestamp;}
if( event[k].ch == 4 ) {ch1 = event[k].energy; t1 = event[k].timestamp;} // Reads channel 6 of the digitizer corresponding to dE
if( event[k].ch == 6 ) {ch4 = event[k].energy; t4 = event[k].timestamp;} // Reads channel 7 of the digitizer corresponding to E
if( event[k].ch == 7 ) {ch7 = event[k].energy; t7 = event[k].timestamp;}
}
@ -157,9 +157,9 @@ inline void Target::UpdateHistograms(){
hdE->Fill(ch1);
hE->Fill(ch4);
hdT->Fill(ch7);
hTotE->Fill(ch1*0.25*0.25 + ch4);
hTotE->Fill(ch1 + ch4);
hdEE->Fill(ch4,ch1);
hdEtotE->Fill(ch1*0.25*0.25 + ch4,ch1);
hdEtotE->Fill(ch1 + ch4,ch1);
hdEdT->Fill((t7-t1)*1e9,ch1);
hTWin->Fill((t4-t1)*1e9);