updated armory codes

This commit is contained in:
tandem 2022-11-07 17:44:20 -05:00
parent d7c5817fe1
commit df5ad3947a
4 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
*.evt.to *.evt.to
*.ev2 *.ev2
*.log *.log
*.pdf
xia2root xia2root
xia2ev2* xia2ev2*

View File

@ -15,6 +15,10 @@
#include <TColor.h> #include <TColor.h>
#include <TSpectrum.h> #include <TSpectrum.h>
#include <TMath.h> #include <TMath.h>
#include <TRandom.h>
#include <TLatex.h>
#include <TH1.h>
#include <TMarker.h>
#include <vector> #include <vector>
void showFitMethod(){ void showFitMethod(){
@ -206,7 +210,7 @@ void GoodnessofFit(TH1F * hist, TF1 * fit){
double x = hist->GetBinCenter(i); double x = hist->GetBinCenter(i);
double ybar = fit->Eval(x); double ybar = fit->Eval(x);
ysq += y*y; ysq += y*y;
mean + y; mean += y;
SSR += (y - ybar)*(y-ybar); SSR += (y - ybar)*(y-ybar);
chisq += (y - ybar)*(y-ybar)/e/e; chisq += (y - ybar)*(y-ybar)/e/e;
@ -1951,7 +1955,7 @@ void saveFitPara(TString fileName = "AutoFit_para.txt"){
fprintf(file_out, "# for n-Gauss fit, can use \"#\", or \"//\" to comment out whole line\n"); fprintf(file_out, "# for n-Gauss fit, can use \"#\", or \"//\" to comment out whole line\n");
fprintf(file_out, "# peak low high fixed? sigma_Max fixed? hight\n"); fprintf(file_out, "# peak low high fixed? sigma_Max fixed? hight\n");
for( int i = 0 ; i < xPeakList.size() ; i++){ for( int i = 0 ; i < (int) xPeakList.size() ; i++){
fprintf(file_out, "%.3f %.3f %.3f 0 %.3f 0 %.0f\n", fprintf(file_out, "%.3f %.3f %.3f 0 %.3f 0 %.0f\n",
xPeakList[i], xPeakList[i],
xPeakList[i] - 5*sigma[i], xPeakList[i] - 5*sigma[i],

View File

@ -77,7 +77,7 @@ public:
} }
void Print(){ void Print(bool printTrace = true){
printf("============== eventID : %llu\n", eventID); printf("============== eventID : %llu\n", eventID);
printf("Crate: %d, Slot: %d, Ch: %d \n", crate, slot, ch); printf("Crate: %d, Slot: %d, Ch: %d \n", crate, slot, ch);
printf("HeaderLength: %d, Event Length: %d, energy: %d, timeStamp: %llu\n", headerLength, eventLength, energy, time); printf("HeaderLength: %d, Event Length: %d, energy: %d, timeStamp: %llu\n", headerLength, eventLength, energy, time);
@ -92,7 +92,7 @@ public:
printf(" QDCsum : \n"); printf(" QDCsum : \n");
for( int i = 0; i < 8; i++) printf(" %-10d\n", QDCsum[i]); for( int i = 0; i < 8; i++) printf(" %-10d\n", QDCsum[i]);
} }
if( eventLength > headerLength ){ if( printTrace && eventLength > headerLength ){
printf(" trace:\n"); printf(" trace:\n");
for( int i = 0 ; i < trace_length ; i++)printf("%3d| %-10d\n",i, trace[i]); for( int i = 0 ; i < trace_length ; i++)printf("%3d| %-10d\n",i, trace[i]);
} }

View File

@ -449,11 +449,11 @@ int main(int argc, char **argv) {
}else{ }else{
if( FillFlag ){ if( FillFlag ){
if ( count < debugCount) printf("----------------- filled \n"); if ( count < debugCount) printf("----------------- filled %d\n", count);
for( i = 0; i < nFill; i++) fwrite(fillevents[i].data, sizeof(unsigned int)*fillevents[i].length, 1, fpw); for( i = 0; i < nFill; i++) fwrite(fillevents[i].data, sizeof(unsigned int)*fillevents[i].length, 1, fpw);
evts_tot_write += nFill; evts_tot_write += nFill;
}else{ }else{
if ( count < debugCount) printf("----------------- dropped \n"); if ( count < debugCount) printf("----------------- dropped %d\n", count);
evts_tot_drop += nFill; evts_tot_drop += nFill;
} }