diff --git a/DEF-files/HMS/RASTER/hms_raster_simple.def b/DEF-files/HMS/RASTER/hms_raster_simple.def new file mode 100644 index 0000000000000000000000000000000000000000..40b70735716483132670b68271e3b2581a992753 --- /dev/null +++ b/DEF-files/HMS/RASTER/hms_raster_simple.def @@ -0,0 +1,20 @@ +# See $ANALYZER/examples/output_example.def for examples +# +block T.hms.* +# Assume FADC range is set to 1V and the integration is 25 channels +# Offset in the FADC is about 0.122V or 500 channels. +formula FRXA_V T.hms.hFRXA_adcPulseIntRaw*(1./4096.)/25. +formula FRXB_V T.hms.hFRXB_adcPulseIntRaw*(1./4096.)/25. +formula FRYA_V T.hms.hFRYA_adcPulseIntRaw*(1./4096.)/25. +formula FRYB_V T.hms.hFRYB_adcPulseIntRaw*(1./4096.)/25. +TH1F hFRXA 'HMS FRXA; FRXA RAW ADC (chan); Counts' T.hms.hFRXA_adcPulseIntRaw 1000 0 100000 +TH1F hFRXA_V 'HMS FRXA; FRXA RAW ADC (Volts); Counts' FRXA_V 1000 0 1.0 +TH1F hFRXB 'HMS FRXB; FRXB RAW ADC (chan); Counts' T.hms.hFRXB_adcPulseIntRaw 1000 0 100000 +TH1F hFRXB_V 'HMS FRXB; FRXB RAW ADC (Volts); Counts' FRXB_V 1000 0 1.0 +TH1F hFRYA 'HMS FRYA; FRYA RAW ADC (chan); Counts' T.hms.hFRYA_adcPulseIntRaw 1000 0 100000 +TH1F hFRYA_V 'HMS FRYA; FRYA RAW ADC (Volts); Counts' FRYA_V 1000 0 1.0 +TH1F hFRYB 'HMS FRYB; FRYB RAW ADC (chan); Counts' T.hms.hFRYB_adcPulseIntRaw 1000 0 100000 +TH1F hFRYB_V 'HMS FRYB; FRYB RAW ADC (Volts); Counts' FRYB_V 1000 0 1.0 +TH2F hFRA_XvsY 'HMSFRA_XvsY ; FRXA RAW ADC (Volts); FRYA RAW ADC (Volts)' FRXA_V FRYA_V 1000 0 1.0 1000 0 1.0 +TH2F hFRB_XvsY 'HMSFRB_XvsY ; FRXB RAW ADC (Volts); FRYB RAW ADC (Volts)' FRXB_V FRYB_V 1000 0 1.0 1000 0 1.0 + diff --git a/DEF-files/HMS/RASTER/hms_raster_simple_cuts.def b/DEF-files/HMS/RASTER/hms_raster_simple_cuts.def new file mode 100644 index 0000000000000000000000000000000000000000..3af34a5e9835ac62bdbfcc30004dda336ed171d9 --- /dev/null +++ b/DEF-files/HMS/RASTER/hms_raster_simple_cuts.def @@ -0,0 +1,13 @@ +Block: RawDecode + +Pedestal_event 0 +RawDecode_master 1 + +Block: Decode +Decode_master 1 + +Block: CoarseTracking +CoarseTracking_master 1 + +Block: CoarseReconstruct +CourseReconstruct 0 diff --git a/DEF-files/SHMS/RASTER/shms_raster_simple.def b/DEF-files/SHMS/RASTER/shms_raster_simple.def new file mode 100644 index 0000000000000000000000000000000000000000..8f88eef7ca770120d53ac5b176976365aa50e001 --- /dev/null +++ b/DEF-files/SHMS/RASTER/shms_raster_simple.def @@ -0,0 +1,20 @@ +# See $ANALYZER/examples/output_example.def for examples +# +block T.shms.* +# Assume FADC range is set to 1V and the integration is 25 channels +# Offset in the FADC is about 0.122V or 500 channels. +formula FRXA_V T.shms.pFRXA_adcPulseIntRaw*(1./4096.)/25. +formula FRXB_V T.shms.pFRXB_adcPulseIntRaw*(1./4096.)/25. +formula FRYA_V T.shms.pFRYA_adcPulseIntRaw*(1./4096.)/25. +formula FRYB_V T.shms.pFRYB_adcPulseIntRaw*(1./4096.)/25. +TH1F pFRXA 'SHMS FRXA; FRXA RAW ADC (chan); Counts' T.shms.pFRXA_adcPulseIntRaw 1000 0 100000 +TH1F pFRXA 'SHMS FRXA; FRXA RAW ADC (Volts); Counts' FRXA_V 1000 0 1.0 +TH1F pFRXB 'SHMS FRXB; FRXB RAW ADC (chan); Counts' T.shms.pFRXB_adcPulseIntRaw 1000 0 100000 +TH1F pFRXB 'SHMS FRXB; FRXB RAW ADC (Volts); Counts' FRXB_V 1000 0 1.0 +TH1F pFRYA 'SHMS FRYA; FRYA RAW ADC (chan); Counts' T.shms.pFRYA_adcPulseIntRaw 1000 0 100000 +TH1F pFRYA 'SHMS FRYA; FRYA RAW ADC (Volts); Counts' FRYA_V 1000 0 1.0 +TH1F pFRYB 'SHMS FRYB; FRYB RAW ADC (chan); Counts' T.shms.pFRYB_adcPulseIntRaw 1000 0 100000 +TH1F pFRYB 'SHMS FRYB; FRYB RAW ADC (Volts); Counts' FRYB_V 1000 0 1.0 +TH2F pFRA_XvsY 'HMSFRA_XvsY ; FRXA RAW ADC (Volts); FRYA RAW ADC (Volts)' FRXA_V FRYA_V 1000 0 1.0 1000 0 1.0 +TH2F pFRB_XvsY 'HMSFRB_XvsY ; FRXB RAW ADC (Volts); FRYB RAW ADC (Volts)' FRXB_V FRYB_V 1000 0 1.0 1000 0 1.0 + diff --git a/DEF-files/SHMS/RASTER/shms_raster_simple_cuts.def b/DEF-files/SHMS/RASTER/shms_raster_simple_cuts.def new file mode 100644 index 0000000000000000000000000000000000000000..3af34a5e9835ac62bdbfcc30004dda336ed171d9 --- /dev/null +++ b/DEF-files/SHMS/RASTER/shms_raster_simple_cuts.def @@ -0,0 +1,13 @@ +Block: RawDecode + +Pedestal_event 0 +RawDecode_master 1 + +Block: Decode +Decode_master 1 + +Block: CoarseTracking +CoarseTracking_master 1 + +Block: CoarseReconstruct +CourseReconstruct 0 diff --git a/MAPS/HMS/DETEC/hraster_simple.map b/MAPS/HMS/DETEC/hraster_simple.map new file mode 100644 index 0000000000000000000000000000000000000000..b5fb0ca2e453c5dcc890f9b3bd01a009df33360e --- /dev/null +++ b/MAPS/HMS/DETEC/hraster_simple.map @@ -0,0 +1,18 @@ +!HMS: +! THMS_ID=10 ADC,TDC + +! Plane = 1 >> ADC Only +! Plane = 2 >> TDC Only + +detector=10 + +ROC=11 + +!F250 module +SLOT=18 +! chan plane bar sig + 12, 1, 1, 0! FR-XA + 13, 1, 2, 0! FR-XB + 14, 1, 3, 0! FR-YA + 15, 1, 4, 0! FR-YB + diff --git a/MAPS/SHMS/DETEC/praster_simple.map b/MAPS/SHMS/DETEC/praster_simple.map new file mode 100644 index 0000000000000000000000000000000000000000..b0212c9b3aca16682408672d11ee22eb38944142 --- /dev/null +++ b/MAPS/SHMS/DETEC/praster_simple.map @@ -0,0 +1,18 @@ +!HMS: +! TSHMS_ID=20 ADC,TDC + +! Plane = 1 >> ADC Only +! Plane = 2 >> TDC Only + +detector=20 + +ROC=2 + +!F250 module +SLOT=14 +! chan plane bar sig + 12, 1, 1, 0! FR-XA + 13, 1, 2, 0! FR-XB + 14, 1, 3, 0! FR-YA + 15, 1, 4, 0! FR-YB + diff --git a/PARAM/TRIG/thms_raster.param b/PARAM/TRIG/thms_raster.param new file mode 100644 index 0000000000000000000000000000000000000000..7888eccff06df22e596337ec2df41ae8ef9644cf --- /dev/null +++ b/PARAM/TRIG/thms_raster.param @@ -0,0 +1,7 @@ +t_hms_numAdc = 4 +t_hms_numTdc = 1 + +; bar num: 1 2 3 4 5 6 7 8 +t_hms_adcNames = "hFRXA hFRYA hFRXB hFRYB" +t_hms_tdcNames = "hFRXA" + diff --git a/PARAM/TRIG/tshms_raster.param b/PARAM/TRIG/tshms_raster.param new file mode 100644 index 0000000000000000000000000000000000000000..7898b042fecfea6a51503c6b8a13402b394a7bba --- /dev/null +++ b/PARAM/TRIG/tshms_raster.param @@ -0,0 +1,7 @@ +t_shms_numAdc = 4 +t_shms_numTdc = 1 + +; bar num: 1 2 3 4 5 6 7 8 +t_shms_adcNames = "pFRXA pFRYA pFRXB pFRYB" +t_shms_tdcNames = "pFRXA" + diff --git a/SCRIPTS/HMS/replay_hms_raster_simple.C b/SCRIPTS/HMS/replay_hms_raster_simple.C new file mode 100644 index 0000000000000000000000000000000000000000..36843a1248515653c6fb62088b827d7b6e909ca8 --- /dev/null +++ b/SCRIPTS/HMS/replay_hms_raster_simple.C @@ -0,0 +1,100 @@ +void replay_hms_raster_simple(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/hms_all_%05d.dat"; + const char* ROOTFileNamePattern = "ROOTfiles/hms_raster_simple_%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 trigger configuration + gHcParms->Load("PARAM/TRIG/thms_raster.param"); + + // Load the Hall C style detector map + gHcDetectorMap = new THcDetectorMap(); + gHcDetectorMap->Load("MAPS/HMS/DETEC/hraster_simple.map"); + + // Set up the equipment to be analyzed. + //THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS"); + //gHaApps->Add(HMS); + // Add hodoscope to HMS apparatus + //THcHodoscope* hod = new THcHodoscope("hod", "Hodoscope"); + //HMS->AddDetector(hod); + + // 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 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/HMS/RASTER/hms_raster_simple.def"); + analyzer->SetCutFile("DEF-files/HMS/RASTER/hms_raster_simple_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) + //); +} diff --git a/SCRIPTS/SHMS/replay_shms_raster_simple.C b/SCRIPTS/SHMS/replay_shms_raster_simple.C new file mode 100644 index 0000000000000000000000000000000000000000..0310699e4aec8d6deac8e1549921129941269145 --- /dev/null +++ b/SCRIPTS/SHMS/replay_shms_raster_simple.C @@ -0,0 +1,100 @@ +void replay_shms_raster_simple(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_raster_simple_%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 trigger configuration + gHcParms->Load("PARAM/TRIG/tshms_raster.param"); + + // Load the Hall C style detector map + gHcDetectorMap = new THcDetectorMap(); + gHcDetectorMap->Load("MAPS/SHMS/DETEC/praster_simple.map"); + + // Set up the equipment to be analyzed. + //THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS"); + //gHaApps->Add(HMS); + // Add hodoscope to HMS apparatus + //THcHodoscope* hod = new THcHodoscope("hod", "Hodoscope"); + //HMS->AddDetector(hod); + + // Add trigger apparatus + THaApparatus* TRG = new THcTrigApp("T", "TRG"); + gHaApps->Add(TRG); + // Add trigger detector to trigger apparatus + THcTrigDet* shms = new THcTrigDet("shms", "SHMS Trigger Information"); + TRG->AddDetector(shms); + + // 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/RASTER/shms_raster_simple.def"); + analyzer->SetCutFile("DEF-files/SHMS/RASTER/shms_raster_simple_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) + //); +} diff --git a/onlineGUI/Config/HMS/RASTER/simple_raster.cfg b/onlineGUI/Config/HMS/RASTER/simple_raster.cfg new file mode 100644 index 0000000000000000000000000000000000000000..16bc067346903782d999ad308918dc0af3e47825 --- /dev/null +++ b/onlineGUI/Config/HMS/RASTER/simple_raster.cfg @@ -0,0 +1,20 @@ +#protorootfile ../ROOTfiles/hhodo_htrig_replay_XXXXX.root +protorootfile ../ROOTfiles/hms_raster_simple_XXXXX.root +guicolor lightblue +canvassize 800 800 +newpage 2 2 +title HMS 1D Raster Raw ADC +hFRXA +hFRXB +hFRYA +hFRYB +newpage 2 2 +title HMS 1D Raster (Volts) +hFRXA_V +hFRXB_V +hFRYA_V +hFRYB_V +newpage 1 2 +title HMS Hodo Raw Ped PMT+ +hFRA_XvsY -type colz +hFRB_XvsY -type colz diff --git a/onlineGUI/Config/SHMS/RASTER/simple_raster.cfg b/onlineGUI/Config/SHMS/RASTER/simple_raster.cfg new file mode 100644 index 0000000000000000000000000000000000000000..abf94831644b2aa7036de9439d35c87937554bcc --- /dev/null +++ b/onlineGUI/Config/SHMS/RASTER/simple_raster.cfg @@ -0,0 +1,20 @@ +#protorootfile ../ROOTfiles/hhodo_htrig_replay_XXXXX.root +protorootfile ../ROOTfiles/shms_raster_simple_XXXXX.root +guicolor lightblue +canvassize 800 800 +newpage 2 2 +title HMS 1D Raster Raw ADC +hFRXA +hFRXB +hFRYA +hFRYB +newpage 2 2 +title HMS 1D Raster (Volts) +hFRXA_V +hFRXB_V +hFRYA_V +hFRYB_V +newpage 1 2 +title HMS Hodo Raw Ped PMT+ +hFRA_XvsY -type colz +hFRB_XvsY -type colz