Skip to content
Snippets Groups Projects
Commit cc30cce3 authored by Mark K Jones's avatar Mark K Jones Committed by GitHub
Browse files

Merge pull request #17 from pooser/pooser-shms-dc-work

Pooser shms dc work
parents bce30a1d 73abbd1b
No related branches found
No related tags found
No related merge requests found
...@@ -23,3 +23,5 @@ raddeg=3.14159265/180 ...@@ -23,3 +23,5 @@ raddeg=3.14159265/180
#include "PARAM/hdriftmap.param" #include "PARAM/hdriftmap.param"
#include "PARAM/hcal.param" #include "PARAM/hcal.param"
#include "PARAM/hcer.param" #include "PARAM/hcer.param"
#include "PARAM/pdc.param"
0-99999 0-99999
g_ctp_parm_filename ="DBASE/general.param" g_ctp_parm_filename ="DBASE/general.param"
g_decode_map_filename ="MAPS/HMS/hdc.map" g_decode_map_filename ="MAPS/HMS/hdc.map"
g_decode_map_filename ="MAPS/SHMS/pdc.map"
g_ctp_kinematics_filename ="DBASE/standard.kinematics" g_ctp_kinematics_filename ="DBASE/standard.kinematics"
# See $ANALYZER/examples/output_example.def for examples
#
block P.dc.*
TH1F pdc1u1_wm 'PDC 1U1 Wiremap' P.dc.1u1.wirenum 107 0.5 107.5
TH1F pdc1u2_wm 'PDC 1U2 Wiremap' P.dc.1u2.wirenum 107 0.5 107.5
TH1F pdc1x1_wm 'PDC 1X1 Wiremap' P.dc.1x1.wirenum 79 0.5 79.5
TH1F pdc1x2_wm 'PDC 1X2 Wiremap' P.dc.1x2.wirenum 79 0.5 79.5
TH1F pdc1v1_wm 'PDC 1V1 Wiremap' P.dc.1v1.wirenum 107 0.5 107.5
TH1F pdc1v2_wm 'PDC 1V2 Wiremap' P.dc.1v2.wirenum 107 0.5 107.5
TH1F pdc2v2_wm 'PDC 2V2 Wiremap' P.dc.2v2.wirenum 107 0.5 107.5
TH1F pdc2v1_wm 'PDC 2V1 Wiremap' P.dc.2v1.wirenum 107 0.5 107.5
TH1F pdc2x2_wm 'PDC 2X2 Wiremap' P.dc.2x2.wirenum 79 0.5 79.5
TH1F pdc2x1_wm 'PDC 2X1 Wiremap' P.dc.2x1.wirenum 79 0.5 79.5
TH1F pdc2u2_wm 'PDC 2U2 Wiremap' P.dc.2u2.wirenum 107 0.5 107.5
TH1F pdc2u2_wm 'PDC 2U1 Wiremap' P.dc.2u1.wirenum 107 0.5 107.5
TH2F pdc1u1_wire_num_vs_raw_tdc 'PDC 1U1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1u1.wirenum P.dc.1u1.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc1u2_wire_num_vs_raw_tdc 'PDC 1U2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1u2.wirenum P.dc.1u2.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc1x1_wire_num_vs_raw_tdc 'PDC 1X1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1x1.wirenum P.dc.1x1.rawtdc 79 0.5 79.5 5000 0 50000
TH2F pdc1x2_wire_num_vs_raw_tdc 'PDC 1X2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1x2.wirenum P.dc.1x2.rawtdc 79 0.5 79.5 5000 0 50000
TH2F pdc1v1_wire_num_vs_raw_tdc 'PDC 1V1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1v1.wirenum P.dc.1v1.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc1v2_wire_num_vs_raw_tdc 'PDC 1V2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.1v2.wirenum P.dc.1v2.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc2v2_wire_num_vs_raw_tdc 'PDC 2V2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2v2.wirenum P.dc.2v2.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc2v1_wire_num_vs_raw_tdc 'PDC 2V1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2v1.wirenum P.dc.2v1.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc2x2_wire_num_vs_raw_tdc 'PDC 2X2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2x2.wirenum P.dc.2x2.rawtdc 79 0.5 79.5 5000 0 50000
TH2F pdc2x1_wire_num_vs_raw_tdc 'PDC 2X1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2x1.wirenum P.dc.2x1.rawtdc 79 0.5 79.5 5000 0 50000
TH2F pdc2u2_wire_num_vs_raw_tdc 'PDC 2U2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2u2.wirenum P.dc.2u2.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc2u1_wire_num_vs_raw_tdc 'PDC 2U1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (clicks)' P.dc.2u1.wirenum P.dc.2u1.rawtdc 107 0.5 107.5 5000 0 50000
TH2F pdc1u1_wire_num_vs_tdc_time 'PDC 1U1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1u1.wirenum P.dc.1u1.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc1u2_wire_num_vs_tdc_time 'PDC 1U2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1u2.wirenum P.dc.1u2.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc1x1_wire_num_vs_tdc_time 'PDC 1X1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1x1.wirenum P.dc.1x1.time 79 0.5 79.5 6000 -1000 5000
TH2F pdc1x2_wire_num_vs_tdc_time 'PDC 1X2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1x2.wirenum P.dc.1x2.time 79 0.5 79.5 6000 -1000 5000
TH2F pdc1v1_wire_num_vs_tdc_time 'PDC 1V1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1v1.wirenum P.dc.1v1.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc1v2_wire_num_vs_tdc_time 'PDC 1V2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.1v2.wirenum P.dc.1v2.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc2v2_wire_num_vs_tdc_time 'PDC 2V2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2v2.wirenum P.dc.2v2.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc2v1_wire_num_vs_tdc_time 'PDC 2V1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2v1.wirenum P.dc.2v1.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc2x2_wire_num_vs_tdc_time 'PDC 2X2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2x2.wirenum P.dc.2x2.time 79 0.5 79.5 6000 -1000 5000
TH2F pdc2x1_wire_num_vs_tdc_time 'PDC 2X1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2x1.wirenum P.dc.2x1.time 79 0.5 79.5 6000 -1000 5000
TH2F pdc2u2_wire_num_vs_tdc_time 'PDC 2U2 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2u2.wirenum P.dc.2u2.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc2u1_wire_num_vs_tdc_time 'PDC 2U1 Wiremap vs. Raw TDC; Wire Number; Raw TDC Value (ns)' P.dc.2u1.wirenum P.dc.2u1.time 107 0.5 107.5 6000 -1000 5000
TH2F pdc1u1_wire_num_vs_ddist 'PDC 1U1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1u1.wirenum P.dc.1u1.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc1u2_wire_num_vs_ddist 'PDC 1U2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1u2.wirenum P.dc.1u2.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc1x1_wire_num_vs_ddist 'PDC 1X1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1x1.wirenum P.dc.1x1.dist 79 0.5 79.5 300 -0.1 0.6
TH2F pdc1x2_wire_num_vs_ddist 'PDC 1X2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1x2.wirenum P.dc.1x2.dist 79 0.5 79.5 300 -0.1 0.6
TH2F pdc1v1_wire_num_vs_ddist 'PDC 1V1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1v1.wirenum P.dc.1v1.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc1v2_wire_num_vs_ddist 'PDC 1V2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.1v2.wirenum P.dc.1v2.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc2u2_wire_num_vs_ddist 'PDC 2U2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2u2.wirenum P.dc.2u2.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc2u1_wire_num_vs_ddist 'PDC 2U1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2u1.wirenum P.dc.2u1.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc2x2_wire_num_vs_ddist 'PDC 2X2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2x2.wirenum P.dc.2x2.dist 79 0.5 79.5 300 -0.1 0.6
TH2F pdc2x1_wire_num_vs_ddist 'PDC 2X1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2x1.wirenum P.dc.2x1.dist 79 0.5 79.5 300 -0.1 0.6
TH2F pdc2v2_wire_num_vs_ddist 'PDC 2V2 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2v2.wirenum P.dc.2v2.dist 107 0.5 107.5 300 -0.1 0.6
TH2F pdc2v1_wire_num_vs_ddist 'PDC 2V1 Wiremap vs. Raw TDC; Wire Number; Drift Distance (cm)' P.dc.2v1.wirenum P.dc.2v1.dist 107 0.5 107.5 300 -0.1 0.6
Block: RawDecode
Pedestal_event 0
RawDecode_master 1
Block: Decode
Decode_master 1
Block: CoarseTracking
CoarseTracking_master 1
Block: CoarseReconstruct
CourseReconstruct 0
==== Crate 6 type vme Bank Decoding ==== Crate 6 type vme Bank Decoding
# slot model bank # slot model bank
5 1190 1190
6 1190 1190 6 1190 1190
7 1190 1190 7 1190 1190
8 1190 1190 8 1190 1190
...@@ -10,3 +9,4 @@ ...@@ -10,3 +9,4 @@
12 1190 1190 12 1190 1190
13 1190 1190 13 1190 1190
14 1190 1190 14 1190 1190
15 1190 1190
==== Crate 7 type vme Bank Decoding
# slot model bank
\ No newline at end of file
This diff is collapsed.
==== Crate 2 type vme
# slot model clear header mask nchan ndata
4 1190 1 0x40000004 0xff00001f 128 4096
5 1190 1 0x40000005 0xff00001f 128 4096
7 1190 1 0x40000007 0xff00001f 128 4096
8 1190 1 0x40000008 0xff00001f 128 4096
10 1190 1 0x4000000a 0xff00001f 128 4096
13 1190 1 0x4000000d 0xff00001f 128 4096
14 1190 1 0x4000000e 0xff00001f 128 4096
16 1190 1 0x40000010 0xff00001f 128 4096
17 1190 1 0x40000011 0xff00001f 128 4096
==== Crate 20 type vme
# slot model clear header mask nchan ndata
6 1190 1 0x40000006 0xff00001f 128 4096
7 1190 1 0x40000007 0xff00001f 128 4096
8 1190 1 0x40000008 0xff00001f 128 4096
9 1190 1 0x40000009 0xff00001f 128 4096
10 1190 1 0x4000000a 0xff00001f 128 4096
11 1190 1 0x4000000b 0xff00001f 128 4096
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
==== Crate 6 type vme Bank Decoding ==== Crate 6 type vme Bank Decoding
# slot model bank # slot model bank
5 1190 1190
6 1190 1190 6 1190 1190
7 1190 1190 7 1190 1190
8 1190 1190 8 1190 1190
...@@ -81,8 +80,6 @@ ...@@ -81,8 +80,6 @@
12 1190 1190 12 1190 1190
13 1190 1190 13 1190 1190
14 1190 1190 14 1190 1190
15 1190 1190
==== Crate 7 type vme Bank Decoding
# slot model bank
#!/usr/bin/perl
# Read a Hall C style MAP file and output a
# Hall A style crate map DB file.
#
# 22.03.2012 (saw)
# 11.04.2014 (saw) Perl cleanup
%crates=();
$crate = 0;
$nsubadd = 0;
$bsub = 0;
$modtype = 0;
$slot = 0;
while(<>) {
chomp($line=$_);
if($line=~/^\s*ROC=\s*(\d*)/i) {
$i++;
$crate = $1;
if(not $crates{$crate}) {
$slotlist={};
$crates{$crate} = $slotlist;
}
$modtype = 0;
$slot = 0;
} elsif ($line=~/^\s*nsubadd=\s*(\d*)/i) {
$nsubadd = $1;
$modtype = 0;
} elsif ($line=~/^\s*bsub=\s*(\d*)/i) {
$bsub = $1;
$modtype = 0;
} elsif ($line=~/^\s*slot=\s*(\d*)/i) {
$slot = $1;
$modtype = 0;
} elsif ($line=~/^\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)/) {
if($modtype == 0) { # Slot not yet registered
if($nsubadd == 96) {
$modtype = 1877;
} elsif($nsubadd == 64) {
if($bsub == 16) {
$modtype = 1875;
} elsif($bsub == 17) {
$modtype = 1881;
}
}
if($modtype == 0) {
print "Unknown module Crate $crate, Slot $slot\n";
}
$crates{$crate}{$slot} = $modtype;
# print "$crate $slot $modtype\n";
}
}
}
print "# Hall C Crate map\n";
foreach $crate (sort {$a <=> $b} keys %crates) {
print "==== Crate $crate type fastbus\n";
print "# slot model clear header mask nchan ndata\n";
foreach $slot (sort {$a <=> $b} keys %{ $crates{$crate}}) {
$modtype = $crates{$crate}{$slot};
if($modtype == 1877) {
$ndata = 256;
} else {
$ndata = 64;
}
printf " %2d %d 1 0x0 0x0 %3d %d\n"
,$slot,$modtype,$nsubadd, $ndata;
}
}
raddeg=3.14159265/180
; 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
; Scintillator parameters
pref_npaddles = 6
pref_nsperchan = 0.1
pref_offset = 0.0
;
; Number of chambers in test setup
pdc_num_chambers = 2
pdc_num_planes = 12
pdc_tdc_time_per_channel = -0.10 ; TDC step size 100ps?
pdc_wire_velocity = 13.0
pdc_central_time = 1,1,1,1,1,1,1,1,1,1,1,1
pdc_plane_names = "1u1 1u2 1x1 1x2 1v1 1v2 2v2 2v1 2x2 2x1 2u2 2u1
pdc_xcenter = 0.0, 0.0
pdc_ycenter = 0.0, 0.0
; Order in which wires are readout
pdc_wire_counting = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; If pdc_wire_counting(plane) = 0
; the wire center is at (wire - pdc_central_wire) * pitch
; If pdc_wire_counting(plane) = 1
; the wire center is at ( pdc_nrwire + 1 - wire - pdc_central_wire) * pitch
; The velocity correction is the distance from the center of the wire divided
; by the velocity of propagation times pdc_drifttime_sign(pln). +/-1
; for disc. card at +/- coord. (i.e. top = -x direction, so top readout is +1)
;
; These are guesses taken from the SOS Chambers
;
pdc_drifttime_sign = 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1
;
; Wire number of center of wire chamber
; Note the convention : x : low number = -x , u,v : low number = "-x"
; x1 and x2, u1 and u2, v1 and v2 are offset by half a cell length
; assume 1st wire of 1st dc of a set is closest to edge where counting starts
; (These taken from SOS. Will be different for SHMS
pdc_central_wire = 54.25
53.75
40.25
40.75
54.25
53.75
53.75
54.25
40.75
40.25
53.75
54.25
; sigma of wire chabmer resolution for each plane
pdc_sigma = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02
; tdc window. Wide limits for now
pdc_tdc_min_win = -55000,-55000,-55000,-55000,-55000,-55000,-55000,-55000,-55000,-55000,-55000,-55000
pdc_tdc_max_win = 55000,55000,55000,55000,55000,55000,55000,55000,55000,55000,55000,55000
; zero time. Decreasing moves sdtime plots to lower time
pdc_plane_time_zero = 120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0
pdc_chamber_planes = 1,1,1,1,1,1,2,2,2,2,2,2 ; Chamber # for each plane
; pdc_1_zpos = -14.5*2.54
pdc_1_zpos = 0 ; Don't try to project to scintillators
; Use geometry of SOS chambers for now
pdc_zpos = pdc_1_zpos - 1.5875
pdc_1_zpos - 0.9525
pdc_1_zpos - 0.3175
pdc_1_zpos + 0.3175
pdc_1_zpos + 0.9525
pdc_1_zpos + 1.5875
pdc_1_zpos - 1.5875
pdc_1_zpos - 0.9525
pdc_1_zpos - 0.3175
pdc_1_zpos + 0.3175
pdc_1_zpos + 0.9525
pdc_1_zpos + 1.5875
; Angle alpha of wires in wire chamber planes
pdc_roll = 0.0 ; SOS chambers had roll as installed
pdc_alpha_angle = (30-pdc_roll)*raddeg
(30-pdc_roll)*raddeg
(90-pdc_roll)*raddeg
(90-pdc_roll)*raddeg
(150-pdc_roll)*raddeg
(150-pdc_roll)*raddeg
(30-pdc_roll)*raddeg
(30-pdc_roll)*raddeg
(90-pdc_roll)*raddeg
(90-pdc_roll)*raddeg
(150-pdc_roll)*raddeg
(150-pdc_roll)*raddeg
pdc_beta = 0.0
pdc_beta_angle = pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_beta
pdc_gamma = 0.0
pdc_gamma_angle = pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_gamma
pdc_pitch = 1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
; Number of wires per plane
pdc_nrwire = 107
107
79
79
107
107
107
107
79
79
107
107
; Tracking parameters
pmax_pr_hits = 25, 25
pmin_hit = 5, 5
pmin_combos = 6, 6
pspace_point_criterion = 1.2, 1.2
; The following four criteria are applied to the stub fit results at the
; focal plane position to link stubs to tracks
pntracks_max_fp = 10
pxt_track_criterion = 100.0
pyt_track_criterion = 2.0
pxpt_track_criterion = 1.0
pypt_track_criterion = 1.0
psingle_stub = 1 ; make a track of all single stubs
; normally 0
pSmallAngleApprox = 0 ; No small angle approximation for
; cosmic ray tests
; Compatibility parameters. Should be zero to precisely mimic ENGINE
; behavior, but one for more correct behavior
pdc_fix_lr = 1 ; Let hit have different L/R assignment for different space point
pdc_fix_propcorr = 1 ; do propagation along wire each time hit appeears
; in a space point
; Debugging flags - not all these implemented in hcana
pdebuglinkstubs = 0 ; Dump link stub results
pdebugprintrawdc = 0 ; Dump PDC_RAW_DC bank
pdebugprintdecodeddc = 0 ; Dump PDC_DECODED_DC bank
pdebugflagpr = 0 ; Dump intermediate pattern recognition results
pdebugflagstubs= 0 ; Dump stub fit results
pdebugtrackprint = 0 ; Dump focal plane track fit results
pdebugstubchisq = 0; Dump chi2 of left-right fits
; Drift map parameters
pdriftbins = 138
; Number of 1st bin in table
pdrift1stbin = -24
; Bin size in ns
pdriftbinsz = 2
; Drift maps simply copied from the SOS chambers
pwc1u1fract=0.0002,0.0005,0.0009,0.0011,0.0015,0.0018,0.0022,0.0027
0.0029,0.0033,0.0038,0.0044,0.0048,0.0051,0.0057,0.0070,0.0090,0.0121
0.0167,0.0217,0.0282,0.0371,0.0467,0.0582,0.0723,0.0873,0.1038,0.1211
0.1409,0.1609,0.1826,0.2060,0.2302,0.2542,0.2796,0.3043,0.3294,0.3555
0.3819,0.4085,0.4343,0.4618,0.4890,0.5140,0.5384,0.5635,0.5880,0.6100
0.6311,0.6522,0.6722,0.6928,0.7120,0.7316,0.7495,0.7684,0.7853,0.8026
0.8191,0.8334,0.8491,0.8629,0.8771,0.8888,0.8994,0.9089,0.9170,0.9242
0.9308,0.9364,0.9411,0.9457,0.9496,0.9538,0.9571,0.9602,0.9630,0.9654
0.9679,0.9698,0.9718,0.9735,0.9750,0.9765,0.9778,0.9791,0.9804,0.9815
0.9825,0.9833,0.9844,0.9851,0.9855,0.9862,0.9870,0.9874,0.9877,0.9883
0.9889,0.9893,0.9895,0.9898,0.9901,0.9904,0.9910,0.9918,0.9923,0.9927
0.9930,0.9935,0.9937,0.9941,0.9943,0.9947,0.9949,0.9952,0.9957,0.9962
0.9964,0.9966,0.9970,0.9973,0.9975,0.9977,0.9979,0.9982,0.9986,0.9988
0.9990,0.9991,0.9994,0.9995,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000
pwc1x1fract=0.0004,0.0006,0.0008,0.0010,0.0012,0.0015,0.0017,0.0021
0.0025,0.0028,0.0031,0.0033,0.0036,0.0041,0.0045,0.0051,0.0060,0.0075
0.0104,0.0138,0.0191,0.0265,0.0356,0.0463,0.0596,0.0743,0.0916,0.1114
0.1316,0.1533,0.1757,0.1988,0.2209,0.2455,0.2689,0.2945,0.3196,0.3437
0.3697,0.3950,0.4196,0.4448,0.4702,0.4953,0.5186,0.5416,0.5650,0.5877
0.6099,0.6316,0.6519,0.6719,0.6909,0.7099,0.7277,0.7463,0.7645,0.7821
0.7979,0.8154,0.8320,0.8477,0.8612,0.8740,0.8865,0.8973,0.9077,0.9161
0.9234,0.9301,0.9351,0.9406,0.9454,0.9497,0.9531,0.9570,0.9605,0.9631
0.9660,0.9690,0.9713,0.9728,0.9748,0.9762,0.9775,0.9786,0.9800,0.9807
0.9818,0.9827,0.9833,0.9843,0.9849,0.9857,0.9861,0.9866,0.9871,0.9877
0.9883,0.9887,0.9891,0.9895,0.9898,0.9901,0.9907,0.9913,0.9916,0.9918
0.9921,0.9925,0.9929,0.9931,0.9935,0.9940,0.9944,0.9946,0.9949,0.9952
0.9956,0.9960,0.9966,0.9968,0.9970,0.9972,0.9974,0.9976,0.9979,0.9980
0.9984,0.9985,0.9988,0.9990,0.9991,0.9993,0.9996,0.9998,0.9999,1.0000
pwc1v1fract=0.0002,0.0006,0.0008,0.0011,0.0013,0.0016,0.0019,0.0020
0.0022,0.0025,0.0030,0.0035,0.0038,0.0042,0.0049,0.0057,0.0076,0.0103
0.0149,0.0200,0.0273,0.0353,0.0455,0.0574,0.0719,0.0865,0.1045,0.1224
0.1416,0.1630,0.1844,0.2074,0.2317,0.2555,0.2807,0.3046,0.3298,0.3553
0.3826,0.4075,0.4316,0.4563,0.4823,0.5065,0.5315,0.5554,0.5781,0.6014
0.6235,0.6434,0.6643,0.6853,0.7050,0.7238,0.7415,0.7602,0.7787,0.7975
0.8152,0.8307,0.8456,0.8595,0.8723,0.8851,0.8957,0.9043,0.9126,0.9205
0.9276,0.9330,0.9383,0.9437,0.9484,0.9521,0.9553,0.9582,0.9607,0.9634
0.9657,0.9676,0.9701,0.9722,0.9738,0.9755,0.9767,0.9781,0.9794,0.9804
0.9814,0.9825,0.9835,0.9842,0.9847,0.9853,0.9861,0.9866,0.9871,0.9878
0.9882,0.9888,0.9891,0.9897,0.9900,0.9903,0.9909,0.9910,0.9917,0.9919
0.9924,0.9929,0.9937,0.9939,0.9944,0.9948,0.9954,0.9956,0.9961,0.9966
0.9968,0.9972,0.9974,0.9978,0.9980,0.9981,0.9984,0.9986,0.9989,0.9991
0.9995,0.9996,0.9998,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
pwc1u2fract=0.0003,0.0004,0.0008,0.0011,0.0015,0.0018,0.0021,0.0024
0.0027,0.0030,0.0033,0.0037,0.0039,0.0043,0.0046,0.0049,0.0059,0.0073
0.0094,0.0129,0.0184,0.0267,0.0352,0.0446,0.0563,0.0707,0.0863,0.1030
0.1206,0.1411,0.1629,0.1845,0.2087,0.2325,0.2578,0.2837,0.3091,0.3357
0.3606,0.3867,0.4119,0.4362,0.4608,0.4857,0.5099,0.5349,0.5587,0.5814
0.6047,0.6260,0.6480,0.6685,0.6892,0.7099,0.7282,0.7456,0.7643,0.7812
0.7988,0.8141,0.8309,0.8454,0.8616,0.8738,0.8847,0.8955,0.9049,0.9133
0.9199,0.9274,0.9341,0.9399,0.9445,0.9489,0.9529,0.9561,0.9593,0.9620
0.9645,0.9667,0.9689,0.9701,0.9720,0.9740,0.9756,0.9771,0.9785,0.9796
0.9808,0.9816,0.9823,0.9832,0.9839,0.9846,0.9854,0.9860,0.9867,0.9874
0.9876,0.9881,0.9885,0.9889,0.9895,0.9900,0.9902,0.9907,0.9910,0.9916
0.9919,0.9923,0.9927,0.9930,0.9934,0.9937,0.9942,0.9945,0.9949,0.9953
0.9957,0.9962,0.9965,0.9968,0.9971,0.9973,0.9976,0.9979,0.9981,0.9984
0.9986,0.9988,0.9989,0.9993,0.9995,0.9998,0.9999,0.9999,1.0000,1.0000
pwc1x2fract=0.0002,0.0005,0.0008,0.0011,0.0014,0.0017,0.0021,0.0025
0.0027,0.0031,0.0032,0.0034,0.0040,0.0045,0.0052,0.0065,0.0083,0.0112
0.0150,0.0200,0.0264,0.0341,0.0435,0.0560,0.0701,0.0862,0.1027,0.1210
0.1417,0.1628,0.1833,0.2069,0.2301,0.2547,0.2799,0.3062,0.3314,0.3582
0.3860,0.4141,0.4390,0.4656,0.4903,0.5161,0.5410,0.5649,0.5874,0.6090
0.6298,0.6507,0.6721,0.6923,0.7117,0.7312,0.7510,0.7706,0.7881,0.8052
0.8204,0.8360,0.8525,0.8666,0.8793,0.8906,0.9019,0.9103,0.9194,0.9274
0.9340,0.9397,0.9442,0.9483,0.9523,0.9557,0.9596,0.9625,0.9653,0.9678
0.9698,0.9718,0.9732,0.9751,0.9768,0.9782,0.9793,0.9804,0.9813,0.9821
0.9828,0.9834,0.9842,0.9848,0.9852,0.9857,0.9861,0.9864,0.9872,0.9877
0.9880,0.9886,0.9889,0.9894,0.9898,0.9903,0.9908,0.9915,0.9921,0.9924
0.9927,0.9930,0.9935,0.9939,0.9943,0.9945,0.9949,0.9952,0.9957,0.9960
0.9963,0.9965,0.9967,0.9972,0.9975,0.9979,0.9980,0.9985,0.9987,0.9988
0.9990,0.9991,0.9992,0.9995,0.9997,1.0000,1.0000,1.0000,1.0000,1.0000
pwc1v2fract=0.0004,0.0006,0.0008,0.0012,0.0013,0.0016,0.0018,0.0021
0.0024,0.0027,0.0029,0.0032,0.0036,0.0039,0.0043,0.0049,0.0063,0.0080
0.0113,0.0155,0.0218,0.0300,0.0397,0.0508,0.0645,0.0793,0.0949,0.1135
0.1343,0.1560,0.1786,0.2019,0.2250,0.2498,0.2756,0.3011,0.3270,0.3526
0.3778,0.4042,0.4299,0.4570,0.4821,0.5077,0.5311,0.5540,0.5784,0.6010
0.6219,0.6429,0.6633,0.6830,0.7023,0.7214,0.7403,0.7590,0.7786,0.7948
0.8118,0.8288,0.8444,0.8587,0.8725,0.8842,0.8946,0.9044,0.9136,0.9208
0.9264,0.9323,0.9377,0.9428,0.9472,0.9506,0.9541,0.9576,0.9602,0.9635
0.9656,0.9675,0.9695,0.9715,0.9732,0.9751,0.9768,0.9777,0.9789,0.9802
0.9809,0.9819,0.9828,0.9835,0.9841,0.9850,0.9858,0.9863,0.9866,0.9870
0.9875,0.9880,0.9884,0.9888,0.9894,0.9899,0.9901,0.9905,0.9909,0.9912
0.9917,0.9919,0.9922,0.9926,0.9931,0.9936,0.9941,0.9945,0.9951,0.9954
0.9959,0.9962,0.9964,0.9967,0.9969,0.9971,0.9975,0.9978,0.9980,0.9983
0.9986,0.9988,0.9991,0.9995,0.9998,0.9999,0.9999,0.9999,1.0000,1.0000
pwc2u1fract=0.0002,0.0005,0.0009,0.0011,0.0015,0.0018,0.0022,0.0027
0.0029,0.0033,0.0038,0.0044,0.0048,0.0051,0.0057,0.0070,0.0090,0.0121
0.0167,0.0217,0.0282,0.0371,0.0467,0.0582,0.0723,0.0873,0.1038,0.1211
0.1409,0.1609,0.1826,0.2060,0.2302,0.2542,0.2796,0.3043,0.3294,0.3555
0.3819,0.4085,0.4343,0.4618,0.4890,0.5140,0.5384,0.5635,0.5880,0.6100
0.6311,0.6522,0.6722,0.6928,0.7120,0.7316,0.7495,0.7684,0.7853,0.8026
0.8191,0.8334,0.8491,0.8629,0.8771,0.8888,0.8994,0.9089,0.9170,0.9242
0.9308,0.9364,0.9411,0.9457,0.9496,0.9538,0.9571,0.9602,0.9630,0.9654
0.9679,0.9698,0.9718,0.9735,0.9750,0.9765,0.9778,0.9791,0.9804,0.9815
0.9825,0.9833,0.9844,0.9851,0.9855,0.9862,0.9870,0.9874,0.9877,0.9883
0.9889,0.9893,0.9895,0.9898,0.9901,0.9904,0.9910,0.9918,0.9923,0.9927
0.9930,0.9935,0.9937,0.9941,0.9943,0.9947,0.9949,0.9952,0.9957,0.9962
0.9964,0.9966,0.9970,0.9973,0.9975,0.9977,0.9979,0.9982,0.9986,0.9988
0.9990,0.9991,0.9994,0.9995,0.9998,0.9999,1.0000,1.0000,1.0000,1.0000
pwc2x1fract=0.0004,0.0006,0.0008,0.0010,0.0012,0.0015,0.0017,0.0021
0.0025,0.0028,0.0031,0.0033,0.0036,0.0041,0.0045,0.0051,0.0060,0.0075
0.0104,0.0138,0.0191,0.0265,0.0356,0.0463,0.0596,0.0743,0.0916,0.1114
0.1316,0.1533,0.1757,0.1988,0.2209,0.2455,0.2689,0.2945,0.3196,0.3437
0.3697,0.3950,0.4196,0.4448,0.4702,0.4953,0.5186,0.5416,0.5650,0.5877
0.6099,0.6316,0.6519,0.6719,0.6909,0.7099,0.7277,0.7463,0.7645,0.7821
0.7979,0.8154,0.8320,0.8477,0.8612,0.8740,0.8865,0.8973,0.9077,0.9161
0.9234,0.9301,0.9351,0.9406,0.9454,0.9497,0.9531,0.9570,0.9605,0.9631
0.9660,0.9690,0.9713,0.9728,0.9748,0.9762,0.9775,0.9786,0.9800,0.9807
0.9818,0.9827,0.9833,0.9843,0.9849,0.9857,0.9861,0.9866,0.9871,0.9877
0.9883,0.9887,0.9891,0.9895,0.9898,0.9901,0.9907,0.9913,0.9916,0.9918
0.9921,0.9925,0.9929,0.9931,0.9935,0.9940,0.9944,0.9946,0.9949,0.9952
0.9956,0.9960,0.9966,0.9968,0.9970,0.9972,0.9974,0.9976,0.9979,0.9980
0.9984,0.9985,0.9988,0.9990,0.9991,0.9993,0.9996,0.9998,0.9999,1.0000
pwc2v1fract=0.0002,0.0006,0.0008,0.0011,0.0013,0.0016,0.0019,0.0020
0.0022,0.0025,0.0030,0.0035,0.0038,0.0042,0.0049,0.0057,0.0076,0.0103
0.0149,0.0200,0.0273,0.0353,0.0455,0.0574,0.0719,0.0865,0.1045,0.1224
0.1416,0.1630,0.1844,0.2074,0.2317,0.2555,0.2807,0.3046,0.3298,0.3553
0.3826,0.4075,0.4316,0.4563,0.4823,0.5065,0.5315,0.5554,0.5781,0.6014
0.6235,0.6434,0.6643,0.6853,0.7050,0.7238,0.7415,0.7602,0.7787,0.7975
0.8152,0.8307,0.8456,0.8595,0.8723,0.8851,0.8957,0.9043,0.9126,0.9205
0.9276,0.9330,0.9383,0.9437,0.9484,0.9521,0.9553,0.9582,0.9607,0.9634
0.9657,0.9676,0.9701,0.9722,0.9738,0.9755,0.9767,0.9781,0.9794,0.9804
0.9814,0.9825,0.9835,0.9842,0.9847,0.9853,0.9861,0.9866,0.9871,0.9878
0.9882,0.9888,0.9891,0.9897,0.9900,0.9903,0.9909,0.9910,0.9917,0.9919
0.9924,0.9929,0.9937,0.9939,0.9944,0.9948,0.9954,0.9956,0.9961,0.9966
0.9968,0.9972,0.9974,0.9978,0.9980,0.9981,0.9984,0.9986,0.9989,0.9991
0.9995,0.9996,0.9998,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000
pwc2u2fract=0.0003,0.0004,0.0008,0.0011,0.0015,0.0018,0.0021,0.0024
0.0027,0.0030,0.0033,0.0037,0.0039,0.0043,0.0046,0.0049,0.0059,0.0073
0.0094,0.0129,0.0184,0.0267,0.0352,0.0446,0.0563,0.0707,0.0863,0.1030
0.1206,0.1411,0.1629,0.1845,0.2087,0.2325,0.2578,0.2837,0.3091,0.3357
0.3606,0.3867,0.4119,0.4362,0.4608,0.4857,0.5099,0.5349,0.5587,0.5814
0.6047,0.6260,0.6480,0.6685,0.6892,0.7099,0.7282,0.7456,0.7643,0.7812
0.7988,0.8141,0.8309,0.8454,0.8616,0.8738,0.8847,0.8955,0.9049,0.9133
0.9199,0.9274,0.9341,0.9399,0.9445,0.9489,0.9529,0.9561,0.9593,0.9620
0.9645,0.9667,0.9689,0.9701,0.9720,0.9740,0.9756,0.9771,0.9785,0.9796
0.9808,0.9816,0.9823,0.9832,0.9839,0.9846,0.9854,0.9860,0.9867,0.9874
0.9876,0.9881,0.9885,0.9889,0.9895,0.9900,0.9902,0.9907,0.9910,0.9916
0.9919,0.9923,0.9927,0.9930,0.9934,0.9937,0.9942,0.9945,0.9949,0.9953
0.9957,0.9962,0.9965,0.9968,0.9971,0.9973,0.9976,0.9979,0.9981,0.9984
0.9986,0.9988,0.9989,0.9993,0.9995,0.9998,0.9999,0.9999,1.0000,1.0000
pwc2x2fract=0.0002,0.0005,0.0008,0.0011,0.0014,0.0017,0.0021,0.0025
0.0027,0.0031,0.0032,0.0034,0.0040,0.0045,0.0052,0.0065,0.0083,0.0112
0.0150,0.0200,0.0264,0.0341,0.0435,0.0560,0.0701,0.0862,0.1027,0.1210
0.1417,0.1628,0.1833,0.2069,0.2301,0.2547,0.2799,0.3062,0.3314,0.3582
0.3860,0.4141,0.4390,0.4656,0.4903,0.5161,0.5410,0.5649,0.5874,0.6090
0.6298,0.6507,0.6721,0.6923,0.7117,0.7312,0.7510,0.7706,0.7881,0.8052
0.8204,0.8360,0.8525,0.8666,0.8793,0.8906,0.9019,0.9103,0.9194,0.9274
0.9340,0.9397,0.9442,0.9483,0.9523,0.9557,0.9596,0.9625,0.9653,0.9678
0.9698,0.9718,0.9732,0.9751,0.9768,0.9782,0.9793,0.9804,0.9813,0.9821
0.9828,0.9834,0.9842,0.9848,0.9852,0.9857,0.9861,0.9864,0.9872,0.9877
0.9880,0.9886,0.9889,0.9894,0.9898,0.9903,0.9908,0.9915,0.9921,0.9924
0.9927,0.9930,0.9935,0.9939,0.9943,0.9945,0.9949,0.9952,0.9957,0.9960
0.9963,0.9965,0.9967,0.9972,0.9975,0.9979,0.9980,0.9985,0.9987,0.9988
0.9990,0.9991,0.9992,0.9995,0.9997,1.0000,1.0000,1.0000,1.0000,1.0000
pwc2v2fract=0.0004,0.0006,0.0008,0.0012,0.0013,0.0016,0.0018,0.0021
0.0024,0.0027,0.0029,0.0032,0.0036,0.0039,0.0043,0.0049,0.0063,0.0080
0.0113,0.0155,0.0218,0.0300,0.0397,0.0508,0.0645,0.0793,0.0949,0.1135
0.1343,0.1560,0.1786,0.2019,0.2250,0.2498,0.2756,0.3011,0.3270,0.3526
0.3778,0.4042,0.4299,0.4570,0.4821,0.5077,0.5311,0.5540,0.5784,0.6010
0.6219,0.6429,0.6633,0.6830,0.7023,0.7214,0.7403,0.7590,0.7786,0.7948
0.8118,0.8288,0.8444,0.8587,0.8725,0.8842,0.8946,0.9044,0.9136,0.9208
0.9264,0.9323,0.9377,0.9428,0.9472,0.9506,0.9541,0.9576,0.9602,0.9635
0.9656,0.9675,0.9695,0.9715,0.9732,0.9751,0.9768,0.9777,0.9789,0.9802
0.9809,0.9819,0.9828,0.9835,0.9841,0.9850,0.9858,0.9863,0.9866,0.9870
0.9875,0.9880,0.9884,0.9888,0.9894,0.9899,0.9901,0.9905,0.9909,0.9912
0.9917,0.9919,0.9922,0.9926,0.9931,0.9936,0.9941,0.9945,0.9951,0.9954
0.9959,0.9962,0.9964,0.9967,0.9969,0.9971,0.9975,0.9978,0.9980,0.9983
0.9986,0.9988,0.9991,0.9995,0.9998,0.9999,0.9999,0.9999,1.0000,1.0000
;
; Not sure why this is here
; Makes the analyzer happy
pdc_2_zpos = 0, 0
\ No newline at end of file
void replay_hdc_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/test_%d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/test_%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 params for HMS DC test stand configuration
gHcParms->Load("PARAM/hdc_test_stand.param");
// Load the Hall C style detector map
gHcDetectorMap = new THcDetectorMap();
//gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
gHcDetectorMap->Load("MAPS/HMS/hdc.map");
// Set up the equipment to be analyzed.
THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
gHaApps->Add(HMS);
// Add HMS drift chambers
HMS->AddDetector(new THcDC("dc", "Drift Chambers"));
// 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/hdcana.def");
analyzer->SetCutFile("DEF-files/hdcana_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)
//);
}
...@@ -99,8 +99,13 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) { ...@@ -99,8 +99,13 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
analyzer->SetEvent(event); analyzer->SetEvent(event);
analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat"); analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
analyzer->SetOutFile(ROOTFileName.Data()); analyzer->SetOutFile(ROOTFileName.Data());
analyzer->SetOdefFile("DEF-files/hdcana.def");
analyzer->SetCutFile("DEF-files/hdcana_cuts.def"); // optional // analyzer->SetOdefFile("DEF-files/hdcana.def");
// analyzer->SetCutFile("DEF-files/hdcana_cuts.def"); // optional
analyzer->SetOdefFile("DEF-files/pdcana.def");
analyzer->SetCutFile("DEF-files/pdcana_cuts.def"); // optional
// File to record cuts accounting information // File to record cuts accounting information
//analyzer->SetSummaryFile("summary_example.log"); // optional //analyzer->SetSummaryFile("summary_example.log"); // optional
......
void replay_pdc_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_dc_00%d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/shms_dc_00%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"));
gHcDetectorMap = new THcDetectorMap();
//gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
gHcDetectorMap->Load("MAPS/SHMS/pdc.map");
// Set up the equipment to be analyzed.
THaApparatus* SHMS = new THcHallCSpectrometer("P", "SHMS");
gHaApps->Add(SHMS);
// Add SHMS drift chambers
SHMS->AddDetector(new THcDC("dc", "Drift Chambers"));
// 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/pdcana.def");
analyzer->SetCutFile("DEF-files/pdcana_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