Skip to content

Commit

Permalink
Updating the panguin plots
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronc137 authored and Parity Account committed Mar 20, 2020
1 parent a513d4d commit a30f3d4
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 103 deletions.
6 changes: 3 additions & 3 deletions panguin/macros/GetStats.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void GetStats(){
statStr[0] = Form("Total Number of events");
statStrNumbers[0] = Form(" = %d", tot);

r->Project(hist->GetName(), "CodaEventNumber", "ErrorFlag==0");
r->Project(hist->GetName(), "CodaEventNumber", "ErrorFlag==0||(ErrorFlag & 0xda7e6bff)==0");
Int_t ok = hist->GetEntries();
Double_t perok= ok*100./tot;
statStr[1] = Form("EventCut passing events");
Expand All @@ -43,7 +43,7 @@ void GetStats(){
Int_t nentFULL = hist->GetEntries();
Double_t avgCurrentFULL = hist->GetMean();
Double_t totalChargeFULL = avgCurrentFULL*(1/1.0e6)*(nentFULL/120);
r->Project(hist->GetName(), "bcm_an_us.hw_sum", "ErrorFlag==0");
r->Project(hist->GetName(), "bcm_an_us.hw_sum", "ErrorFlag==0||(ErrorFlag & 0xda7e6bff)==0");
Int_t nent = hist->GetEntries();
Double_t avgCurrent = hist->GetMean();
Double_t totalCharge = avgCurrent*(1/1.0e6)*(nent/120);
Expand Down Expand Up @@ -75,7 +75,7 @@ void GetStats(){
for (Int_t j = 0 ; j < Nstats ; j++){
text.DrawLatex(0.10, iniY - (j*2.5+1)*diffY, statStr[j]);
text.DrawLatex(0.10, iniY - (j*2.5+2)*diffY, statStrNumbers[j]);
string = string + statStr[j] + statStrNumbers[j] + "\n\n";
string = string + "\n\t" + statStr[j] + statStrNumbers[j];
}
gSystem->Exec(Form("echo \"%s\" >> /adaqfs/home/apar/scripts/stats.dat",string.Data()));
if(hist) delete hist;
Expand Down
6 changes: 3 additions & 3 deletions panguin/macros/GetStatsManually.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void GetStatsManually(Int_t runNum = 999999){
statStr[0] = Form("Total Number of events");
statStrNumbers[0] = Form(" = %d", tot);

r->Project(hist->GetName(), "CodaEventNumber", "ErrorFlag==0","goff");
r->Project(hist->GetName(), "CodaEventNumber", "ErrorFlag==0||(ErrorFlag & 0xda7e6bff)==0","goff");
Int_t ok = hist->GetEntries();
Double_t perok= ok*100./tot;
statStr[1] = Form("EventCut passing events");
Expand All @@ -47,7 +47,7 @@ void GetStatsManually(Int_t runNum = 999999){
Int_t nentFULL = hist->GetEntries();
Double_t avgCurrentFULL = hist->GetMean();
Double_t totalChargeFULL = avgCurrentFULL*(1/1.0e6)*(nentFULL/120);
r->Project(hist->GetName(), "bcm_an_us.hw_sum", "ErrorFlag==0","goff");
r->Project(hist->GetName(), "bcm_an_us.hw_sum", "ErrorFlag==0||(ErrorFlag & 0xda7e6bff)==0","goff");
Int_t nent = hist->GetEntries();
Double_t avgCurrent = hist->GetMean();
Double_t totalCharge = avgCurrent*(1/1.0e6)*(nent/120);
Expand All @@ -66,7 +66,7 @@ void GetStatsManually(Int_t runNum = 999999){
//}

for (Int_t j = 0 ; j < Nstats ; j++){
string = string + statStr[j] + statStrNumbers[j] + "\n\n";
string = string + "\n\t" + statStr[j] + statStrNumbers[j];
}
gSystem->Exec(Form("echo \"%s\" > /adaqfs/home/apar/scripts/stats.dat",string.Data()));
gSystem->Exec(Form("echo \"%s\" > /adaqfs/home/apar/scripts/stats/stats_%d.dat",string.Data(),runNum));
Expand Down
29 changes: 4 additions & 25 deletions panguin/macros/longSlopeCheck.C
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ void longSlopeCheck(TString type = "burst_lrb_std", Double_t refRMS4eX = 10, Dou
TChain* tree_agg = new TChain("agg");
gSystem->Exec("export runNum=`~/scripts/getRunNumber`; export runNum2=`echo $runNum-30 | bc`; python /adaqfs/home/apar/pvdb/prex/examples/make_run_list.py --run=$runNum2-$runNum --type=Production --current=20 --target=48Ca --slug=`~/scripts/getSlugNumber`");
//gSystem->Exec("export runNum=`~/scripts/getRunNumber`; export runNum2=`echo $runNum-100 | bc`; python /adaqfs/home/apar/pvdb/prex/examples/make_run_list.py --run=$runNum2-$runNum --type=Production --current=20 --target=48Ca --slug=149");
ifstream infile("/adaqfs/home/apar/PREX/japan/panguin/list.txt");
std::ifstream* infile = new std::ifstream("/adaqfs/home/apar/PREX/japan/panguin/list.txt");
TString currentRunNum = gSystem->GetFromPipe("/adaqfs/home/apar/scripts/getRunNumber");
std::vector<Int_t> listOfFileIndices;
std::string line;
if (infile.is_open()) {
while(getline(infile,line)){
if (infile->is_open()) {
while(getline(*infile,line)){
listOfFileIndices.push_back(atoi(line.c_str()));
}
}
Expand Down Expand Up @@ -165,27 +165,6 @@ void longSlopeCheck(TString type = "burst_lrb_std", Double_t refRMS4eX = 10, Dou
cPlot->cd(6);

GetStats();
infile->close();

// FIXME wants:
// * Conditional warning text about too large RMSs
// * Better red line
// * Description of what is shown and what it should be
//
/*
cPlot->cd(4);
TLatex Line1;
TLatex Line2;
TLatex Line3;
Line1.SetTextSize(.2);
Line1.SetTextAlign(12);
Line2.SetTextSize(.15);
Line2.SetTextAlign(12);
Line3.SetTextSize(.3);
Line3.SetTextAlign(12);
cPlot->cd(4);
Line1.DrawLatex(.3,.25,"Stability Errors!");
Line2.DrawLatex(.25,.5,"If RMS exceeds line");
Line3.DrawLatex(.12,.75,"Call RC now!");
*/
}
85 changes: 64 additions & 21 deletions panguin/macros/online_shiftcrew.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ newpage 2 2
macro ./regMulPlot.C("burst_lrb_std","us_dd")
macro ./regMulPlot.C("burst_lrb_std","us_avg")

#newpage 2 2
# title LIVE REGRESSION HISTOGRAMS - 4aX
# macro ./regMulPlot.C("burst_lrb_orig_std","usl")
# macro ./regMulPlot.C("burst_lrb_orig_std","usr")
# macro ./regMulPlot.C("burst_lrb_orig_std","us_dd")
# macro ./regMulPlot.C("burst_lrb_orig_std","us_avg")

newpage 2 3
title SYNC Check
abs((lhrs_flexio_input&0x1)-reported_helicity):CodaEventNumber goodhel -type box -title "LHRS helicity check, must be zero!" -tree evt
Expand Down Expand Up @@ -125,26 +132,50 @@ newpage 2 4
bpm12YM:CodaEventNumber evcut -tree evt -type box -title "12 Y-(MUST be below 50k!)"

### column row
newpage 2 3
newpage 4 3
title EventCut: BPM 16, 12, 11 Diffs
diff_bpm16X/um goodevtcut -tree mul -title "diff_bpm16X"
diff_bpm16Y/um goodevtcut -tree mul -title "diff_bpm16Y"
diff_bpm12X/um goodevtcut -tree mul -title "diff_bpm12X"
diff_bpm12Y/um goodevtcut -tree mul -title "diff_bpm12Y"
diff_bpm11X/um goodevtcut -tree mul -title "diff_bpm11X"
diff_bpm11Y/um goodevtcut -tree mul -title "diff_bpm11Y"
diff_bpm16X/um goodevtcut -tree mul -title "diff_bpm16X"
diff_bpm16X/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm16X"
diff_bpm16Y/um goodevtcut -tree mul -title "diff_bpm16Y"
diff_bpm16Y/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm16Y"
diff_bpm12X/um goodevtcut -tree mul -title "diff_bpm12X"
diff_bpm12X/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm12X"
diff_bpm12Y/um goodevtcut -tree mul -title "diff_bpm12Y"
diff_bpm12Y/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm12Y"
diff_bpm11X/um goodevtcut -tree mul -title "diff_bpm11X"
diff_bpm11X/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm11X"
diff_bpm11Y/um goodevtcut -tree mul -title "diff_bpm11Y"
diff_bpm11Y/um:CodaEventNumber goodevtcut -tree mul -title "diff_bpm11Y"

newpage 2 4
title EventCut: BPM 4a, 4e Diffs
diff_bpm4aX/um goodevtcut -tree mul -title "diff_bpm4aX"
diff_bpm4aY/um goodevtcut -tree mul -title "diff_bpm4aY"
diff_bpm4eX/um goodevtcut -tree mul -title "diff_bpm4eX"
diff_bpm4eY/um goodevtcut -tree mul -title "diff_bpm4eY"
diff_bpm4acX/um goodevtcut -tree mul -title "diff_bpm4acX"
diff_bpm4acY/um goodevtcut -tree mul -title "diff_bpm4acY"
diff_bpm4ecX/um goodevtcut -tree mul -title "diff_bpm4ecX"
diff_bpm4ecY/um goodevtcut -tree mul -title "diff_bpm4ecY"

title EventCut: BPM 4a, 4e Diffs
diff_bpm4aX/um goodevtcut -tree mul -title "diff_bpm4aX"
diff_bpm4aY/um goodevtcut -tree mul -title "diff_bpm4aY"
diff_bpm4eX/um goodevtcut -tree mul -title "diff_bpm4eX"
diff_bpm4eY/um goodevtcut -tree mul -title "diff_bpm4eY"
diff_bpm4acX/um goodevtcut -tree mul -title "diff_bpm4acX"
diff_bpm4acY/um goodevtcut -tree mul -title "diff_bpm4acY"
diff_bpm4ecX/um goodevtcut -tree mul -title "diff_bpm4ecX"
diff_bpm4ecY/um goodevtcut -tree mul -title "diff_bpm4ecY"

newpage 4 4
title Cavities
yield_cav4bX:CodaEventNumber goodevtcut -tree mul -title "yield cav4bX"
diff_cav4bX/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4bX"
yield_cav4bY:CodaEventNumber goodevtcut -tree mul -title "yield cav4bX"
diff_cav4bY/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4bX"
yield_cav4cX:CodaEventNumber goodevtcut -tree mul -title "yield cav4cX"
diff_cav4cX/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4cX"
yield_cav4cY:CodaEventNumber goodevtcut -tree mul -title "yield cav4cX"
diff_cav4cY/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4cX"
yield_cav4dX:CodaEventNumber goodevtcut -tree mul -title "yield cav4dX"
diff_cav4dX/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4dX"
yield_cav4dY:CodaEventNumber goodevtcut -tree mul -title "yield cav4dX"
diff_cav4dY/um:CodaEventNumber goodevtcut -tree mul -title "diff cav4dX"
yield_cav4bQ:CodaEventNumber goodevtcut -tree mul -title "yield cav4bQ"
yield_cav4cQ:CodaEventNumber goodevtcut -tree mul -title "yield cav4cQ"
yield_cav4dQ:CodaEventNumber goodevtcut -tree mul -title "yield cav4dQ"
asym_cav4cQ/ppm:CodaEventNumber goodevtcut -tree mul -title "asym cav4cQ"

#newpage 1 3
# title BPM Diff Correlations
Expand Down Expand Up @@ -267,6 +298,18 @@ newpage 2 3
asym_bcm0l02/ppm:CodaEventNumber goodevtcut -tree mul -title "Injector BCM Asym"
asym_bpm1i02WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM1i02"

# newpage 3 3
# title NEW Diagnostic Aq vs Time
# (asym_bcm_an_us/ppm-asym_bcm_an_ds/ppm)/sqrt(2):CodaEventNumber goodevtcut -tree mul -title "Analog DD noise floor -> ~15ppm is good"
# asym_bcm_an_us/ppm:CodaEventNumber goodevtcut -tree mul -title "Analog Upstream BCM Asym"
# asym_bcm0l02/ppm:CodaEventNumber goodevtcut -tree mul -title "Injector BCM Asym"
# asym_bpm0i02WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM0i02"
# asym_bpm1i02WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM1i02"
# asym_bpm2i02WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM2i02"
# asym_bpm2i01WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM2i01"
# asym_bpm1i01WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM1i01"
# asym_bpm0i01WS/ppm:CodaEventNumber goodevtcut -tree mul -title "Inj BPM0i01"

newpage 3 4
title Diagnostic BCM Aq DDs
(asym_bcm_an_us/ppm-asym_bcm_an_ds/ppm)/2 goodevtcut -tree mul -title "Analog US - Analog DS DD"
Expand Down Expand Up @@ -523,10 +566,10 @@ newpage 3 3

newpage 2 2
title Hall C Charge Feedback
1e6*asym_hallc_bcm_4c:CodaEventNumber yield_hallc_bcm_4c>4 -tree mul -title "Hall C BCM Asym"
yield_hallc_bcm_4c:CodaEventNumber yield_hallc_bcm_4c>4 -tree mul -title "Hall C BCM Yield"
1e6*asym_hallc_bcm_4c yield_hallc_bcm_4c>4 -tree mul -title "Hall C BCM Asym - Mean ~ +-30"
yield_hallc_bcm_4c yield_hallc_bcm_4c>4 -tree mul -title "Hall C BCM Yield - Feedback if > 4 uA"
1e6*asym_hallc_bcm_4c:CodaEventNumber -tree mul -title "Hall C BCM Asym"
yield_hallc_bcm_4c:CodaEventNumber -tree mul -title "Hall C BCM Yield"
1e6*asym_hallc_bcm_4c yield_hallc_bcm_4c>2 -tree mul -title "Hall C BCM Asym - Mean ~ +-30"
yield_hallc_bcm_4c yield_hallc_bcm_4c>2 -tree mul -title "Hall C BCM Yield - Feedback if > 4 uA"

newpage 1 3
title Check Unser Scaler
Expand Down
Loading

0 comments on commit a30f3d4

Please sign in to comment.