Skip to content
Snippets Groups Projects
Commit 7c6156f7 authored by hallc-online's avatar hallc-online
Browse files

Calibrated SHMS DCs.

The calibration scripts work in a very specific way. First you have to change the
`wire_drift_times.h` to read the correct run. Then you have to change the
`pdc_plane_time_zero` in the parameter file to `1280`, since it is hardcoded.
Then you replay the run with these values and run the calibration. Then you
get the correct corrections to the time zero.
parent 31ef74f8
No related branches found
No related tags found
No related merge requests found
......@@ -12,9 +12,11 @@ void get_pdc_time_histo()
ifstream infile(f0);
infile >> run_NUM;
TString file_name = "../../../ROOTfiles/shms_replay_%d.root";
//Create RUN Directories if they dont exist
char *dir0 = Form("mkdir ../root_files/run%d", run_NUM);
char *dir1 = Form("mkdir ../data_files/run%d", run_NUM);
char *dir0 = Form("mkdir -p ../root_files/run%d", run_NUM);
char *dir1 = Form("mkdir -p ../data_files/run%d", run_NUM);
if (system(dir0 || dir1) != 0) {
system(dir0);
......@@ -22,7 +24,7 @@ void get_pdc_time_histo()
}
//open file
TFile *f = new TFile(Form("../../../ROOTfiles/pdc_replay_%d.root", run_NUM), "READ");
TFile *f = new TFile(Form(file_name.Data(), run_NUM), "READ");
//create new file
TFile *g = new TFile(Form("../root_files/run%d/shms_dc_time_%d.root", run_NUM, run_NUM), "RECREATE"); // create new file to store histo
......@@ -63,7 +65,6 @@ void get_pdc_time_histo()
h[ip] = new TH1F(drift_time_histo, title, 200, -50, 350); //set time to 400 ns/200 bins = 2ns/bin
}
//Declare number of entries in the tree
Long64_t nentries = tree->GetEntries(); //number of triggers (particles that passed through all 4 hodo planes)
......@@ -87,12 +88,6 @@ void get_pdc_time_histo()
}
//Write histograms to file
g->Write();
}
......@@ -16,7 +16,7 @@ void get_pdc_time_histo_tzero_corrected()
//open file
TFile *f = new TFile(Form("../../../ROOTfiles/pdc_replay_%d.root", run_NUM), "READ");
TFile *f = new TFile(Form("../../../ROOTfiles/shms_replay_%d.root", run_NUM), "READ");
//updates file
TFile *g = new TFile(Form("../root_files/run%d/shms_dc_t0_corrected_%d.root", run_NUM, run_NUM), "UPDATE"); // create new file to store histo
......
407
437
......@@ -2,7 +2,7 @@
// This class has been automatically generated on
// Tue Mar 7 17:30:40 2017 by ROOT version 5.34/36
// from TTree T/Hall A Analyzer Output DST
// found on file: ROOTfiles/pdc_replay_407.root
// found on file: ROOTfiles/pdc_replay_437.root
//////////////////////////////////////////////////////////
#ifndef wire_drift_times_h
......@@ -324,9 +324,9 @@ wire_drift_times::wire_drift_times(TTree *tree) : fChain(0)
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
if (tree == 0) {
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../../../ROOTfiles/pdc_replay_407.root");
TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../../../ROOTfiles/shms_replay_437.root");
if (!f || !f->IsOpen()) {
f = new TFile("../../../ROOTfiles/pdc_replay_407.root");
f = new TFile("../../../ROOTfiles/shms_replay_437.root");
}
f->GetObject("T",tree);
......
......@@ -42,19 +42,19 @@ TH1F pdc2x1_wirenum 'SHMS DC 2X1 Wiremap; Wire Number; Number of Entries' P.dc.2
TH1F pdc2u2_wirenum 'SHMS DC 2U2 Wiremap; Wire Number; Number of Entries' P.dc.2u2.wirenum 107 0.5 107.5
TH1F pdc2u1_wirenum 'SHMS DC 2U1 Wiremap; Wire Number; Number of Entries' P.dc.2u1.wirenum 107 0.5 107.5
TH2F pdc1u1_wirenum_vs_tdc 'SHMS DC 1U1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1u1.wirenum P.dc.1u1.time 107 0.5 107.5 500 0 500
TH2F pdc1u2_wirenum_vs_tdc 'SHMS DC 1U2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1u2.wirenum P.dc.1u2.time 107 0.5 107.5 500 0 500
TH2F pdc1x1_wirenum_vs_tdc 'SHMS DC 1X1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1x1.wirenum P.dc.1x1.time 79 0.5 79.5 500 0 500
TH2F pdc1x2_wirenum_vs_tdc 'SHMS DC 1X2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1x2.wirenum P.dc.1x2.time 79 0.5 79.5 500 0 500
TH2F pdc1v1_wirenum_vs_tdc 'SHMS DC 1V1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1v1.wirenum P.dc.1v1.time 107 0.5 107.5 500 0 500
TH2F pdc1v2_wirenum_vs_tdc 'SHMS DC 1V2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1v2.wirenum P.dc.1v2.time 107 0.5 107.5 500 0 500
TH2F pdc2v2_wirenum_vs_tdc 'SHMS DC 2V2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2v2.wirenum P.dc.2v2.time 107 0.5 107.5 500 0 500
TH2F pdc2v1_wirenum_vs_tdc 'SHMS DC 2V1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2v1.wirenum P.dc.2v1.time 107 0.5 107.5 500 0 500
TH2F pdc2x2_wirenum_vs_tdc 'SHMS DC 2X2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2x2.wirenum P.dc.2x2.time 79 0.5 79.5 500 0 500
TH2F pdc2x1_wirenum_vs_tdc 'SHMS DC 2X1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2x1.wirenum P.dc.2x1.time 79 0.5 79.5 500 0 500
TH2F pdc2u2_wirenum_vs_tdc 'SHMS DC 2U2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2u2.wirenum P.dc.2u2.time 107 0.5 107.5 500 0 500
TH2F pdc2u1_wirenum_vs_tdc 'SHMS DC 2U1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2u1.wirenum P.dc.2u1.time 107 0.5 107.5 500 0 500
TH2F pdc1u1_wirenum_vs_tdc 'SHMS DC 1U1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1u1.wirenum P.dc.1u1.time 107 0.5 107.5 600 -100 500
TH2F pdc1u2_wirenum_vs_tdc 'SHMS DC 1U2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1u2.wirenum P.dc.1u2.time 107 0.5 107.5 600 -100 500
TH2F pdc1x1_wirenum_vs_tdc 'SHMS DC 1X1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1x1.wirenum P.dc.1x1.time 79 0.5 79.5 600 -100 500
TH2F pdc1x2_wirenum_vs_tdc 'SHMS DC 1X2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1x2.wirenum P.dc.1x2.time 79 0.5 79.5 600 -100 500
TH2F pdc1v1_wirenum_vs_tdc 'SHMS DC 1V1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1v1.wirenum P.dc.1v1.time 107 0.5 107.5 600 -100 500
TH2F pdc1v2_wirenum_vs_tdc 'SHMS DC 1V2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.1v2.wirenum P.dc.1v2.time 107 0.5 107.5 600 -100 500
TH2F pdc2v2_wirenum_vs_tdc 'SHMS DC 2V2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2v2.wirenum P.dc.2v2.time 107 0.5 107.5 600 -100 500
TH2F pdc2v1_wirenum_vs_tdc 'SHMS DC 2V1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2v1.wirenum P.dc.2v1.time 107 0.5 107.5 600 -100 500
TH2F pdc2x2_wirenum_vs_tdc 'SHMS DC 2X2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2x2.wirenum P.dc.2x2.time 79 0.5 79.5 600 -100 500
TH2F pdc2x1_wirenum_vs_tdc 'SHMS DC 2X1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2x1.wirenum P.dc.2x1.time 79 0.5 79.5 600 -100 500
TH2F pdc2u2_wirenum_vs_tdc 'SHMS DC 2U2 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2u2.wirenum P.dc.2u2.time 107 0.5 107.5 600 -100 500
TH2F pdc2u1_wirenum_vs_tdc 'SHMS DC 2U1 Wire Number vs. TDC; Wire Number; TDC Time (ns) / 1 ns' P.dc.2u1.wirenum P.dc.2u1.time 107 0.5 107.5 600 -100 500
TH2F pdc1u1_wirenum_vs_resid 'SHMS 1U1 DC Wire Number vs. Residuals; Wire Number; Residuals (mm)' P.dc.1u1.wirenum P.dc.residual[0] 107 0.5 107.5 200 -1.0 1.0
TH2F pdc1u2_wirenum_vs_resid 'SHMS 1U2 DC Wire Number vs. Residuals; Wire Number; Residuals (mm)' P.dc.1u2.wirenum P.dc.residual[1] 107 0.5 107.5 200 -1.0 1.0
......@@ -180,4 +180,4 @@ TH1F ptrig_p2T_tdc 'SHMS p2x/p2y Coincidence TDC Time; Raw TDC Time (TDC Units);
TH1F ptrig_pT1_tdc 'SHMS p1x/p1y/p2x/p2y Coincidence TDC Time (Slot 20, Channel 15); Raw TDC Time (TDC Units); Counts / 10 TDC Units;' T.shms.pT1_tdcTime 350 0 3500
TH1F ptrig_pT2_tdc 'SHMS p1x/p1y/p2x/p2y Coincidence TDC Time (Slot 19, Channel 31); Raw TDC Time (TDC Units); Counts / 10 TDC Units;' T.shms.pT2_tdcTime 350 0 3500
TH1F ptrig_pT3_tdc 'SHMS p1x/p1y/p2x/p2y Coincidence TDC Time (Slot 19, Channel 38); Raw TDC Time (TDC Units); Counts / 10 TDC Units;' T.shms.pT3_tdcTime 350 0 3500
\ No newline at end of file
TH1F ptrig_pT3_tdc 'SHMS p1x/p1y/p2x/p2y Coincidence TDC Time (Slot 19, Channel 38); Raw TDC Time (TDC Units); Counts / 10 TDC Units;' T.shms.pT3_tdcTime 350 0 3500
......@@ -14,11 +14,8 @@ pdc_tdc_max_win = 55000, 55000, 55000, 55000, 55000, 55000 ; TODO - wide limits
pdc_tdc_time_per_channel = -0.10
; Zero time correction for each plane in ns that is added to TDC time.
pdc_plane_time_zero = 1253.89,1252.55,1255.96,1256.28,1256.23,1255.7
1256.94,1256.95,1258.05,1257.86,1257.78,1256.91
;pdc_plane_time_zero = ;1280.0, 1280.0, 1280.0, 1280.0, 1280.0, 1280.0 ; TODO - fine calibration
;1280.0, 1280.0, 1280.0, 1280.0, 1280.0, 1280.0
pdc_plane_time_zero = 1283.82, 1283.30, 1286.73, 1283.56, 1282.57, 1284.30
1283.94, 1283.34, 1286.95, 1286.46, 1286.37, 1284.47
; For wire velocity corrections.
pdc_wire_velocity = 13.0 ; TODO
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment