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

Merge pull request #7 from JureBericic/corr_hodomap

Corrected hodomap + cleanup of demo replay script
parents 10125c1d 340df96b
No related branches found
No related tags found
No related merge requests found
......@@ -128,145 +128,145 @@ SLOT=16
SLOT=20
! A0
! chan plane bar sig
0, 1, 1, 3! h1x01T+
1, 1, 3, 3! h1x03T+
2, 1, 5, 3! h1x05T+
3, 1, 7, 3! h1x07T+
4, 1, 2, 3! h1x02T+
5, 1, 4, 3! h1x04T+
6, 1, 6, 3! h1x06T+
7, 1, 8, 3! h1x08T+
8, 1, 9, 3! h1x09T+
9, 1, 11, 3! h1x11T+
10, 1, 13, 3! h1x13T+
11, 1, 15, 3! h1x15T+
12, 1, 10, 3! h1x10T+
13, 1, 12, 3! h1x12T+
14, 1, 14, 3! h1x14T+
15, 1, 16, 3! h1x16T+
0, 1, 1, 2! h1x01T+
1, 1, 3, 2! h1x03T+
2, 1, 5, 2! h1x05T+
3, 1, 7, 2! h1x07T+
4, 1, 2, 2! h1x02T+
5, 1, 4, 2! h1x04T+
6, 1, 6, 2! h1x06T+
7, 1, 8, 2! h1x08T+
8, 1, 9, 2! h1x09T+
9, 1, 11, 2! h1x11T+
10, 1, 13, 2! h1x13T+
11, 1, 15, 2! h1x15T+
12, 1, 10, 2! h1x10T+
13, 1, 12, 2! h1x12T+
14, 1, 14, 2! h1x14T+
15, 1, 16, 2! h1x16T+
! A1
! chan plane bar sig
16, 1, 1, 4! h1x01T-
17, 1, 3, 4! h1x03T-
18, 1, 5, 4! h1x05T-
19, 1, 7, 4! h1x07T-
20, 1, 2, 4! h1x02T-
21, 1, 4, 4! h1x04T-
22, 1, 6, 4! h1x06T-
23, 1, 8, 4! h1x08T-
24, 1, 9, 4! h1x09T-
25, 1, 11, 4! h1x11T-
26, 1, 13, 4! h1x13T-
27, 1, 15, 4! h1x15T-
28, 1, 10, 4! h1x10T-
29, 1, 12, 4! h1x12T-
30, 1, 14, 4! h1x14T-
31, 1, 16, 4! h1x16T-
16, 1, 1, 3! h1x01T-
17, 1, 3, 3! h1x03T-
18, 1, 5, 3! h1x05T-
19, 1, 7, 3! h1x07T-
20, 1, 2, 3! h1x02T-
21, 1, 4, 3! h1x04T-
22, 1, 6, 3! h1x06T-
23, 1, 8, 3! h1x08T-
24, 1, 9, 3! h1x09T-
25, 1, 11, 3! h1x11T-
26, 1, 13, 3! h1x13T-
27, 1, 15, 3! h1x15T-
28, 1, 10, 3! h1x10T-
29, 1, 12, 3! h1x12T-
30, 1, 14, 3! h1x14T-
31, 1, 16, 3! h1x16T-
! B0
! chan plane bar sig
32, 2, 1, 3! h1y01T+
33, 2, 3, 3! h1y03T+
34, 2, 5, 3! h1y05T+
35, 2, 7, 3! h1y07T+
36, 2, 2, 3! h1y02T+
37, 2, 4, 3! h1y04T+
38, 2, 6, 3! h1y06T+
39, 2, 8, 3! h1y08T+
40, 2, 9, 3! h1y09T+
32, 2, 1, 2! h1y01T+
33, 2, 3, 2! h1y03T+
34, 2, 5, 2! h1y05T+
35, 2, 7, 2! h1y07T+
36, 2, 2, 2! h1y02T+
37, 2, 4, 2! h1y04T+
38, 2, 6, 2! h1y06T+
39, 2, 8, 2! h1y08T+
40, 2, 9, 2! h1y09T+
! 41, , , !
! 42, , , !
! 43, , , !
44, 2, 10, 3! h1y10T+
44, 2, 10, 2! h1y10T+
! 45, , , !
! 46, , , !
! 47, , , !
! B1
! chan plane bar sig
48, 2, 1, 4! h1y01T-
49, 2, 3, 4! h1y03T-
50, 2, 5, 4! h1y05T-
51, 2, 7, 4! h1y07T-
52, 2, 2, 4! h1y02T-
53, 2, 4, 4! h1y04T-
54, 2, 6, 4! h1y06T-
55, 2, 8, 4! h1y08T-
56, 2, 9, 4! h1y09T-
48, 2, 1, 3! h1y01T-
49, 2, 3, 3! h1y03T-
50, 2, 5, 3! h1y05T-
51, 2, 7, 3! h1y07T-
52, 2, 2, 3! h1y02T-
53, 2, 4, 3! h1y04T-
54, 2, 6, 3! h1y06T-
55, 2, 8, 3! h1y08T-
56, 2, 9, 3! h1y09T-
! 57, , , !
! 58, , , !
! 59, , , !
60, 2, 10, 4! h1y10T-
60, 2, 10, 3! h1y10T-
! 61, , , !
! 62, , , !
! 63, , , !
! C0
! chan plane bar sig
64, 3, 1, 3! h2x01T+
65, 3, 3, 3! h2x03T+
66, 3, 5, 3! h2x05T+
67, 3, 7, 3! h2x07T+
68, 3, 2, 3! h2x02T+
69, 3, 4, 3! h2x04T+
70, 3, 6, 3! h2x06T+
71, 3, 8, 3! h2x08T+
72, 3, 9, 3! h2x09T+
73, 3, 11, 3! h2x11T+
74, 3, 13, 3! h2x13T+
75, 3, 15, 3! h2x15T+
76, 3, 10, 3! h2x10T+
77, 3, 12, 3! h2x12T+
78, 3, 14, 3! h2x14T+
79, 3, 16, 3! h2x16T+
64, 3, 1, 2! h2x01T+
65, 3, 3, 2! h2x03T+
66, 3, 5, 2! h2x05T+
67, 3, 7, 2! h2x07T+
68, 3, 2, 2! h2x02T+
69, 3, 4, 2! h2x04T+
70, 3, 6, 2! h2x06T+
71, 3, 8, 2! h2x08T+
72, 3, 9, 2! h2x09T+
73, 3, 11, 2! h2x11T+
74, 3, 13, 2! h2x13T+
75, 3, 15, 2! h2x15T+
76, 3, 10, 2! h2x10T+
77, 3, 12, 2! h2x12T+
78, 3, 14, 2! h2x14T+
79, 3, 16, 2! h2x16T+
! C1
! chan plane bar sig
80, 3, 1, 4! h2x01T-
81, 3, 3, 4! h2x03T-
82, 3, 5, 4! h2x05T-
83, 3, 7, 4! h2x07T-
84, 3, 2, 4! h2x02T-
85, 3, 4, 4! h2x04T-
86, 3, 6, 4! h2x06T-
87, 3, 8, 4! h2x08T-
88, 3, 9, 4! h2x09T-
89, 3, 11, 4! h2x11T-
90, 3, 13, 4! h2x13T-
91, 3, 15, 4! h2x15T-
92, 3, 10, 4! h2x10T-
93, 3, 12, 4! h2x12T-
94, 3, 14, 4! h2x14T-
95, 3, 16, 4! h2x16T-
80, 3, 1, 3! h2x01T-
81, 3, 3, 3! h2x03T-
82, 3, 5, 3! h2x05T-
83, 3, 7, 3! h2x07T-
84, 3, 2, 3! h2x02T-
85, 3, 4, 3! h2x04T-
86, 3, 6, 3! h2x06T-
87, 3, 8, 3! h2x08T-
88, 3, 9, 3! h2x09T-
89, 3, 11, 3! h2x11T-
90, 3, 13, 3! h2x13T-
91, 3, 15, 3! h2x15T-
92, 3, 10, 3! h2x10T-
93, 3, 12, 3! h2x12T-
94, 3, 14, 3! h2x14T-
95, 3, 16, 3! h2x16T-
! D0
! chan plane bar sig
96, 4, 1, 3! h2y01T+
97, 4, 3, 3! h2y03T+
98, 4, 5, 3! h2y05T+
99, 4, 7, 3! h2y07T+
100, 4, 2, 3! h2y02T+
101, 4, 4, 3! h2y04T+
102, 4, 6, 3! h2y06T+
103, 4, 8, 3! h2y08T+
104, 4, 9, 3! h2y09T+
96, 4, 1, 2! h2y01T+
97, 4, 3, 2! h2y03T+
98, 4, 5, 2! h2y05T+
99, 4, 7, 2! h2y07T+
100, 4, 2, 2! h2y02T+
101, 4, 4, 2! h2y04T+
102, 4, 6, 2! h2y06T+
103, 4, 8, 2! h2y08T+
104, 4, 9, 2! h2y09T+
! 105, , , !
! 106, , , !
! 107, , , !
108, 4, 10, 3! h2y10T+
108, 4, 10, 2! h2y10T+
! 109, , , !
! 110, , , !
! 111, , , !
! D1
! chan plane bar sig
112, 4, 1, 4! h2y01T-
113, 4, 3, 4! h2y03T-
114, 4, 5, 4! h2y05T-
115, 4, 7, 4! h2y07T-
116, 4, 2, 4! h2y02T-
117, 4, 4, 4! h2y04T-
118, 4, 6, 4! h2y06T-
119, 4, 8, 4! h2y08T-
120, 4, 9, 4! h2y09T-
112, 4, 1, 3! h2y01T-
113, 4, 3, 3! h2y03T-
114, 4, 5, 3! h2y05T-
115, 4, 7, 3! h2y07T-
116, 4, 2, 3! h2y02T-
117, 4, 4, 3! h2y04T-
118, 4, 6, 3! h2y06T-
119, 4, 8, 3! h2y08T-
120, 4, 9, 3! h2y09T-
! 121, , , !
! 122, , , !
! 123, , , !
124, 4, 10, 4! h2y10T-
124, 4, 10, 3! h2y10T-
! 125, , , !
! 126, , , !
! 127, , , !
void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
//
//
if(RunNumber == 0) {
// Get RunNumber and MaxEvent if not provided.
if(RunNumber == 0) {
cout << "Enter a Run Number (-1 to exit): ";
cin >> RunNumber;
if( RunNumber<=0 ) break;
......@@ -15,50 +14,53 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
exit;
}
}
char* RunFileNamePattern="raw/test_%d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/hms1190_%d.root";
//
// Create file name patterns.
char* RunFileNamePattern = "raw/test_%d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/hms1190_%d.root";
// Add variables to global list.
gHcParms->Define("gen_run_number", "Run Number", RunNumber);
gHcParms->AddString("g_ctp_database_filename", "DBASE/standard.database");
gHcParms->Load(gHcParms->GetString("g_ctp_database_filename"), RunNumber);
// g_ctp_parm_filename and g_decode_map_filename should now be defined
// 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"));
// Generate db_cratemap to correspond to map file contents
// Generate db_cratemap to correspond to map file contents via Pearl script.
//char command[100];
// sprintf(command,"MAPS/make_cratemap.pl < %s > db_cratemap.dat",gHcParms->GetString("g_decode_map_filename"));
//sprintf(
// command,
// "MAPS/make_cratemap.pl < %s > MAPS/db_cratemap.dat",
// gHcParms->GetString("g_decode_map_filename")
//);
//system(command);
// for now used pre made crate map
// Load the Hall C style detector map
gHcDetectorMap=new THcDetectorMap();
gHcDetectorMap = new THcDetectorMap();
gHcDetectorMap->Load(gHcParms->GetString("g_decode_map_filename"));
// Set up the equipment to be analyzed.
THaApparatus* HMS = new THcHallCSpectrometer("H","HMS");
gHaApps->Add( HMS );
// HMS->AddDetector( new THcHodoscope("hod", "Hodoscope" ));
//HMS->AddDetector( new THcShower("cal", "Shower" ));
//THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov" );
// HMS->AddDetector( cherenkov );
HMS->AddDetector( new THcDC("dc", "Drift Chambers" ));
//THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov" );
//HMS->AddDetector( aerogel );
THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
gHaApps->Add(HMS);
HMS->AddDetector(new THcDC("dc", "Drift Chambers"));
// Additional detectors:
//HMS->AddDetector(new THcHodoscope("hod", "Hodoscope"));
//HMS->AddDetector(new THcShower("cal", "Shower"));
//
//THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS","HC scaler event type 0");
// hscaler->SetDebugFile("HScaler.txt");
//gHaEvtHandlers->Add (hscaler);
//THcCherenkov* cherenkov = new THcCherenkov("cher", "Gas Cerenkov");
//HMS->AddDetector(cherenkov);
//THcAerogel* aerogel = new THcAerogel("aero", "Aerogel Cerenkov");
//HMS->AddDetector(aerogel);
//
//
//THcScalerEvtHandler *hscaler = new THcScalerEvtHandler("HS", "HC scaler event type 0");
//hscaler->SetDebugFile("HScaler.txt");
//gHaEvtHandlers->Add(hscaler);
// Set up the analyzer - we use the standard one,
......@@ -67,40 +69,43 @@ void replay_hms(Int_t RunNumber=0, Int_t MaxEvent=0) {
// 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);
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->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->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
analyzer->Process(run); // start the actual analysis
// analyzer->PrintReport("TEMPLATES/dcana.template",Form("REPORT_OUTPUT/replay_hms_%05d.report",RunNumber));
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->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)
//);
}
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