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

Include HMS Cherenkov into replay scripts. Add/Modify DEF-files for HMS.

parent 39587383
No related branches found
No related tags found
No related merge requests found
# See $ANALYZER/examples/output_example.def for examples
#
block H.cer.*
block T.hms.*
TH1F hcer_occu 'HMS Cherenkov ADC Occupancy; PMT Number; Number of ADC Hits' H.cer.adcCounter 2 0.5 2.5
TH2F hcer_rawped 'HMS Cherenkov Raw Pulse Pedestal; PMT Number; Raw Pulse Pedestal / 10 ADC Units' H.cer.adcCounter H.cer.adcPedRaw 2 0.5 2.5 400 0 4000
TH2F hcer_rawpint 'HMS Cherenkov Raw Pulse Integral; PMT Number; Raw Pulse Integral / 10 ADC Units' H.cer.adcCounter H.cer.adcPulseIntRaw 2 0.5 2.5 4000 0 40000
TH2F hcer_rawpamp 'HMS Cherenkov Raw Pulse Amplitude; PMT Number; Raw Pulse Amplitude / 10 ADC Units' H.cer.adcCounter H.cer.adcPulseAmpRaw 2 0.5 2.5 410 0 4100
TH2F hcer_rawptime 'HMS Cherenkov Raw Pulse Time; PMT Number; Raw Pulse Time / 10 ADC Units' H.cer.adcCounter H.cer.adcPulseTimeRaw 2 0.5 2.5 400 0 4000
TH2F hcer_ped 'HMS Cherenkov Pulse Pedestal; PMT Number; Pulse Pedestal / 10 ADC Units' H.cer.adcCounter H.cer.adcPed 2 0.5 2.5 400 0 4000
TH2F hcer_pint 'HMS Cherenkov Pulse Integral; PMT Number; Pulse Pedestal / 10 ADC Units' H.cer.adcCounter H.cer.adcPulseInt 2 0.5 2.5 4000 0 40000
TH2F hcer_pamp 'HMS Cherenkov Pulse Amplitude; PMT Number; Pulse Pedestal / 10 ADC Units' H.cer.adcCounter H.cer.adcPulseAmp 2 0.5 2.5 410 0 4100
\ 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
! THMS_ID=10 :: ADC,TDC
! HCER_ID=14 :: (TDC),ADC
DETECTOR=10
ROC=11
SLOT=17
8, 1, 1, 0 ! hASUM
9, 1, 2, 0 ! hBSUM
10, 1, 3, 0 ! hCSUM
11, 1, 4, 0 ! hDSUM
12, 1, 5, 0 ! hPSHWR
13, 1, 6, 0 ! hSHWR
14, 1, 7, 0 ! hAERSUM
15, 1, 8, 0 ! hCERSUM
SLOT=2
0, 2, 1, 1 ! h1X
1, 2, 2, 1 ! h1Y
2, 2, 3, 1 ! h2X
3, 2, 4, 1 ! h2Y
4, 2, 5, 1 ! h1T
5, 2, 6, 1 ! h2T
6, 2, 7, 1 ! hT1
7, 2, 8, 1 ! hASUM
8, 2, 9, 1 ! hBSUM
9, 2, 10, 1 ! hCSUM
10, 2, 11, 1 ! hDSUM
11, 2, 12, 1 ! hPSHWRLO
12, 2, 13, 1 ! hPSHWRHI
13, 2, 14, 1 ! hSHWR
14, 2, 15, 1 ! hAERSUM
15, 2, 16, 1 ! hCERSUM
SLOT=20
127, 2, 17, 1 ! hT2
ROC=3
SLOT=5
111, 2, 18, 1 ! hDCREF1
SLOT=8
127, 2, 19, 1 ! hDCREF2
SLOT=10
127, 2, 20, 1 ! hDCREF3
SLOT=17
127, 2, 21, 1 ! hDCREF4
DETECTOR=14
ROC=11
SLOT=17
14, 1, 1, 0 ! hCER01
15, 1, 2, 0 ! hCER02
void replay_hcer_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/hms_all_%05d.dat";
const char* ROOTFileNamePattern = "ROOTfiles/hcer_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 params for HMS trigger configuration
gHcParms->Load("PARAM/TRIG/thms.param");
// Load the Hall C style detector map
gHcDetectorMap = new THcDetectorMap();
gHcDetectorMap->Load("MAPS/HMS/DETEC/hcer_htrig.map");
// Set up the equipment to be analyzed.
THaApparatus* HMS = new THcHallCSpectrometer("H", "HMS");
gHaApps->Add(HMS);
// Add hodoscope to HMS apparatus
THcCherenkov* cer = new THcCherenkov("cer", "Heavy Gas Cherenkov");
HMS->AddDetector(cer);
// 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/CER/hcerana.def");
analyzer->SetCutFile("DEF-files/HMS/CER/hcerana_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