Skip to content
Snippets Groups Projects
Commit ff99e41f authored by Yero1990's avatar Yero1990 Committed by Eric Pooser
Browse files

Shms dc calib (#144)

* commented out a cout line

* increased the total number of bins by two, since the bin width was reduced from 2ns to 1ns. This change produced better drift distances

* reduced drift time bin width to 1ns.

* reduced bin width to 1 ns/bin

* reduced bin width to 1 ns /bin

* Updated parameter files
parent 08715ec6
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,7 @@
*/
#define NPLANES 12
#define TOTAL_BINS 137
#define TOTAL_BINS 274
void get_LookUp_Values() {
......@@ -49,7 +48,7 @@ void get_LookUp_Values() {
ofs << "; number of 1st bin in table in ns" << "\n";
ofs << "pdrift1stbin=0" << "\n";
ofs << "; bin size in ns" << "\n";
ofs << "pdriftbinsz=2" << "\n";
ofs << "pdriftbinsz=1" << "\n";
......@@ -101,12 +100,12 @@ void get_LookUp_Values() {
lookup_value[ip] = binSUM[ip] / binContent_TOTAL[ip];
bin_count = bin_count + 1;
if (bin_count <= 8 ) {
if (bin_count <= 16 ) {
ofs << setprecision(5) << lookup_value[ip] << fixed << ",";
}
else if (bin_count >8 && bin_count < 138) {
ofs << setprecision(5) << lookup_value[ip] << ((bin_count+1) % 10 ? "," : "\n") << fixed;
else if (bin_count >16 && bin_count < 274) {
ofs << setprecision(5) << lookup_value[ip] << ((bin_count+1) % 20 ? "," : "\n") << fixed;
}
else {
ofs << setprecision(5) << lookup_value[ip] << fixed << endl;
......
......@@ -2,6 +2,7 @@
#define NPLANES 12
#define NBINS 400
void get_pdc_time_histo()
{
......@@ -57,9 +58,9 @@ void get_pdc_time_histo()
//Create Histograms
h[ip] = new TH1F(drift_time_histo, title, 200, -50, 350); //set time to 400 ns/200 bins = 2ns/bin
h[ip] = new TH1F(drift_time_histo, title, NBINS, -50, 350); //set time to 400 ns/200 bins = 2ns/bin
h[ip]->GetXaxis()->SetTitle("Drift Time (ns)");
h[ip]->GetYaxis()->SetTitle("Number of Entries / 2 ns");
h[ip]->GetYaxis()->SetTitle("Number of Entries / 1 ns");
}
......
#define NPLANES 12
#define NBINS 400
using namespace std;
void get_pdc_time_histo_tzero_corrected()
{
......@@ -100,8 +100,7 @@ void get_pdc_time_histo_tzero_corrected()
int i;
int nbins = 200; // set number of bins in histos
int bin_width = 2;
int bin_width = 1;
int bin_Content;
Double_t shift; //will be the t0 offset
......@@ -131,10 +130,10 @@ void get_pdc_time_histo_tzero_corrected()
f[ip] = new TFile(root_file, "READ");
h_add[ip] =new TH1F("plane_"+plane_names[ip]+"drifttime", "", nbins, -50, 350);
h_add[ip] =new TH1F("plane_"+plane_names[ip]+"drifttime", "", NBINS, -50, 350);
h_add[ip]->GetXaxis()->SetTitle("Drift Time (ns)");
h_add[ip]->GetYaxis()->SetTitle("Number of Entries / 2 ns");
h_add[ip]->GetYaxis()->SetTitle("Number of Entries / 1 ns");
TH1F *cell_dt[107];
......@@ -159,10 +158,10 @@ void get_pdc_time_histo_tzero_corrected()
//Create corrected wire histos
cell_dt_corr[sw-1] = new TH1F(plane_names[ip]+Form("_wire_%d_corr", sw), "", nbins, -50, 350);
cell_dt_corr[sw-1] = new TH1F(plane_names[ip]+Form("_wire_%d_corr", sw), "", NBINS, -50, 350);
cell_dt_corr[sw-1]->GetXaxis()->SetTitle("Drift Time (ns)");
cell_dt_corr[sw-1]->GetYaxis()->SetTitle("Number of Entries / 2 ns");
cell_dt_corr[sw-1]->GetYaxis()->SetTitle("Number of Entries / 1 ns");
shift = tzero[ip][sw-1]; //the shift represents how much the drift time histo needs to be offset
......@@ -174,7 +173,7 @@ void get_pdc_time_histo_tzero_corrected()
//INCLUDE the code 'shift.C ', which shifts a histogram
for (i=1; i<=nbins; i++) {
for (i=1; i<=NBINS; i++) {
bin_Content = cell_dt[sw-1]->GetBinContent(i);
......
......@@ -319,7 +319,7 @@ void get_wire_tzero()
// if(sensewire<=fNWires[ip]){
cout << sensewire << endl;
//cout << sensewire << endl;
//Check if entries for each sensewire exceeds a certain number of events
if (entries>300 && abs(t0)<30)
......
......@@ -4,7 +4,7 @@
#include <TStyle.h>
#include <TCanvas.h>
#define NPLANES 12
#define NBINS 400
void wire_drift_times::Loop()
{
// In a ROOT session, you can do:
......@@ -76,7 +76,7 @@ void wire_drift_times::Loop()
if(ip == 0 || ip == 1 || ip == 4 || ip == 5 || ip == 6 || ip == 7 || ip == 10 || ip == 11) {
TH1F *cell_dt[total_wires_uv];
TH2F *drifttime_vs_wire = new TH2F("drifttime_vs_wire", "", 107., 0.,107., 200., -50., 350.);
TH2F *drifttime_vs_wire = new TH2F("drifttime_vs_wire", "", 107., 0.,107., NBINS, -50., 350.);
......@@ -85,10 +85,10 @@ void wire_drift_times::Loop()
//Initialize wire drift time histograms
for (wirenum=1; wirenum<=total_wires_uv; wirenum++){
cell_dt[wirenum-1] = new TH1F(Form("wire_%d", wirenum), "", 200., -50., 350.);
cell_dt[wirenum-1] = new TH1F(Form("wire_%d", wirenum), "", NBINS, -50., 350.);
cell_dt[wirenum-1]->GetXaxis()->SetTitle("Drift Time (ns)");
cell_dt[wirenum-1]->GetYaxis()->SetTitle("Number of Entries / 2 ns");
cell_dt[wirenum-1]->GetYaxis()->SetTitle("Number of Entries / 1 ns");
}
//Loop over all entries (triggers or events)
......@@ -210,7 +210,7 @@ void wire_drift_times::Loop()
if(ip == 2 || ip == 3 || ip == 8 || ip == 9) {
TH1F *cell_dt[total_wires_x];
TH2F *drifttime_vs_wire = new TH2F("drifttime_vs_wire", "", 79., 0., 79., 200., -50., 350.);
TH2F *drifttime_vs_wire = new TH2F("drifttime_vs_wire", "", 79., 0., 79., NBINS, -50., 350.);
......@@ -219,10 +219,10 @@ void wire_drift_times::Loop()
//Initialize wire drift time histograms
for (int wirenum=1; wirenum<=total_wires_x; wirenum++){
cell_dt[wirenum-1] = new TH1F(Form("wire_%d", wirenum), "", 200., -50., 350.);
cell_dt[wirenum-1] = new TH1F(Form("wire_%d", wirenum), "", NBINS, -50., 350.);
cell_dt[wirenum-1]->GetXaxis()->SetTitle("Drift Time (ns)");
cell_dt[wirenum-1]->GetYaxis()->SetTitle("Number of Entries / 2 ns");
cell_dt[wirenum-1]->GetYaxis()->SetTitle("Number of Entries / 1 ns");
}
......
This diff is collapsed.
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