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

Add script to replay HMS KPP run

With the new HMS chambers, need to have separate HMS KPP
  replay script.

Also add gscalers.param to the HMS/GEN/general.param
parent 1bd65e91
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ cminch=2.54
#include "PARAM/GEN/gdebug.param"
#include "PARAM/GEN/gtarget.param"
#include "PARAM/GEN/gbeam.param"
#include "PARAM/GEN/gscalers.param"
; General HMS parameter files
; Note: hmsflags.param includes spectrometer offsets and options.
......
......@@ -8,6 +8,7 @@ cminch=2.54
#include "PARAM/GEN/gdebug.param"
#include "PARAM/GEN/gtarget.param"
#include "PARAM/GEN/gbeam.param"
#include "PARAM/GEN/gscalers.param"
; General HMS parameter files
; Note: hmsflags.param includes spectrometer offsets and options.
......
# Report file for HMS stack
Block: RawDecode
Pedestal_event g.evtyp == 99
HMS_trig_1_event g.evtyp == 1
HMS_trig_2_event g.evtyp == 2
HMS_trig_3_event g.evtyp == 3
HMS_trig_4_event g.evtyp == 4
HMS_trig_5_event g.evtyp == 5
HMS_trig_6_event g.evtyp == 6
HMS_event HMS_trig_1_event || HMS_trig_2_event || HMS_trig_3_event || HMS_trig_4_event || HMS_trig_5_event || HMS_trig_6_event
RawDecode_master 1
Block: Decode
hms_trigs HMS_event
Decode_master HMS_event
Block: CoarseTracking
CoarseTracking_master HMS_event
#add cuts to stricter times and apply them to drift distances (HMS 6 GeV Drift Chambers)
time_cut1 H.dc.1x1.time > 0 && H.dc.1x1.time < 250
time_cut2 H.dc.1y1.time > 0 && H.dc.1y1.time < 250
time_cut3 H.dc.1u1.time > 0 && H.dc.1u1.time < 250
time_cut4 H.dc.1v1.time > 0 && H.dc.1v1.time < 250
time_cut5 H.dc.1y2.time > 0 && H.dc.1y2.time < 250
time_cut6 H.dc.1x2.time > 0 && H.dc.1x2.time < 250
time_cut7 H.dc.2x1.time > 0 && H.dc.2x1.time < 250
time_cut8 H.dc.2y1.time > 0 && H.dc.1y1.time < 250
time_cut9 H.dc.2u1.time > 0 && H.dc.2u1.time < 250
time_cut10 H.dc.2v1.time > 0 && H.dc.2v1.time < 250
time_cut11 H.dc.2y2.time > 0 && H.dc.2y2.time < 250
time_cut12 H.dc.2x2.time > 0 && H.dc.2x2.time < 250
hmsDC1Planes_large (H.dc.1x1.nhit+H.dc.1y1.nhit+H.dc.1u1.nhit+H.dc.1v1.nhit+H.dc.1x2.nhit+H.dc.1y2.nhit) >20
hmsDC2Planes_large (H.dc.2x1.nhit+H.dc.2y1.nhit+H.dc.2u1.nhit+H.dc.2v1.nhit+H.dc.2x2.nhit+H.dc.2y2.nhit) >20
hmsDC1_1hit_x1 H.dc.1x1.nhit == 1
hmsDC1_1hit_y1 H.dc.1y1.nhit == 1
hmsDC1_1hit_u1 H.dc.1u1.nhit == 1
hmsDC1_1hit_v1 H.dc.1v1.nhit == 1
hmsDC1_1hit_y2 H.dc.1y2.nhit == 1
hmsDC1_1hit_x2 H.dc.1x2.nhit == 1
hmsDC2_1hit_x1 H.dc.2x1.nhit == 1
hmsDC2_1hit_y1 H.dc.2y1.nhit == 1
hmsDC2_1hit_u1 H.dc.2u1.nhit == 1
hmsDC2_1hit_v1 H.dc.2v1.nhit == 1
hmsDC2_1hit_y2 H.dc.2y2.nhit == 1
hmsDC2_1hit_x2 H.dc.2x2.nhit == 1
h1hit1 H.dc.1x1.nhit >= 1
h1hit2 H.dc.1y1.nhit >= 1
h1hit3 H.dc.1u1.nhit >= 1
h1hit4 H.dc.1v1.nhit >= 1
h1hit5 H.dc.1y2.nhit >= 1
h1hit6 H.dc.1x2.nhit >= 1
h2hit1 H.dc.2x1.nhit >= 1
h2hit2 H.dc.2y1.nhit >= 1
h2hit3 H.dc.2u1.nhit >= 1
h2hit4 H.dc.2v1.nhit >= 1
h2hit5 H.dc.2y2.nhit >= 1
h2hit6 H.dc.2x2.nhit >= 1
hmsDC1Planes6hits (H.dc.1x1.nhit+H.dc.1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sDC2_1hit_v1&&hmsDC2_1hit_y2
hmsDC2_6hits_x2 h2hit6&&hmsDC2_1hit_x1&&hmsDC2_1hit_y1&&hmsDC2_1hit_u1&&hmsDC2_1hit_v1&&hmsDC2_1hit_y2
hmsDC2_5hits_y2 hmsDC2_1hit_x1&&hmsDC2_1hit_y1&&hmsDC2_1hit_u1&&hmsDC2_1hit_v1&&hmsDC2_1hit_x2
hmsDC2_6hits_y2 h2hit5&&hmsDC2_1hit_x1&&hmsDC2_1hit_y1&&hmsDC2_1hit_u1&&hmsDC2_1hit_v1&&hmsDC2_1hit_x2
hms1HitsLt H.dc.Ch1.nhit <= H.dc.Ch1.maxhits && g.evtyp==1
hms2HitsLt H.dc.Ch2.nhit <= H.dc.Ch2.maxhits && g.evtyp==1
hmsHitsLt H.dc.Ch1.nhit <= H.dc.Ch1.maxhits && H.dc.Ch2.nhit <= H.dc.Ch2.maxhits && g.evtyp==1
hmsDC1PlanesGT (h1hit1 + h1hit2 + h1hit3 + h1hit4 + h1hit5 + h1hit6 )>=5
hmsDC2PlanesGT (h2hit1 + h2hit2 + h2hit3 + h2hit4 + h2hit5 + h2hit6 )>=5
hmsPlanesGT hmsDC1PlanesGT && hmsDC2PlanesGT
hmsHitsPlanes (H.dc.Ch1.nhit <= H.dc.Ch1.maxhits) && (H.dc.Ch2.nhit <= H.dc.Ch2.maxhits) && hmsPlanesGT
hSpacePoints H.dc.Ch1.spacepoints >= 1 && H.dc.Ch2.spacepoints >=1
hSpacePointsStub H.dc.stubtest==1 && H.dc.Ch1.spacepoints >=1 && H.dc.Ch2.spacepoints >=1
hFoundTrack H.dc.ntrack>0
hStubLT H.dc.stubtest==1
f1HSpacePoints hms1HitsLt && hmsDC1PlanesGT && H.dc.Ch1.spacepoints==0 && g.evtyp==1
f2HSpacePoints hms2HitsLt && hmsDC2PlanesGT && H.dc.Ch2.spacepoints==0 && g.evtyp==1
hTest1 hmsHitsPlanes && (!hSpacePoints)
hTest2 hSpacePoints && (!hStubLT)
Block: CoarseReconstruct
CoarseReconstruct_master HMS_event
Block: Tracking
Tracking_master HMS_event
Block: Reconstruct
Reconstruct_master HMS_event
cer_pmt1_elec H.cer.npe[0]>.5
cer_pmt2_elec H.cer.npe[0]>.5
cer_elec H.cer.npeSum>.5
cer_pi H.cer.npeSum<.5
HMSScinGood H.hod.goodscinhit == 1
HMSScinShould HMSScinGood
HMSScinShoulde HMSScinGood && H.cal.etotnorm > 0.6&& H.cal.etotnorm < 2.0&& H.cer.npeSum > 0.5
HMSScinShouldh HMSScinGood && H.cal.etotnorm <0.6&& H.cal.etotnorm>0.0&& H.cer.npeSum < 0.5
HMSScinDid HMSScinShould && H.dc.ntrack > 0
HMSScinDide HMSScinShoulde && H.dc.ntrack > 0
HMSScinDidh HMSScinShouldh && H.dc.ntrack > 0
goodHDC1x1 H.dc.1x1.nhit > 0 && H.dc.1x1.nhit < 3
goodHDC1y1 H.dc.1y1.nhit > 0 && H.dc.1y1.nhit < 3
goodHDC1u1 H.dc.1u1.nhit > 0 && H.dc.1u1.nhit < 3
goodHDC1v1 H.dc.1v1.nhit > 0 && H.dc.1v1.nhit < 3
goodHDC1y2 H.dc.1y2.nhit > 0 && H.dc.1y2.nhit < 3
goodHDC1x2 H.dc.1x2.nhit > 0 && H.dc.1x2.nhit < 3
goodHDC2x1 H.dc.2x1.nhit > 0 && H.dc.2x1.nhit < 3
goodHDC2y1 H.dc.2y1.nhit > 0 && H.dc.2y1.nhit < 3
goodHDC2u1 H.dc.2u1.nhit > 0 && H.dc.2u1.nhit < 3
goodHDC2v1 H.dc.2v1.nhit > 0 && H.dc.2v1.nhit < 3
goodHDC2y2 H.dc.2y2.nhit > 0 && H.dc.2y2.nhit < 3
goodHDC2x2 H.dc.2x2.nhit > 0 && H.dc.2x2.nhit < 3
goodHDC1 goodHDC1x1 && goodHDC1y1 && goodHDC1u1 && goodHDC1v1 && goodHDC1y2 && goodHDC1x2
goodHDC2 goodHDC2x1 && goodHDC2y1 && goodHDC2u1 && goodHDC2v1 && goodHDC2y2 && goodHDC2x2
bothGood goodHDC1 && goodHDC2
realhdc1x1 goodHDC1x1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc1y1 goodHDC1y1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc1u1 goodHDC1u1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc1v1 goodHDC1v1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc1y2 goodHDC1y2 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc1x2 goodHDC1x2 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2x1 goodHDC2x1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2y1 goodHDC2y1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2u1 goodHDC2u1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2v1 goodHDC2v1 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2y2 goodHDC2y2 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
realhdc2x2 goodHDC2x2 && ((H.dc.Ch1.spacepoints+H.dc.Ch2.spacepoints)>0)
hFound1Track H.dc.ntrack == 1
hFound2Track H.dc.ntrack == 2
hFound3Track H.dc.ntrack == 3
hFound4Track H.dc.ntrack == 4
hCleanTrack H.gtr.index > -1
1hCleanTrack H.gtr.index == 0
2hCleanTrack H.gtr.index == 1
3hCleanTrack H.gtr.index == 2
4hCleanTrack H.gtr.index == 3
anyhs1x H.hod.1x.nhits > 0
anyhs1y H.hod.1y.nhits > 0
anyhs2x H.hod.2x.nhits > 0
anyhs2y H.hod.2y.nhits > 0
goodhs1x H.hod.1x.nhits > 0 && H.hod.1x.nhits < 3
goodhs1y H.hod.1y.nhits > 0 && H.hod.1y.nhits < 3
goodhs1 goodhs1x && goodhs1y
goodhs2x H.hod.2x.nhits > 0 && H.hod.2x.nhits < 3
goodhs2y H.hod.2y.nhits > 0 && H.hod.2y.nhits < 3
goodhs2 goodhs2x && goodhs2y
goodhs1s2 goodhs1 && goodhs2
Block: Physics
Physics_master HMS_event
This diff is collapsed.
......@@ -70,37 +70,37 @@ hhodo_neg_invadc_linear = 15.00, 15.00, 15.00, 15.00
15.00, 15.00, 15.00, 15.00
15.00, 15.00, 15.00, 15.00
hhodo_pos_invadc_adc= -0.00, -0.00, 106.88, -0.00
-0.00, -0.00, 109.67, 122.91
-0.00, 102.28, 127.88, 117.82
100.32, 76.55, 109.30, 139.97
72.45, 90.73, 111.62, 121.49
59.46, 83.45, 116.54, 123.92
95.04, 91.79, 125.49, 127.74
62.95, 53.50, 113.46, 106.91
78.26, 49.84, 100.37, 141.06
73.52, -0.00, 101.78, -0.00
94.23, -0.00, 129.39, -0.00
75.59, -0.00, 94.17, -0.00
79.87, -0.00, -0.00, -0.00
63.90, -0.00, -0.00, -0.00
hhodo_pos_invadc_adc= -0.00, -0.00, 106.88*0.20, -0.00
-0.00, -0.00, 109.67*0.20, 122.91*0.20
-0.00, 102.28*0.20, 127.88*0.20, 117.82*0.20
100.32*0.20, 76.55, 109.30, 139.97
72.45*0.20, 90.73, 111.62, 121.49
59.46*0.20, 83.45, 116.54, 123.92
95.04*0.20, 91.79, 125.49, 127.74
62.95*0.20, 53.50, 113.46, 106.91
78.26*0.20, 49.84, 100.37, 141.06
73.52*0.20, -0.00, 101.78, -0.00
94.23*0.20, -0.00, 129.39, -0.00
75.59*0.20, -0.00, 94.17, -0.00
79.87*0.20, -0.00, -0.00, -0.00
63.90*0.20, -0.00, -0.00, -0.00
-0.00, -0.00, -0.00, -0.00
-0.00, -0.00, -0.00, -0.00
hhodo_neg_invadc_adc= -0.00, -0.00, 128.32, -0.00
-0.00, -0.00, 113.16, 159.99
-0.00, 68.41, 116.51, 119.18
73.18, 65.95, 112.50, 122.16
96.71, 91.23, 96.00, 103.37
52.93, 87.48, 103.59, 122.65
72.72, 82.28, 118.40, 140.72
76.58, 68.02, 104.25, 120.16
73.69, 98.85, 91.95, 119.78
72.26, -0.00, 89.16, -0.00
70.89, -0.00, 113.44, -0.00
72.26, -0.00, 101.96, -0.00
76.14, -0.00, -0.00, -0.00
36.51, -0.00, -0.00, -0.00
hhodo_neg_invadc_adc= -0.00, -0.00, 128.32*0.20, -0.00
-0.00, -0.00, 113.16*0.20, 159.99*0.20
-0.00, 68.41*0.20, 116.51*0.20, 119.18*0.20
73.18*0.20, 65.95*0.20, 112.50*0.20, 122.16*0.20
96.71*0.20, 91.23*0.20, 96.00*0.20, 103.37*0.20
52.93*0.20, 87.48*0.20, 103.59*0.20, 122.65*0.20
72.72*0.20, 82.28*0.20, 118.40*0.20, 140.72*0.20
76.58*0.20, 68.02*0.20, 104.25*0.20, 120.16*0.20
73.69*0.20, 98.85*0.20, 91.95*0.20, 119.78*0.20
72.26*0.20, -0.00, 89.16*0.20, -0.00
70.89*0.20, -0.00, 113.44*0.20, -0.00
72.26*0.20, -0.00, 101.96*0.20, -0.00
76.14*0.20, -0.00, -0.00, -0.00
36.51*0.20, -0.00, -0.00, -0.00
-0.00, -0.00, -0.00, -0.00
-0.00, -0.00, -0.00, -0.00
......
void replay_production_hms_kpp(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 = "hms_all_%05d.dat";
vector<TString> pathList;
pathList.push_back(".");
pathList.push_back("./raw");
pathList.push_back("./cache");
const char* ROOTFileNamePattern = "ROOTfiles/hms_replay_production_%d_%d.root";
//Load Global parameters
// Add variables to global list.
gHcParms->Define("gen_run_number", "Run Number", RunNumber);
gHcParms->AddString("g_ctp_database_filename", "DBASE/HMS/STD/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"));
gHcParms->Load(gHcParms->GetString("g_ctp_calib_filename"));
// Load params for HMS trigger configuration
gHcParms->Load("PARAM/TRIG/thms.param");
// Load the Hall C detector map
gHcDetectorMap = new THcDetectorMap();
gHcDetectorMap->Load("MAPS/HMS/DETEC/STACK/hms_stack_6gev.map");
// Add trigger apparatus
THaApparatus* TRG = new THcTrigApp("T", "TRG");
gHaApps->Add(TRG);
// Add trigger detector to trigger apparatus
THcTrigDet* hms = new THcTrigDet("hms", "HMS Trigger Information");
TRG->AddDetector(hms);
// Set up the equipment to be analyzed.
THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
gHaApps->Add(HMS);
// Add drift chambers to HMS apparatus
THcDC* dc = new THcDC("dc", "Drift Chambers");
HMS->AddDetector(dc);
// Add hodoscope to HMS apparatus
THcHodoscope* hod = new THcHodoscope("hod", "Hodoscope");
HMS->AddDetector(hod);
// Add Cherenkov to HMS apparatus
THcCherenkov* cer = new THcCherenkov("cer", "Heavy Gas Cherenkov");
HMS->AddDetector(cer);
// Add Aerogel Cherenkov to HMS apparatus
//THcAerogel* aero = new THcAerogel("aero", "Aerogel");
//HMS->AddDetector(aero);
// Add calorimeter to HMS apparatus
THcShower* cal = new THcShower("cal", "Calorimeter");
HMS->AddDetector(cal);
// Include golden track information
THaGoldenTrack* gtr = new THaGoldenTrack("H.gtr", "HMS Golden Track", "H");
gHaPhysics->Add(gtr);
// Add Ideal Beam Apparatus
THaApparatus* beam = new THaIdealBeam("IB", "Ideal Beamline");
gHaApps->Add(beam);
// Add Physics Module to calculate primary (scattered) beam kinematics
THcPrimaryKine* hkin = new THcPrimaryKine("H.kin", "HMS Single Arm Kinematics", "H", "IB");
gHaPhysics->Add(hkin);
THcHodoEff* heff = new THcHodoEff("hodeff"," HMS hodo efficiency","H.hod");
gHaPhysics->Add(heff);
// Add handler for prestart event 125.
THcConfigEvtHandler* ev125 = new THcConfigEvtHandler("HC", "Config Event type 125");
gHaEvtHandlers->Add(ev125);
// Add handler for EPICS events
THaEpicsEvtHandler *hcepics = new THaEpicsEvtHandler("epics", "HC EPICS event type 180");
gHaEvtHandlers->Add(hcepics);
// Add handler for scaler events
THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("H", "Hall C scaler event type 1");
hscaler->AddEvtType(1);
hscaler->SetUseFirstEvent(kTRUE);
gHaEvtHandlers->Add(hscaler);
// 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.
THaRun* run = new THaRun( pathList, Form(RunFileNamePattern, RunNumber) );
// Set to read in Hall C run database parameters
run->SetRunParamClass("THcRunParameters");
// 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, MaxEvent);
analyzer->SetCountMode(2); // 0 = counter is # of physics triggers
// 1 = counter is # of all decode reads
// 2 = counter is event number
analyzer->SetEvent(event);
// Set EPICS event type
analyzer->SetEpicsEvtType(180);
// Define crate map
analyzer->SetCrateMapFileName("MAPS/db_cratemap.dat");
// Define output ROOT file
analyzer->SetOutFile(ROOTFileName.Data());
// Define output DEF-file
analyzer->SetOdefFile("DEF-files/HMS/PRODUCTION/hstackana_production_kpp.def");
// Define cuts file
analyzer->SetCutFile("DEF-files/HMS/PRODUCTION/hstackana_production_cuts_kpp.def"); // optional
// File to record cuts accounting information for cuts
analyzer->SetSummaryFile(Form("REPORT_OUTPUT/HMS/PRODUCTION/summary_production_%d_%d.report", RunNumber, MaxEvent)); // optional
// Start the actual analysis.
analyzer->Process(run);
// Create report file from template.
analyzer->PrintReport("TEMPLATES/HMS/PRODUCTION/hstackana_production_kpp.template",
Form("REPORT_OUTPUT/HMS/PRODUCTION/replay_hms_production_%d_%d.report", RunNumber, MaxEvent));
}
Run #{gen_run_number}
**************************
* General Run Information
**************************
1 MhZ Pulses : {H.1Mhz.scaler}
Run Length : {H.1Mhz.scalerTime:%.3f} sec
***********
* Beamline
***********
BCM1 Current: {H.BCM1.scalerCurrent:%.3f} uA
BCM2 Current: {H.BCM2.scalerCurrent:%.3f} uA
Unser Current: {H.Unser.scalerCurrent:%.3f} uA
With no cuts on BCM{gBCM_Current_threshold_index+1}.
BCM1 Counts: {H.BCM1.scaler} Total Charge: {H.BCM1.scalerCharge:%.3f} uC
BCM2 Counts: {H.BCM2.scaler} Total Charge: {H.BCM2.scalerCharge:%.3f} uC
Unser Counts: {H.Unser.scaler} Total Charge: {H.Unser.scalerCharge:%.3f} uC
Cut on BCM{gBCM_Current_threshold_index+1} current of {gBCM_Current_threshold} uA. Beam over threshold for {H.1Mhz.scalerTimeCut:%.3f}s, or {((H.1Mhz.scalerTimeCut/H.1Mhz.scalerTime)*100.):%.3f}% of total run time.
BCM1 Counts: {H.BCM1.scalerCut} Total Charge: {H.BCM1.scalerChargeCut:%.3f} uC
BCM2 Counts: {H.BCM2.scalerCut} Total Charge: {H.BCM2.scalerChargeCut:%.3f} uC
Unser Counts: {H.Unser.scalerCut} Total Charge: {H.Unser.scalerChargeCut:%.3f} uC
{hdc_plane_names}
Horizontal drift chamber z positions:
Chamber 1: {hdc_zpos[0]:%6.2f} {hdc_zpos[1]:%6.2f} {hdc_zpos[2]:%6.2f}
{hdc_zpos[3]:%6.2f} {hdc_zpos[4]:%6.2f} {hdc_zpos[5]:%6.2f}
Chamber 2: {hdc_zpos[6]:%6.2f} {hdc_zpos[7]:%6.2f} {hdc_zpos[8]:%6.2f}
{hdc_zpos[9]:%6.2f} {hdc_zpos[10]:%6.2f} {hdc_zpos[11]:%6.2f}
HMS triggers: {hms_trigs.npassed}
Hodo efficiency:
Plane 1: {hhodo_plane_AND_eff[0]}
Plane 2: {hhodo_plane_AND_eff[1]}
Plane 3: {hhodo_plane_AND_eff[2]}
Plane 4: {hhodo_plane_AND_eff[3]}
S1XY : {hhodo_s1XY_eff}
S2XY : {hhodo_s2XY_eff}
STOF: {hhodo_stof_eff}
3_of_4 EFF : {hhodo_3_of_4_eff}
4_of_4 EFF : {hhodo_4_of_4_eff}
Rate : {H.Trig.scalerRate/1000.:%7.3f} kHz
Live Time : {(hms_trigs.npassed / H.Trig.scaler)*100.0:%3.2f} %
Dead Time : {100.0 - (hms_trigs.npassed / H.Trig.scaler)*100.0:%3.2f} %
hmsDC1Planes_large Counts: {hmsDC1Planes_large.npassed} /hms_trigs : {hmsDC1Planes_large.npassed/hms_trigs.npassed}
hmsDC2Planes_large Counts: {hmsDC2Planes_large.npassed} /hms_trigs : {hmsDC2Planes_large.npassed/hms_trigs.npassed}
hmsDC1Planes6 Counts: {hmsDC1Planes6hits.npassed} /hms_trigs : {hmsDC1Planes6hits.npassed/hms_trigs.npassed}
hmsDC2Planes6 Counts: {hmsDC2Planes6hits.npassed} /hms_trigs : {hmsDC2Planes6hits.npassed/hms_trigs.npassed}
hmsDC1x1Planes5 Counts: {hmsDC1_5hits_x1.npassed} eff : {hmsDC1_6hits_x1.npassed/hmsDC1_5hits_x1.npassed}
hmsDC1u1Planes5 Counts: {hmsDC1_5hits_u1.npassed} eff : {hmsDC1_6hits_u1.npassed/hmsDC1_5hits_u1.npassed}
hmsDC1y2Planes5 Counts: {hmsDC1_5hits_y2.npassed} eff : {hmsDC1_6hits_y2.npassed/hmsDC1_5hits_y2.npassed}
hmsDC1v1Planes5 Counts: {hmsDC1_5hits_v1.npassed} eff : {hmsDC1_6hits_v1.npassed/hmsDC1_5hits_v1.npassed}
hmsDC1y1Planes5 Counts: {hmsDC1_5hits_y1.npassed} eff : {hmsDC1_6hits_y1.npassed/hmsDC1_5hits_y1.npassed}
hmsDC1x2Planes5 Counts: {hmsDC1_5hits_x2.npassed} eff : {hmsDC1_6hits_x2.npassed/hmsDC1_5hits_x2.npassed}
hmsDC2x1Planes5 Counts: {hmsDC2_5hits_x1.npassed} eff : {hmsDC2_6hits_x1.npassed/hmsDC2_5hits_x1.npassed}
hmsDC2u1Planes5 Counts: {hmsDC2_5hits_u1.npassed} eff : {hmsDC2_6hits_u1.npassed/hmsDC2_5hits_u1.npassed}
hmsDC2y2Planes5 Counts: {hmsDC2_5hits_y2.npassed} eff : {hmsDC2_6hits_y2.npassed/hmsDC2_5hits_y2.npassed}
hmsDC2v1Planes5 Counts: {hmsDC2_5hits_v1.npassed} eff : {hmsDC2_6hits_v1.npassed/hmsDC2_5hits_v1.npassed}
hmsDC2y1Planes5 Counts: {hmsDC2_5hits_y1.npassed} eff : {hmsDC2_6hits_y1.npassed/hmsDC2_5hits_y1.npassed}
hmsDC2x2Planes5 Counts: {hmsDC2_5hits_x2.npassed} eff : {hmsDC2_6hits_x2.npassed/hmsDC2_5hits_x2.npassed}
*****************************
*HMS TRACKING EFFICIENCIES *
*****************************
htrig : {hmscoin_event.npassed}
hhitslt = passed hits/cham : {hmsHitsLt.npassed}
hhitsplanes = +planes >= 5/6 : {hmsHitsPlanes.npassed}
hhitsplanessps = + sps : {hSpacePoints.npassed}
hhitsplanesspsstubs +stub : {hSpacePointsStub.npassed}
hsfoundtrack : {hFoundTrack.npassed}
hscleantrack : {hCleanTrack.npassed}
hstublt = passed stub tests : {hStubLT.npassed}
h1hitslt : {hms1HitsLt.npassed}
h2hitslt : {hms2HitsLt.npassed}
h1planesgt : {hmsDC1PlanesGT.npassed}
h2planesgt : {hmsDC2PlanesGT.npassed}
hplanesgt = gt 5 planes/cham : {hmsPlanesGT.npassed}
f1hspacepoints : {f1HSpacePoints.npassed}
f2hspacepoints : {f2HSpacePoints.npassed}
htest1=p hits/planes, f sp : {hTest1.npassed}
htest2=p sp, f stubs : {hTest2.npassed}
hdid : {HMSScinDid.npassed}
hdide : {HMSScinDide.npassed}
hdidh : {HMSScinDidh.npassed}
hscinshould : {HMSScinShould.npassed}
hscinshoulde : {HMSScinShoulde.npassed}
hscinshouldh : {HMSScinShouldh.npassed}
SING FID TRACK EFFIC : {HMSScinDid.npassed/(HMSScinShould.npassed+0.0001):%8.4f} +- {(sqrt(HMSScinShould.npassed-HMSScinDid.npassed)/(HMSScinShould.npassed+.0001)):%8.4f}
E SING FID TRACK EFFIC : {HMSScinDide.npassed/(HMSScinShoulde.npassed+0.0001):%8.4f} +- {(sqrt(HMSScinShoulde.npassed-HMSScinDide.npassed)/(HMSScinShoulde.npassed+.0001)):%8.4f}
HADRON SING FID TRACK EFFIC : {HMSScinDidh.npassed/(HMSScinShouldh.npassed+0.0001):%8.4f} +- {(sqrt(HMSScinShouldh.npassed-HMSScinDidh.npassed)/(HMSScinShouldh.npassed+.0001)):%8.4f}
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