diff --git a/CALIBRATION/hms_hodo_calib/README.md b/CALIBRATION/hms_hodo_calib/README.md index 3d24926bf48ceab323a5f3e5bb7aef32a2852bca..465d6a85da6016d36c783c76469847bfd1591c39 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 dfd67db941add124e0f74172220480309f948231..595b7e6a580a58ce8851d5514057034f4819d0bb 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 e58b4a8ed2fd06bc458223e7189caf8f5b34b6d4..0299c783dc2e0c7408b251e6ca38ab41fb02aa0f 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 1c7b7aff41ec46ee8b79313f37a1064cf78290d8..cb87f44e22cf00c81d2734eac8960b9d97f4c3fe 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