Adapt analysis code to avoid hardcoded absolute paths (add additional argv), add paths only in filename_creator

This commit is contained in:
2021-09-07 13:50:56 +02:00
parent c9ab9f4d70
commit 4f35d285ac
10 changed files with 449 additions and 53 deletions

View File

@ -1,4 +1,5 @@
// to analyse the backplane pulsing data per module
// changes by VH 210906: to eliminate hardcoded absolute paths, uses location of the analysis root files as additional input argument (accordingly changed in filename_creator.sh)
#include "../sls_detector_calibration/jungfrauCommonHeader.h"
#include "../sls_detector_calibration/jungfrauCommonFunctions.h"
@ -33,15 +34,26 @@ int main(int argc, char* argv[]) {
gROOT->SetBatch(1);
gStyle->SetOptFit(11);
/*
if (argc != 3) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
cout << "arg 2: specify data location" << endl;
exit(1);
}
*/ //uncomment for SR
if (argc != 4) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
cout << "arg 2: specify data location (folder + data file prefix)" << endl;
cout << "arg 3: specify location of analysis root files" << endl;
exit(1);
} //uncomment for VH 210906
string module_str = argv[1];
string data_loc = argv[2];
string anadata_loc = argv[3]; //uncomment for VH 210906
int createHistos = 1; // set to 0 to do a fit-only run
int createPerStepHistos = 0; //debug
@ -58,8 +70,10 @@ int main(int argc, char* argv[]) {
TH2F* avg_adcG1_map [220];
TH2F* avg_adcG1er_map [220];
char savename[128];
char filename[128];
//char savename[128]; //uncomment for SR
//char filename[128]; //uncomment for SR
char savename[256]; //uncomment for VH 210902
char filename[256]; //uncomment for VH 210902
// create necessary directories with permissions drwxrwxr-x
// data/Mxxx
@ -72,7 +86,8 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/BackplanePulsing", module_str.c_str());
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
// /mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/Mxxx_CalibAna
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str()); //uncomment for SR
sprintf(savename,"%s", anadata_loc.c_str()); //uncomment for VH 210906
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
double xs[220];
@ -186,7 +201,7 @@ int main(int argc, char* argv[]) {
cout << "exiting to make sure you notice" << endl;
exit(1);
}
int framecounter = 0;
for (int filei = 0; filei < 3; filei++) {
@ -258,7 +273,8 @@ int main(int argc, char* argv[]) {
} // end of files
// save histograms
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/BP_histos_M%s.root", module_str.c_str(), module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/BP_histos_M%s.root", module_str.c_str(), module_str.c_str()); //uncomment for SR
sprintf(savename,"%s/BP_histos_M%s.root", anadata_loc.c_str(), module_str.c_str()); //uncomment for VH 210906
TFile* saved_file = new TFile((const char *)(savename),"RECREATE");
for (int i = 0; i < 220; i++) {
@ -272,7 +288,8 @@ int main(int argc, char* argv[]) {
} else {
// load histos
cout << "LOADING HISTOS" << endl;
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/BP_histos_M%s.root", module_str.c_str(), module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/BP_histos_M%s.root", module_str.c_str(), module_str.c_str()); //uncomment for SR
sprintf(savename,"%s/BP_histos_M%s.root", anadata_loc.c_str(), module_str.c_str()); //uncomment for VH 210906
TFile* saved_file = new TFile((const char *)(savename),"READ");
for (int i = 0; i < 220; i++) {

View File

@ -6,9 +6,10 @@
# - setup_env.sh souced
# - the hostname is set
# - detector is on
# - Filename_creator has been run (with correct module #)
# - waveform generator is on
# - amplifier board is powered and unconnected.
# - last file should be 2097184000 bytes big.
# connect to pc8830 (or any RH7 machine connected to the pulser and, after klog, run the command
# nc -k -n -v -l -p 5555 -e /bin/bash

View File

@ -1,4 +1,6 @@
// file to take current source scan files, analyse and plot them.
// changes by VH 210906: to eliminate hardcoded absolute paths, uses location of the analysis root files as additional input argument (accordingly changed in filename_creator.sh)
#include "../sls_detector_calibration/jungfrauCommonHeader.h"
#include "../sls_detector_calibration/jungfrauCommonFunctions.h"
@ -30,12 +32,15 @@ double checkRangeMinForRCEffect(double range_min) {
}
int main(int argc, char* argv[]) {
jungfrauStyle();
gROOT->SetBatch(1);
gStyle->SetOptFit(11);
/*
if (argc != 4) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
@ -44,10 +49,31 @@ int main(int argc, char* argv[]) {
cout << " " << endl;
exit(1);
}
*/ //uncomment for SR
if (argc != 5) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
cout << "arg 2: specify data location folder" << endl;
cout << "arg 3: specify data file prefix" << endl;
cout << "arg 4: specify location of analysis root files" << endl;
cout << " " << endl;
exit(1);
} //uncomment for VH 210906
string module_str = argv[1];
string data_loc = argv[2];
string data_file = argv[3];
string anadata_loc = argv[4]; //uncomment for VH 210906
vector<string> scan_v1;
scan_v1.push_back("002");
@ -252,6 +278,39 @@ int main(int argc, char* argv[]) {
scan_v6.push_back("355");
scan_v6.push_back("364");
scan_v6.push_back("366");
scan_v6.push_back("243");
scan_v6.push_back("339");
scan_v6.push_back("341");
scan_v6.push_back("368");
scan_v6.push_back("376");
scan_v6.push_back("379");
scan_v6.push_back("359");
scan_v6.push_back("363");
scan_v6.push_back("365");
scan_v6.push_back("347");
scan_v6.push_back("366");
scan_v6.push_back("268");
scan_v6.push_back("300");
scan_v6.push_back("302");
scan_v6.push_back("303");
scan_v6.push_back("309");
scan_v6.push_back("326");
scan_v6.push_back("308");
scan_v6.push_back("322");
scan_v6.push_back("328");
scan_v6.push_back("332");
scan_v6.push_back("335");
scan_v6.push_back("353");
scan_v6.push_back("335_FW2_2");
scan_v6.push_back("353_FW2_2");
scan_v6.push_back("262_FWcheck_1_1_1");
scan_v6.push_back("262_FWcheck_1_1_1_test");
scan_v6.push_back("262_FWcheck_1_2_rc210831");
jungfrauFile *thisfile = new jungfrauFile();
@ -274,7 +333,8 @@ int main(int argc, char* argv[]) {
TH2F* no_g0g1_calib_map = new TH2F("no_g0g1_calib_map","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
TH2F* no_g1g2_calib_map = new TH2F("no_g1g2_calib_map","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
char savename[128];
//char savename[128];
char savename[256]; // VH 210902
int createHistoFile = 1; //set 0 for a fit-only run
int createPerStepHistos = 0; //debug
@ -294,11 +354,12 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/CurrentSource", module_str.c_str());
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
// /mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/Mxxx_CalibAna
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str()); //uncomment for SR
sprintf(savename,"%s", anadata_loc.c_str()); //uncomment for VH 210906
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
// open first file
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str());
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str()); //VH: note, this adds a double slash in the filepath
thisfile->open((char*)savename, 0);
// calculate pixel mask
@ -312,7 +373,7 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < 640; i++) {
thisfile->readNextFrame();
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), pixel_mask);
pixelMaskObject->maskIfGainNot(1, thisfile->getFrameDataHandle(), pixel_mask); // change to Not(2 to fix FW error during JF11 FW develop. needed for modules 243-379
}
cout << "after G1, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl;
@ -504,7 +565,7 @@ int main(int argc, char* argv[]) {
for (int filei = 0; filei < nfiles; filei++) {
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str());
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str()); //VH: note, this adds a double slash in the filepath
thisfile->open((char*)savename, filei);
while(thisfile->readNextFrame()) {
@ -525,7 +586,7 @@ int main(int argc, char* argv[]) {
for (int filei = 0; filei < nfiles; filei++) {
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str());
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str()); //VH: note, this adds a double slash in the filepath
thisfile->open((char*)savename, filei);
if (filei == 0) {
@ -560,7 +621,7 @@ int main(int argc, char* argv[]) {
gain_histos[i]->Fill(gain);
if (gain == 0) {
adc_histos_g0[i]->Fill(adc);
} else if (gain == 1) {
} else if ((gain == 1)||(gain == 2)) { //(gain == 2) to fix FW error during JF11 FW develop. needed for modules 243-379
adc_histos_g1[i]->Fill(adc);
} else if (gain == 3) {
adc_histos_g2[i]->Fill(adc);
@ -764,7 +825,8 @@ int main(int argc, char* argv[]) {
}
// save histograms
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str()); //uncomment for SR
sprintf(savename,"%s/CS_histos_M%s.root", anadata_loc.c_str(), module_str.c_str()); //uncomment for VH 210906
TFile* saved_file = new TFile((const char *)(savename),"RECREATE");
for (int i = 0; i < 97; i++) {
@ -779,7 +841,8 @@ int main(int argc, char* argv[]) {
} else {
// load histos
cout << "LOADING HISTOS" << endl;
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str()); //uncomment for SR
sprintf(savename,"%s/CS_histos_M%s.root", anadata_loc.c_str(), module_str.c_str()); //uncomment for VH 210906
TFile* saved_file = new TFile((const char *)(savename),"READ");
for (int i = 0; i < 97; i++) {

View File

@ -6,14 +6,15 @@
# - setup_env.sh souced
# - the hostname is set
# - detector is on
# fileneame script has been sourced
# - fileneame script has been sourced
# last file should have exactly 4194368000 byte in it.
KILLRCV="killall ju_udp_receiver_3threads_2_0"
$KILLRCV
sls_detector_put stop #just in case
sls_detector_put powerchip 1

View File

@ -2,6 +2,7 @@
// make correction and save spectrum per pixel
// then fit fluo spectrum per pixel
// and save peak position and uncertainty
// changes by VH 210906: to eliminate hardcoded absolute paths, uses location of the analysis root files as additional input argument (accordingly changed in filename_creator.sh)
#include "../sls_detector_calibration/jungfrauCommonHeader.h"
#include "../sls_detector_calibration/jungfrauCommonFunctions.h"
@ -28,6 +29,7 @@ int main(int argc, char* argv[]) {
jungfrauStyle();
gStyle->SetOptFit(11);
/*
if (argc != 6) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
@ -38,17 +40,33 @@ int main(int argc, char* argv[]) {
cout << " " << endl;
exit(1);
}
*/ //uncomment for SR
if (argc != 7) {
cout << "Correct usage:" << endl;
cout << "arg 1: specify module number" << endl;
cout << "arg 2: specify HG0 or G0" << endl;
cout << "arg 3: specify data location folder" << endl;
cout << "arg 4: specify pede file prefix" << endl;
cout << "arg 5: specify data file prefix" << endl;
cout << "arg 6: specify location of analysis root files" << endl;
cout << " " << endl;
exit(1);
} //uncomment for VH 210906
string module_str = argv[1];
string gain_str = argv[2];
string data_loc = argv[3];
string pede_file = argv[4];
string data_file = argv[5];
string anadata_loc = argv[6]; //uncomment for VH 210906
int createHistoFile = 1;
char histoname[128];
char savename[128];
//char histoname[128];
//char savename[128];
char histoname[256]; // VH 210902
char savename[256]; // VH 210902
int filen = 20;
// create necessary directories with permissions drwxrwxr-x
@ -68,7 +86,8 @@ int main(int argc, char* argv[]) {
sprintf(savename,"plots/M%s/CuFluo/HG0", module_str.c_str());
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
// /mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/Mxxx_CalibAna
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str());
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna", module_str.c_str()); //uncomment for SR
sprintf(savename,"%s", anadata_loc.c_str()); //uncomment for VH 210906
mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask();
@ -98,7 +117,7 @@ int main(int argc, char* argv[]) {
TH2F* pedeRMSG0 = new TH2F("pedeRMSG0","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
// open pede file
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), pede_file.c_str());
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), pede_file.c_str()); //VH: note, this adds a double slash in the filepath
thisfile->open((char*)savename, 0);
// calculate pixel mask
@ -252,7 +271,7 @@ int main(int argc, char* argv[]) {
for (int filei = 0; filei < filen; filei++) {
// open data file
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str());
sprintf(savename,"%s/%s_%%6.6d.dat", data_loc.c_str(), data_file.c_str()); //VH: note, this adds a double slash in the filepath
thisfile->open((char*)savename, filei);
while (thisfile->readNextFrame()) {
@ -328,7 +347,8 @@ int main(int argc, char* argv[]) {
} // end of file loop
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CuFluo_%s_file0to%d.root", module_str.c_str(), gain_str.c_str(), filen-1);
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/CuFluo_%s_file0to%d.root", module_str.c_str(), gain_str.c_str(), filen-1);
sprintf(savename,"%s/CuFluo_%s_file0to%d.root", anadata_loc.c_str(), gain_str.c_str(), filen-1); //uncomment for VH 210906
TFile* saved_file = new TFile((const char *)(savename),"RECREATE");
adc2d_1->Write();
adc2d_2->Write();
@ -344,7 +364,8 @@ int main(int argc, char* argv[]) {
c1->cd();
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CuFluo_%s_file0to%d.root", module_str.c_str(), gain_str.c_str(), filen-1);
//sprintf(savename,"/mnt/sls_det_storage/jungfrau_data1/jungfrau_ana_sophie/M%s_CalibAna/CuFluo_%s_file0to%d.root", module_str.c_str(), gain_str.c_str(), filen-1);
sprintf(savename,"%s/CuFluo_%s_file0to%d.root", anadata_loc.c_str(), gain_str.c_str(), filen-1); //uncomment for VH 210906
TFile* comb_file = new TFile((const char *)(savename),"READ");
pixelMaskObject->initialisePixelMask(pixel_mask);

View File

@ -33,12 +33,15 @@ $CLI setv 40
$CLI setc 60
$CLI HV on
sls_detector_put clearbit 0x5d 0
$CLI shutter 1 off
echo "warmin up the board"
sls_detector_put frames 40000
sls_detector_put start
sleep 81
sls_detector_put stop
echo "end of board warm up"
@ -75,7 +78,7 @@ $TKFG0 &
sls_detector_put frames 220000
$CLI shutter 1 on
sleep 1
sleep 1
sls_detector_put start
sleep 450
# 200k frames at 500 frames per second takes 400s

View File

@ -39,7 +39,8 @@ int main(int argc, char* argv[]) {
string module_str = argv[1];
char savename[128];
//char savename[128];
char savename[256]; // VH 210902
// today's date
time_t rawtime;
@ -129,7 +130,7 @@ int main(int argc, char* argv[]) {
mapsObject->g2VALs[i] = 0.;
}
TH1F* hg0histall = new TH1F("hg0histall","",100,80,120);
TH1F* hg0histall = new TH1F("hg0histall","",160,80,160);
TH1F* g0histall = new TH1F("g0histall","",100,20,60);
TH1F* g1histall = new TH1F("g1histall","",100,-3,0);
TH1F* g2histall = new TH1F("g2histall","",100,-0.2,0);
@ -139,7 +140,7 @@ int main(int argc, char* argv[]) {
TH1F* g1ferhistall = new TH1F("g1ferhistall","",100,0,0.01);
TH1F* g2ferhistall = new TH1F("g2ferhistall","",100,0,0.05);
TH1F* hg0histcut = new TH1F("hg0histcut","",100,80,120);
TH1F* hg0histcut = new TH1F("hg0histcut","",160,80,160);
TH1F* g0histcut = new TH1F("g0histcut","",100,20,60);
TH1F* g1histcut = new TH1F("g1histcut","",100,-3,0);
TH1F* g2histcut = new TH1F("g2histcut","",100,-0.2,0);
@ -299,7 +300,7 @@ int main(int argc, char* argv[]) {
// crazy and missing value check: replace with module default
// think of a way to get the limits better
if (mapsObject->hg0VALs[i] < 80 || mapsObject->hg0VALs[i] > 120 || isnan(mapsObject->hg0VALs[i])) {
if (mapsObject->hg0VALs[i] < 80 || mapsObject->hg0VALs[i] > 160 || isnan(mapsObject->hg0VALs[i])) {
mapsObject->hg0VALs[i] = defaultHG0;
defaultvalmap_hg0->Fill(i%NC,i/NC,1);
}

View File

@ -1,41 +1,53 @@
#!/bin/bash
echo "#############################################################################"
echo "#############################################################################"
echo "#############################################################################"
echo "####### REMEMBER TO USE SOURCE, NOT SH to call this script ############"
echo "#############################################################################"
echo "#############################################################################"
echo "#############################################################################"
if [[ "$0" == *"filename_creator.sh"* ]]; then
echo "script changes env. variables: should be invoked with source, not sh "
exit
fi
echo $0
echo "printing filenames for module " $1
echo "copy paste to execute "
datafolder="/mnt/pcmoench_jungfrau_calib/data/Module_"$1"_Calib/"
#define folder structure
parentdir="/mnt/sls_det_storage/"
calib_relativedir="jungfrau_calib/data/Module_"$1"_Calib/"
ana_relativedir="jungfrau_data1/jungfrau_ana_sophie/M"$1"_CalibAna"
calibdatafolder=$parentdir$calib_relativedir
anadatafolder=$parentdir$ana_relativedir
#datafolder="/mnt/sls_det_storage/jungfrau_calib/data/Module_"$1"_Calib/"
datestring=$(date +%F)
echo "mkdir "$datafolder
echo "Relative calib directory is "$calib_relativedir
echo "Relative analysis results directory is "$ana_relativedir
echo "mkdir "$calibdatafolder "if not already existing."
#mkdir -p $calibdatafolder
export TKBPG0="ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_ 10.1.4.105"
export TKBPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKBPG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"BP_M"$1"_"$datestring"_ 10.1.4.105"
export TKCSHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKBPHG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"BP_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKCSG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_ 10.1.4.105"
export TKCSHG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CS_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKCSG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CS_M"$1"_"$datestring"_ 10.1.4.105"
echo "exporting the fluorescence receiver commands "
export TKFG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CuFluoG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKFHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CuFluoHG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKFG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CuFluoG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKFHG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CuFluoHG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"pedeG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPHG0="ju_udp_receiver_3threads_2_0 S "$calibdatafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.4.105"
echo "printing the analysis commands "
for file in $(find $datafolder -type f -exec basename {} \; | grep 000000 ); do
for file in $(find $calibdatafolder -type f -exec basename {} \; | grep 000000 ); do
prefix=${file%_000000.dat}
echo $prefix ;
if [[ $prefix == *"BP"* ]]; then
@ -75,11 +87,12 @@ echo "----------------------------------------------------------------------"
echo "---------------------START OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"
echo "M"$1
echo "./BP_analysis "$1" "$datafolder$bpfile
echo "./CS_analysis "$1" "$datafolder $csfile
echo "./CuFluo_analysis "$1" G0 "$datafolder $pgofile $cgofile
echo "./CuFluo_analysis "$1" HG0 "$datafolder $phgofile $chgofile
echo "./BP_analysis "$1" "$calibdatafolder$bpfile" "$anadatafolder
echo "./CS_analysis "$1" "$calibdatafolder" "$csfile" "$anadatafolder
echo "./CuFluo_analysis "$1" G0 "$calibdatafolder $pgofile $cgofile $anadatafolder
echo "./CuFluo_analysis "$1" HG0 "$calibdatafolder $phgofile $chgofile $anadatafolder
echo "./JFMC_CalibWriter_wBP" "$1"
echo " "
echo "----------------------------------------------------------------------"
echo "---------------------END OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"

112
filename_creator_SR.sh Normal file
View File

@ -0,0 +1,112 @@
#!/bin/bash
if [[ "$0" == *"filename_creator.sh"* ]]; then
echo "script changes env. variables: should be invoked with source, not sh "
exit
fi
echo $0
echo "printing filenames for module " $1
datafolder="/mnt/sls_det_storage/jungfrau_calib/data/Module_"$1"_Calib/"
datestring=$(date +%F)
echo "mkdir "$datafolder "if not already existing."
mkdir -p $datafolder
export TKBPG0="ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_ 10.1.4.105"
export TKBPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKCSHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105"
export TKCSG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_ 10.1.4.105"
echo "exporting the fluorescence receiver commands "
export TKFG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CuFluoG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKFHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CuFluoHG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeG0_M"$1"_"$datestring"_ 10.1.4.105"
export TKPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.4.105"
echo "printing the analysis commands "
for file in $(find $datafolder -type f -exec basename {} \; | grep 000000 ); do
prefix=${file%_000000.dat}
echo $prefix ;
if [[ $prefix == *"BP"* ]]; then
bpfile=$prefix
fi
if [[ $prefix == *"CS"* ]]; then
csfile=$prefix
fi
if [[ $prefix == *"oG0"* ]]; then
cgofile=$prefix
fi
if [[ $prefix == *"eG0"* ]]; then
pgofile=$prefix
fi
if [[ $prefix == *"oHG0"* ]]; then
chgofile=$prefix
fi
if [[ $prefix == *"eHG0"* ]]; then
phgofile=$prefix
fi
# echo "ss"
done
echo "----------------------------------------------------------------------"
echo "---------------------START OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"
echo "M"$1
echo "./BP_analysis "$1" "$datafolder$bpfile
echo "./CS_analysis "$1" "$datafolder $csfile
echo "./CuFluo_analysis "$1" G0 "$datafolder $pgofile $cgofile
echo "./CuFluo_analysis "$1" HG0 "$datafolder $phgofile $chgofile
echo "./JFMC_CalibWriter_wBP" "$1"
echo " "
echo "----------------------------------------------------------------------"
echo "---------------------END OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"
echo "creating the output folders? Y for yes "
read -n 1 -s input
if [[ $input = "Y" ]]; then
echo "creating the output folders."
plotbasefolder="/afs/psi.ch/project/mythen/sophie/JFCalibration/plots/M"$1
mkdir -v $plotbasefolder
mkdir -v $plotbasefolder"/BackplanePulsing"
# mkdir -v $plotbasefolder"/Calib_"$datestring #done by/JFMC_CalibWrite
mkdir -v $plotbasefolder"/CuFluo"
mkdir -v $plotbasefolder"/CuFluo/G0"
mkdir -v $plotbasefolder"/CuFluo/HG0"
mkdir -v $plotbasefolder"/CurrentSource"
outdatabasefolder="/afs/psi.ch/project/mythen/sophie/JFCalibration/data/M"$1
mkdir -v $outdatabasefolder
echo "Output folders created"
else
echo "Exiting script"
fi

View File

@ -1629,3 +1629,167 @@ M379
./CuFluo_analysis 379 G0 /mnt/pcmoench_jungfrau_calib/data/Module_379_Calib/ pedeG0_M379_2021-03-24 CuFluoG0_M379_2021-03-24
./CuFluo_analysis 379 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_379_Calib/ pedeHG0_M379_2021-03-24 CuFluoHG0_M379_2021-03-24
./JFMC_CalibWriter_wBP 379
M359
./BP_analysis 359 /mnt/pcmoench_jungfrau_calib/data/Module_359_Calib/BP_M359_2021-03-15
./CS_analysis_JF11_JF11 359 /mnt/pcmoench_jungfrau_calib/data/Module_359_Calib/ CS_M359_2021-03-16
./CuFluo_analysis 359 G0 /mnt/pcmoench_jungfrau_calib/data/Module_359_Calib/ pedeG0_M359_2021-03-17 CuFluoG0_M359_2021-03-16
./CuFluo_analysis 359 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_359_Calib/ pedeHG0_M359_2021-03-17 CuFluoHG0_M359_2021-03-17
./JFMC_CalibWriter_wBP 359
M363
./BP_analysis 363 /mnt/pcmoench_jungfrau_calib/data/Module_363_Calib/BP_M363_2021-03-15
./CS_analysis_JF11 363 /mnt/pcmoench_jungfrau_calib/data/Module_363_Calib/ CS_M363_2021-03-16
./CuFluo_analysis 363 G0 /mnt/pcmoench_jungfrau_calib/data/Module_363_Calib/ pedeG0_M363_2021-03-17 CuFluoG0_M363_2021-03-17
./CuFluo_analysis 363 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_363_Calib/ pedeHG0_M363_2021-03-17 CuFluoHG0_M363_2021-03-17
./JFMC_CalibWriter_wBP 363
M365
./BP_analysis 365 /mnt/pcmoench_jungfrau_calib/data/Module_365_Calib/BP_M365_2021-03-16
./CS_analysis_JF11 365 /mnt/pcmoench_jungfrau_calib/data/Module_365_Calib/ CS_M365_2021-03-16
./CuFluo_analysis 365 G0 /mnt/pcmoench_jungfrau_calib/data/Module_365_Calib/ pedeG0_M365_2021-03-17 CuFluoG0_M365_2021-03-17
./CuFluo_analysis 365 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_365_Calib/ pedeHG0_M365_2021-03-17 CuFluoHG0_M365_2021-03-17
./JFMC_CalibWriter_wBP 365
M364
./BP_analysis 364 /mnt/pcmoench_jungfrau_calib/data/Module_364_Calib/BP_M364_2021-03-15
./CS_analysis_JF11 364 /mnt/pcmoench_jungfrau_calib/data/Module_364_Calib/ CS_M364_2021-03-04
./CuFluo_analysis 364 G0 /mnt/pcmoench_jungfrau_calib/data/Module_364_Calib/ pedeG0_M364_2021-03-09 CuFluoG0_M364_2021-03-09
./CuFluo_analysis 364 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_364_Calib/ pedeHG0_M364_2021-03-11 CuFluoHG0_M364_2021-03-11
./JFMC_CalibWriter_wBP 364
M355
./BP_analysis 355 /mnt/pcmoench_jungfrau_calib/data/Module_355_Calib/BP_M355_2021-03-09
./CS_analysis_JF11 355 /mnt/pcmoench_jungfrau_calib/data/Module_355_Calib/ CS_M355_2021-03-04
./CuFluo_analysis 355 G0 /mnt/pcmoench_jungfrau_calib/data/Module_355_Calib/ pedeG0_M355_2021-03-11 CuFluoG0_M355_2021-03-11
./CuFluo_analysis 355 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_355_Calib/ pedeHG0_M355_2021-03-11 CuFluoHG0_M355_2021-03-11
./JFMC_CalibWriter_wBP 355
M361
./BP_analysis 361 /mnt/pcmoench_jungfrau_calib/data/Module_361_Calib/BP_M361_2021-03-15
./CS_analysis_JF11 361 /mnt/pcmoench_jungfrau_calib/data/Module_361_Calib/ CS_M361_2021-03-04
./CuFluo_analysis 361 G0 /mnt/pcmoench_jungfrau_calib/data/Module_361_Calib/ pedeG0_M361_2021-03-11 CuFluoG0_M361_2021-03-11
./CuFluo_analysis 361 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_361_Calib/ pedeHG0_M361_2021-03-11 CuFluoHG0_M361_2021-03-11
./JFMC_CalibWriter_wBP 361
M347
./BP_analysis 347 /mnt/pcmoench_jungfrau_calib/data/Module_347_Calib/BP_M347_2021-03-08
./CS_analysis_JF11 347 /mnt/pcmoench_jungfrau_calib/data/Module_347_Calib/ CS_M347_2021-03-04
./CuFluo_analysis 347 G0 /mnt/pcmoench_jungfrau_calib/data/Module_347_Calib/ pedeG0_M347_2021-03-11 CuFluoG0_M347_2021-03-11
./CuFluo_analysis 347 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_347_Calib/ pedeHG0_M347_2021-03-11 CuFluoHG0_M347_2021-03-11
./JFMC_CalibWriter_wBP 347
M366
./BP_analysis 366 /mnt/pcmoench_jungfrau_calib/data/Module_366_Calib/BP_M366_2021-03-09
./CS_analysis_JF11 366 /mnt/pcmoench_jungfrau_calib/data/Module_366_Calib/ CS_M366_2021-03-04
./CuFluo_analysis 366 G0 /mnt/pcmoench_jungfrau_calib/data/Module_366_Calib/ pedeG0_M366_2021-03-11 CuFluoG0_M366_2021-03-11
./CuFluo_analysis 366 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_366_Calib/ pedeHG0_M366_2021-03-11 CuFluoHG0_M366_2021-03-11
./JFMC_CalibWriter_wBP 366
268
./BP_analysis 268 /mnt/pcmoench_jungfrau_calib/data/Module_268_Calib/BP_M268_2021-06-24
./CS_analysis 268 /mnt/pcmoench_jungfrau_calib/data/Module_268_Calib/ CS_M268_2021-06-17
./CuFluo_analysis 268 G0 /mnt/pcmoench_jungfrau_calib/data/Module_268_Calib/ pedeG0_M268_2021-06-22 CuFluoG0_M268_2021-06-22
./CuFluo_analysis 268 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_268_Calib/ pedeHG0_M268_2021-06-22 CuFluoHG0_M268_2021-06-22
./JFMC_CalibWriter_wBP 268
M300
./BP_analysis 300 /mnt/pcmoench_jungfrau_calib/data/Module_300_Calib/BP_M300_2021-06-24
./CS_analysis 300 /mnt/pcmoench_jungfrau_calib/data/Module_300_Calib/ CS_M300_2021-06-17
./CuFluo_analysis 300 G0 /mnt/pcmoench_jungfrau_calib/data/Module_300_Calib/ pedeG0_M300_2021-06-22 CuFluoG0_M300_2021-06-22
./CuFluo_analysis 300 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_300_Calib/ pedeHG0_M300_2021-06-22 CuFluoHG0_M300_2021-06-22
./JFMC_CalibWriter_wBP 300
M302
./BP_analysis 302 /mnt/pcmoench_jungfrau_calib/data/Module_302_Calib/BP_M302_2021-06-24
./CS_analysis 302 /mnt/pcmoench_jungfrau_calib/data/Module_302_Calib/ CS_M302_2021-06-17
./CuFluo_analysis 302 G0 /mnt/pcmoench_jungfrau_calib/data/Module_302_Calib/ pedeG0_M302_2021-06-22 CuFluoG0_M302_2021-06-22
./CuFluo_analysis 302 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_302_Calib/ pedeHG0_M302_2021-06-22 CuFluoHG0_M302_2021-06-22
./JFMC_CalibWriter_wBP 302
M303
./BP_analysis 303 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/BP_M303_2021-06-17
./CS_analysis 303 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ CS_M303_2021-06-17
./CuFluo_analysis 303 G0 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ pedeG0_M303_2021-06-22 CuFluoG0_M303_2021-06-22
./CuFluo_analysis 303 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ pedeHG0_M303_2021-06-22 CuFluoHG0_M303_2021-06-22
./JFMC_CalibWriter_wBP 303
M303
./BP_analysis 303 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/BP_M303_2021-06-17
./CS_analysis 303 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ CS_M303_2021-06-17
./CuFluo_analysis 303 G0 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ pedeG0_M303_2021-06-22 CuFluoG0_M303_2021-06-22
./CuFluo_analysis 303 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_303_Calib/ pedeHG0_M303_2021-06-22 CuFluoHG0_M303_2021-06-22
./JFMC_CalibWriter_wBP 303
M309
./BP_analysis 309 /mnt/pcmoench_jungfrau_calib/data/Module_309_Calib/BP_M309_2021-06-17
./CS_analysis 309 /mnt/pcmoench_jungfrau_calib/data/Module_309_Calib/ CS_M309_2021-06-17
./CuFluo_analysis 309 G0 /mnt/pcmoench_jungfrau_calib/data/Module_309_Calib/ pedeG0_M309_2021-06-22 CuFluoG0_M309_2021-06-22
./CuFluo_analysis 309 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_309_Calib/ pedeHG0_M309_2021-06-22 CuFluoHG0_M309_2021-06-22
./JFMC_CalibWriter_wBP 309
M326
./BP_analysis 326 /mnt/pcmoench_jungfrau_calib/data/Module_326_Calib/BP_M326_2021-06-17
./CS_analysis 326 /mnt/pcmoench_jungfrau_calib/data/Module_326_Calib/ CS_M326_2021-06-17
./CuFluo_analysis 326 G0 /mnt/pcmoench_jungfrau_calib/data/Module_326_Calib/ pedeG0_M326_2021-06-22 CuFluoG0_M326_2021-06-22
./CuFluo_analysis 326 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_326_Calib/ pedeHG0_M326_2021-06-22 CuFluoHG0_M326_2021-06-22
./JFMC_CalibWriter_wBP 326
M308
./BP_analysis 308 /mnt/pcmoench_jungfrau_calib/data/Module_308_Calib/BP_M308_2021-08-04
./CS_analysis 308 /mnt/pcmoench_jungfrau_calib/data/Module_308_Calib/ CS_M308_2021-08-04
./CuFluo_analysis 308 G0 /mnt/pcmoench_jungfrau_calib/data/Module_308_Calib/ pedeG0_M308_2021-08-04 CuFluoG0_M308_2021-08-04
./CuFluo_analysis 308 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_308_Calib/ pedeHG0_M308_2021-08-04 CuFluoHG0_M308_2021-08-04
./JFMC_CalibWriter_wBP 308
M322
./BP_analysis 322 /mnt/pcmoench_jungfrau_calib/data/Module_322_Calib/BP_M322_2021-08-04
./CS_analysis 322 /mnt/pcmoench_jungfrau_calib/data/Module_322_Calib/ CS_M322_2021-08-04
./CuFluo_analysis 322 G0 /mnt/pcmoench_jungfrau_calib/data/Module_322_Calib/ pedeG0_M322_2021-08-04 CuFluoG0_M322_2021-08-04
./CuFluo_analysis 322 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_322_Calib/ pedeHG0_M322_2021-08-04 CuFluoHG0_M322_2021-08-04
./JFMC_CalibWriter_wBP 322
M328
./BP_analysis 328 /mnt/pcmoench_jungfrau_calib/data/Module_328_Calib/BP_M328_2021-08-04
./CS_analysis 328 /mnt/pcmoench_jungfrau_calib/data/Module_328_Calib/ CS_M328_2021-08-04
./CuFluo_analysis 328 G0 /mnt/pcmoench_jungfrau_calib/data/Module_328_Calib/ pedeG0_M328_2021-08-04 CuFluoG0_M328_2021-08-04
./CuFluo_analysis 328 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_328_Calib/ pedeHG0_M328_2021-08-04 CuFluoHG0_M328_2021-08-04
./JFMC_CalibWriter_wBP 328
M332
./BP_analysis 332 /mnt/pcmoench_jungfrau_calib/data/Module_332_Calib/BP_M332_2021-08-04
./CS_analysis 332 /mnt/pcmoench_jungfrau_calib/data/Module_332_Calib/ CS_M332_2021-08-04
./CuFluo_analysis 332 G0 /mnt/pcmoench_jungfrau_calib/data/Module_332_Calib/ pedeG0_M332_2021-08-04 CuFluoG0_M332_2021-08-04
./CuFluo_analysis 332 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_332_Calib/ pedeHG0_M332_2021-08-04 CuFluoHG0_M332_2021-08-04
./JFMC_CalibWriter_wBP 332
M335
./BP_analysis 335 /mnt/pcmoench_jungfrau_calib/data/Module_335_Calib/BP_M335_2021-08-04
./CS_analysis 335 /mnt/pcmoench_jungfrau_calib/data/Module_335_Calib/ CS_M335_2021-08-04
./CuFluo_analysis 335 G0 /mnt/pcmoench_jungfrau_calib/data/Module_335_FW2_2_Calib/ pedeG0_M335_FW2_2_2021-07-12 CuFluoG0_M335_FW2_2_2021-07-12
./CuFluo_analysis 335 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_335_FW2_2_Calib/ pedeHG0_M335_FW2_2_2021-07-12 CuFluoHG0_M335_FW2_2_2021-07-12
./JFMC_CalibWriter_wBP 335
M353
./BP_analysis 353 /mnt/pcmoench_jungfrau_calib/data/Module_353_Calib/BP_M353_2021-08-04
./CS_analysis 353 /mnt/pcmoench_jungfrau_calib/data/Module_353_Calib/ CS_M353_2021-08-04
./CuFluo_analysis 353 G0 /mnt/pcmoench_jungfrau_calib/data/Module_353_FW2_2_Calib/ pedeG0_M353_FW2_2_2021-07-12 CuFluoG0_M353_FW2_2_2021-07-12
./CuFluo_analysis 353 HG0 /mnt/pcmoench_jungfrau_calib/data/Module_353_FW2_2_Calib/ pedeHG0_M353_FW2_2_2021-07-12 CuFluoHG0_M353_FW2_2_2021-07-12
./JFMC_CalibWriter_wBP 353
Module 262 (used for FW check 210902)
./BP_analysis 262_FWcheck_1_1_1 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_1_1_Calib/BP_M262_FWcheck_1_1_1_2021-09-01
./CS_analysis 262_FWcheck_1_1_1 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_1_1_Calib/ CS_M262_FWcheck_1_1_1_2021-09-01
./CuFluo_analysis 262_FWcheck_1_1_1 G0 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_1_1_Calib/ pedeG0_M262_FWcheck_1_1_1_2021-09-01 CuFluoG0_M262_FWcheck_1_1_1_2021-09-01
./CuFluo_analysis 262_FWcheck_1_1_1 HG0 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_1_1_Calib/ pedeHG0_M262_FWcheck_1_1_1_2021-09-01 CuFluoHG0_M262_FWcheck_1_1_1_2021-09-01
./JFMC_CalibWriter_wBP 262_FWcheck_1_1_1
./BP_analysis 262_FWcheck_1_2_rc210831 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_2_rc210831_Calib/BP_M262_FWcheck_1_2_rc210831_2021-09-02
./CS_analysis 262_FWcheck_1_2_rc210831 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_2_rc210831_Calib/ CS_M262_FWcheck_1_2_rc210831_2021-09-02
./CuFluo_analysis 262_FWcheck_1_2_rc210831 G0 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_2_rc210831_Calib/ pedeG0_M262_FWcheck_1_2_rc210831_2021-09-02 CuFluoG0_M262_FWcheck_1_2_rc210831_2021-09-02
./CuFluo_analysis 262_FWcheck_1_2_rc210831 HG0 /mnt/sls_det_storage/jungfrau_calib/data/Module_262_FWcheck_1_2_rc210831_Calib/ pedeHG0_M262_FWcheck_1_2_rc210831_2021-09-02 CuFluoHG0_M262_FWcheck_1_2_rc210831_2021-09-02
./JFMC_CalibWriter_wBP 262_FWcheck_1_2_rc210831