Skip to content
Snippets Groups Projects
Commit 1519d8ad authored by Eric Pooser's avatar Eric Pooser
Browse files

Incorporate SHMS pre-shower and shower in the hallc replay framework

parent 4397a34a
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ raddeg=3.14159265/180
#include "PARAM/SHMS/GEN/ptracking.param"
; SHMS detector specific paramter files
#include "PARAM/SHMS/CAL/pcal.param"
#include "PARAM/SHMS/DC/pdc.pos"
#include "PARAM/SHMS/DC/pdc.param"
#include "PARAM/SHMS/DC/pdriftmap.param"
......
# See $ANALYZER/examples/output_example.def for examples
#
block P.cal.*
TH2F pcal_pi_v_shwr_blk 'SHMS Shower Pulse Integral vs. Block Number; Block Number; Pulse Integral / 10 ADC Units' P.cal.fly.adchits P.cal.fly.a 224 0.5 224.5 4000 0 40000
TH2F pcal_pi_v_prshwr_pos_blk 'SHMS Positive Preshower Pulse Integral vs. Block Number; Block Number; Pulse Integral / 10 ADC Units' P.cal.pr.posadchits P.cal.pr.apos 13 0.5 13.5 4000 0 40000
TH2F pcal_pi_v_prshwr_neg_blk 'SHMS Negative Preshower Pulse Integral vs. Block Number; Block Number; Pulse Integral / 10 ADC Units' P.cal.pr.negadchits P.cal.pr.aneg 13 0.5 13.5 4000 0 40000
\ No newline at end of file
Block: RawDecode
Pedestal_event 0
RawDecode_master 1
Block: Decode
Decode_master 1
Block: CoarseTracking
CoarseTracking_master 1
Block: CoarseReconstruct
CourseReconstruct 0
! SCAL_ID=26 :: ADC
! PCAL_ID=26 :: ADC
DETECTOR=26
......
pcal_array = 1
pcal_layer_names = "pr fly"
pcal_pr_nr = 14 # Num of rows in preshower
pcal_num_layers = 1
pcal_arr_nrows = 16
pcal_arr_ncolumns = 14
pcal_arr_front_x = 1.0
pcal_arr_front_y = 1.0
pcal_arr_front_z = 1.0
pcal_arr_xstep = 1.0
pcal_arr_ystep = 1.0
pcal_arr_zsize = 1.0
pcal_arr_ped_limit = 1.0
pcal_arr_cal_const = 1.0
pcal_arr_gain_cor = 1.0
; Exclusion bandwidth for calorimeter fiducial volume.
pcal_fv_delta = 5
# Constants for the coordiante correction of the calorimeter energy depositions
pcal_a_cor = 200.
pcal_b_cor = 8000.
pcal_c_cor = 64.36, 64.36 # for positive and negative sides
pcal_d_cor = 1.66, 1.66
; Parameters copied from HMS
; Slop in x possitino. Allowed distance between track and edge of block
pcal_slop = 7.5
pcal_pr_thick = 10.0
; Z Position of from of preshower
pcal_pr_zpos = 200.0
pcal_pr_left = 35.0
pcal_pr_right = -35.0
pcal_pr_top = (-69.0-1.4)
(-59.0-1.4)
(-49.0-1.4)
(-39.0-1.4)
(-29.0-1.4)
(-19.0-1.4)
( -9.0-1.4)
( 1.0-1.4)
( 11.0-1.4)
( 21.0-1.4)
( 31.0-1.4)
( 41.0-1.4)
( 51.0-1.4)
( 61.0-1.4)
pcal_pos_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,
0.001,0.001,0.001,0.001,0.001,0.001
pcal_neg_cal_const =0.001,0.001,0.001,0.001,0.001,0.001,0.001,0.001,
0.001,0.001,0.001,0.001,0.001,0.001
pcal_pos_ped_limit=1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,
1000,1000,1000,1000
pcal_neg_ped_limit=1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,
1000,1000,1000,1000
pcal_pos_gain_cor=1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
pcal_neg_gain_cor=1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
pcal_min_peds = 500
; Parameters we need to keep THcHallCSpectrometer Happy
p_recon_coeff_filename = ""
ptheta_offset = 0.0
pphi_offset = 0.0
pdelta_offset = 0.0
pthetacentral_offset = 0.0
p_oopcentral_offset = 0.0
ppcentral_offset = 0.0
ppcentral = 0.0
ptheta_lab = 0.0
ppartmass = 0.139
phodo_num_planes = 1
; "Hodoscope" parameters
; Not used, but to keep THcTestPaddles happy
pref_offset = 0
pref_nsperchan = 0.1
\ No newline at end of file
......@@ -16,8 +16,8 @@ void replay_hcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
}
// Create file name patterns.
const char* RunFileNamePattern = "raw/hms_all_000%d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/test_%d.root";
const char* RunFileNamePattern = "raw/hms_all_%05d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/hms_hcal_replay_%d.root";
// Add variables to global list.
gHcParms->Define("gen_run_number", "Run Number", RunNumber);
gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
......
void replay_pcal_test_stand(Int_t RunNumber=0, Int_t MaxEvent=0) {
// Get RunNumber and MaxEvent if not provided.
if(RunNumber == 0) {
cout << "Enter a Run Number (-1 to exit): ";
cin >> RunNumber;
if( RunNumber<=0 ) return;
}
if(MaxEvent == 0) {
cout << "\nNumber of Events to analyze: ";
cin >> MaxEvent;
if(MaxEvent == 0) {
cerr << "...Invalid entry\n";
exit;
}
}
// Create file name patterns.
const char* RunFileNamePattern = "raw/shms_all_%05d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/shms_pcal_replay_%d.root";
// Add variables to global list.
gHcParms->Define("gen_run_number", "Run Number", RunNumber);
gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
// Load varibles from files to global list.
gHcParms->Load(gHcParms->GetString("g_ctp_database_filename"), RunNumber);
// g_ctp_parm_filename and g_decode_map_filename should now be defined.
gHcParms->Load(gHcParms->GetString("g_ctp_kinematics_filename"), RunNumber);
gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
// Load the Hall C style detector map
gHcDetectorMap = new THcDetectorMap();
gHcDetectorMap->Load("MAPS/SHMS/DETEC/pcal.map");
// Set up the equipment to be analyzed.
THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
gHaApps->Add(SHMS);
// Add hodoscope to HMS apparatus
THcShower* cal = new THcShower("cal", "Calorimeter");
SHMS->AddDetector(cal);
// Set up the analyzer - we use the standard one,
// but this could be an experiment-specific one as well.
// The Analyzer controls the reading of the data, executes
// tests/cuts, loops over Acpparatus's and PhysicsModules,
// and executes the output routines.
THcAnalyzer* analyzer = new THcAnalyzer;
// A simple event class to be output to the resulting tree.
// Creating your own descendant of THaEvent is one way of
// defining and controlling the output.
THaEvent* event = new THaEvent;
// Define the run(s) that we want to analyze.
// We just set up one, but this could be many.
char RunFileName[100];
sprintf(RunFileName, RunFileNamePattern, RunNumber);
THaRun* run = new THaRun(RunFileName);
// Eventually need to learn to skip over, or properly analyze
// the pedestal events
run->SetEventRange(1, MaxEvent); // Physics Event number, does not
// include scaler or control events.
run->SetNscan(1);
run->SetDataRequired(0x7);
run->Print();
// Define the analysis parameters
TString ROOTFileName = Form(ROOTFileNamePattern, RunNumber);
analyzer->SetCountMode(2); // 0 = counter is # of physics triggers
// 1 = counter is # of all decode reads
// 2 = counter is event number
analyzer->SetEvent(event);
analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
analyzer->SetOutFile(ROOTFileName.Data());
analyzer->SetOdefFile("DEF-files/SHMS/CAL/pcalana.def");
analyzer->SetCutFile("DEF-files/SHMS/CAL/pcalana_cuts.def"); // optional
// File to record cuts accounting information
//analyzer->SetSummaryFile("summary_example.log"); // optional
// Start the actual analysis.
analyzer->Process(run);
// Create report file from template.
//analyzer->PrintReport( // optional
// "TEMPLATES/dcana.template",
// Form("REPORT_OUTPUT/replay_hms_%05d.report", RunNumber)
//);
}
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