From f04eec0e165feaa6399fad7c67937ed6d98c00d2 Mon Sep 17 00:00:00 2001 From: Carlos Yero <cyero002@fiu.edu> Date: Wed, 17 Oct 2018 14:24:20 -0400 Subject: [PATCH] Updated HMS Hodo Calib: 1) Updated README.md for help with calibration 2) Added additional input parameter in timeWalkHistos.C to handle coincidence runs. Now it needs to specity either "hms" or "coin" to use the correct leafs 3) Added lines to specify the Run Number in the parameter file modified: README.md modified: fitHodoCalib.C modified: timeWalkCalib.C modified: timeWalkHistos.C --- CALIBRATION/hms_hodo_calib/README.md | 22 +++++++++++++-------- CALIBRATION/hms_hodo_calib/fitHodoCalib.C | 2 +- CALIBRATION/hms_hodo_calib/timeWalkCalib.C | 2 +- CALIBRATION/hms_hodo_calib/timeWalkHistos.C | 12 +++++------ 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/CALIBRATION/hms_hodo_calib/README.md b/CALIBRATION/hms_hodo_calib/README.md index 3d24926b..465d6a85 100644 --- a/CALIBRATION/hms_hodo_calib/README.md +++ b/CALIBRATION/hms_hodo_calib/README.md @@ -11,11 +11,15 @@ The two codes have different parameters and it is possible to switch between the ## Instructions -1. Replay the data with ptofusinginvadc=0 and need to have T.* and H.hod.* in the tree. +1. Replay the data with ptofusinginvadc=0 and need to have T.hms.* and H.hod.* in the tree. + Go to: PARAM/HMS/GEN/h_fadc_debug.param, and set hhodo_debug_adc = 1 ---> Use the correct hodo raw leafs variables + +(In case you are calibrating HMS hodo using a coincidence run, then make sure to include T.coin.*) + 2. Determine the time walk correction parameters - a. Start "root -l" and then .x timeWalkHistos.C+("entire_root_filename",runnumber) + a. Start "root -l" and then .x timeWalkHistos.C+("current_dir/to/ROOT_filename.root", Run_Number, "hms") ---> If doing coincidence, then "hms"->"coin" b. This creats the file: timeWalkHistos.root @@ -25,15 +29,17 @@ The two codes have different parameters and it is possible to switch between the 3. Replay the data with ptofusinginvadc=0 and the new parameter files (the simplest is to copy phodo_TWcalib_runnumber.param to phodo_TWcalib.param). -4. Determine the the effective propagation speeed in the paddle, the time difference between the positive and negative PMTs and then the relative time difference of all paddles compared to paddle 7 in plane S1X. The script +4. Determine the effective propagation speed in the paddle, the time difference between the positive and negative PMTs and then the relative time difference of all paddles compared to paddle 7 in plane S1X. The script puts cuts on H.cal.etracknorm, H.hgcer.npeSum and H.hod.betanotrack to select electrons. These cuts are hard coded as etrknrm_low_cut = 0.7, npngcer_npeSum_low_cut = 0.7 , betanotrack_low_cut = 0.5 and betanotrack_hi_cut = 1.5. These may need to be modified. The event must have a track. - a. Start "root -l" and then .x fitHodoCalib.C+("entire_root_filename",runnumber) +*** Make sure to have included H.hgcer.* and H.cal.etracknorm in the ROOT tree + + a. Start "root -l" and then .x fitHodoCalib.C+("current_dir/to/ROOT_filename.root",Run_Number) - b. This creates the parameter file "../../PARAM/HMS/HODO/hhodo_Vpcalib_runnumber.param" + b. This creates the parameter file "../../PARAM/HMS/HODO/hhodo_Vpcalib_runnumber.param" - c. It also creates the root file HodoCalibPlots_runnumber.root + c. It also creates the root file HodoCalibPlots_runnumber.root - d. To analyze cosmic data : .x fitHodoCalib.C+("entire_root_filename",runnumber,kTRUE) + d. To analyze cosmic data : .x fitHodoCalib.C+("current_dir/to/ROOT_filename.root",Run_Number,kTRUE) - e. For csomic data the spped of light is set to -30 cm/ns and the PID cut is just on P.hod.betanotrack with the default of betanotrack_low_cut = -1.2 and betanotrack_hi_cut = -.7 + e. For cosmic data the speed of light is set to -30 cm/ns and the PID cut is just on P.hod.betanotrack with the default of betanotrack_low_cut = -1.2 and betanotrack_hi_cut = -.7 diff --git a/CALIBRATION/hms_hodo_calib/fitHodoCalib.C b/CALIBRATION/hms_hodo_calib/fitHodoCalib.C index dfd67db9..595b7e6a 100644 --- a/CALIBRATION/hms_hodo_calib/fitHodoCalib.C +++ b/CALIBRATION/hms_hodo_calib/fitHodoCalib.C @@ -653,7 +653,7 @@ void fitHodoCalib(TString filename,Int_t runNUM,Bool_t cosmic_flag=kFALSE) outPARAM << "; HMS Hodoscope Parameter File Containing propagation velocities per paddle " << endl; outPARAM << "; and signal cable time diff. offsets per paddle " << endl; - outPARAM << " " << endl; + outPARAM << Form("; Run %d ", runNUM) << endl; outPARAM << " " << endl; outPARAM << " " << endl; diff --git a/CALIBRATION/hms_hodo_calib/timeWalkCalib.C b/CALIBRATION/hms_hodo_calib/timeWalkCalib.C index e58b4a8e..0299c783 100644 --- a/CALIBRATION/hms_hodo_calib/timeWalkCalib.C +++ b/CALIBRATION/hms_hodo_calib/timeWalkCalib.C @@ -266,7 +266,7 @@ void WriteFitParam(int runNUM) TString outPar_Name = Form("../../PARAM/HMS/HODO/hhodo_TWcalib_%d.param", runNUM); outParam.open(outPar_Name); - outParam << ";HMS Hodoscopes Output Parameter File" << endl; + outParam << Form(";HMS Hodoscopes Output Parameter File: Run %d", runNUM) << endl; outParam << " " << endl; // outParam << "htofusinginvadc=0 " << " ;set to zero to NOT read old style hodo calib parameters" << endl; outParam << "hTDC_threshold=" << tdcThresh << ". ;units of mV " << endl; diff --git a/CALIBRATION/hms_hodo_calib/timeWalkHistos.C b/CALIBRATION/hms_hodo_calib/timeWalkHistos.C index 1c7b7aff..cb87f44e 100644 --- a/CALIBRATION/hms_hodo_calib/timeWalkHistos.C +++ b/CALIBRATION/hms_hodo_calib/timeWalkHistos.C @@ -197,7 +197,7 @@ void generatePlots(UInt_t iplane, UInt_t iside, UInt_t ipaddle) { } // generatePlots() -void timeWalkHistos(TString inputname,Int_t runNum) { +void timeWalkHistos(TString inputname,Int_t runNum, string SPEC_flg) { //SPEC_flg ---> "hms" or "coin" // Global ROOT settings gStyle->SetOptFit(); @@ -222,11 +222,11 @@ void timeWalkHistos(TString inputname,Int_t runNum) { // Obtain the tree rawDataTree = dynamic_cast <TTree*> (replayFile->Get("T")); // Acquire the trigger apparatus data - rawDataTree->SetBranchAddress("T.hms.hFADC_TREF_ROC1_adcPulseTimeRaw", &refAdcPulseTimeRaw); - rawDataTree->SetBranchAddress("T.hms.hFADC_TREF_ROC1_adcPulseAmp", &refAdcPulseAmp); - rawDataTree->SetBranchAddress("T.hms.hFADC_TREF_ROC1_adcMultiplicity", &refAdcMultiplicity); - rawDataTree->SetBranchAddress("T.hms.hT1_tdcTimeRaw", &refT1TdcTimeRaw); - rawDataTree->SetBranchAddress("T.hms.hT2_tdcTimeRaw", &refT2TdcTimeRaw); + rawDataTree->SetBranchAddress(Form("T.%s.hFADC_TREF_ROC1_adcPulseTimeRaw", SPEC_flg.c_str()), &refAdcPulseTimeRaw); + rawDataTree->SetBranchAddress(Form("T.%s.hFADC_TREF_ROC1_adcPulseAmp", SPEC_flg.c_str()), &refAdcPulseAmp); + rawDataTree->SetBranchAddress(Form("T.%s.hFADC_TREF_ROC1_adcMultiplicity", SPEC_flg.c_str()), &refAdcMultiplicity); + rawDataTree->SetBranchAddress(Form("T.%s.hT1_tdcTimeRaw", SPEC_flg.c_str()), &refT1TdcTimeRaw); + rawDataTree->SetBranchAddress(Form("T.%s.hT2_tdcTimeRaw", SPEC_flg.c_str()), &refT2TdcTimeRaw); rawDataTree->SetBranchAddress("H.cal.etot", &calEtot); rawDataTree->SetBranchAddress("H.cer.npeSum", &cerNpeSum); // Loop over the planes, sides, signals, leafs, and fill data arrays -- GitLab